@media screen {
html[data-theme=light] #rv-interpret,html[data-theme=light] #rv-interpret>div,html[data-theme=light] #rv-summary>div{color:#617458!important}
html[data-theme=light] :is(.rv-left,.rv-right) [style*="color:rgba(200,180,140"],html[data-theme=light] .rv-chartbar [style*="color:rgba(200,180,140"]{color:#617458!important}
html[data-theme=light] .rv-eval-row strong[style*="#f5d98a"]{color:#88631d!important}
html[data-theme=light] .rv-eval-row strong[style*="#74f0d2"]{color:#266f51!important}

html[data-theme=light] body:not(.auth-mode) :is(#nav-username,.user-info,.rv-player-rank,.rv-player-captures,#review-game-info,.rv-progress-label,.rv-interpret,.rv-interpret-empty,.rv-chart-label){color:#53684f!important}
html[data-theme=light] body:not(.auth-mode) :is(.rv-left,.rv-right,.rv-header,.rv-chartbar,.modal,.lobby-card) :is(small,label){color:#617458!important}
html[data-theme=light] body:not(.auth-mode) :is(.rv-left,.rv-right,.rv-header,.rv-chartbar,.modal,.lobby-card) [style*="color:rgba(200,185,155"],
html[data-theme=light] body:not(.auth-mode) :is(.rv-left,.rv-right,.rv-header,.rv-chartbar,.modal,.lobby-card) [style*="color: rgba(200,185,155"],
html[data-theme=light] body:not(.auth-mode) :is(.rv-left,.rv-right,.rv-header,.rv-chartbar,.modal,.lobby-card) [style*="color:var(--paper"],
html[data-theme=light] body:not(.auth-mode) :is(.rv-left,.rv-right,.rv-header,.rv-chartbar,.modal,.lobby-card) [style*="color: var(--paper"]{color:#617458!important}
html[data-theme=light] .rv-tool-btn:not(.primary){background:#f7f7ef!important;color:#37543c!important}
html[data-theme=light] .rv-tool-btn:disabled{opacity:.55!important}
html[data-theme=light] .rv-left,html[data-theme=light] .rv-right{--paper:#304d39;--paper2:#617458}
html[data-theme=light] .rv-chartbar{--paper:#304d39;--paper2:#617458}
html[data-theme=light] .online-user .badge{color:#2b674b!important}
}

/* Soft sage surfaces for 玉润松青; retain artwork and clock identities. */
@media screen {
html[data-theme=light] body .auth-brand-logo{background:#e6ecdd!important;border:1px solid #cfdac2;box-shadow:0 4px 18px #38533a08;content:url('/assets/aiqigo-logo-horizontal-light.svg')}
html[data-theme=light] body:not(.auth-mode) #navbar .logo{background:#e6ecdd!important;border:1px solid #cfdac2}
html[data-theme=light] body:not(.auth-mode) .site-logo-image{content:url('/assets/aiqigo-logo-horizontal-light.svg')}
html[data-theme=light] body:not(.auth-mode) :is(.avatar,.online-user .avatar,.personal-card .avatar){background:#d9e5d1!important;color:#36543a!important;border-color:#bfceb3!important}
html[data-theme=light] body:not(.auth-mode) :is(.toast,.toast.success,.toast-success){background:#e4ecda!important;color:#31523a!important;border-color:#a7bfa0!important;box-shadow:0 6px 22px #32573515!important}
html[data-theme=light] body:not(.auth-mode) :is(.toast,.toast.success,.toast-success) *{color:#31523a!important}
html[data-theme=light] body:not(.auth-mode) :is(.personal-card,.stat-chip,.online-tabs button.active,.lobby-nav-item.active){background:#e5ecdc!important;color:#37563d!important}
html[data-theme=light] .badge-ai{background:#dcebdc!important;color:#38694a!important}
}

/* === P0 对比度修复 2026-09-12：浅色下不可读区域 === */
@media screen {
/* P0-5 / P0-6：共享深色卡片规则（styles.css:3307-3320）在浅色下仍是深底，文字却被解析成浅色期墨绿。
   一次覆盖该组，同时修好对局室形势判断面板、后台统计卡、用户表格容器、详情区、AI 卡片与棋谱行。 */
html[data-theme=light] body:not(.auth-mode) :is(.stat-card,.admin-user-toolbar,.admin-user-table-wrap,.admin-detail-section,.ai-card,.kifu-item,.kifu-detail,.analyze-floating,.analyze-card,.analyze-panel-head){background:#fffdf8!important;border-color:#cdd6c2!important;color:#304c3b!important}
/* 卡片内次要文字（styles.css:3326-3337 固定米色 rgba(216,201,168,.62)） */
html[data-theme=light] body:not(.auth-mode) :is(.stat-card .lbl,.admin-user-subtitle,.admin-user-meta,.admin-user-id,.admin-detail-grid span,.admin-detail-games span,.admin-detail-games em,.toggle-label small,.kifu-meta,.kifu-rank){color:#5c705a!important}
html[data-theme=light] body:not(.auth-mode) .stat-card .num{color:#856022!important}

/* P0-6：管理后台整页仍是硬编码深色渐变（styles.css:3250-3258，浅色层零覆盖） */
html[data-theme=light] body:not(.auth-mode) #admin-view.active{background:radial-gradient(at center top,#fffdf8,transparent 65%),#fffdf8!important}
html[data-theme=light] body:not(.auth-mode) :is(.admin-header,.admin-tabs){background:#e9eee2!important;border-color:#cdd6c2!important}
html[data-theme=light] body:not(.auth-mode) .admin-tab{color:#5c705a!important}
html[data-theme=light] body:not(.auth-mode) .admin-tab.active{color:#856022!important;border-color:#c6d1b7!important;background:#efe6cf!important}
html[data-theme=light] body:not(.auth-mode) .admin-table th{background:#e9eee2!important;color:#856022!important;border-bottom-color:#cdd6c2!important}
html[data-theme=light] body:not(.auth-mode) .admin-table td{border-bottom-color:#dbe2d3!important}
html[data-theme=light] body:not(.auth-mode) .admin-table tr:hover td{background:rgba(31,108,89,0.07)!important}
html[data-theme=light] body:not(.auth-mode) .ai-log-box{background:#f7f8f2!important;border-color:#cdd6c2!important}

/* P0-6 附带：徽章文字在浅色卡片上为近白（styles.css:3357-3378） */
html[data-theme=light] body:not(.auth-mode) :is(.badge-user,.badge-offline){background:#e9eee2!important;color:#4d6253!important}
html[data-theme=light] body:not(.auth-mode) :is(.badge-admin,.badge-warn){background:#efe6cf!important;color:#856022!important}
html[data-theme=light] body:not(.auth-mode) :is(.badge-ai,.badge-online){background:#dcebdc!important;color:#286c4b!important}
html[data-theme=light] body:not(.auth-mode) .badge-danger{background:#f6e0dc!important;color:#a7473a!important}

/* P0-4：主题层把 .admin-action-btn.coin 文字改成深绿，却保留琥珀底 rgb(133,79,11)（1.40:1）。
   恢复深色期的浅字方案，保住"金色=金额操作"的语义。 */
html[data-theme=light] body:not(.auth-mode) .admin-action-btn.coin{background:rgb(133,79,11)!important;color:#FAEEDA!important;border-color:#8a6a2e!important}
html[data-theme=light] body:not(.auth-mode) .admin-action-btn.coin:hover{background:rgb(99,56,6)!important;color:#FAEEDA!important}

/* P0-3：认知复盘（弈理）整块在浅色层零覆盖——cognitive-review.css 全部硬编码深色，
   且被 scripts/build-theme-layer.cjs:18 的排除正则 \.cr- 挡在生成层之外。这里手工补齐。 */
html[data-theme=light] #rv-cognitive{color:#304c3b!important}
html[data-theme=light] :is(.cr-entry,.cr-card,.cr-position,.cr-playback,.cr-voice,.cr-language-status){background:#fffdf8!important;border-color:#cdd6c2!important}
html[data-theme=light] :is(.cr-position,.cr-card.cr-student){background:#e9eee2!important;border-color:#cdd6c2!important}
html[data-theme=light] :is(.cr-evaluation,.cr-choice){background:#e9eee2!important;border-left-color:#286c4b!important}
html[data-theme=light] :is(.cr-entry strong,.cr-position strong,.cr-card h3,.cr-card h4,.cr-card p,.cr-card ul,.cr-card label,.cr-card small,.cr-card blockquote,.cr-playback p,.cr-evaluation b,.cr-choice b,.cr-record b,.cr-voice small,.cr-position>span){color:#304c3b!important}
html[data-theme=light] :is(.cr-header h2,.cr-header p){color:#304c3b!important}
html[data-theme=light] .cr-header>span{color:#5c705a!important}
html[data-theme=light] .cr-header h2 span{color:#856022!important}
html[data-theme=light] :is(.cr-answer-hidden,.cr-hint){border-color:#c6d1b7!important}
html[data-theme=light] .cr-record{border-bottom-color:#cdd6c2!important}
html[data-theme=light] .cr-steps li{color:#5c705a!important;border-top-color:#cdd6c2!important}
html[data-theme=light] .cr-steps .current{color:#856022!important;border-color:#856022!important;background:#efe6cf!important}
html[data-theme=light] .cr-steps .done{color:#286c4b!important;border-color:#286c4b!important}
html[data-theme=light] :is(.cr-status,.cr-answer-notice){color:#856022!important;background:#efe6cf!important;border-color:#cdd6c2!important}
html[data-theme=light] .cr-verdict{color:#304c3b!important}
html[data-theme=light] .cr-success{color:#286c4b!important}
html[data-theme=light] .cr-card summary{color:#856022!important}
html[data-theme=light] :is(.cr-card select,.cr-card textarea){background:#fffdf8!important;border-color:#cdd6c2!important;color:#304c3b!important}
/* 主题层把 #rv-cognitive 的所有按钮统一成白底，主按钮失去层级，这里恢复墨绿主操作 */
html[data-theme=light] #rv-cognitive button.cr-primary{background:#173c35!important;color:#fff!important;border-color:#173c35!important}

/* P0-7 / P0-8：语义色令牌的浅色取值。深色值定义在 styles.css 的 body:not(.auth-mode) 令牌块中。
   评级/分数/进度/目差/账单金额原本由 JS 写入内联 style，CSS 类选择器无法覆盖；
   改为 var() 引用后即可随主题切换。以下取值均在 #fffdf8 上实测 >= 4.5:1。 */
html[data-theme=light] body:not(.auth-mode){
  --g-brilliant:#0f6f70;
  --g-good:#1f6f2a;
  --g-normal:#5a7a10;
  --g-doubt:#806020;
  --g-bad:#8a5f14;
  --g-blunder:#a8121a;
  --g-terrible:#8c1a88;
  --g-score-good:#1c6e4d;
  --g-score-mid:#856022;
  --g-score-bad:#a83a34;
  --g-info:#19607d;
  --g-eval-plus:#856022;
  --g-eval-minus:#286c4b;
  --g-amt-neutral:#4d6253;
  --g-amt-refund:#856022;
  --g-amt-spend:#9c4029;
  --g-amt-gain:#286c4b;
  --g-fp-insufficient:#5f5c47;
  --g-fp-ordinary:#286c4b;
  --g-fp-some:#856022;
  --g-fp-noticeable:#8a5a10;
  --g-fp-concentrated:#a83a34;
  /* P1：--green2 在浅色下是深墨绿，按钮文字应取白，与深色的深墨字相反 */
  --on-jade:#ffffff;
  /* P1：生成层漏覆盖的 4 个 --ui-* 令牌。--ui-jade 原为浅薄荷 #8ecab2，
     但它同时被 .rv-title-wrap small 当作文字色使用（浅色下仅 1.84:1）。 */
  --ui-jade:#2f6b59;
  --ui-action-gold-deep:#b9871f;
  --ui-action-gold-light:#e8c063;
  --ui-action-gold-edge:#9c7a22;
}
/* P1：成品弹窗遮罩。生成层把 ::backdrop 从 rgba(0,0,0,.8) 改成了不透明纸白，
   遮罩完全失效、弹窗与页面无法区分。恢复为品牌墨绿的半透明遮罩。 */
html[data-theme=light] .dynamic-result-dialog::backdrop{background:rgba(8,26,19,.34)!important}
}

/* === 四个工作区头部：品牌墨绿 #173C35 底 + 浅色无金（浅色）===
   深色基座已在 styles.css 中直接改为 #173c35；这里覆盖生成层的 #fffdf8 与 theme-brand-green.css
   的浅色按钮配色。选择器叠加 body.view-* 与视图容器类，以超过 theme-brand-green.css
   （加载晚于本文件）的 (0,3,3)~(0,5,3) 特异性，否则同分时按加载顺序告负。
   文字配色对齐语音复盘入口卡（theme-brand-green.css:720-725）的浅色用色，并遵循
   "浅色界面不使用金色"：标题 #ffffff、说明 #e8f3ed、小字 #bde8d5、按钮为白色描边式。
   深色主题（墨韵鎏金）仍保留金色，其取值在 styles.css 的四条头部规则中。 */
@media screen {
/* 语音复盘 */
html[data-theme=light] body:not(.auth-mode).view-voice-review-view .voice-review-workspace .voice-review-header{background:#173c35!important;background-color:#173c35!important;border-bottom-color:rgba(232,243,237,.24)!important}
html[data-theme=light] body:not(.auth-mode).view-voice-review-view .voice-review-workspace .voice-review-header>div:first-child>small{color:#bde8d5!important}
html[data-theme=light] body:not(.auth-mode).view-voice-review-view .voice-review-workspace .voice-review-header h1{color:#ffffff!important}
html[data-theme=light] body:not(.auth-mode).view-voice-review-view .voice-review-workspace .voice-review-header p{color:#e8f3ed!important}
html[data-theme=light] body:not(.auth-mode).view-voice-review-view .voice-review-workspace .voice-review-header-actions button{background:rgba(255,255,255,.10)!important;background-color:rgba(255,255,255,.10)!important;border-color:rgba(255,255,255,.34)!important;color:#ffffff!important}
html[data-theme=light] body:not(.auth-mode).view-voice-review-view .voice-review-workspace .voice-review-header-actions button:hover{background:rgba(255,255,255,.18)!important;background-color:rgba(255,255,255,.18)!important;border-color:rgba(255,255,255,.55)!important}

/* 动态棋谱 */
html[data-theme=light] body:not(.auth-mode).view-dynamic-kifu-view .dynamic-kifu-view .dynamic-kifu-header{background:#173c35!important;background-color:#173c35!important;border-bottom-color:rgba(232,243,237,.24)!important}
html[data-theme=light] body:not(.auth-mode).view-dynamic-kifu-view .dynamic-kifu-view .dynamic-kifu-header small{color:#bde8d5!important}
html[data-theme=light] body:not(.auth-mode).view-dynamic-kifu-view .dynamic-kifu-view .dynamic-kifu-header h1{color:#ffffff!important}
html[data-theme=light] body:not(.auth-mode).view-dynamic-kifu-view .dynamic-kifu-view .dynamic-kifu-header h1 small{color:#bde8d5!important}
html[data-theme=light] body:not(.auth-mode).view-dynamic-kifu-view .dynamic-kifu-view .dynamic-kifu-header p{color:#e8f3ed!important}
html[data-theme=light] body:not(.auth-mode).view-dynamic-kifu-view .dynamic-kifu-view .dynamic-kifu-header button{background:rgba(255,255,255,.10)!important;background-color:rgba(255,255,255,.10)!important;border-color:rgba(255,255,255,.34)!important;color:#ffffff!important}
html[data-theme=light] body:not(.auth-mode).view-dynamic-kifu-view .dynamic-kifu-view .dynamic-kifu-header button:not(:disabled):hover{background:rgba(255,255,255,.18)!important;background-color:rgba(255,255,255,.18)!important;border-color:rgba(255,255,255,.55)!important}

/* 机构复盘 */
html[data-theme=light] body:not(.auth-mode).view-institution-view .institution-workspace .institution-workspace-header{background:#173c35!important;background-color:#173c35!important;border-bottom-color:rgba(232,243,237,.24)!important}
html[data-theme=light] body:not(.auth-mode).view-institution-view .institution-workspace .institution-workspace-header small{color:#bde8d5!important}
html[data-theme=light] body:not(.auth-mode).view-institution-view .institution-workspace .institution-workspace-header h1{color:#ffffff!important}
html[data-theme=light] body:not(.auth-mode).view-institution-view .institution-workspace .institution-workspace-header p{color:#e8f3ed!important}
html[data-theme=light] body:not(.auth-mode).view-institution-view .institution-workspace .institution-header-actions button{background:rgba(255,255,255,.10)!important;background-color:rgba(255,255,255,.10)!important;background-image:none!important;border-color:rgba(255,255,255,.34)!important;color:#ffffff!important}
html[data-theme=light] body:not(.auth-mode).view-institution-view .institution-workspace .institution-header-actions button:last-child{background:#fffdf8!important;background-color:#fffdf8!important;background-image:none!important;border-color:#fffdf8!important;color:#173c35!important}

/* AI鉴定 */
html[data-theme=light] body:not(.auth-mode).view-fairplay-view .fairplay-workspace .fairplay-workspace-header{background:#173c35!important;background-color:#173c35!important;border-color:rgba(232,243,237,.24)!important}
html[data-theme=light] body:not(.auth-mode).view-fairplay-view .fairplay-workspace .fairplay-workspace-header small{color:#bde8d5!important}
html[data-theme=light] body:not(.auth-mode).view-fairplay-view .fairplay-workspace .fairplay-workspace-header h1{color:#ffffff!important}
html[data-theme=light] body:not(.auth-mode).view-fairplay-view .fairplay-workspace .fairplay-workspace-header p{color:#e8f3ed!important}
html[data-theme=light] body:not(.auth-mode).view-fairplay-view .fairplay-workspace .fairplay-workspace-header button{background:rgba(255,255,255,.10)!important;background-color:rgba(255,255,255,.10)!important;border-color:rgba(255,255,255,.34)!important;color:#ffffff!important}
html[data-theme=light] body:not(.auth-mode).view-fairplay-view .fairplay-workspace .fairplay-workspace-header button:hover{background:rgba(255,255,255,.18)!important;background-color:rgba(255,255,255,.18)!important;border-color:rgba(255,255,255,.55)!important}
}
