/* =====================================================
   UX Refresh · P1（纯样式层）  2026-10-14
   目标：最小字号 12px、次要文字对比度达 AA、可见焦点框、
         列表卡片题干放大并去掉缩放抖动。
   范围：只覆盖界面 UI；A4 试卷画布（.a4-paper-sheet）内一律不动，
         以免影响 PDF/打印版式所见即所得。
   加载：放在 codex-layout.css 之后。回滚：删掉 index.html 中引用本文件的那一行。
   ===================================================== */

/* ---------- 1. 颜色：次要/辅助文字加深 ---------- */
/* 浅色：tertiary #a3a3a3(2.5:1) → #737373(4.7:1)；secondary #737373 → #525252 */
.theme-obsidian, .theme-violet, .theme-emerald, .theme-ocean, .theme-amber, .theme-crimson {
    --cdx-text-secondary: #525252;
    --cdx-text-tertiary: #737373;
}
.dark {
    --cdx-text-secondary: #b5b5b5;
    --cdx-text-tertiary: #8f8f8f;
}
/* Tailwind 浅灰字只在浅色模式下加深一档（深色模式不动，A4 画布不动） */
html:not(.dark) .text-slate-400:not(.a4-paper-sheet *) { color: #64748b; }
html:not(.dark) .text-slate-300:not(.a4-paper-sheet *) { color: #94a3b8; }

/* ---------- 2. 字号：7~11px 全部抬到 12px ---------- */
:is(.text-\[7px\], .text-\[8px\], .text-\[9px\], .text-\[10px\], .text-\[11px\], .text-\[11\.5px\]):not(.a4-paper-sheet *) {
    font-size: 12px !important;
}
/* 图标类只抬到 11px，避免小徽章被撑高 */
i:is(.text-\[7px\], .text-\[8px\], .text-\[9px\], .text-\[10px\]):not(.a4-paper-sheet *) {
    font-size: 11px !important;
}
/* 输入框、下拉框 12 → 13px（按钮不动，避免工具栏换行） */
:is(input, select, textarea).text-xs:not(.a4-paper-sheet *),
.glass-select, input.glass-input, select.glass-select {
    font-size: 13px !important;
}

/* CSS 文件里写死的小字号 */
.global-tooltip { font-size: 12px !important; }
.pagination-btn,
.pagination-ellipsis,
.pagination-jump-input { font-size: 12px; }
#codexRail .rail-tooltip { font-size: 12px; }
#codexStatusBar { font-size: 12px; }
#codexStatusBar kbd { font-size: 11px; }
.codex-palette-item .cpi-icon,
.codex-palette-item .cpi-desc { font-size: 12px; }
.codex-palette-item .cpi-shortcut { font-size: 11px; }

/* ---------- 3. 题目列表卡片 ---------- */
.question-card .line-clamp-2 {
    font-size: 14px !important;
    line-height: 1.7 !important;
}
/* 取消悬停位移与点击缩放（列表里有抖动感） */
.question-card:hover,
.question-card:active { transform: none !important; }
/* 卡片首行徽章（题型/标签/解法/难度/题号）保持原字号：放大后会挤成 2~3 行。
   这一行的结构调整放到 P2（改卡片模板）里做 */
.question-card > div:first-child .text-\[10px\] { font-size: 10px !important; }
.question-card > div:first-child .text-\[9px\]  { font-size: 9px !important; }
.question-card > div:first-child .text-\[8px\]  { font-size: 8px !important; }
.question-card > div:first-child .text-\[7px\]  { font-size: 7px !important; }
/* 选中态：左侧主题色竖条 */
.question-card.active {
    box-shadow: inset 3px 0 0 rgb(var(--brand-600-rgb)) !important;
}
/* 收藏、删除按钮：点击区域加大到 24px */
.question-card button[aria-label="收藏题目"],
.question-card button[aria-label="删除题目"] {
    min-width: 24px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---------- 4. 标签页 ---------- */
#codexSidebarTabs .glass-tab-item { font-size: 13px !important; }
/* 选中的标签页是黑底，但里面的 .text-brand-600 / 继承色把文字压成深灰，看不清
  （如「OCR 图像识别」）。统一改为反白 */
.glass-tab-item.active,
.glass-tab-item.active * {
    color: var(--cdx-accent-text) !important;
}

/* ---------- 5. 键盘焦点框：清晰可见 ---------- */
*:focus-visible {
    outline: 2px solid rgb(var(--brand-500-rgb)) !important;
    outline-offset: 2px !important;
}
