/**
 * Soft Apple skin — 全站统一字体字阶 / 柔和字色 / 圆角扁平
 * 叠在 driver-hub.css 之上；回滚见 backups/home-apple-20260820/
 *
 * 字阶（相对正文大 1–2 号）：
 *   caption 12–13 · body 15 · title 17 · page 19–20
 * 字色：#333 / #666 / #999 系，避免纯黑。
 */

:root,
body.dh-ui--apple {
  --dh-bg: #f8fafc;
  --dh-bg-accent-1: rgba(2, 132, 199, 0.07);
  --dh-bg-accent-2: rgba(249, 115, 22, 0.06);

  --dh-ink: #0f172a;
  --dh-sand: #0f172a;
  --dh-prose: #334155;
  --dh-muted: #64748b;
  --dh-caption: #94a3b8;
  --dh-line: #e2e8f0;
  --dh-hairline: #e2e8f0;
  --dh-panel: #ffffff;
  --dh-tile: #ffffff;
  --dh-primary: #0284c7;
  --dh-primary-press: #0369a1;
  --dh-primary-soft: #e0f2fe;
  --dh-idle-bg: #f1f5f9;
  --dh-ai-grad: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  --dh-accent: #f97316;
  --dh-accent-press: #ea580c;
  --dh-action: var(--dh-accent);
  --dh-action-press: var(--dh-accent-press);
  --dh-action-soft: rgba(249, 115, 22, 0.12);
  --dh-action-ink: #ffffff;
  --dh-ai: #0ea5e9;
  --dh-topbar: rgba(248, 250, 252, 0.9);
  --dh-tabbar: rgba(255, 255, 255, 0.94);

  --dh-radius: 16px;
  --dh-radius-sm: 12px;
  --dh-radius-shell: 24px;
  --dh-page-x: 16px;
  --dh-shell-max: 560px;
  --dh-shell-margin: 20px;
  --dh-shell-pad-x: 0px;
  --dh-dock-inset-x: 0px;

  /* Rounded system stack — no Google CDN */
  --dh-font: "PingFang SC", "HarmonyOS Sans SC", "HarmonyOS Sans", "MiSans", "OPPO Sans", "Noto Sans SC", "Source Han Sans SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --dh-display: var(--dh-font);

  /* Type scale */
  --dh-text-xs: 0.75rem;     /* 12 — caption */
  --dh-text-sm: 0.8125rem;   /* 13 — meta */
  --dh-text: 0.9375rem;      /* 15 — body */
  --dh-text-md: 1.0625rem;   /* 17 — section title (+2) */
  --dh-text-lg: 1.1875rem;   /* 19 — page / hero title */
  --dh-text-xl: 1.3125rem;   /* 21 — rare display */
  --dh-lh: 1.45;
  --dh-lh-tight: 1.28;

  --dh-shadow: 0 1px 0 rgba(60, 60, 67, 0.04);
  --dh-shadow-soft: none;
  --dh-score-ink: #333338;
  --dh-input-bg: rgba(118, 118, 128, 0.1);
}

body.dh-ui--night {
  --dh-ink: #e4e6eb;
  --dh-sand: #e4e6eb;
  --dh-prose: rgba(228, 230, 235, 0.82);
  --dh-muted: rgba(228, 230, 235, 0.55);
  --dh-caption: rgba(228, 230, 235, 0.45);
  --dh-font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC", "Hiragino Sans GB", system-ui, sans-serif;
  --dh-display: var(--dh-font);
  --dh-radius: 16px;
  --dh-radius-sm: 12px;
  --dh-radius-shell: 24px;
  --dh-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  --dh-shadow-soft: none;
  --dh-score-ink: #e4e6eb;
}

/* ——— Base ——— */
html,
body,
body.driver-hub {
  font-family: var(--dh-font) !important;
  font-size: var(--dh-text);
  line-height: var(--dh-lh);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  color: var(--dh-ink);
}

body.driver-hub {
  background: #e8eaef;
}

body.dh-ui--night.driver-hub {
  background: #061015;
}

/* ——— Shell：顶边贴齐，避免顶栏上方露白 ——— */
.dh-shell {
  max-width: var(--dh-shell-max, 560px);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  border-radius: var(--dh-radius-shell);
  overflow: hidden;
  background: var(--dh-bg);
  border: 1px solid var(--dh-hairline);
  box-shadow: var(--dh-shadow);
}

body.dh-ui--night .dh-shell {
  background: var(--dh-bg);
}

.dh-top {
  border-radius: 0;
  border-bottom: 1px solid var(--dh-hairline);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.dh-dock,
.dh-dock .dh-tabbar {
  border-top: 0;
}

/* Floating tab bar — same column as .dh-shell / .dh-main cards */
.dh-dock {
  bottom: 10px;
  width: calc(min(var(--dh-shell-max, 560px), 100%) - 2px);
  max-width: 100%;
  background: transparent;
  box-shadow: none;
}

.dh-dock .dh-tabbar {
  width: 100%;
  margin-inline: 0;
  box-sizing: border-box;
  border-radius: var(--dh-radius);
  border: 1px solid var(--dh-hairline);
  background: var(--dh-tabbar);
  box-shadow:
    0 4px 20px rgba(60, 60, 67, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.dh-dock .dh-tab {
  border-radius: var(--dh-radius-sm);
}

body.dh-ui--night .dh-dock .dh-tabbar {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

/* ——— Unified titles (home + all subpages) ——— */
.dh-brand__text,
.ch-hero__title,
.ch-hero--compact .ch-hero__title,
.ch-section__head h1,
.ch-section__head h2,
.ch-home-lead__head h2,
.ch-home-lead__pair .ch-home-lead__head h2,
.ch-home-lead__premium .ch-home-lead__head h2,
.ch-premium-heat__intro h2,
.ch-radar-card__body h3,
.ch-radar-detail__top h2,
.ch-list-item strong,
.ch-route-brief__card strong,
.ch-home-decision__text strong,
.ch-article h1,
.ch-ad .ch-section__head h1,
.ch-prose h2,
.ch-auth__title,
h1.page-title,
.block-page-title-block h1,
.ch-page > h1,
.ch-page.ch-platform > h1,
.ch-page.ch-article > h1 {
  font-family: var(--dh-display) !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
  line-height: var(--dh-lh-tight);
  color: var(--dh-ink) !important;
}

/* Page / hero titles ≈ body + 2 */
.ch-hero__title,
.ch-hero--compact .ch-hero__title,
.ch-article h1,
.ch-page > h1,
.ch-page.ch-platform > h1,
.ch-page.ch-article > h1,
h1.page-title,
.block-page-title-block h1,
.ch-radar-detail__top h2,
.ch-auth__title {
  font-size: var(--dh-text-lg) !important;
}

/* Section titles ≈ body + 1–2 */
.ch-section__head h1,
.ch-section__head h2,
.ch-home-lead__head h2,
.ch-home-lead__pair .ch-home-lead__head h2,
.ch-home-lead__premium .ch-home-lead__head h2,
.ch-premium-heat__intro h2,
.ch-radar-card__body h3,
.ch-list-item strong,
.ch-route-brief__card strong,
.ch-home-decision__text strong,
.ch-ad .ch-section__head h1,
.ch-prose h2,
.dh-brand__text {
  font-size: var(--dh-text-md) !important;
}

/* Body copy */
.ch-lead,
.ch-prose,
.ch-prose p,
.ch-radar-card__body p,
.ch-list-item,
.ch-home-decision__meta,
.ch-route-brief__card span,
.ch-section,
.ch-tile,
.ch-empty,
.ch-advice,
.ch-now,
.ch-auth__hint {
  font-size: var(--dh-text) !important;
  line-height: var(--dh-lh);
  color: var(--dh-prose);
}

.ch-prose,
.ch-prose p {
  color: var(--dh-prose) !important;
}

/* Meta / captions */
.ch-meta,
.ch-section__hint,
.ch-section__head a,
.ch-radar-card__body small,
.ch-list-item span,
.ch-home-status,
.ch-hero__brand,
.ch-hero--home .ch-hero__brand,
.ch-hero--compact .ch-hero__brand,
.ch-airport .ch-hero__brand,
.ch-page .ch-hero--compact .ch-hero__brand,
.ch-pill,
.dh-chip,
.ch-home-ads__tag,
.ch-freshness,
.ch-tag {
  font-size: var(--dh-text-sm) !important;
  font-weight: 500;
  color: var(--dh-muted) !important;
  letter-spacing: 0.02em;
}

.dh-chip.dh-chip--more,
.dh-chip.dh-chip--auth,
.dh-chip.dh-chip--login,
a.dh-top__auth {
  background: var(--dh-idle-bg, #f1f5f9) !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: var(--dh-muted, #64748b) !important;
  font-weight: 400 !important;
}

.dh-chip.dh-chip--auth.is-active,
.dh-chip.dh-chip--login.is-active,
a.dh-top__auth.is-active,
.dh-chip.dh-chip--more[aria-expanded='true'] {
  background: var(--dh-primary, #0284c7) !important;
  color: #fff !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2) !important;
}

.dh-chip.dh-chip--ai,
a.dh-chip.dh-chip--ai,
.dh-chip.dh-chip--ai.is-active,
a.dh-chip.dh-chip--ai.is-active {
  font-family: var(--dh-display) !important;
  font-weight: 600 !important;
  background: var(--dh-ai-grad, linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%)) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.28) !important;
}

.dh-brand__text,
.dh-brand.is-active .dh-brand__text,
.dh-brand:not(.is-active) .dh-brand__text {
  background: transparent !important;
  border: 0 !important;
  color: var(--dh-ink, #0f172a) !important;
  font-weight: 700 !important;
}

.ch-hero__brand,
.ch-hero--minimal .ch-hero__brand {
  font-size: var(--dh-text-xs) !important;
  text-transform: none;
  letter-spacing: 0.04em;
  color: var(--dh-caption) !important;
}

/* Buttons / chips keep readable body size */
.ch-btn,
.ch-btn--primary,
.ch-btn--ghost,
.ch-home-hud__actions a,
.ch-home-hud__actions button {
  font-family: var(--dh-font) !important;
  font-size: var(--dh-text-sm) !important;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ——— Cards: equal soft radius ——— */
.ch-home-lead > .ch-home-lead__go,
.ch-home-lead > .ch-home-lead__route,
.ch-home-lead__pair > .ch-home-lead__route,
.ch-page.ch-home > .ch-hero--home,
.ch-page.ch-home > .ch-hero,
.ch-section,
.ch-tile,
.ch-list-item,
.ch-radar-card,
.ch-route-brief__card,
.ch-home-decision,
.ch-home-strip,
.ch-btn,
.dh-chip,
.dh-top__menu,
.ch-empty--card,
.ch-hero,
.ch-hero--compact {
  border-radius: var(--dh-radius) !important;
  box-shadow: var(--dh-shadow) !important;
}

.ch-home-lead__route .ch-route-brief__card,
.ch-home-lead__go .ch-route-brief__card {
  border-radius: var(--dh-radius-sm) !important;
}

.dh-chip,
.ch-home-ads__row,
.ch-tabs button,
.ch-pill,
.ch-go-badge,
.ch-home-lead__badge {
  border-radius: 999px !important;
}

.ch-btn,
.ch-btn--primary,
.ch-btn--ghost {
  border-radius: var(--dh-radius-sm) !important;
}

.ch-btn--primary,
.ch-advice a.ch-btn,
.ch-home-lead__badge {
  background: var(--dh-primary, #0284c7) !important;
  color: #fff !important;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2) !important;
}

/* 地图卡片主 CTA「去哪跑」保持活力橙 */
.ch-home-hud__actions .is-primary,
.ch-home-hud__actions .is-go,
.ch-wait-brief__actions .is-primary,
.ch-wait-brief__actions .is-go {
  background: var(--dh-accent, #f97316) !important;
  color: #fff !important;
}

.ch-go-badge,
.ch-home-radar__row .ch-go-badge,
.ch-radar-card__decision .ch-go-badge {
  background: var(--dh-primary-soft, #e0f2fe) !important;
  color: var(--dh-primary-press, #0369a1) !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

/* 去哪跑页：GO 块走主色青，不套列表默认浅蓝胶囊 */
.ch-page.ch-radar .ch-radar-card__decision .ch-go-badge {
  background: transparent !important;
  color: #0284c7 !important;
  border-radius: 0 !important;
  font-weight: 800 !important;
}

.ch-page.ch-radar .ch-radar-card,
.ch-page.ch-radar .ch-hero--radar,
.ch-radar-action {
  box-shadow: none !important;
}

.ch-page.ch-radar .ch-section.ch-radar__top,
.ch-page.ch-radar .ch-radar-fold {
  box-shadow: var(--dh-shadow) !important;
}

.ch-go-bar {
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 20px !important;
  background: rgba(15, 23, 42, 0.72) !important;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(12px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.2) !important;
}

.ch-route-toast {
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 20px !important;
  background: rgba(15, 23, 42, 0.72) !important;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(12px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.2) !important;
}

.ch-home-map__frame,
.ch-map-canvas {
  border-radius: var(--dh-radius) !important;
  overflow: hidden;
}

/* Score numbers stay bold but not harsh black */
.ch-radar-card__decision strong,
.ch-premium-heat__pct {
  color: var(--dh-ink) !important;
  font-family: var(--dh-display) !important;
}

/* JS 宽屏 class（≥768）与纯 CSS 断点对齐，避免会员/登录等页仍像手机窄壳 */
body.dh-layout--wide {
  --dh-shell-max: 1180px;
  --dh-shell-margin: 0px;
  --dh-shell-pad-x: 20px;
  --dh-dock-inset-x: 0px;
}

@media (min-width: 720px) {
  :root,
  body.dh-ui--apple {
    --dh-shell-max: 1180px;
    --dh-shell-margin: 0px;
    --dh-shell-pad-x: 20px;
    --dh-dock-inset-x: 0px;
  }
}

@media (min-width: 900px) {
  :root,
  body.dh-ui--apple {
    /* 宽屏也不要顶边 margin，否则顶栏上方露一大块底色空白 */
    --dh-shell-margin: 0px;
  }

  .dh-shell {
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: var(--dh-radius-shell);
  }

  .dh-dock {
    bottom: 16px;
  }
}

@media (min-width: 1100px) and (orientation: landscape) {
  :root,
  body.dh-ui--apple,
  body.dh-layout--wide {
    --dh-shell-max: 1360px;
  }
}

body.dh-map-fs .dh-shell,
html.dh-android-app.dh-map-fs .dh-shell:not(.dh-shell--ai-chat),
body.dh-android-app.dh-map-fs .dh-shell:not(.dh-shell--ai-chat) {
  margin: 0 !important;
  max-width: none !important;
  min-height: 100dvh !important;
  border-radius: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}

@media (min-width: 1100px), (min-width: 720px) and (orientation: landscape) {
  .ch-wide-split--map .ch-map-canvas {
    height: 100% !important;
  }
}

html.dh-android-app .dh-shell,
body.dh-android-app .dh-shell,
html.dh-android-app .dh-shell--ai-chat,
body.dh-android-app .dh-shell--ai-chat {
  /* 三页（首页 / AI / 会员）顶边对齐，禁止 margin-top 露白 */
  margin: 0 auto 8px;
  min-height: calc(100vh - 8px);
  min-height: calc(100dvh - 8px);
  border-radius: var(--dh-radius-shell);
}

html.dh-android-app .dh-dock,
body.dh-android-app .dh-dock {
  bottom: 8px;
  --dh-shell-margin: 16px;
}

/* Station / airport detail — Tech Teal hierarchy */
.ch-hero--station .ch-hero__title {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}

.ch-hero__meta-line {
  font-size: 0.8125rem !important;
  color: #64748b !important;
  font-weight: 500 !important;
}

.ch-radar-detail .ch-radar-detail__score {
  background: #f0f9ff !important;
  color: #0284c7 !important;
  border: 1px solid #bae6fd !important;
  box-shadow: none !important;
}

.ch-radar-alert {
  color: #0284c7 !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

.ch-metric {
  color: #0f172a !important;
  font-weight: 800 !important;
}

.ch-dest-chip {
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  margin: 0 !important;
  border: none !important;
}

.ch-dest-chip--premium {
  color: #7e22ce !important;
  background: #f3e8ff !important;
}

.ch-dest-chip--cross {
  color: #b45309 !important;
  background: #fef3c7 !important;
}

.ch-dest-chip--district,
.ch-dest-chip.is-lead {
  color: #0369a1 !important;
  background: #e0f2fe !important;
}

.ch-dest-bar {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 6px !important;
  overflow: visible !important;
}

.ch-dest-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100% !important;
}

.ch-dest-row__main {
  display: contents !important;
}

.ch-dest-row--secondary {
  justify-content: flex-start !important;
}

.ch-dest-chip--trail {
  flex: 0 0 auto !important;
  margin-left: auto !important;
  box-sizing: border-box !important;
  min-width: 5.5em !important;
  justify-content: center !important;
  font-variant-numeric: tabular-nums !important;
}

.ch-hv-pill {
  display: inline-flex !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
}

.ch-hv-pill--premium {
  color: #7e22ce !important;
  background: #f3e8ff !important;
}

.ch-hv-pill--cross {
  color: #b45309 !important;
  background: #fef3c7 !important;
}

.ch-hv-alerts {
  display: none !important;
}

.ch-slot__metrics {
  font-size: 13px !important;
  color: #64748b !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.ch-slot__tags {
  flex-wrap: nowrap !important;
  margin-left: auto !important;
  max-width: none !important;
  flex: 0 0 auto !important;
}

.ch-slot__flags {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  margin: 0 0 4px !important;
}

.ch-slot__time {
  overflow: visible !important;
  text-overflow: clip !important;
}

.ch-radar-window__orders {
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: -0.5px !important;
  white-space: nowrap !important;
}

.ch-radar-windows .ch-radar-window,
.ch-radar-windows > div {
  padding: 8px 2px !important;
}

.ch-slot__advice {
  font-size: 12px !important;
  color: #475569 !important;
  margin-top: 4px !important;
}

.ch-slot__delay:not(.is-severe) {
  font-size: 11px !important;
  color: #94a3b8 !important;
}

.ch-slot__delay.is-severe {
  color: #dc2626 !important;
}

.ch-slot__head,
.ch-now__body {
  min-width: 0 !important;
  overflow: hidden !important;
}

html.dh-android-app:not(.dh-map-fs) .dh-top,
body.dh-android-app:not(.dh-map-fs) .dh-top {
  padding-top: 10px !important;
  margin-top: 0 !important;
}
