/* ============================================================
   player.css — 词库播放器页专用样式（基础词库 / 进阶词库共用）
   外壳（背景、卡片、导航）在 app.css，这里只放播放器自己的东西。
   ============================================================ */

.stats-bar { display: flex; gap: 20px; margin-top: 15px; flex-wrap: wrap; }
.stat-item { text-align: center; background: rgba(255,255,255,0.65); padding: 8px 16px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.stat-num { font-size: 1.5em; font-weight: bold; }
.stat-num.blue { color: #2980b9; }
.stat-num.green { color: #27ae60; }
.stat-num.red { color: #c0392b; }
.stat-num.gray { color: #7f8c8d; }
.stat-label { font-size: 0.8em; color: #5d6d7e; }
.controls { padding: 15px 30px; background: #f8f9fa; border-bottom: 1px solid #eee; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-box { flex: 1; min-width: 200px; padding: 10px 16px; border: 2px solid #ddd; border-radius: 20px; font-size: 14px; }
.search-box:focus { outline: none; border-color: #3498db; }
.filter-btns { display: flex; gap: 5px; }
.filter-btn { padding: 8px 14px; border: 2px solid #ddd; border-radius: 20px; background: white; cursor: pointer; font-size: 13px; transition: all 0.2s; }
.filter-btn:hover { border-color: #3498db; }
.filter-btn.active { background: #3498db; color: white; border-color: #3498db; }
.accent-btns { display: flex; gap: 5px; }
.accent-btn { padding: 8px 14px; border: 2px solid #ddd; border-radius: 20px; background: white; cursor: pointer; font-size: 13px; transition: all 0.2s; }
.accent-btn:hover { border-color: #27ae60; }
.accent-btn.active { background: #27ae60; color: white; border-color: #27ae60; }
.dot-status { width: 9px; height: 9px; border-radius: 50%; background: #d5dbe2; flex: 0 0 auto; transition: background-color 0.2s; }
.dot-status.connected { background: #2ecc71; }
.dot-status.disconnected { background: #d5dbe2; }
.pron-log { margin: 18px 30px 30px; padding: 14px 16px; background: #fff; border: 1px solid #e0e0e0; border-radius: 12px; max-height: 260px; overflow-y: auto; }
.pron-log .pl-empty { color: #95a5a6; font-size: 0.9em; }
.pron-log .pl-head { font-size: 0.9em; font-weight: 600; margin-bottom: 8px; color: #2c3e50; }
.pron-log .pl-head a { color: #3498db; }
.pron-log .pl-row { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; border-bottom: 1px dashed #eee; font-size: 0.86em; }
.pron-log .pl-idx { color: #95a5a6; min-width: 42px; }
.pron-log .pl-word { font-weight: 600; min-width: 160px; word-break: break-all; }
.pron-log .pl-status { padding: 2px 8px; border-radius: 10px; font-size: 0.78em; min-width: 78px; text-align: center; }
.pron-log .pl-ok { background: #e8f5e9; color: #2e7d32; }
.pron-log .pl-deferred { background: #fff8e1; color: #f57f17; }
.pron-log .pl-error { background: #fde0dc; color: #c62828; }
.pron-log .pl-no-audio { background: #ffebee; color: #b71c1c; font-weight: 700; }
.pron-log .pl-empty { padding: 8px 10px; color: #2e7d32; background: #e8f5e9; border-radius: 6px; }
.pron-log .pl-head a { color: #3498db; cursor: pointer; text-decoration: none; margin-left: 4px; }
.pron-log .pl-head a:hover { text-decoration: underline; }
.pron-log .pl-msg { color: #777; font-size: 0.9em; word-break: break-all; }
.player { padding: 25px 30px; }
.current-word { text-align: center; margin-bottom: 20px; }
.current-word h2 { font-size: 2.2em; color: #2c3e50; margin-bottom: 5px; }
.current-word .index { color: #7f8c8d; font-size: 0.95em; margin-bottom: 10px; display: block; }
.current-word .status-tag { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 0.85em; font-weight: 600; }
.status-tag.known { background: #d5f5e3; color: #27ae60; }
.status-tag.unknown { background: #fadbd8; color: #e74c3c; }
.status-tag.unmarked { background: #eee; color: #999; }
.audio-controls { display: flex; justify-content: center; gap: 10px; margin-bottom: 15px; flex-wrap: wrap; }
.btn { padding: 10px 22px; border: none; border-radius: 20px; font-size: 14px; cursor: pointer; transition: background-color 0.15s; display: flex; align-items: center; gap: 6px; }
.btn-primary { background: #3498db; color: white; }
.btn-primary:hover { background: #2980b9; }
.btn-primary.playing { background: #1d6fa5; }
#playBtn { min-width: 92px; justify-content: center; }
.btn-auto { background: #ecf0f1; color: #2c3e50; }
.btn-auto:hover { background: #f6f8f9; border-color: #c9d4dc; }
.btn-auto.auto-on { background: #2ecc71; color: #fff; }
.btn-auto.auto-on:hover { background: #27ae60; }
#autoPlayBtn { min-width: 96px; justify-content: center; }
.btn-secondary { background: #ecf0f1; color: #2c3e50; }
.btn-secondary:hover { background: #f6f8f9; border-color: #c9d4dc; }

/* 点击反馈：按下瞬间压缩变深 + 松开后一圈扩散闪光——
   悬停保持轻（不误导"已选中"），点击则明确可见（用户触摸板工作流） */
.btn:active { transform: translateY(1px) scale(.97); filter: brightness(.9); }
@keyframes btn-flash { 0% { box-shadow: 0 0 0 0 rgba(52,152,219,.45); }
                       100% { box-shadow: 0 0 0 14px rgba(52,152,219,0); } }
.btn.clicked { animation: btn-flash .45s ease-out; }
/* 点击效果二态（设置里切换）：flash 炫光扩散（默认）/ plain 质朴变深 */
html[data-click-style="plain"] .btn.clicked { animation: btn-plain .4s ease-out; }
@keyframes btn-plain { 0% { filter: brightness(.68); } 100% { filter: brightness(1); } }
.btn-success { background: #2ecc71; color: white; }
.btn-success:hover { background: #27ae60; }
.btn-danger { background: #e74c3c; color: white; }
.btn-danger:hover { background: #c0392b; }
.btn-known { background: #27ae60; color: white; }
.btn-known:hover { background: #219a52; }
.btn-unknown { background: #e74c3c; color: white; }
.btn-unknown:hover { background: #c0392b; }
.btn-known.marked { box-shadow: 0 0 0 3px rgba(39,174,96,0.4); }
.btn-unknown.marked { box-shadow: 0 0 0 3px rgba(231,76,60,0.4); }
.gap-input { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #555; padding: 6px 12px; background: #fff; border: 1px solid #ddd; border-radius: 18px; }
.gap-input input { width: 52px; padding: 3px 6px; border: 1px solid #ccc; border-radius: 6px; font-size: 13px; text-align: center; }
.mark-controls { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.flag-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: #b9770e; background: #fef5e7; border: 1px solid #f5cba7; padding: 9px 14px; border-radius: 8px; cursor: pointer; user-select: none; }
.flag-toggle input { width: 16px; height: 16px; accent-color: #e67e22; cursor: pointer; }
.flag-comment { flex: 1; min-width: 160px; max-width: 360px; padding: 9px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.flag-comment:disabled { background: #f4f4f4; color: #aaa; }
.progress-container { margin-bottom: 20px; }
.progress-bar { width: 100%; height: 6px; background: #ecf0f1; border-radius: 3px; overflow: hidden; }
.progress { height: 100%; background: #3498db; width: 0%; transition: width 0.3s; }
.word-list { max-height: 380px; overflow-y: auto; border: 1px solid #eee; border-radius: 8px; scroll-behavior: smooth; }
.word-item { padding: 10px 16px; border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.word-item:hover { background: #f8f9fa; }
.word-item.active { background: #e3f2fd; border-left: 3px solid #3498db; }
.word-item .wi-idx { color: #aaa; font-size: 0.85em; min-width: 30px; }
.word-item .wi-word { flex: 1; font-weight: 500; }
.word-item .wi-meaning { color: #98a8b8; font-size: 0.9em; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.word-item.active .wi-meaning { color: #5d7d99; }
@media (max-width: 700px) {
    .word-item .wi-meaning { max-width: 45%; font-size: 0.85em; }
}
.word-item .wi-example { width: 8px; height: 8px; border-radius: 50%; background: #3498db; flex-shrink: 0; margin-right: 4px; }
.word-item .wi-flag { width: 8px; height: 8px; border-radius: 2px; background: #e67e22; flex-shrink: 0; margin-right: 4px; }
.word-item.active .wi-example { background: #1d6fa5; }
.word-item .wi-badge { font-size: 0.75em; padding: 2px 8px; border-radius: 8px; font-weight: 600; }
.wi-badge.known { background: #d5f5e3; color: #27ae60; }
.wi-badge.unknown { background: #fadbd8; color: #e74c3c; }
.filter-select { padding: 8px 10px; border: 2px solid #ddd; border-radius: 20px; background: white; cursor: pointer; font-size: 13px; max-width: 160px; }
.filter-select:hover { border-color: #3498db; }
.word-item .wi-cat { font-size: 0.72em; color: #7a8aa0; background: #eef2f7; padding: 2px 8px; border-radius: 8px; margin-right: 6px; white-space: nowrap; }
.word-item .wi-play { background: none; border: none; color: #3498db; cursor: pointer; font-size: 1em; padding: 4px; }
.word-item .wi-play:hover { color: #2980b9; }
.footer-bar { margin-top: 15px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.keyboard-hints { font-size: 0.8em; color: #888; }
.keyboard-hints kbd { background: #ecf0f1; padding: 1px 5px; border-radius: 3px; font-family: monospace; border: 1px solid #ddd; font-size: 0.9em; }
.reset-btn { font-size: 0.8em; color: #e74c3c; cursor: pointer; background: none; border: 1px solid #e74c3c; padding: 4px 10px; border-radius: 12px; }
.reset-btn:hover { background: #e74c3c; color: white; }
.practice-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff3cd; color: #856404; padding: 10px 14px; border-radius: 10px; margin: 12px 0; font-size: 14px; }
.practice-banner[hidden] { display: none; }
.practice-banner .pb-count { font-size: 16px; }
.practice-banner .pb-note { color: #9a7b1a; font-size: 12px; }
.practice-banner .btn-secondary { padding: 5px 12px; font-size: 13px; }
/* Example shown as a calm, fixed-height subtitle line directly under the current
   word. It NEVER shifts the layout or pops up a box, so it can't steal attention
   the way the old drop-down panel did. */
.example-sub { position: relative; height: 78px; margin: 2px 0 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; overflow: hidden; }
.example-sub .es-sentence { font-size: 1.05em; color: #1f3a5f; line-height: 1.5; cursor: pointer; border-bottom: 1px dashed transparent; }
.example-sub .es-sentence:hover { border-bottom-color: #b9c9e6; }
.example-sub .es-meaning { font-size: 0.9em; color: #4a6079; }
.example-sub .es-note { position: absolute; top: 1px; right: 6px; font-size: 0.72em; color: #95a5a6; text-align: right; max-width: 72%; }
.btn-example { background: #eaf1ff; color: #2c5aa0; }
.btn-example:hover { background: #d6e4ff; }
.heatmap-panel { margin: 16px 0; padding: 16px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; }
.heatmap-panel[hidden] { display: none; }
.hm-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.hm-head h3 { margin: 0; font-size: 15px; color: #2c3e50; }
.hm-legend { font-size: 12px; color: #95a5a6; display: flex; align-items: center; gap: 4px; }
.hm-legend i { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }
.hm-scroll { overflow-x: auto; padding-bottom: 4px; }
.hm-cal { display: inline-flex; flex-direction: column; }
.hm-months { display: flex; gap: 3px; padding-left: 27px; margin-bottom: 4px; }
.hm-month { width: 18px; font-size: 10px; color: #95a5a6; overflow: visible; white-space: nowrap; }
.hm-body { display: flex; }
.hm-weekdays { display: flex; flex-direction: column; gap: 3px; margin-right: 5px; }
.hm-weekdays span { height: 15px; line-height: 15px; font-size: 10px; color: #95a5a6; text-align: right; width: 22px; }
.hm-grid { display: flex; gap: 3px; }
.hm-week { display: flex; flex-direction: column; gap: 3px; }
.hm-cell { width: 15px; height: 15px; border-radius: 3px; background: #ebedf0; cursor: pointer; }
.hm-cell.empty { background: transparent; cursor: default; }
.hm-cell.l1 { background: #c6e9d3; }
.hm-cell.l2 { background: #8fd6ab; }
.hm-cell.l3 { background: #4cbf86; }
.hm-cell.l4 { background: #1e8e57; }
.hm-cell:not(.empty):hover { outline: 1px solid #2c3e50; }
.hm-detail { margin-top: 14px; font-size: 13px; line-height: 1.7; }
.hm-detail .hm-date { font-weight: 600; color: #2c3e50; margin-bottom: 6px; }
.hm-detail ul { margin: 0; padding-left: 18px; }
.hm-detail li .st-known { color: #27ae60; }
.hm-detail li .st-unknown { color: #e74c3c; }
.hm-detail li .st-unmarked { color: #95a5a6; }
.hm-detail .hm-none { color: #95a5a6; }

/* ---- Compact right-hand cluster: progress ring + settings gear ---- */
.ctl-right { position: relative; display: flex; align-items: center; gap: 12px; margin-left: auto; flex: 0 0 auto; }
.ring-progress { position: relative; width: 52px; height: 52px; flex: 0 0 auto; }
.ring-progress svg { display: block; transform: rotate(-90deg); }
.rp-track { fill: none; stroke: #e8edf2; stroke-width: 5; }
.rp-fill { fill: none; stroke: #3498db; stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.rp-center { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; pointer-events: none; }
.rp-num { font-size: 16px; font-weight: 700; color: #2c3e50; }
.rp-den { font-size: 10px; color: #95a5a6; margin-top: 1px; }
.gear-btn { position: relative; width: 38px; height: 38px; border: 1px solid #dde3ea; border-radius: 50%; background: #fff; color: #5d6d7e; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: border-color 0.15s, color 0.15s, background-color 0.15s; flex: 0 0 auto; }
.gear-btn:hover { border-color: #3498db; color: #3498db; }
.gear-btn.open { border-color: #3498db; color: #3498db; background: #f2f8fd; }
.gear-btn .gb-dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: #2ecc71; }
.gear-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 292px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 14px 34px rgba(44,62,80,0.16); padding: 6px 16px 14px; z-index: 60; text-align: left; }
.gear-panel[hidden] { display: none; }
.gp-sec { padding: 12px 0; border-bottom: 1px solid #f0f3f6; }
.gp-sec:last-child { border-bottom: none; padding-bottom: 2px; }
.gp-title { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #95a5a6; margin-bottom: 9px; }
.gp-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #2c3e50; padding: 4px 0; }
.gp-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: #3498db; cursor: pointer; }
.gp-row input[type="number"] { width: 56px; padding: 4px 6px; border: 1px solid #dde3ea; border-radius: 6px; font-size: 13px; text-align: center; }
.gp-row input[type="number"]:focus { outline: none; border-color: #3498db; }
.gear-panel .accent-btns, .gear-panel .accent-btn { width: 100%; }
.gear-panel .accent-btn { flex: 1; padding: 7px 0; }
.gear-panel .btn-auto { padding: 7px 14px; min-width: 92px; font-size: 13px; border-radius: 16px; justify-content: center; }
.gp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gp-btn { padding: 8px 10px; border: 1px solid #dde3ea; border-radius: 8px; background: #fff; color: #2c3e50; font-size: 13px; cursor: pointer; transition: border-color 0.15s, color 0.15s, background-color 0.15s; }
.gp-btn:hover { border-color: #3498db; color: #3498db; }
.gp-btn.danger { color: #e74c3c; border-color: #f3c9c4; }
.gp-btn.danger:hover { border-color: #e74c3c; background: #fdf3f2; }
.flag-icon-btn { width: 38px; height: 38px; border: 1px solid #dde3ea; border-radius: 50%; background: #fff; color: #95a5a6; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: border-color 0.15s, color 0.15s, background-color 0.15s; flex: 0 0 auto; }
.flag-icon-btn:hover { border-color: #e67e22; color: #e67e22; }
.flag-icon-btn.active { border-color: #e67e22; color: #e67e22; background: #fef5e7; }
.flag-row { display: flex; justify-content: center; align-items: center; gap: 10px; margin: -4px 0 18px; flex-wrap: wrap; }
.flag-row[hidden] { display: none; }

#gate {
    display: none;
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(245, 248, 252, 0.98);
    align-items: center; justify-content: center;
    font-family: 'Segoe UI', system-ui, sans-serif;
}
html.lib-advanced #gate { display: flex; }
#gateBox {
    width: 100%; max-width: 420px; background: #fff;
    border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    padding: 32px 34px; text-align: center; color: #2c3e50;
}
#gateBox h2 { font-size: 1.3em; margin-bottom: 10px; }
#gateBox p { font-size: 0.9em; color: #5d6d7e; line-height: 1.6; margin-bottom: 16px; }
#gateBox input {
    width: 100%; padding: 12px 14px; border: 2px solid #ddd; border-radius: 10px;
    font-size: 15px; letter-spacing: 1px; text-align: center; outline: none;
}
#gateBox input:focus { border-color: #3498db; }
#gateBtn {
    width: 100%; margin-top: 16px; padding: 12px 0; border: none; border-radius: 22px;
    background: #3498db; color: #fff; font-size: 15px; cursor: pointer;
}
#gateBtn:hover { background: #2980b9; }
#gateMsg { min-height: 18px; margin-top: 12px; font-size: 0.85em; }
#gateMsg.err { color: #c0392b; }
#gateMsg.ok { color: #27ae60; }
.gate-hint { margin-top: 18px; font-size: 0.78em; color: #95a5a6; }

/* ---------- 类目筛选：只有进阶词库（带 wordMeta）才显示 ---------- */
html:not(.lib-advanced) .class-filter { display: none; }

/* ---------- 热力图当天词条：可点击跳转 ---------- */
.hm-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hm-pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 14px; font-size: 13px; cursor: pointer; user-select: none; border: 1px solid #e2e8f0; background: #fff; color: #2c3e50; transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
.hm-pill:hover { border-color: #3498db; color: #3498db; }
.hm-pill.st-known { background: #e8f7ee; border-color: #c2e6cc; color: #1e8e57; }
.hm-pill.st-known:hover { border-color: #1e8e57; color: #156d44; }
.hm-pill.st-unknown { background: #fdecea; border-color: #f5c6c2; color: #c0392b; }
.hm-pill.st-unknown:hover { border-color: #c0392b; color: #962d22; }
.hm-pill.st-unmarked { background: #f3f5f8; border-color: #dde2ea; color: #7f8c8d; }
.hm-pill.st-unmarked:hover { border-color: #7f8c8d; color: #2c3e50; }
