:root {
  --bg: #f3efe3;
  --panel: rgba(255, 252, 245, 0.92);
  --panel-strong: #fffaf0;
  --ink: #1b1d1f;
  --muted: #5a5f65;
  --rail: #21334b;
  --signal: #bb4a2c;
  --signal-soft: rgba(187, 74, 44, 0.12);
  --good: #26644f;
  --good-soft: rgba(38, 100, 79, 0.14);
  --line: rgba(27, 29, 31, 0.08);
  --shadow: 0 20px 60px rgba(33, 51, 75, 0.12);
  --radius: 24px;
  --radius-sm: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 35%),
    repeating-linear-gradient(
      -12deg,
      rgba(33, 51, 75, 0.02) 0,
      rgba(33, 51, 75, 0.02) 14px,
      transparent 14px,
      transparent 34px
    ),
    linear-gradient(180deg, #ebe4d0 0%, #f5f2e9 42%, #efe7d8 100%);
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 20px;
  margin-bottom: 20px;
}

.hero-copy,
.hero-clock,
.card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-copy {
  position: relative;
  padding: 28px 30px 34px;
  border-radius: calc(var(--radius) + 8px);
  overflow: hidden;
}

.hero-copy::after {
  content: "";
  position: absolute;
  inset: auto -10% -48px auto;
  width: 320px;
  height: 120px;
  background:
    linear-gradient(90deg, transparent 0 5%, rgba(33, 51, 75, 0.08) 5% 7%, transparent 7% 100%),
    linear-gradient(180deg, rgba(187, 74, 44, 0.18), rgba(187, 74, 44, 0));
  transform: rotate(-8deg);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--signal);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.02;
}

.hero-note,
.muted {
  color: var(--muted);
  line-height: 1.65;
}

.hero-note {
  margin: 18px 0 0;
  max-width: 68ch;
}

.hero-clock {
  display: grid;
  align-content: center;
  padding: 26px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(33, 51, 75, 0.96), rgba(41, 68, 101, 0.92)),
    var(--panel);
  color: #f8f6f1;
}

.clock-label,
.summary-label {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.82;
}

.clock-time {
  margin-top: 10px;
  font-size: clamp(42px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.clock-date {
  margin-top: 8px;
  color: rgba(248, 246, 241, 0.78);
}

.card {
  padding: 22px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.control-grid,
.summary-grid,
.section-head,
.card-top,
.train-cards {
  display: grid;
}

.control-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 14px;
  font-weight: 600;
}

input[type="date"],
input[type="number"],
select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(27, 29, 31, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 15px;
}

select {
  appearance: none;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 48px;
  align-items: center;
}

.checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.actions {
  align-self: stretch;
}

.refresh-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

button {
  min-width: 160px;
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--signal), #d26c39);
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 16px 28px rgba(187, 74, 44, 0.22);
}

button:hover {
  transform: translateY(-1px);
}

.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.summary-card {
  min-height: 146px;
}

.summary-card.next {
  background:
    linear-gradient(135deg, rgba(38, 100, 79, 0.98), rgba(45, 122, 89, 0.92)),
    var(--panel);
  color: #f8fbf8;
}

.summary-main {
  margin-top: 12px;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.04;
}

.summary-main.small {
  font-size: clamp(22px, 3vw, 30px);
}

.summary-sub {
  margin-top: 10px;
  color: inherit;
  opacity: 0.82;
}

.section-head {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.source-link {
  color: var(--rail);
  font-weight: 600;
  text-decoration: none;
}

.train-cards {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.train-card {
  padding: 18px;
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  animation: reveal 280ms ease both;
}

.card-top {
  grid-template-columns: auto auto;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.train-code {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(33, 51, 75, 0.08);
  color: var(--rail);
}

.status-pill.active {
  background: var(--good-soft);
  color: var(--good);
}

.status-pill.passed {
  background: rgba(27, 29, 31, 0.08);
  color: var(--muted);
}

.status-pill.upcoming {
  background: var(--signal-soft);
  color: var(--signal);
}

.watch-window {
  margin-top: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--signal);
}

.pass-time {
  margin-top: 16px;
  font-size: 24px;
  font-weight: 700;
}

.route-line,
.station-line,
.basis-line {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.basis-line {
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: rgba(33, 51, 75, 0.03);
}

.empty {
  padding: 18px;
  border-radius: 16px;
  background: rgba(33, 51, 75, 0.04);
  color: var(--muted);
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .hero,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-copy {
    padding: 24px;
  }

  h1 {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .card,
  .hero-clock {
    padding: 18px;
  }

  .control-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    grid-template-columns: 1fr;
  }

  .train-cards {
    grid-template-columns: 1fr;
  }
}
