
    :root {
      color-scheme: light;
      --page: #eef3f1;
      --surface: #fff;
      --surface-soft: #f5f8f7;
      --ink: #132824;
      --ink-soft: #50655f;
      --line: #cedbd7;
      --line-strong: #a8bdb6;
      --brand: #0f5f52;
      --brand-strong: #0a493f;
      --brand-soft: #dcece7;
      --signal: #f3a712;
      --warning-bg: #fff4d8;
      --warning-ink: #745000;
      --danger-bg: #fde9e5;
      --danger-ink: #8a2f20;
      --radius-control: 10px;
      --radius-card: 14px;
      --shadow-card: 0 8px 22px rgba(21, 53, 46, .08);
    }

    * { box-sizing: border-box; }

    html {
      background: var(--page);
      -webkit-text-size-adjust: 100%;
    }

    body {
      margin: 0;
      min-width: 320px;
      background: var(--page);
      color: var(--ink);
      font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
      font-size: 16px;
      line-height: 1.5;
    }

    button, input, select { font: inherit; }
    button, summary, a { -webkit-tap-highlight-color: transparent; }

    button:focus-visible,
    input:focus-visible,
    select:focus-visible,
    summary:focus-visible,
    a:focus-visible {
      outline: 3px solid rgba(20, 121, 209, .45);
      outline-offset: 2px;
    }

    [hidden] { display: none !important; }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .app-shell {
      width: 100%;
      max-width: 430px;
      min-height: 100vh;
      min-height: 100svh;
      margin: 0 auto;
      overflow-x: hidden;
      background: var(--surface-soft);
    }

    .app-header {
      position: relative;
      padding: max(22px, env(safe-area-inset-top)) 18px 17px;
      overflow: hidden;
      background: var(--brand);
      color: #fff;
    }

    .app-header::after {
      content: "";
      position: absolute;
      right: -42px;
      bottom: -72px;
      width: 150px;
      height: 150px;
      border: 22px solid rgba(255, 255, 255, .08);
      border-radius: 50%;
      pointer-events: none;
    }

    .title-row {
      position: relative;
      z-index: 1;
      display: flex;
      align-items: center;
      gap: 11px;
    }

    .route-symbol {
      position: relative;
      width: 21px;
      height: 35px;
      flex: 0 0 21px;
      margin-left: 5px;
      border-left: 3px solid #fff;
    }

    .route-symbol::before,
    .route-symbol::after {
      content: "";
      position: absolute;
      left: -7px;
      width: 9px;
      height: 9px;
      border: 2px solid var(--brand);
      border-radius: 50%;
      background: var(--signal);
      box-shadow: 0 0 0 2px #fff;
    }

    .route-symbol::before { top: 1px; }
    .route-symbol::after { bottom: 1px; }

    h1 {
      margin: 0;
      font-size: 27px;
      font-weight: 760;
      line-height: 1.2;
      letter-spacing: .01em;
    }

    .status-row {
      position: relative;
      z-index: 1;
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 7px 9px;
      margin: 7px 0 0 37px;
    }

    .data-meta {
      margin: 0;
      color: rgba(255, 255, 255, .82);
      font-size: 12px;
    }

    .offline-status {
      display: inline-flex;
      align-items: center;
      min-height: 22px;
      padding: 2px 8px;
      border: 1px solid rgba(255, 255, 255, .34);
      border-radius: 999px;
      background: rgba(255, 255, 255, .11);
      color: #fff;
      font-size: 11px;
      font-weight: 700;
      line-height: 1.2;
    }

    .offline-status[data-state="offline"] {
      border-color: rgba(243, 167, 18, .72);
      background: rgba(243, 167, 18, .2);
    }

    .offline-status[data-state="error"] {
      border-color: rgba(255, 255, 255, .5);
      background: rgba(138, 47, 32, .45);
    }

    .stale-notice {
      position: relative;
      z-index: 1;
      margin: 12px 0 0;
      padding: 9px 11px;
      border: 1px solid rgba(255, 255, 255, .28);
      border-radius: 8px;
      background: rgba(0, 0, 0, .12);
      color: #fff;
      font-size: 13px;
    }

    .query-panel {
      padding: 18px;
      border-bottom: 1px solid var(--line);
      background: var(--surface);
    }

    .field + .field { margin-top: 15px; }

    .field-label {
      display: block;
      margin-bottom: 7px;
      font-size: 14px;
      font-weight: 680;
    }

    .segmented {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 3px;
      padding: 3px;
      border: 1px solid var(--line);
      border-radius: var(--radius-control);
      background: #e9efed;
    }

    .segment {
      min-height: 44px;
      padding: 0 10px;
      border: 0;
      border-radius: 7px;
      background: transparent;
      color: var(--ink-soft);
      cursor: pointer;
      font-size: 15px;
      font-weight: 650;
    }

    .segment[aria-pressed="true"] {
      background: var(--brand);
      color: #fff;
      box-shadow: 0 2px 7px rgba(15, 95, 82, .2);
    }

    .segment:disabled { cursor: wait; opacity: .62; }
    .select-wrap, .combobox { position: relative; }

    .select-wrap::after {
      content: "";
      position: absolute;
      top: 50%;
      right: 16px;
      width: 8px;
      height: 8px;
      border-right: 2px solid var(--ink-soft);
      border-bottom: 2px solid var(--ink-soft);
      transform: translateY(-70%) rotate(45deg);
      pointer-events: none;
    }

    select, .station-input {
      width: 100%;
      min-height: 48px;
      padding: 0 42px 0 13px;
      appearance: none;
      border: 1px solid var(--line-strong);
      border-radius: var(--radius-control);
      background: #fff;
      color: var(--ink);
    }

    select:disabled, .station-input:disabled {
      border-color: var(--line);
      background: #f0f3f2;
      color: #8b9a96;
      cursor: not-allowed;
    }

    .station-input[aria-expanded="true"] {
      border-color: var(--brand);
      box-shadow: 0 0 0 3px var(--brand-soft);
    }

    .combobox::after {
      content: "";
      position: absolute;
      top: 18px;
      right: 17px;
      width: 10px;
      height: 10px;
      border: 2px solid var(--ink-soft);
      border-radius: 50%;
      pointer-events: none;
    }

    .combobox::before {
      content: "";
      position: absolute;
      z-index: 1;
      top: 29px;
      right: 14px;
      width: 7px;
      height: 2px;
      background: var(--ink-soft);
      transform: rotate(45deg);
      pointer-events: none;
    }

    .station-list {
      position: absolute;
      z-index: 20;
      top: calc(100% + 6px);
      right: 0;
      left: 0;
      max-height: min(238px, 38vh);
      margin: 0;
      padding: 5px;
      overflow-y: auto;
      border: 1px solid var(--line-strong);
      border-radius: 10px;
      background: #fff;
      box-shadow: 0 14px 30px rgba(21, 53, 46, .18);
      list-style: none;
      overscroll-behavior: contain;
    }

    .station-option {
      width: 100%;
      min-height: 44px;
      padding: 9px 10px;
      border: 0;
      border-radius: 7px;
      background: transparent;
      color: var(--ink);
      text-align: left;
      cursor: pointer;
    }

    .station-option:hover, .station-option.is-active {
      background: var(--brand-soft);
      color: var(--brand-strong);
    }

    .station-empty {
      padding: 12px 10px;
      color: var(--ink-soft);
      font-size: 14px;
    }

    .query-button {
      width: 100%;
      min-height: 52px;
      margin-top: 19px;
      border: 0;
      border-radius: var(--radius-control);
      background: var(--brand);
      color: #fff;
      cursor: pointer;
      font-size: 16px;
      font-weight: 720;
      letter-spacing: .02em;
      box-shadow: 0 7px 16px rgba(15, 95, 82, .2);
    }

    .query-button:active:not(:disabled) {
      background: var(--brand-strong);
      transform: translateY(1px);
    }

    .query-button:disabled {
      background: #c8d3d0;
      color: #72847f;
      cursor: not-allowed;
      box-shadow: none;
    }

    .results-section {
      padding: 18px 14px calc(24px + env(safe-area-inset-bottom));
    }

    .results-summary {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      margin: 0 4px 13px;
    }

    .results-title {
      margin: 0;
      font-size: 18px;
      font-weight: 760;
      line-height: 1.3;
    }

    .results-note {
      margin: 4px 0 0;
      color: var(--ink-soft);
      font-size: 12px;
    }

    .text-action {
      min-height: 44px;
      margin: -8px -5px 0 0;
      padding: 8px 5px;
      border: 0;
      background: transparent;
      color: var(--brand);
      cursor: pointer;
      font-size: 14px;
      font-weight: 700;
      white-space: nowrap;
    }

    .inline-action { margin: 10px 0 -8px; }
    .route-list { display: grid; gap: 12px; }

    .route-card {
      position: relative;
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: var(--radius-card);
      background: var(--surface);
      box-shadow: var(--shadow-card);
    }

    .route-card::before {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      width: 5px;
      background: var(--brand);
    }

    .route-main { padding: 15px 14px 13px 18px; }

    .route-topline {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
    }

    .time-stack { min-width: 0; }

    .time-label {
      margin: 0 0 1px;
      color: var(--ink-soft);
      font-size: 11px;
      font-weight: 650;
    }

    .route-time {
      margin: 0;
      color: var(--brand-strong);
      font-size: 31px;
      font-weight: 790;
      font-variant-numeric: tabular-nums;
      line-height: 1.06;
      letter-spacing: -.02em;
      overflow-wrap: anywhere;
    }

    .time-range { font-size: 24px; letter-spacing: -.03em; }

    .time-status {
      display: inline-block;
      margin-top: 6px;
      padding: 3px 7px;
      border-radius: 999px;
      background: var(--brand-soft);
      color: var(--brand-strong);
      font-size: 11px;
      font-weight: 700;
    }

    .time-status-warning {
      background: var(--warning-bg);
      color: var(--warning-ink);
    }

    .vehicle-stack {
      display: flex;
      min-width: 0;
      flex: 0 1 48%;
      flex-direction: column;
      align-items: flex-end;
      gap: 5px;
      padding-top: 2px;
      text-align: right;
    }

    .bus-code {
      display: inline-flex;
      align-items: center;
      max-width: 100%;
      min-height: 26px;
      padding: 3px 8px;
      border: 1px solid var(--brand);
      border-radius: 999px;
      color: var(--brand-strong);
      font-size: 12px;
      font-weight: 760;
      overflow-wrap: anywhere;
    }

    .plate {
      max-width: 100%;
      color: var(--ink-soft);
      font-size: 13px;
      font-weight: 620;
      font-variant-numeric: tabular-nums;
      overflow-wrap: anywhere;
      white-space: pre-wrap;
    }

    .route-direction {
      margin: 12px 0 0;
      font-size: 15px;
      font-weight: 680;
      overflow-wrap: anywhere;
      white-space: pre-wrap;
    }

    .boarding-time {
      margin: 5px 0 0;
      color: var(--brand);
      font-size: 13px;
      font-weight: 650;
    }

    .contact-list {
      display: grid;
      gap: 7px;
      margin-top: 13px;
      padding-top: 12px;
      border-top: 1px solid var(--line);
    }

    .contact-label {
      margin: 0;
      color: var(--ink-soft);
      font-size: 12px;
      font-weight: 650;
    }

    .contact-row {
      min-width: 0;
      color: var(--ink);
      font-size: 15px;
      font-weight: 650;
      line-height: 1.7;
      overflow-wrap: anywhere;
      white-space: pre-wrap;
    }

    .phone-number {
      color: var(--ink);
      font-weight: 760;
      font-variant-numeric: tabular-nums;
      text-decoration: underline;
      text-decoration-color: var(--line-strong);
      text-underline-offset: 3px;
    }

    .call-actions { display: flex; flex-wrap: wrap; gap: 8px; }

    .call-link {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 44px;
      padding: 0 13px;
      border: 1px solid var(--brand);
      border-radius: 8px;
      color: var(--brand);
      font-size: 13px;
      font-weight: 720;
      text-decoration: none;
    }

    .warning {
      margin: 12px 0 0;
      padding: 9px 10px;
      border-left: 3px solid var(--signal);
      background: var(--warning-bg);
      color: var(--warning-ink);
      font-size: 12px;
      line-height: 1.45;
      overflow-wrap: anywhere;
    }

    .route-details {
      border-top: 1px solid var(--line);
      background: #fafcfb;
    }

    .route-details summary {
      position: relative;
      min-height: 46px;
      padding: 12px 39px 11px 18px;
      color: var(--brand);
      cursor: pointer;
      font-size: 13px;
      font-weight: 700;
      list-style: none;
    }

    .route-details summary::-webkit-details-marker { display: none; }

    .route-details summary::after {
      content: "";
      position: absolute;
      top: 16px;
      right: 18px;
      width: 8px;
      height: 8px;
      border-right: 2px solid var(--brand);
      border-bottom: 2px solid var(--brand);
      transform: rotate(45deg);
      transition: transform 160ms ease;
    }

    .route-details[open] summary::after { top: 20px; transform: rotate(225deg); }

    .route-path {
      margin: 0;
      padding: 0 18px 16px;
      color: var(--ink-soft);
      font-size: 13px;
      line-height: 1.7;
      overflow-wrap: anywhere;
      white-space: pre-wrap;
    }

    .parking {
      display: block;
      margin-top: 8px;
      color: var(--ink);
      font-weight: 620;
    }

    .state-card {
      padding: 22px 18px;
      border: 1px solid var(--line);
      border-radius: var(--radius-card);
      background: var(--surface);
    }

    .state-card h2 { margin: 0; font-size: 18px; line-height: 1.35; }
    .state-card p { margin: 7px 0 0; color: var(--ink-soft); font-size: 14px; }

    .state-card.error {
      border-color: #e9bbb1;
      background: var(--danger-bg);
      color: var(--danger-ink);
    }

    .state-card.error p { color: var(--danger-ink); }

    .related-heading {
      margin: 18px 4px 10px;
      color: var(--ink-soft);
      font-size: 13px;
      font-weight: 720;
    }

    .reference-card::before { background: var(--line-strong); }

    .reference-label {
      display: inline-block;
      margin: 0 0 8px;
      padding: 2px 7px;
      border-radius: 999px;
      background: #eef1f0;
      color: var(--ink-soft);
      font-size: 11px;
      font-weight: 700;
    }

    .loading-row {
      display: flex;
      align-items: center;
      gap: 11px;
      min-height: 72px;
      padding: 0 5px;
      color: var(--ink-soft);
      font-size: 14px;
    }

    .loading-dot {
      width: 18px;
      height: 18px;
      border: 2px solid var(--line);
      border-top-color: var(--brand);
      border-radius: 50%;
      animation: spin 700ms linear infinite;
    }

    @keyframes spin { to { transform: rotate(360deg); } }

    @media (max-width: 359px) {
      .query-panel { padding-right: 14px; padding-left: 14px; }
      .route-topline { gap: 8px; }
      .route-time { font-size: 28px; }
      .time-range { font-size: 21px; }
    }

    @media (min-width: 431px) {
      .app-shell {
        border-right: 1px solid var(--line);
        border-left: 1px solid var(--line);
        box-shadow: 0 0 30px rgba(21, 53, 46, .08);
      }
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
      }
    }
