:root {
  --teal: #18acb9;
  --teal-dark: #1296a1;
  --navy: #1f2a49;
  --text: #333;
  --muted: #666;
  --border: #e6e6e6;
  --page: #f2f2f2;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, "Helvetica Neue", Helvetica, "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--page);
}

button,
textarea {
  font-family: inherit;
}

/* ---------- Shared search form ---------- */

.search-row {
  display: flex;
  align-items: flex-start;
  position: relative;
}

/* Search block is sized relative to the viewport so it always occupies
   roughly one third of the screen width, matching the reference site. */
.search-label {
  flex: 0 0 clamp(108px, 7vw, 230px);
  height: clamp(56px, 4.8vw, 156px);
  line-height: clamp(56px, 4.8vw, 156px);
  background: var(--teal);
  color: #fff;
  font-size: clamp(15px, 1.25vw, 40px);
  text-align: center;
  border-radius: 2px 0 0 2px;
  white-space: nowrap;
}

.search-input-wrap {
  position: relative;
  width: clamp(450px, 26vw, 860px);
}

.search-input-wrap textarea {
  display: block;
  width: clamp(450px, 26vw, 860px);
  min-height: clamp(56px, 4.8vw, 156px);
  height: clamp(56px, 4.8vw, 156px);
  line-height: clamp(24px, 1.55vw, 50px);
  padding: clamp(10px, 0.8vw, 26px) clamp(34px, 2vw, 66px) clamp(10px, 0.8vw, 26px) clamp(12px, 0.9vw, 30px);
  border: 1px solid #d9d9d9;
  border-left: 0;
  border-radius: 0 2px 2px 0;
  font-size: clamp(16px, 1.35vw, 44px);
  resize: vertical;
  overflow-y: auto;
  outline: none;
}

.search-input-wrap textarea::placeholder {
  color: #999;
}

.search-input-wrap textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(24, 172, 185, 0.15);
}

.search-tip {
  margin: clamp(12px, 1vw, 32px) 0 0;
  font-size: clamp(14px, 1.15vw, 36px);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

/* Magnifier sits inside the white input, on its right side, in dark color. */
.search-button-wrap {
  position: absolute;
  right: clamp(20px, 1.8vw, 60px);
  top: clamp(18px, 1.5vw, 50px);
  z-index: 3;
}

.search-button {
  position: relative;
  width: clamp(20px, 1.75vw, 56px);
  height: clamp(20px, 1.75vw, 56px);
  padding: 0;
  border: 2px solid #2b3947;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.search-button::after {
  content: "";
  position: absolute;
  right: -35%;
  bottom: -25%;
  width: 45%;
  height: 2px;
  background: #2b3947;
  transform: rotate(45deg);
  border-radius: 2px;
}

.search-button:hover {
  opacity: 0.8;
}

/* ---------- Home page ---------- */

.home-page {
  height: 100%;
  min-height: 480px;
}

.home {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(6, 15, 31, 0.78) 0%, rgba(6, 15, 31, 0.42) 52%, rgba(6, 15, 31, 0.16) 100%),
    url('/img/home-bg.jpg') center center / cover no-repeat;
}

.home::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.18), transparent 45%);
  pointer-events: none;
}

.home-body {
  position: absolute;
  top: 50%;
  left: 15%;
  transform: translateY(-50%);
  color: #fff;
  z-index: 1;
}

.home-title h1 {
  margin: 0;
  font-size: clamp(54px, 6.2vw, 200px);
  line-height: 1.12;
  font-weight: 300;
  letter-spacing: 2px;
}

.home-title p {
  margin: clamp(22px, 1.8vw, 58px) 0 clamp(30px, 2.4vw, 76px);
  font-size: clamp(20px, 1.9vw, 62px);
  letter-spacing: 2px;
}

.site-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 48px 16px 26px;
  text-align: center;
  font-size: 20px;
  letter-spacing: 1.5px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  z-index: 2;
}

.site-footer a {
  color: #fff;
  text-decoration: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ---------- Result page ---------- */

.result-shell {
  min-height: 100vh;
  background: var(--page);
  position: relative;
}

.result-header {
  height: 80px;
  background: var(--navy);
}

.result-hero {
  height: 385px;
  margin: 20px 100px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background:
    linear-gradient(rgba(7, 17, 34, 0.28), rgba(7, 17, 34, 0.42)),
    url('/img/search-bg.jpg') center center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.result-hero h2 {
  margin: 0 0 22px;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 2px;
}

.result-main {
  margin: 0 100px;
  background: #fff;
  min-height: 240px;
}

.result-section {
  padding: 12px 0 30px;
}

.result-footer {
  position: static;
  margin: 36px 100px 0;
  padding: 22px 16px 32px;
  border-top: 1px solid var(--border);
  background: transparent;
  color: #5a6570;
  font-size: 18px;
}

.result-footer a {
  color: #5a6570;
  text-shadow: none;
}

.result-footer a:hover {
  color: var(--teal);
}

/* ---------- Result content ---------- */

.result-card {
  padding: 18px 28px 26px;
}

.result-card-title {
  margin-bottom: 14px;
  font-size: 16px;
  font-weight: 600;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 20px;
  padding: 14px 16px;
  margin-bottom: 18px;
  background: #f8fbfb;
  border: 1px solid #edf2f4;
  border-radius: 4px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.summary-item span {
  color: var(--muted);
}

.summary-item strong {
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
}

.track-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 14px;
}

.track-table th,
.track-table td {
  padding: 10px 12px;
  border: 1px solid #e8e8e8;
  text-align: left;
  vertical-align: top;
}

.track-table th {
  background: #f7f7f7;
  font-weight: 600;
  text-align: center;
}

.track-table .track-time {
  width: 200px;
  white-space: nowrap;
  color: #444;
}

.empty-message,
.error-message,
.loading-message {
  padding: 24px 0;
  text-align: center;
  font-size: 15px;
}

.error-card {
  margin-top: 24px;
  padding: 16px 20px 20px;
  border: 1px solid #e5e5e5;
  background: #fff;
}

.error-number {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}

.error-card .error-message {
  padding: 10px 0;
}

.error-message {
  color: #d93025;
}

.error-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  line-height: 24px;
  border: 2px solid #d93025;
  border-radius: 50%;
  font-weight: 700;
  text-align: center;
}

.loading-message {
  color: #999;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border: 2px solid #ddd;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -3px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Batch panels ---------- */

.batch-result {
  padding-top: 24px;
}

.batch-numbers {
  text-align: center;
  margin-bottom: 18px;
}

.batch-row {
  margin-bottom: 14px;
}

.batch-row span {
  margin-right: 8px;
  font-weight: 600;
}

.batch-row textarea {
  font-family: inherit;
  font-size: 14px;
  color: #333;
  vertical-align: top;
}

.section-title {
  margin: 18px 0;
  padding: 10px 14px;
  border-left: 4px solid var(--teal);
  background: #f7f7f7;
  font-weight: 600;
  color: #444;
}

.track-list {
  border-top: 1px solid var(--border);
}

.track-panel {
  border-bottom: 1px solid var(--border);
}

.track-panel summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  cursor: pointer;
  list-style: none;
}

.track-panel summary::-webkit-details-marker {
  display: none;
}

.track-panel summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid #888;
  border-bottom: 2px solid #888;
  transform: rotate(45deg);
  transition: transform 0.2s;
}

.track-panel[open] summary::after {
  transform: rotate(-135deg);
}

.track-index {
  display: inline-block;
  min-width: 24px;
  height: 24px;
  margin-right: 10px;
  line-height: 24px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  text-align: center;
  font-size: 13px;
}

.track-no {
  font-size: 16px;
  font-weight: 600;
}

.track-latest {
  margin-left: 18px;
  font-size: 13px;
  color: var(--muted);
}

.track-latest-time {
  margin-right: 10px;
  color: #333;
}

.track-latest-desc {
  color: var(--teal);
}

.track-panel-content {
  padding: 0 16px 18px;
  background: #fcfcfc;
}

@media (max-width: 900px) {
  .home-title h1 { font-size: clamp(44px, 9vw, 84px); }
  .home-title p { font-size: clamp(16px, 3vw, 28px); }
  .home-body { left: 8%; }
  .result-hero { margin: 20px 24px 0; }
  .result-main { margin: 0 24px; }
  .result-footer { margin: 28px 24px 0; }
  .search-label { flex-basis: 100px; }
  .search-input-wrap, .search-input-wrap textarea { width: min(60vw, 450px); }
  .summary-grid { grid-template-columns: 1fr 1fr; }
}
