/* CD-1653：3015 定稿视觉令牌映射。后载入，不修改锁定设计文件或数据状态。
 * 原安全策略未放行字体，沿用系统字体；不引入网络资源或修改安全策略。 */


/* 2026-10-04 用户指定3015当前融合页配色与数字字体候选。
 * 深色取运行页 visual-fusion.css 最终有效令牌；浅色保持 freeze-c.css 中性材质。
 * 全部数字原格式与状态规则不变；不改锁定 design.css。
 * 阅读候选增大分层间距，手机按内容自然增高，不继承146/161px卡高结论。
 * 唯一覆盖样式包含双主题及数字字体；不编码未经获审的深度比例。
 */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --refresh-page: #071011;
  --refresh-surface: #0c1718;
  --refresh-raised: #112021;
  --refresh-hover: #16292a;
  --refresh-border: rgb(156 215 209 / .11);
  --refresh-border-strong: rgb(156 215 209 / .21);
  --refresh-text: rgb(244 251 250 / .96);
  --refresh-secondary: rgb(218 234 232 / .79);
  --refresh-tertiary: rgb(202 222 219 / .62);
  --refresh-accent: #12c8c1;
  --refresh-accent-soft: rgb(18 200 193 / .10);
  --refresh-accent-line: rgb(18 200 193 / .38);
  --refresh-accent-ink: #071011;
  --refresh-positive: #42d69a;
  --refresh-negative: #ff667c;
  --refresh-warning: #e8bd67;
  --refresh-warning-soft: rgb(232 189 103 / .05);
  --refresh-warning-line: rgb(232 189 103 / .25);
  --refresh-neutral: #8da19f;
  --refresh-disabled: #68817e;
  --refresh-stale: #8da19f;
  --refresh-stale-bg: #112021;
  --refresh-quote-bg: color-mix(in srgb, var(--refresh-raised) 56%, var(--refresh-surface));
  --refresh-quote-line: rgb(156 215 209 / .065);
  --refresh-depth: rgb(18 200 193 / .18);
  --refresh-focus: rgb(18 200 193 / .40);
  --refresh-clear: transparent;
  --refresh-shadow-color: #00000088;
  --refresh-shadow-soft-color: #00000040;
  --refresh-backdrop: #00000099;
  --refresh-header: rgb(12 23 24 / .94);
  --refresh-highlight: rgb(244 251 250 / .04);
  --refresh-card-shadow: 0 1px 2px rgb(0 0 0 / .10), 0 8px 24px rgb(0 0 0 / .12);
  --refresh-dialog-shadow: 0 14px 48px #00000088;
  --refresh-selected-shadow: 0 5px 14px rgb(0 0 0 / .16), inset 0 1px rgb(18 200 193 / .12), inset 0 -2px var(--refresh-accent);
  --refresh-quote-shadow: inset 0 1px rgb(244 251 250 / .035);
  --refresh-control-shadow: inset 0 1px rgb(244 251 250 / .035);
  --refresh-knob-shadow: 0 1px 2px #00000033;
  --refresh-radius-card: 10px;
  --refresh-radius-control: 7px;
  --refresh-tight-card-min: 0px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --refresh-page: #fbfbfd;
  --refresh-surface: #ffffff;
  --refresh-raised: #f5f5f7;
  --refresh-hover: #f1f2f4;
  --refresh-border: rgb(29 29 31 / 0.075);
  --refresh-border-strong: rgb(29 29 31 / 0.15);
  --refresh-text: #1d1d1f;
  --refresh-secondary: #515154;
  --refresh-tertiary: #6e6e73;
  --refresh-accent: #12c8c1;
  --refresh-accent-soft: rgb(18 200 193 / 0.095);
  --refresh-accent-line: rgb(18 200 193 / 0.34);
  --refresh-accent-ink: #1d1d1f;
  --refresh-positive: #087a55;
  --refresh-negative: #c9344d;
  --refresh-warning: #8a650d;
  --refresh-warning-soft: rgb(138 101 13 / 0.06);
  --refresh-warning-line: rgb(138 101 13 / 0.22);
  --refresh-neutral: #6e6e73;
  --refresh-disabled: #a8a8ad;
  --refresh-stale: #6e6e73;
  --refresh-stale-bg: #f5f5f7;
  --refresh-quote-bg: #f7f7f9;
  --refresh-quote-line: rgb(29 29 31 / 0.055);
  --refresh-depth: rgb(18 200 193 / 0.18);
  --refresh-focus: rgb(18 200 193 / 0.3);
  --refresh-shadow-color: rgb(29 29 31 / 0.11);
  --refresh-shadow-soft-color: rgb(29 29 31 / 0.07);
  --refresh-backdrop: rgb(29 29 31 / 0.35);
  --refresh-header: rgb(255 255 255 / 0.94);
  --refresh-highlight: rgb(255 255 255 / 0.92);
  --refresh-card-shadow: 0 1px 2px rgb(29 29 31 / 0.035), 0 8px 24px rgb(29 29 31 / 0.045);
  --refresh-dialog-shadow: 0 2px 8px rgb(29 29 31 / 0.055), 0 18px 48px rgb(29 29 31 / 0.11);
  --refresh-selected-shadow: 0 2px 8px rgb(29 29 31 / 0.07), inset 0 1px rgb(255 255 255 / 0.92), inset 0 -2px var(--refresh-accent);
  --refresh-quote-shadow: inset 0 1px rgb(255 255 255 / 0.92);
  --refresh-control-shadow: inset 0 1px rgb(255 255 255 / 0.92);
  --refresh-knob-shadow: 0 1px 2px rgb(29 29 31 / 0.15);
}

/* 此映射保持原 theme.css 的全部状态走同一套令牌。
 * 与 :root[data-theme] 同级，必须在原样式之后载入。
 * --shadow 仍为原代码要求的颜色值；完整阴影另用 --refresh-dialog-shadow。
 */
:root,
:root[data-theme="dark"],
:root[data-theme="light"] {
  --bg: var(--refresh-page);
  --paper: var(--refresh-surface);
  --ink: var(--refresh-text);
  --secondary: var(--refresh-secondary);
  --muted: var(--refresh-tertiary);
  --line: var(--refresh-border);
  --soft: var(--refresh-raised);
  --brand: var(--refresh-accent);
  --brand-bg: var(--refresh-accent-soft);
  --accent: var(--refresh-accent);
  --stale-ink: var(--refresh-stale);
  --stale-bg: var(--refresh-stale-bg);
  --info: var(--refresh-secondary);
  --info-bg: var(--refresh-raised);
  --warn: var(--refresh-warning);
  --warn-bg: var(--refresh-warning-soft);
  --card: var(--refresh-surface);
  --cell: var(--refresh-quote-bg);
  --cell-line: var(--refresh-quote-line);
  --cell-heading: var(--refresh-secondary);
  --cents: var(--refresh-secondary);
  --amount: var(--refresh-secondary);
  --volume: var(--refresh-secondary);
  --stale-line: var(--refresh-border);
  --oldest-stale: var(--refresh-stale);
  --extreme-bg: var(--refresh-raised);
  --extreme-line: var(--refresh-border);
  --extreme-ink: var(--refresh-secondary);
  --upstream-bg: var(--refresh-raised);
  --upstream-line: var(--refresh-border);
  --upstream-ink: var(--refresh-secondary);
  --checking-bg: var(--refresh-raised);
  --checking-line: var(--refresh-border-strong);
  --checking-ink: var(--refresh-secondary);
  --invalid-line: var(--refresh-warning-line);
  --unavailable-line: var(--refresh-border);
  --message-bg: var(--refresh-raised);
  --message-line: var(--refresh-border);
  --score-bg: var(--refresh-raised);
  --score-line: var(--refresh-border);
  --score-frozen-bg: var(--refresh-raised);
  --score-frozen-line: var(--refresh-border-strong);
  --score-frozen-ink: var(--refresh-stale);
  --minute-frozen-bg: var(--refresh-raised);
  --minute-frozen-line: var(--refresh-border);
  --group-bg: var(--refresh-surface);
  --group-line: var(--refresh-border);
  --group-ink: var(--refresh-text);
  --date-bg: var(--refresh-raised);
  --date-line: var(--refresh-border);
  --date-ink: var(--refresh-secondary);
  --fold-ink: var(--refresh-secondary);
  --ended: var(--refresh-negative);
  --ended-dot: var(--refresh-negative);
  --dot-idle: var(--refresh-neutral);
  --dot-live: var(--refresh-positive);
  --wordmark: var(--refresh-text);
  --disclaimer: var(--refresh-secondary);
  --dock-bg: var(--refresh-header);
  --fb-ink: var(--refresh-secondary);
  --fb-line: var(--refresh-border-strong);
  --field-line: var(--refresh-border-strong);
  --brand-fill: var(--refresh-accent);
  --on-brand: var(--refresh-accent-ink);
  --focus-soft: var(--refresh-focus);
  --help-lead-bg: var(--refresh-accent-soft);
  --help-lead-ink: var(--refresh-text);
  --help-lead-line: var(--refresh-accent-line);
  --dialog-line: var(--refresh-border);
  --shadow: var(--refresh-shadow-color);
  --help-row-line: var(--refresh-border);
  --switch-row-line: var(--refresh-border);
  --option-selected-line: var(--refresh-accent-line);
  --switch-on: var(--refresh-accent);
  --oldest-ink: var(--refresh-secondary);
  --badge-warning-line: var(--refresh-warning-line);
  --badge-info-line: var(--refresh-border);
  --empty-icon: var(--refresh-neutral);
  --brand-divider: var(--refresh-border);
  --hover-bg: var(--refresh-hover);
  --option-bg: var(--refresh-raised);
  --small-dot: var(--refresh-neutral);
  --fb-hover: var(--refresh-hover);
  --brand-fill-hover: var(--refresh-accent);
  --access-grad-a: var(--refresh-surface);
  --access-grad-b: var(--refresh-page);
  --access-input-line: var(--refresh-border-strong);
  --backdrop: var(--refresh-backdrop);
  --dialog-divider: var(--refresh-border);
  --option-line: var(--refresh-border);
  --feedback-related-line: var(--refresh-border);
  --select-line: var(--refresh-border-strong);
  --failure-line: var(--refresh-warning-line);
  --help-reason-line: var(--refresh-border);
  --help-icon: var(--refresh-secondary);
  --switch-off-bg: var(--refresh-border-strong);
  --switch-off-line: var(--refresh-border-strong);
  --switch-knob: var(--refresh-surface);
  --switch-focus: var(--refresh-focus);
  --storage-notice: var(--refresh-warning);
  --shadow-soft: var(--refresh-shadow-soft-color);
  --disabled-bg: var(--refresh-raised);
  --disabled-line: var(--refresh-border);
  --disabled-ink: var(--refresh-disabled);
  --option-checked-bg: var(--refresh-accent-soft);
  --option-checked-line: var(--refresh-accent-line);
  --input-disabled-bg: var(--refresh-raised);
  --input-disabled-ink: var(--refresh-disabled);
  --input-invalid-bg: var(--refresh-warning-soft);
  --input-invalid-line: var(--refresh-warning-line);
  --field-invalid-line: var(--refresh-warning);
  --league-ink: var(--refresh-secondary);
  --badge-neutral-ink: var(--refresh-secondary);
  --badge-neutral-line: var(--refresh-border);
  --reason-none-ink: var(--refresh-secondary);
  --date-summary-bg: var(--refresh-raised);
}

/* 3015 的可读层级，适配 #208 的真实组件；不移植原型的额外开关或报价。 */
:root, :root[data-theme="dark"], :root[data-theme="light"] {
  --card-text-1: var(--refresh-text);
  --card-text-2: var(--refresh-secondary);
  --card-fs-odd: 20px;
  --card-fs-name: 16px;
  --card-fs-line: 15px;
  --card-fs-time: 14px;
  --card-fs-meta: 13px;
  --card-fs-volume: 13px;
  --card-fs-minor: 12px;
}
:root[data-theme="light"] { --brand: #087772; --focus-soft: #087772; }
:root[data-theme="dark"] { --focus-soft: var(--refresh-accent); }
body[data-design="v08"] .m08-card .m08-event-time[data-light="green"] :is(.state-text,.minute) { color: var(--dot-live); }
body {
  background: var(--refresh-page);
  color: var(--refresh-text);
}
.app-header {
  min-height: 66px;
  gap: 16px;
  padding-block: calc(12px + env(safe-area-inset-top, 0px)) 12px;
  border-bottom-color: var(--refresh-border);
}
/* CD-1699：安全区由系统提供，普通浏览器为零时保留原间距。 */
#view-desktop:not([hidden]) {
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}
body:has(#view-desktop:not([hidden])) { padding-bottom: calc(54px + env(safe-area-inset-bottom, 0px)); }
@media (display-mode: standalone) {
  /* black-translucent 的白色状态图标始终落在与 theme-color 一致的深底上。 */
  body::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    height: env(safe-area-inset-top, 0px);
    background: #071011;
    z-index: 31;
    pointer-events: none;
  }
}
.app-header .brand { flex: 1; min-width: 0; margin: 0; }
.brand-divider, .app-header .brand-subtitle { display: none; }
.brand-home-logo { display: block; width: 220px; max-width: 100%; line-height: 0; color: var(--refresh-text); }
.brand-home-logo:focus-visible { outline: 2px solid var(--refresh-accent); outline-offset: 6px; border-radius: 3px; }
.brand-svg { display: block; width: 100%; height: auto; overflow: visible; }
.brand-on-light { display: none; }
:root[data-theme="light"] .brand-on-dark { display: none; }
:root[data-theme="light"] .brand-on-light { display: block; }
.app-header-actions { display: flex; align-items: center; gap: 10px; }
/* CD-1653 补充一：普通导航外链，不加载 Telegram 脚本或资源。 */
.telegram-monitor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: none;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--refresh-accent-line);
  border-radius: 7px;
  background: var(--refresh-accent-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
}
.telegram-monitor svg { width: 17px; height: 17px; flex: none; }
.telegram-monitor-short { display: none; }
.telegram-monitor:hover { background: var(--refresh-hover); }
.telegram-monitor:focus-visible, .official-channel:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.official-channel { display: inline-flex; color: var(--brand); text-underline-offset: 3px; white-space: nowrap; }
.list-footer .official-channel { margin-left: 16px; }
.login-header { display: flex; justify-content: flex-end; width: 100%; max-width: 1168px; padding: 16px 24px 0; margin-inline: auto; }
.access-footer .official-channel { display: flex; justify-content: center; margin-top: 8px; }
.list-controls { border-color: var(--refresh-border); }
.list-search-field, .icon-button, .settings-button, .league-button {
  border-color: var(--refresh-border-strong);
  border-radius: 7px;
}
.list-search-field { box-shadow: var(--refresh-control-shadow); }
.list-tab.selected { color: var(--refresh-accent); border-color: var(--refresh-accent); }
:root[data-theme="light"] .list-tab.selected { color: #087772; }
body[data-design="v08"] .m08-card {
  border-radius: 10px;
  border-color: var(--refresh-border);
  background: var(--refresh-surface);
  box-shadow: var(--refresh-card-shadow);
}
body[data-design="v08"] .m08-card .quote {
  border-radius: 6px;
  box-shadow: var(--refresh-quote-shadow);
}
body[data-design="v08"] .m08-card .odd, .crown-odd {
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.crown-odd { font-size: 16px; font-weight: 400; }
.prototype-dialog {
  border: 1px solid var(--refresh-border);
  border-radius: 12px;
  box-shadow: var(--refresh-dialog-shadow);
}
.prototype-dialog::backdrop { background: var(--refresh-backdrop); }
.prototype-dialog.m06-settings-dialog {
  width: 440px;
  height: min(720px, calc(var(--m06-vv-h) - 2 * var(--m06-dialog-gap)));
}
.odds-option.selected { background: var(--refresh-accent-soft); border-color: var(--refresh-accent-line); }
:root[data-theme="light"] .odds-option.selected { color: #087772; }
.feedback-dock {
  background: var(--refresh-header);
  backdrop-filter: blur(18px) saturate(1.08);
  height: calc(54px + env(safe-area-inset-bottom, 0px));
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.feedback-dock-inner { height: 54px; }
.mobile-disclaimer, .mobile-feedback { display: none; }
.access-panel {
  border: 1px solid var(--refresh-border);
  border-radius: 12px;
  background: var(--refresh-surface);
  box-shadow: var(--refresh-card-shadow);
}
.access-panel .brand-home-logo { margin-inline: auto; }
.access-panel .access-subtitle { color: var(--refresh-secondary); }
.access-panel :is(input, button) { border-radius: 7px; }

/* #202 的同源组件换装；不设置横幅槽高度、不触及状态显隐。 */
.maint-stage { background: var(--refresh-page); color: var(--refresh-text); }
.maint-slot .maint-banner { border-radius: 7px; }
.maint-symbol { border-color: var(--refresh-border); }
.maintenance-shell .app-header { background: var(--refresh-page); }

@media (max-width: 820px) {
  :root, :root[data-theme="dark"], :root[data-theme="light"] {
    --card-fs-odd: 16px;
    --card-fs-name: 16px;
    --card-fs-line: 13px;
    --card-fs-time: 12px;
    --card-fs-meta: 12px;
    --card-fs-volume: 12px;
    --card-fs-minor: 11px;
  }
  .app-header { min-height: 68px; gap: 4px; padding-block: 12px; flex-wrap: wrap; }
  #view-desktop .app-header { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  #view-desktop:not([hidden]) { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
  /* CD-1701：手机只留系统底部安全区，反馈进设置，免责声明随列表滚动。 */
  body:has(#view-desktop:not([hidden])) { padding-bottom: env(safe-area-inset-bottom, 0px); }
  #view-desktop:not([hidden]) { padding-bottom: 0; }
  .feedback-dock, #desktop-feed .list-conventions, #desktop-feed .settle-wrap { display: none; }
  .mobile-disclaimer, .mobile-feedback { display: block; }
  .mobile-feedback { margin-bottom: 18px; }
  .app-header .brand { flex: 1 0 174px; }
  .brand-home-logo { width: 174px; }
  .app-header-actions { gap: 0; }
  /* 补充二：标志与监控先排同行；更窄时其余操作自然折行，不挤压标志。 */
  .app-header > .telegram-monitor { margin-left: auto; padding-inline: 4px; gap: 5px; }
  .telegram-monitor-label { display: none; }
  .telegram-monitor-short { display: inline; }
  .telegram-monitor { padding-inline: 9px; }
  .login-header { padding: 12px 16px 0; }
  /* 补充七：登录卡片统一内边距，电报与邮箱入口共用内容边界。 */
  .access-panel.login-panel { padding: 24px 16px; }
  .list-footer { display: flex; flex-direction: column; align-items: center; gap: 10px; }
  .list-footer .official-channel { margin-left: 0; }
  body[data-design="v08"] :is(#view-desktop, #view-mobile, #view-three, #view-compare) .m08-card.m08-phone {
    /* 补充三：独赢列容纳主客方向及六位赔率；不缩小定稿字号。 */
    --col-win: 78px;
    --row-main: 56px;
    --row-draw: 46px;
    --col-hcap: 72px;
    --col-total: 74px;
  }
  /* 品牌字号与完整数字并存：水滴/旧价时钟留在价格上方的独立空间。 */
  body[data-design="v08"] :is(#view-desktop, #view-mobile, #view-three, #view-compare) .m08-card.m08-phone .quote {
    padding-top: 14px;
    padding-inline: 0;
  }
  body[data-design="v08"] :is(#view-desktop, #view-mobile, #view-three, #view-compare) .m08-card.m08-phone .quote .quote-main { gap: 2px; }
  body[data-design="v08"] :is(#view-desktop, #view-mobile, #view-three, #view-compare) .m08-card.m08-phone .m081-market-pair .quote-main { flex-direction: column; gap: 0; align-items: center; }
  body[data-design="v08"]:not([data-crown="on"]) :is(#view-desktop, #view-mobile, #view-three, #view-compare) .m06-card.m08-card.m08-phone { --col-hcap: 70px; --col-total: 70px; }
  body[data-design="v08"] :is(#view-desktop, #view-mobile, #view-three, #view-compare) .m08-card.m08-phone .quote:is(.quote-thin,.quote-stale) .quote-main { padding-right: 0 !important; }
  /* 补充三：长对照市场仅收紧主价字距；窄屏保留既有列宽和队名空间。 */
  body[data-design="v08"][data-crown="on"] :is(#view-desktop, #view-mobile, #view-three, #view-compare) .m08-card.m08-phone.crown-long-hcap .m081-hcap-pair .odd,
  body[data-design="v08"][data-crown="on"] :is(#view-desktop, #view-mobile, #view-three, #view-compare) .m08-card.m08-phone.crown-long-total .m081-total-pair .odd { letter-spacing: -.5px; }
  body[data-design="v08"][data-crown="on"] :is(#view-desktop, #view-mobile, #view-three, #view-compare) .m08-card.m08-phone.m081-tight.crown-long-hcap .m081-hcap-pair .odd,
  body[data-design="v08"][data-crown="on"] :is(#view-desktop, #view-mobile, #view-three, #view-compare) .m08-card.m08-phone.m081-tight.crown-long-total .m081-total-pair .odd { letter-spacing: -1.5px; }
  body[data-design="v08"][data-crown="on"] .m08-card.m08-phone .crown-odd { font-size: 13px; }
  .access-panel .brand-home-logo { width: 220px; }
}
/* 补充四：窄屏比赛状态/时间独占首行，市场栏头自然排在下一行；不改字号与报价网格。 */
@media (max-width: 390px) {
  body[data-design="v08"] :is(#view-desktop, #view-mobile, #view-three, #view-compare) .m08-card.m08-phone .card-header { row-gap: 2px; }
  body[data-design="v08"] :is(#view-desktop, #view-mobile, #view-three, #view-compare) .m08-card.m08-phone .card-header > .m08-meta { grid-column: 1 / -1; grid-row: 1; }
  body[data-design="v08"] :is(#view-desktop, #view-mobile, #view-three, #view-compare) .m08-card.m08-phone .card-header > :is(.win-heading, .hcap-heading, .total-heading) { grid-row: 2; min-height: 2em; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-home-logo { scroll-behavior: auto; }
}
