/**
 * 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: #f2f3f7;
  --dh-bg-accent-1: rgba(255, 159, 10, 0.07);
  --dh-bg-accent-2: rgba(48, 176, 199, 0.06);

  /* Soft ink (reference: #333 / #666 / #999) */
  --dh-ink: #333338;
  --dh-sand: #333338;
  --dh-prose: #5c5c66;
  --dh-muted: #8e8e96;
  --dh-caption: #9a9aa3;
  --dh-line: rgba(60, 60, 67, 0.1);
  --dh-hairline: rgba(60, 60, 67, 0.06);
  --dh-panel: #ffffff;
  --dh-tile: #ffffff;
  --dh-topbar: rgba(242, 243, 247, 0.92);
  --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 four corners ——— */
.dh-shell {
  max-width: var(--dh-shell-max, 560px);
  margin: 10px auto;
  min-height: calc(100vh - 20px);
  min-height: calc(100dvh - 20px);
  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: 600 !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--ai,
a.dh-chip.dh-chip--ai {
  color: #fff !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-more__panel,
.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: linear-gradient(180deg, #ffb84d, #f5a623) !important;
  box-shadow: none !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 {
    --dh-shell-margin: 32px;
  }

  .dh-shell {
    margin: 16px auto;
    min-height: calc(100vh - 32px);
    min-height: calc(100dvh - 32px);
    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:not(.dh-shell--ai-chat),
body.dh-android-app .dh-shell:not(.dh-shell--ai-chat) {
  margin: 8px auto;
  min-height: calc(100vh - 16px);
  min-height: calc(100dvh - 16px);
  border-radius: var(--dh-radius-shell);
}

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