/* ============================================================================
 * 至元德语 · 每日口语De —— App Shell 样式
 * 骨架与「单词学习程序」一致：顶栏 + 内容页 + 固定底部导航
 * 差异：口语程序桌面端更宽（1 行 4 列磁贴），不锁 480px。
 * ========================================================================== */

#app {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    max-width: 100%;
    margin: 0 auto;
    background: var(--background-color);
}

/* ==================== 顶栏 ==================== */
.app-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 10px 16px;
    background: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 100;
    padding-top: calc(10px + var(--safe-t));
}
.header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* 正方形 logo：浅色主题显示彩色版，深色主题显示反色版 */
.logo-sq { width: 32px; height: 32px; object-fit: contain; flex: 0 0 auto; }
.logo-sq.only-dark { display: none; }
html[data-theme="dark"] .logo-sq.only-light { display: none; }
html[data-theme="dark"] .logo-sq.only-dark { display: block; }
.logo-fallback {
    width: 30px; height: 30px; border-radius: var(--radius-sm); flex: 0 0 auto;
    background: var(--gradient-primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
}
/* 品牌标题：与单词程序（woerter 的 .logo-text）完全同款 —— 同一字号/字重/颜色，中间用连字符 */
.logo-text { font-size: 15px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-right { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

.icon-btn {
    width: 36px; height: 36px; border: none; background: transparent;
    border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); cursor: pointer; transition: var(--transition-fast); flex: 0 0 auto;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text-primary); }

/* ==================== 内容区 ==================== */
/* 背景景深：顶部一层极淡的品牌光晕（不进滚动、不抢内容），磁贴浮在它上面 */
.app-main {
    flex: 1; min-height: 0; overflow-y: auto;
    padding-bottom: calc(var(--nav-h) + var(--safe-b));
    background-image:
        radial-gradient(130% 46% at 12% -6%, var(--bg-glow-1), transparent 62%),
        radial-gradient(110% 40% at 96% 2%, var(--bg-glow-2), transparent 58%);
    background-repeat: no-repeat;
}
html:not([data-theme="dark"]) { --bg-glow-1: rgba(37, 99, 235, .10); --bg-glow-2: rgba(124, 58, 237, .08); }
html[data-theme="dark"] { --bg-glow-1: rgba(59, 130, 246, .13); --bg-glow-2: rgba(139, 92, 246, .10); }
.page { display: none; padding: 16px; }
.page.active { display: block; animation: pageIn .2s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-title { font-size: 18px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
/* 今日练习状态灯：默认灰（没开始）/ 黄（不足 5 分钟）/ 绿（满 5 分钟） */
.today-dot {
    width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto;
    background: var(--border-color); transition: var(--transition-normal);
}
.today-dot.half { background: var(--warning-color); box-shadow: 0 0 0 3px var(--warning-soft); }
.today-dot.full { background: var(--success-color); box-shadow: 0 0 0 3px var(--success-soft); }
.page-header-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.pick-title { font-size: 19px; font-weight: 700; }
.pick-sub { font-size: 13px; color: var(--text-secondary); margin: 4px 0 14px; line-height: 1.6; }

/* ==================== 模式磁贴（首页） ==================== */
.mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
/* 四个模式各自的底色 / 图标底色 / 主色 / 投影色 —— 让磁贴一眼能区分、且有厚度
 * 变量作用在卡片上，图标与标签通过 var() 继承，改这里即可换配色。 */
/* V2.7.1：底色略微加深（原来太淡，几乎与页面背景同色、磁贴边界不清） */
.mode-card[data-mode-id="level"] { --mode-tint: #E7F0FF; --mode-chip: #D2E2FF; --mode-ink: #1D4ED8; --mode-shadow: rgba(37, 99, 235, .32); }
.mode-card[data-mode-id="chat"]  { --mode-tint: #E4F5FB; --mode-chip: #CBEAF5; --mode-ink: #0E7490; --mode-shadow: rgba(8, 145, 178, .30); }
.mode-card[data-mode-id="topic"] { --mode-tint: #EFE9FF; --mode-chip: #E0D4FF; --mode-ink: #6D28D9; --mode-shadow: rgba(124, 58, 237, .30); }
.mode-card[data-mode-id="call"]  { --mode-tint: #E4F7EE; --mode-chip: #C9EEDA; --mode-ink: #047857; --mode-shadow: rgba(5, 150, 105, .30); }
html[data-theme="dark"] .mode-card[data-mode-id="level"] { --mode-tint: #16233C; --mode-chip: #1E3A5F; --mode-ink: #60A5FA; --mode-shadow: rgba(96, 165, 250, .26); }
html[data-theme="dark"] .mode-card[data-mode-id="chat"]  { --mode-tint: #12252B; --mode-chip: #1A3B45; --mode-ink: #38BDF8; --mode-shadow: rgba(56, 189, 248, .24); }
html[data-theme="dark"] .mode-card[data-mode-id="topic"] { --mode-tint: #1E1935; --mode-chip: #2C2350; --mode-ink: #A78BFA; --mode-shadow: rgba(167, 139, 250, .26); }
html[data-theme="dark"] .mode-card[data-mode-id="call"]  { --mode-tint: #12241D; --mode-chip: #1B3B2D; --mode-ink: #34D399; --mode-shadow: rgba(52, 211, 153, .24); }

/* 立体感的三个来源（都不引入新颜色，只做明暗关系）：
 *   ① 顶部受光：一层自上而下的白色薄纱（深色主题下减弱）
 *   ② 棱边描亮：一圈近乎白的细边，像被光打到的边
 *   ③ 分层投影：贴地细影 + 中景柔影 + 以模式主色渲染的远景薄影
 */
.mode-card {
    display: flex; flex-direction: column; gap: 8px;
    padding: 14px 14px 13px;
    background: var(--mode-tint, var(--card-background));
    background-image:
        radial-gradient(72% 82% at 88% -12%, var(--card-sheen), rgba(255, 255, 255, 0) 72%),
        linear-gradient(180deg, var(--card-sheen), rgba(255, 255, 255, 0) 64%);
    border: 1px solid var(--card-edge);
    border-radius: var(--radius-lg); cursor: pointer; text-align: left;
    transition: transform .18s ease, box-shadow .18s ease;
    position: relative; overflow: hidden;
    box-shadow:
        inset 0 1px 0 var(--card-hi),
        0 1px 2px rgba(15, 23, 42, .06),
        0 8px 18px -8px var(--mode-shadow, var(--card-shadow)),
        0 18px 34px -22px var(--mode-shadow, var(--card-shadow));
}
.mode-card:hover {
    transform: translateY(-3px);
    box-shadow:
        inset 0 1px 0 var(--card-hi),
        0 2px 4px rgba(15, 23, 42, .07),
        0 14px 26px -10px var(--mode-shadow, var(--card-shadow)),
        0 26px 46px -24px var(--mode-shadow, var(--card-shadow));
}
.mode-card:active { transform: translateY(-1px); }
/* 图标与标题左右排列 */
.mode-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mode-icon {
    width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
    background: var(--mode-chip, var(--primary-soft)); color: var(--mode-ink, var(--primary-color));
    background-image: linear-gradient(165deg, var(--chip-sheen), rgba(255, 255, 255, 0) 70%);
    box-shadow: inset 0 1px 0 var(--chip-hi), 0 2px 5px -2px var(--mode-shadow, var(--card-shadow));
}
.mode-card h3 { font-size: 16px; font-weight: 700; }
/* 描述最多两行（超出省略），磁贴整体高度因此可控 */
.mode-card p {
    font-size: 13px; color: var(--text-secondary); line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mode-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.mode-tag { font-size: 12px; color: var(--mode-ink, var(--primary-color)); font-weight: 600; }

/* V2.7.1 · 深色主题：磁贴标题原来沿用正文色，在加深后的底色上不够醒目 ——
 * 标题用品级最高的文字色，描述用调亮后的次要色，标签保持模式主色但加重字重。 */
html[data-theme="dark"] .mode-card h3 { color: var(--text-primary); }
html[data-theme="dark"] .mode-card p  { color: #B7C3D4; }
html[data-theme="dark"] .mode-tag     { color: var(--mode-ink); font-weight: 700; }

/* 立体感的明暗参数：浅色主题更亮、深色主题更含蓄 */
html:not([data-theme="dark"]) {
    --card-sheen: rgba(255, 255, 255, .75);
    --card-edge: rgba(255, 255, 255, .78);
    --card-hi: rgba(255, 255, 255, .95);
    --chip-sheen: rgba(255, 255, 255, .65);
    --chip-hi: rgba(255, 255, 255, .9);
    --card-shadow: rgba(15, 23, 42, .18);
}
html[data-theme="dark"] {
    --card-sheen: rgba(255, 255, 255, .055);
    --card-edge: rgba(255, 255, 255, .07);
    --card-hi: rgba(255, 255, 255, .06);
    --chip-sheen: rgba(255, 255, 255, .08);
    --chip-hi: rgba(255, 255, 255, .07);
    --card-shadow: rgba(0, 0, 0, .55);
}

/* ==================== 二级磁贴（图片 + 标题） ====================
 * 图片规范（后续用 AI 生成的图替换即可）：
 *   尺寸  800×600（4:3），JPG / WebP，单张 ≤ 150KB
 *   路径  public/img/levels/a1.jpg · public/img/topics/<分类id>-<主题id>.jpg · public/img/scenes/<情景id>.jpg
 *   容器  固定 4:3，圆角 var(--radius-lg)，图片 object-fit:cover 铺满
 *   标题  左下角白色粗体 + 底部渐变遮罩（保证任何底图都可读）
 *   占位  未提供图片时显示 .tile-ph（渐变底色 + 图标），替换时给 .tile 加 style="--img:url(...)"
 * ========================================================================== */
.tile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile {
    position: relative; aspect-ratio: 4 / 3; overflow: hidden;
    border-radius: var(--radius-lg); cursor: pointer;
    background: var(--tile-bg, var(--gradient-primary));
    background-image: var(--img, none); background-size: cover; background-position: center;
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tile:active { transform: translateY(0); }
.tile-ph {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 40px; opacity: .9;
}
/* 磁贴图片：放入 img/<...>.jpg 后自动生效；加载失败会被 onerror 移除，露出占位 */
.tile-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 42%, rgba(15, 23, 42, .72) 100%);
}
.tile-label {
    position: absolute; left: 12px; bottom: 10px; right: 12px; z-index: 2;
    color: #fff; font-weight: 700; font-size: 15px; line-height: 1.35;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.tile-label small { display: block; font-weight: 500; font-size: 11.5px; opacity: .88; margin-top: 2px; }
.tile-badge {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    font-size: 10.5px; font-weight: 700; color: #fff; background: var(--primary-color);
    padding: 2px 8px; border-radius: var(--radius-pill);
}
/* V2.7.33（issues_V2 R-21）：徽章原先只有一种蓝色，二级磁贴上一片蓝、分不出进度。
   绿色 = 已经练过（情景「已练习」/ 等级分类里动过的）；蓝色 = 还没练。 */
.tile-badge.done { background: var(--ok); }

/* ==================== V2.7.4 · 图片蒙版「直接做在图片上」 ====================
 * 情景与主题用的是真实场景照片，亮度与饱和度高，直接铺满会让二级磁贴比首页四个主模式
 * 还抢眼（主次不清）。按用户口径：**蒙版直接烘焙进 JPG**（与等级图统一），
 * 程序端**不再叠加任何蒙版层** —— 处理参数与复现命令见 DEVELOPMENT.md 的 2.7.4 段。
 * 因此这里只保留一条与蒙版无关的显示规则。 */
/* 图片与占位图标**二选一**：只要磁贴有图片元素，就同步隐藏占位图标。
 * `.has-img` 由 shell.js 的 openPick **同步加上**（不等图片加载完），所以
 *   ① 不依赖 `:has()`（老浏览器 / 内嵌 WebView 也不会"图 + 图标"同屏）
 *   ② 不会出现"先闪一下占位图标再变图片"
 * 图片加载失败时 JS 会摘掉 `.has-img` 并移除 <img>，占位图标照旧显示 ——
 * 因此两种坏状态（图+图标同屏 / 空白磁贴）都不会出现。 */
.tile.has-img .tile-ph { display: none; }

/* ==================== 底部导航 ==================== */
.app-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 100%;
    display: flex; align-items: stretch;
    height: calc(var(--nav-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: var(--card-background); border-top: 1px solid var(--border-color);
    z-index: 100;
}
.nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: none; background: transparent; color: var(--text-secondary);
    font-size: 11px; font-weight: 500; cursor: pointer;
    transition: var(--transition-fast); -webkit-tap-highlight-color: transparent;
}
.nav-item:hover { color: var(--text-primary); }
.nav-item.active { color: var(--primary-color); }
.nav-item svg { pointer-events: none; }

/* ==================== 统计页 ==================== */
.stats-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stats-header h2 { font-size: 19px; font-weight: 700; }
/* 右上角范围切换：文字自适应宽度且单行不换行（原来是固定 36px 方按钮，长文字会被挤出边界） */
#statsRangeBtn { width: auto; padding: 0 10px; min-height: 32px; }
.range-label { font-size: 12.5px; font-weight: 600; color: var(--primary-color); white-space: nowrap; }

.stats-overview { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.overview-card {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 12px; background: var(--card-background);
    border: 1px solid var(--border-color); border-radius: var(--radius-lg);
}
.overview-icon {
    width: 36px; height: 36px; border-radius: var(--radius-md); flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-soft); color: var(--primary-color);
}
.overview-info { display: flex; flex-direction: column; min-width: 0; }
.overview-value { font-size: 19px; font-weight: 700; line-height: 1.2; }
.overview-label { font-size: 11.5px; color: var(--text-secondary); }

.stats-section { margin-bottom: 20px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.section-count { color: var(--text-muted); font-weight: 500; font-size: 12.5px; }
.link-btn { border: none; background: transparent; color: var(--primary-color); font-size: 12.5px; font-weight: 600; cursor: pointer; }

/* 时长趋势：连续曲线 + 每点标记（分钟）+ 平均线
   用 SVG viewBox 等比缩放：近 30 天按周聚合后只有 4 个点，任何屏宽都不会溢出 */
.trend-chart {
    padding: 10px 12px; background: var(--card-background);
    border: 1px solid var(--border-color); border-radius: var(--radius-lg);
    overflow: hidden;
}
.trend-svg { display: block; width: 100%; height: auto; }
.tp-area { fill: url(#tpFill); }
.tp-line { fill: none; stroke: var(--primary-color); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tp-avg { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 4 4; }
.tp-avgtext { fill: var(--text-muted); font-size: 9px; text-anchor: end; }
.tp-dot { fill: var(--card-background); stroke: var(--primary-color); stroke-width: 2; }
.tp-dot.zero { stroke: var(--border-color); }
.tp-val { fill: var(--primary-color); font-size: 9px; font-weight: 700; text-anchor: middle; }
.tp-tick { fill: var(--text-muted); font-size: 9px; text-anchor: middle; }

/* 可折叠板块（错误汇总 / 练习过的单词 / 最近练习）：标题一行 + 右侧小三角，默认收起 */
.fold-head {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 11px 12px; background: var(--card-background); font: inherit;
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    cursor: pointer; text-align: left;
}
.fold.open .fold-head { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.fold-body {
    display: none; padding: 10px 12px 2px;
    border: 1px solid var(--border-color); border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.fold.open .fold-body { display: block; }
.fold-arrow {
    display: inline-block; font-size: 11px; color: var(--text-muted);
    transform: rotate(-90deg); transition: transform var(--transition-fast);
}
.fold.open .fold-arrow, .err-group.open .fold-arrow { transform: rotate(0deg); }

/* 错误分组：点一行展开该类型的全部记录（只记录 1 处的不可展开） */
.err-group:not(.flat) { cursor: pointer; }
.err-group .err-list { display: none; margin-top: 6px; }
.err-group.open .err-list { display: block; }
.err-group.open .err-preview { display: none; }
.err-group .record-value .fold-arrow { margin-left: 4px; }
.err-row {
    padding: 4px 0; font-size: 12px; line-height: 1.6; color: var(--text-secondary);
    border-top: 1px dashed var(--border-color);
}
.err-row:first-child { border-top: none; }
.err-why { color: var(--text-muted); margin-left: 6px; }
.err-more { color: var(--text-muted); }

/* 记录 / 错误 列表 */
.record-list { display: flex; flex-direction: column; gap: 8px; }
.record-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px; background: var(--card-background);
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
}
.record-icon {
    width: 32px; height: 32px; border-radius: var(--radius-sm); flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
    background: var(--panel-2);
}
.record-icon.err { background: var(--danger-soft); }
.record-main { flex: 1; min-width: 0; }
.record-title { font-size: 13.5px; font-weight: 600; }
.record-sub { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; line-height: 1.5; }
.record-sub .fix { color: var(--success-color); font-weight: 600; }
.record-sub .bad { color: var(--danger-color); text-decoration: line-through; }
.record-value { font-size: 13px; font-weight: 700; color: var(--primary-color); flex: 0 0 auto; }
/* 最近练习里的对话原文：靠背景色分界，每行最多两行，超出省略 */
.record-dialog {
    margin-top: 8px; padding: 8px 10px;
    background: var(--panel-2); border-radius: var(--radius-sm);
    display: flex; flex-direction: column; gap: 4px;
}
.dlg-row { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.55; }
.dlg-who { flex: 0 0 auto; font-weight: 600; color: var(--text-muted); }
.dlg-text {
    min-width: 0; color: var(--text-secondary);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.empty-hint { padding: 18px 12px; text-align: center; font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }

/* 单词 chips */
.word-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.word-chip {
    display: inline-flex; align-items: baseline; gap: 6px;
    padding: 7px 12px; border-radius: var(--radius-pill);
    background: var(--card-background); border: 1px solid var(--border-color);
    font-size: 13px; cursor: pointer; transition: var(--transition-fast);
}
.word-chip:hover { border-color: var(--primary-light); }
.word-chip b { font-weight: 600; }
.word-chip span { font-size: 11.5px; color: var(--text-muted); }

/* 首页单词表入口 */
/* V2.9.0（用户口径 2）：单词表标题行右侧的三个按钮（跟读 / 统计 / 全部）并排 */
/* V2.8.6（用户口径 2-1）：单词表标题行右侧三个入口 = **三个独立简约按钮**
   （各自浅边框 + 图标 + 间距；原来是纯文字链接，看着像混在一起）。 */
.section-actions { display: flex; align-items: center; gap: 8px; }
.section-actions .link-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--panel-2); color: var(--text-secondary);
    font-size: 12px; font-weight: 600; line-height: 1.2;
}
.section-actions .link-btn svg { width: 13px; height: 13px; }
.section-actions .link-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.word-entry-card {
  /* V2.9.0（用户口径 3）：**固定高度** —— 不随单词数量增长；首页一屏内显示完，不触发上下滚动。
     完整列表由标题行的【全部】承担（打开单词表浮层）。 */
  height: clamp(170px, 32vh, 250px);
  overflow: hidden;
    background: var(--card-background); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 14px;
}
.word-entry-card .day-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.word-entry-card .day-label:not(:first-child) { margin-top: 14px; }
.entry-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ==================== 我的（设置） ==================== */
.settings-section { margin-bottom: 18px; }
.settings-section .section-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.setting-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 12px; background: var(--card-background);
    border: 1px solid var(--border-color); border-bottom: none; cursor: pointer;
}
.setting-item:first-of-type { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.setting-item:last-of-type { border-bottom: 1px solid var(--border-color); border-radius: 0 0 var(--radius-md) var(--radius-md); }
.setting-item:only-of-type { border-radius: var(--radius-md); border-bottom: 1px solid var(--border-color); }
.setting-item:hover { background: var(--panel-2); }
.setting-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.setting-label { font-size: 14.5px; font-weight: 500; }
.setting-desc { font-size: 11.5px; color: var(--text-secondary); line-height: 1.5; }
.setting-control { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.setting-value { font-size: 13.5px; color: var(--text-secondary); }
.chev { color: var(--text-muted); font-size: 18px; line-height: 1; }
.setting-item.noswitch { cursor: default; }
.setting-item.noswitch:hover { background: var(--card-background); }
.setting-slider { width: 130px; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: var(--border-color); outline: none; }
.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
    background: var(--primary-color); cursor: pointer; box-shadow: var(--shadow-sm);
}
.setting-slider::-moz-range-thumb { width: 18px; height: 18px; border: none; border-radius: 50%; background: var(--primary-color); cursor: pointer; }
.setting-slider.narrow { width: 104px; }

/* 原位下拉（选项 > 4 时用，不弹窗） */
.setting-select {
    height: 34px; padding: 0 26px 0 10px; font-size: 13.5px; font-weight: 500;
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    background-color: var(--card-background); color: var(--text-primary);
    appearance: none; cursor: pointer; outline: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%), linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position: calc(100% - 14px) 15px, calc(100% - 9px) 15px;
    background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.setting-select:focus { border-color: var(--primary-color); }

/* 二选一：左右分段按钮 */
.seg {
    display: inline-flex; padding: 2px; gap: 2px;
    background: var(--panel-2); border: 1px solid var(--border-color); border-radius: var(--radius-sm);
}
.seg button {
    border: none; background: transparent; color: var(--text-secondary);
    font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 6px;
    cursor: pointer; white-space: nowrap; transition: var(--transition-fast);
}
.seg button.on { background: var(--card-background); color: var(--primary-color); box-shadow: var(--shadow-sm); }

/* V2.7.8 · 页脚统一版式：版本+版权（一行）/ 专利说明 / 隐私说明 —— 三者同款字体、字号、行距、颜色 */
.settings-footer { padding: 18px 0 10px; text-align: center; }
.settings-footer p { font-size: 11px; color: var(--text-muted); opacity: .85; line-height: 1.7; margin: 0; }
.copyright { font-size: 11px; color: var(--text-muted); opacity: .85; margin-top: 3px; }
.patent { margin-top: 8px; }

/* 隐私说明：存在即可、不抢视线 —— 与版本 / 专利说明**完全同款**。
   入口只显示「隐私说明」四个字（去掉浏览器默认三角，不留任何附加文字），点开才看正文。 */
.privacy-note { margin-top: 8px; }
.privacy-note summary {
    display: inline-block; cursor: pointer; list-style: none;
    font-size: 11px; color: var(--text-muted); opacity: .85;
    transition: var(--transition-fast);
}
.privacy-note summary::-webkit-details-marker { display: none; }
.privacy-note summary:hover, .privacy-note[open] summary { opacity: 1; }
.privacy-body {
    max-width: 520px; margin: 8px auto 0; padding: 0 14px;
    font-size: 11px; line-height: 1.7; color: var(--text-muted); opacity: .85; text-align: left;
}
.privacy-body p { margin: 2px 0; }

/* V2.7.17 · 外壳图标统一（issues_V2 P1-8）：外壳改用与练习页**同一套** Lucide 线性图标
   （表在 shell.js 的 SH_ICO，规格与 docs/图标统一-变更记录-V2.7.13.md 一致，颜色跟随主题）。
   用户口径：`🎭` 作为「情景模式 / 情景角色」的标识**刻意保留**，不换成图标。 */
svg.ico { width: 16px; height: 16px; flex: 0 0 auto; vertical-align: -3px; stroke-width: 2 }
.mode-icon { display: inline-flex; align-items: center; color: currentColor }
.mode-icon svg.ico { width: 19px; height: 19px; vertical-align: -2px }
.tile-ph svg.ico { width: 28px; height: 28px; vertical-align: -3px }
.record-icon svg.ico { width: 18px; height: 18px; vertical-align: 0 }
.fold-arrow svg.ico { width: 14px; height: 14px; vertical-align: -2px }
.entry-actions .btn-primary svg.ico, .entry-actions .btn-secondary svg.ico { width: 17px; height: 17px; vertical-align: -3px }
[data-ico-sh] { display: inline-flex; align-items: center; justify-content: center }

/* V2.7.17 · P1-7 登录卡：说明上下两个入口的区别（教师＝上方表单，学员＝下方按钮） */
.auth-hint { font-size: 11.5px; color: var(--text-muted); opacity: .9; margin: -2px 0 8px; text-align: center }

/* ==================== 选择器 / API 弹层 ==================== */
.choose-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.choose-row {
    padding: 12px; border-radius: var(--radius-md); font-size: 14.5px;
    border: 1px solid var(--border-color); cursor: pointer; transition: var(--transition-fast);
}
.choose-row:hover { background: var(--panel-2); }
.choose-row.on { background: var(--primary-soft); border-color: var(--primary-color); color: var(--primary-color); font-weight: 600; }
.api-sheet { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.api-row { display: flex; align-items: center; gap: 8px; }
.api-row span { font-size: 13px; color: var(--text-secondary); flex: 0 0 84px; }
.api-row input {
    flex: 1; min-width: 0; height: 38px; padding: 0 10px; font-size: 13px;
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    background: var(--card-background); color: var(--text-primary); outline: none;
}
.api-row input:focus { border-color: var(--primary-color); }
.api-note { font-size: 11.5px; color: var(--text-muted); line-height: 1.6; }
/* AI 配置：所选方案实际会用到哪些服务（避免界面与运行时不一致） */
.plan-note {
    padding: 8px 10px; margin-top: -6px;
    background: var(--panel-2); border-radius: var(--radius-sm);
    font-size: 11.5px; color: var(--text-secondary); line-height: 1.55; text-align: left;
}
.api-actions { display: flex; gap: 8px; margin-top: 6px; }
.api-actions > * { flex: 1; }

/* ==================== 拨动块：左右标识两个状态（单词程序同款开关） ==================== */
.switch-labeled { display: flex; align-items: center; gap: 7px; }
.switch-labeled .sw-side { font-size: 11.5px; color: var(--text-muted); transition: var(--transition-fast); white-space: nowrap; }
.switch-labeled .sw-side.on { color: var(--primary-color); font-weight: 600; }

/* ==================== 登录遮罩 ==================== */
.auth-gate {
    position: fixed; inset: 0; z-index: 600;
    display: flex; align-items: center; justify-content: center;
    background: var(--background-color); padding: 20px;
}
.auth-card {
    width: 100%; max-width: 340px; text-align: center;
    background: var(--card-background); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 28px 24px 20px;
    box-shadow: var(--shadow-lg);
}
.auth-logo { height: 52px; width: 52px; object-fit: contain; }
.auth-brand { margin-top: 10px; font-size: 15.5px; font-weight: 700; }
.auth-tip { margin-top: 8px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }
.auth-form { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; text-align: left; }
.auth-form input {
    height: 42px; padding: 0 12px; font-size: 14px;
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    background: var(--panel-2); color: var(--text-primary); outline: none;
}
.auth-form input:focus { border-color: var(--primary-color); }
.auth-err { min-height: 16px; margin-top: 9px; font-size: 12px; color: var(--danger-color); line-height: 1.5; }
.auth-div { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--text-muted); font-size: 11px; }
.auth-div::before, .auth-div::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }
.auth-foot { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-color); font-size: 10.5px; line-height: 1.6; color: var(--text-muted); opacity: .78; }

/* ==================== AI 方案选择（弹层内） ==================== */
.plan-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; text-align: left; }
.plan-item {
    display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px;
    border: 1px solid var(--border-color); border-radius: var(--radius-md); cursor: pointer;
    transition: var(--transition-fast);
}
.plan-item:hover { background: var(--panel-2); }
.plan-item.on { border-color: var(--primary-color); background: var(--primary-soft); }
.plan-radio {
    width: 17px; height: 17px; border-radius: 50%; flex: 0 0 auto; margin-top: 1px;
    border: 2px solid var(--border-color); background: var(--card-background); position: relative;
}
.plan-item.on .plan-radio { border-color: var(--primary-color); }
.plan-item.on .plan-radio::after {
    content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--primary-color);
}
.plan-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.plan-name { font-size: 14px; font-weight: 600; }
.plan-item.on .plan-name { color: var(--primary-color); }
/* 提示文字另起一行；带链接的可点击直达官网 */
.plan-desc { display: block; font-size: 11.5px; color: var(--text-secondary); line-height: 1.55; margin-top: 3px; }
.plan-link { color: var(--primary-color); text-decoration: none; }
.plan-link:hover { text-decoration: underline; }
.plan-badge { font-size: 10px; color: #fff; background: var(--primary-color); padding: 1px 6px; border-radius: var(--radius-pill); margin-left: 5px; font-weight: 600; }
.plan-tag { font-size: 12px; font-weight: 500; color: var(--primary-color); }
.plan-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); text-align: left; margin-bottom: 9px; }

/* ==================== 单词表浮层 ==================== */
.word-modal { max-width: 460px; text-align: left; max-height: 76dvh; display: flex; flex-direction: column; padding: 18px; }
.word-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.word-modal-body { overflow-y: auto; flex: 1; min-height: 0; }
.word-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border-color); }
.word-row:last-child { border-bottom: none; }
.word-main { flex: 1; min-width: 0; }
.word-de { font-size: 15px; font-weight: 600; }
.word-zh { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.word-src { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; }
.word-play {
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border-color);
    background: var(--card-background); color: var(--primary-color); cursor: pointer;
    display: flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: 15px;
}
.word-play:hover { background: var(--primary-soft); }

/* ==================== 响应式 ==================== */
/* 平板：二级磁贴 3 列 */
@media (min-width: 640px) {
    .tile-grid { grid-template-columns: repeat(3, 1fr); }
    .page { padding: 20px 24px; }
}

/* 桌面：更宽，磁贴 1 行 4 列 */
@media (min-width: 1024px) {
    #app { max-width: 1120px; box-shadow: var(--shadow-lg); }
    .app-nav { max-width: 1120px; }
    .mode-grid { grid-template-columns: repeat(4, 1fr); }
    .tile-grid { grid-template-columns: repeat(4, 1fr); }
    .stats-overview { grid-template-columns: repeat(4, 1fr); }
    .page { padding: 24px 28px; }
}

/* 窄屏：压缩间距；字号只比标准档小一号（不再退回 14/12，手机上也看得清） */
@media (max-width: 400px) {
    .logo-text { font-size: 14px; }
    .page { padding: 12px; }
    .mode-grid { gap: 10px; }
    .mode-card { padding: 13px 12px 12px; }
    .mode-card h3 { font-size: 15px; }
    .mode-card p { font-size: 12.5px; }
    .mode-icon { width: 36px; height: 36px; font-size: 19px; }
    .tile-label { font-size: 14px; left: 10px; bottom: 8px; right: 10px; }
    .setting-slider { width: 104px; }
}


/* ==================== V2.8.7（用户口径 ③）：首页一屏刚好显示、页面不滚动 ====================
   之前只给卡片加了 clamp 限高，整页仍会随内容上下滚动 —— 不符合「移动设备尺寸下首页一屏显示完」。
   现在：标题与四个磁贴按内容高度固定，下面的「跟读练习」栏目**吃掉剩余空间**，
   卡片内部滚动（卡片高度也随单词量变化，但整页不滚）。 */
#homePage.active {
    display: flex; flex-direction: column;
    box-sizing: border-box; overflow: hidden;
}
#homePage > .page-title,
#homePage > .mode-grid { flex: 0 0 auto; }
#homePage > #todayWordsSection {
    flex: 1 1 auto; min-height: 0; margin-bottom: 0;
    display: flex; flex-direction: column;
}
#homePage > #todayWordsSection .section-header { flex: 0 0 auto; }
#homePage > #todayWordsSection .word-entry-card {
    height: auto; flex: 1 1 auto; min-height: 96px; overflow-y: auto;
}
/* V2.8.7：【全部】浮层里的分组小标题（今日 / 上一练习日 / 历史） */
.word-modal-body .day-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin: 12px 0 8px; }
.word-modal-body .day-label:first-child { margin-top: 0; }

/* V2.8.8（口径 3）：首页一屏不滚动 —— 主区变成 flex 列，页面吃掉整屏高度（比 height:100% 可靠） */
.app-main.home-on { overflow: hidden; display: flex; flex-direction: column; }
.app-main.home-on > #homePage.active { flex: 1 1 auto; min-height: 0; overflow: hidden; }

/* ==================== V2.8.9（用户口径）：词类标记 + 释义左·词类右 ==================== */
.word-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.word-bottom .word-zh { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-pos { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.pos-mark { display: inline-block; width: 9px; height: 9px; flex: 0 0 auto; border-radius: 1.5px; background: var(--pc, currentColor); }
.pos-mark[data-shape="dot"] { border-radius: 50%; }
.pos-mark[data-shape="dot-empty"] { border-radius: 50%; background: transparent; border: 1.5px solid var(--text-muted); }
.pos-mark[data-shape="square"] { border-radius: 2px; }
.pos-mark[data-shape="tri"] { width: 0; height: 0; background: transparent; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid var(--pc, currentColor); }
.pos-mark[data-shape="diamond"] { transform: rotate(45deg); }
.pos-mark[data-shape="diamond-split"] { transform: rotate(45deg); background: linear-gradient(135deg, #2563EB 0 50%, #059669 50% 100%); }
/* V2.8.10（用户口径）：名词「默认复数」= **同心双圈**（外圈按词性着色 + 内小圈）——
   一眼可辨，比只靠颜色更快。 */
.pos-mark[data-shape="dot-double"] { border-radius: 50%; background: var(--pc, currentColor); position: relative; }
.pos-mark[data-shape="dot-double"]::after {
    content: ''; position: absolute; left: 50%; top: 50%; width: 42%; height: 42%;
    transform: translate(-50%, -50%); border-radius: 50%; background: #fff;
}
/* ==================== V2.8.11：**等级配色规范**（等级标识植入） ====================
   标准来源：Datenbank/doc/方案讨论/德语词类标记系统(POS)-当前版.html v1.2
   「等级配色规范（CEFR A1–C1）—— 全站唯一标准」：
   · 原色取自**无水彩蒙版**的斑点图 WanX Image/等级图标/{A1,A2,B1,B2,C1}.png
     （取面积最大的色相 → 该色相内中等偏上饱和度像素的平均色）；
   · 徽章文字色**按底色亮度自适应**（亮底用深字、深底用白字），即下面的 -on；
   · -soft / -ink 供「浅底标签」使用（深色主题下换成原色 + 透明，避免刺眼）。 */
:root {
    --lv-a1: #0BA653; --lv-a1-on: #1F2937; --lv-a1-soft: #E7F8EF; --lv-a1-ink: #157F46;
    --lv-a2: #15BAEE; --lv-a2-on: #1F2937; --lv-a2-soft: #E7F4F8; --lv-a2-ink: #156984;
    --lv-b1: #F8D83E; --lv-b1-on: #1F2937; --lv-b1-soft: #F8F5E7; --lv-b1-ink: #7F6D15;
    --lv-b2: #D02750; --lv-b2-on: #FFFFFF; --lv-b2-soft: #F8E7EB; --lv-b2-ink: #811832;
    --lv-c1: #B932D5; --lv-c1-on: #FFFFFF; --lv-c1-soft: #F5E7F8; --lv-c1-ink: #6E1A7F;
}
html[data-theme="dark"] {
    --lv-a1-soft: rgba(11,166,83,.20); --lv-a1-ink: #7FD8A8;
    --lv-a2-soft: rgba(21,186,238,.20); --lv-a2-ink: #86D9F7;
    --lv-b1-soft: rgba(248,216,62,.20); --lv-b1-ink: #F6E383;
    --lv-b2-soft: rgba(208,39,80,.22); --lv-b2-ink: #F09CB2;
    --lv-c1-soft: rgba(185,50,213,.22); --lv-c1-ink: #DDA0EC;
}
/* 徽章（实心）· 浅底标签 · 圆点 · 色块 —— 与文档同规格 */
.lv-badge, .lv-chip, .lv-dot, .lv-swatch { display: inline-flex; align-items: center; justify-content: center; }
.lv-badge { min-width: 34px; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--lvon, #fff); background: var(--lvc, #9CA3AF); }
.lv-badge[data-lv="A1"] { --lvc: var(--lv-a1); --lvon: var(--lv-a1-on); }
.lv-badge[data-lv="A2"] { --lvc: var(--lv-a2); --lvon: var(--lv-a2-on); }
.lv-badge[data-lv="B1"] { --lvc: var(--lv-b1); --lvon: var(--lv-b1-on); }
.lv-badge[data-lv="B2"] { --lvc: var(--lv-b2); --lvon: var(--lv-b2-on); }
.lv-badge[data-lv="C1"] { --lvc: var(--lv-c1); --lvon: var(--lv-c1-on); }
.lv-chip { padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.lv-chip[data-lv="A1"] { background: var(--lv-a1-soft); color: var(--lv-a1-ink); }
.lv-chip[data-lv="A2"] { background: var(--lv-a2-soft); color: var(--lv-a2-ink); }
.lv-chip[data-lv="B1"] { background: var(--lv-b1-soft); color: var(--lv-b1-ink); }
.lv-chip[data-lv="B2"] { background: var(--lv-b2-soft); color: var(--lv-b2-ink); }
.lv-chip[data-lv="C1"] { background: var(--lv-c1-soft); color: var(--lv-c1-ink); }
.lv-dot { width: 9px; height: 9px; border-radius: 50%; }
.lv-dot[data-lv="A1"], .lv-swatch[data-lv="A1"] { background: var(--lv-a1); }
.lv-dot[data-lv="A2"], .lv-swatch[data-lv="A2"] { background: var(--lv-a2); }
.lv-dot[data-lv="B1"], .lv-swatch[data-lv="B1"] { background: var(--lv-b1); }
.lv-dot[data-lv="B2"], .lv-swatch[data-lv="B2"] { background: var(--lv-b2); }
.lv-dot[data-lv="C1"], .lv-swatch[data-lv="C1"] { background: var(--lv-c1); }
.lv-swatch { width: 46px; height: 22px; border-radius: 6px; border: 1px solid rgba(0,0,0,.06); }
/* 磁贴上的「你的水平」徽章 = 直接用该等级的**原色**（与文档徽章同色同字色） */
.tile-badge[data-lv="A1"] { background: var(--lv-a1); color: var(--lv-a1-on); }
.tile-badge[data-lv="A2"] { background: var(--lv-a2); color: var(--lv-a2-on); }
.tile-badge[data-lv="B1"] { background: var(--lv-b1); color: var(--lv-b1-on); }
.tile-badge[data-lv="B2"] { background: var(--lv-b2); color: var(--lv-b2-on); }
.tile-badge[data-lv="C1"] { background: var(--lv-c1); color: var(--lv-c1-on); }
/* V2.8.11：单词表行内的**等级标识**（.lv-chip 定义见上方等级配色规范） */
.word-row .lv-chip { flex: 0 0 auto; }
.word-bottom { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* ==================== V2.8.12（用户口径 1/3/4）==================== */
/* 口径 4：三个入口按钮 = **图标与文字左右并排**（.link-btn 基类是 column，这里显式改 row）
   —— 原来图标压文字上方，把标题行撑得很高。 */
.section-actions .link-btn { flex-direction: row; white-space: nowrap; }

/* 口径 1：我的 → 我的德语水平 → 等级选择处的等级颜色标识 */
.setting-control .lv-badge { flex: 0 0 auto; margin-right: 8px; }
.setting-select[data-lv="A1"] { border-color: var(--lv-a1); color: var(--lv-a1-ink); }
.setting-select[data-lv="A2"] { border-color: var(--lv-a2); color: var(--lv-a2-ink); }
.setting-select[data-lv="B1"] { border-color: var(--lv-b1); color: var(--lv-b1-ink); }
.setting-select[data-lv="B2"] { border-color: var(--lv-b2); color: var(--lv-b2-ink); }
.setting-select[data-lv="C1"] { border-color: var(--lv-c1); color: var(--lv-c1-ink); }

/* 口径 3：跟读练习 = 磁贴 + 最近词汇（行数由 JS 按单屏高度决定，至少 3 行） */
.word-entry-card .tw-list { display: flex; flex-direction: column; }
.tw-row {
    display: flex; align-items: center; gap: 8px; height: 30px;
    padding: 0 2px; cursor: pointer; border-bottom: 1px dashed var(--border-color);
}
.tw-row:last-child { border-bottom: none; }
.tw-row:hover .tw-de { color: var(--primary-color); }
.tw-de { flex: 0 0 auto; font-weight: 600; font-size: 13.5px; color: var(--text-primary); }
.tw-row .lv-chip { flex: 0 0 auto; font-size: 10.5px; padding: 0 6px; }
.tw-zh { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-muted); }
/* 首页：卡片**不再内部滚动**（一屏显示完），至少留 3 行高度 */
#homePage > #todayWordsSection .word-entry-card { overflow: hidden; padding: 10px 12px; min-height: 112px; }
/* V2.8.12（用户口径 3）：统计页「练习过的单词」= 与单词表同一行式组件（列式容器） */
.word-list { display: flex; flex-direction: column; }
/* ==================== V2.8.14（用户需求 6）：**按等级色调的皮肤** ====================
   用当前等级**原色**的 RGB 分量做两层极淡的径向渲染（透明度很低，只做个性化，保证可读性）。
   等级原色标准见 shell.css / 文档 v1.2；未定级时不加任何色调（走默认，视觉不变）。 */
html[data-lv="A1"]{ --lv-tint:11,166,83; }
html[data-lv="A2"]{ --lv-tint:21,186,238; }
html[data-lv="B1"]{ --lv-tint:248,216,62; }
html[data-lv="B2"]{ --lv-tint:208,39,80; }
html[data-lv="C1"]{ --lv-tint:185,50,213; }
body {
  background-image:
    radial-gradient(120% 55% at 50% 0%, rgba(var(--lv-tint,37,99,235), .12), rgba(var(--lv-tint,37,99,235), 0) 62%),
    radial-gradient(95% 42% at 50% 100%, rgba(var(--lv-tint,37,99,235), .07), rgba(var(--lv-tint,37,99,235), 0) 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}
html[data-theme="dark"] body {
  background-image:
    radial-gradient(120% 55% at 50% 0%, rgba(var(--lv-tint,59,130,246), .16), rgba(var(--lv-tint,59,130,246), 0) 62%),
    radial-gradient(95% 42% at 50% 100%, rgba(var(--lv-tint,59,130,246), .10), rgba(var(--lv-tint,59,130,246), 0) 60%);
}

/* V2.8.14（口径 4/5）：单词表行 —— 释义靠左，**词类与等级标签一律靠右**（等级标签最右） */
.word-bottom { justify-content: flex-start; flex-wrap: nowrap; }
.word-bottom .word-zh { flex: 1 1 auto; }
/* V2.8.14（口径 5）：首页跟读练习 —— 词条左对齐，等级标签右对齐 */
.tw-zh { flex: 1 1 auto; text-align: right; }

/* ==================== V2.8.20（用户口径 1/2）==================== */
/* ① 三档滑块：轨道下方三个点标出档位位置（左右各内缩半个滑块宽，和滑块位置对齐；简约风格） */
.slider-wrap { position: relative; display: inline-flex; align-items: center; padding-bottom: 7px; }
.slider-dots { position: absolute; left: 9px; right: 9px; bottom: 1px; display: flex; justify-content: space-between; pointer-events: none; }
.slider-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); opacity: .5; transition: background .15s, opacity .15s, transform .15s; }
.slider-dots i.on { background: var(--primary-color); opacity: 1; transform: scale(1.25); }

/* ② 首页标题栏：日期药丸 + 口语练习 + **状态灯在最右**（日期效果参考「每日单词」程序） */
.page-title .page-title-text { flex: 0 1 auto; min-width: 0; }
.page-title .today-date {
    flex: 0 0 auto; font-size: 13px; font-weight: 600; line-height: 1;
    padding: 4px 9px; border-radius: 8px; font-variant-numeric: tabular-nums;
    background: var(--panel-2); border: 1px solid var(--line); color: var(--text-secondary);
}
.page-title .today-dot { margin-left: auto; }   /* ★ 状态灯推到最右侧 */

/* ==================== V2.8.21（用户口径 2b）：AI 配置弹窗的交互化样式 ==================== */
.plan-item.locked { opacity: .45; }                     /* 没填 Key 的方案：灰掉（点了会提示+高亮） */
.api-row { border-radius: 10px; transition: background .2s, box-shadow .2s; }
.api-row.hl { background: var(--warn-soft, #fff7e6); box-shadow: 0 0 0 2px var(--warning-color, #f59e0b) inset; }

/* V2.8.43: dev-only row (export diag log) hidden by default; revealed by 3 taps on version */
.setting-item.dev-only:not(.show){display:none !important}

/* ==================== V2.8.44（设计）：统计磁贴（情景 / 等级） ====================
 *  原先 .tile-stat 只有 cursor:default、没有配图，只吃默认蓝色渐变 ⇒ 与整体 UI 不搭。
 *  按「数据卡」定位重做：主色族深青绿 + 右上高光 + 左下暗角 + 细网格底 + 上升折线纹样，
 *  全部用 CSS 渐变与内联 SVG 完成（不引入外部图片，打包体积不变）。
 *  注意：背景写在 .tile-stat 上而不是 --tile-bg（统计磁贴已不再内联 --tile-bg）。
 */
.tile-stat {
  background:
    radial-gradient(120% 95% at 100% 0%, rgba(255,255,255,.22), rgba(255,255,255,0) 58%),
    radial-gradient(95% 85% at 0% 100%, rgba(0,0,0,.26), rgba(0,0,0,0) 62%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 48'><path d='M2 40 L26 31 L48 34 L72 20 L96 25 L118 9' fill='none' stroke='rgba(255,255,255,.55)' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/><circle cx='118' cy='9' r='3.6' fill='rgba(255,255,255,.9)'/></svg>") no-repeat right 6px bottom 30px / 54% auto,
    repeating-linear-gradient(0deg, rgba(255,255,255,.085) 0 1px, rgba(255,255,255,0) 1px 16px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, rgba(255,255,255,0) 1px 16px),
    linear-gradient(135deg, #0A6B4B 0%, #0E8F63 52%, #2FC98E 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 6px 16px rgba(10,107,75,.18);
}
/* 图标：毛玻璃徽章（与磁贴配图的柔和感一致，不再是"裸图标"） */
.tile-stat .tile-ph {
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
  color: #fff;
}
/* 文案：数字等宽（"已练 5 / 12 个主题" 不会跳动），标签加柔和投影保证可读 */
.tile-stat .tile-label { font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.tile-stat .tile-label small { opacity: .9; }
/* 悬停：比其他磁贴更收敛（它是信息卡，不是入口） */
.tile-stat:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 8px 20px rgba(10,107,75,.24); }
/* 深色主题：更沉的墨绿，避免在深底上"发光" */
html[data-theme="dark"] .tile-stat,
body.dark .tile-stat {
  background:
    radial-gradient(120% 95% at 100% 0%, rgba(255,255,255,.14), rgba(255,255,255,0) 58%),
    radial-gradient(95% 85% at 0% 100%, rgba(0,0,0,.38), rgba(0,0,0,0) 62%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 48'><path d='M2 40 L26 31 L48 34 L72 20 L96 25 L118 9' fill='none' stroke='rgba(255,255,255,.55)' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/><circle cx='118' cy='9' r='3.6' fill='rgba(255,255,255,.9)'/></svg>") no-repeat right 6px bottom 30px / 54% auto,
    repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 1px, rgba(255,255,255,0) 1px 16px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, rgba(255,255,255,0) 1px 16px),
    linear-gradient(135deg, #07402D 0%, #0A5B40 55%, #12835C 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 6px 16px rgba(0,0,0,.32);
}
