:root{--bg:#f4efe3;--panel:#fffdf7;--surface:#fff;--ink:#1e2f2c;--muted:#53655f;--border:#d7cec0;--accent:#0f766e;--accent-soft:#d9f0ed;--accent-ghost-border:#a8d8d2;--shadow-color:#1e2f2c14;--button-text:#fff;--bg-grad-1:#f8f4ea;--bg-grad-2:#f4efe3;--bg-grad-3:#ece4d5}:root[data-theme=dark]{--bg:#151c1c;--panel:#1d2626;--surface:#222d2d;--ink:#e9efee;--muted:#9db0ab;--border:#324040;--accent:#2ec4b6;--accent-soft:#133431;--accent-ghost-border:#295851;--shadow-color:#00000047;--button-text:#0c1514;--bg-grad-1:#1b2524;--bg-grad-2:#151c1c;--bg-grad-3:#111716}*{box-sizing:border-box}body{background:radial-gradient(circle at 10% 10%, var(--bg-grad-1) 0%, var(--bg-grad-2) 40%, var(--bg-grad-3) 100%);color:var(--ink);margin:0;font-family:Segoe UI,Tahoma,sans-serif}#root{min-height:100vh}.app-shell{max-width:920px;margin:0 auto;padding:24px}.topbar h1{margin:0;font-size:2rem}.topbar-main{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.topbar-actions{--topbar-control-height:42px;align-items:flex-start;gap:10px;margin-left:auto;display:flex}.user-controls{border:1px solid var(--accent-ghost-border);min-height:var(--topbar-control-height);border-radius:12px;align-items:center;gap:0;display:inline-flex;overflow:hidden}.user-controls label{min-height:var(--topbar-control-height);background:var(--surface);border-right:1px solid var(--accent-ghost-border);color:var(--muted);align-items:center;padding:10px;font-size:.78rem;font-weight:600;display:inline-flex}.user-controls select{min-width:132px;min-height:var(--topbar-control-height);background:var(--surface);color:var(--muted);border:0;border-radius:0;padding:10px 28px 10px 10px}.theme-toggle{background:var(--accent-soft);color:var(--accent);border-color:var(--accent-ghost-border);white-space:nowrap}.theme-controls{border:1px solid var(--accent-ghost-border);min-height:var(--topbar-control-height);border-radius:12px;display:inline-flex;overflow:hidden}.theme-controls .theme-toggle{min-height:var(--topbar-control-height);border:0;border-radius:0;align-items:center;display:inline-flex}.theme-controls .theme-toggle+.theme-toggle{border-left:1px solid var(--accent-ghost-border)}.theme-controls .theme-toggle.active{background:var(--accent);color:var(--button-text)}.topbar p{color:var(--muted);margin:6px 0 0}.topbar-sub{justify-content:flex-end;gap:8px;margin-top:10px;display:flex}.topbar-action-btn{white-space:nowrap;min-height:34px;padding:0 14px;font-size:.85rem}.stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:20px;display:grid}.stats div{background:var(--panel);border:1px solid var(--border);border-radius:14px;padding:12px}.stats span{color:var(--muted);font-size:.9rem;display:block}.stats strong{font-size:1.4rem}.stats-overview{grid-template-columns:1fr .95fr;align-items:stretch;gap:16px;margin-top:24px;display:grid}.stats-card{background:var(--panel);border:1px solid var(--border);border-radius:14px;padding:12px}.stats-card h3{margin:0 0 10px;font-size:1rem}.stats-chart-slot{min-height:320px;padding:14px}.insights-slot{flex-direction:column;min-width:0;min-height:320px;display:flex}.stats-chart-head{justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px;display:flex}.stats-chart-head h3{margin:0}.stats-view-toggle{border:1px solid var(--accent-ghost-border);border-radius:999px;display:inline-flex;overflow:hidden}.stats-view-button{background:var(--surface);color:var(--muted);border:0;border-radius:0;padding:6px 10px;font-size:.78rem}.stats-view-button+.stats-view-button{border-left:1px solid var(--accent-ghost-border)}.stats-view-button.active{background:var(--accent-soft);color:var(--accent)}.trend-columns{grid-template-columns:repeat(7,minmax(0,1fr));align-items:end;gap:10px;min-height:212px;display:grid}.trend-column{grid-template-rows:auto 1fr auto auto;align-items:end;gap:5px;display:grid}.trend-column-value,.trend-column-meta,.trend-column-label{text-align:center;color:var(--muted)}.trend-column-value{font-size:.78rem}.trend-column-label{font-size:.75rem}.trend-column-meta{font-size:.72rem}.trend-column-bar-wrap{border:1px solid var(--border);background:var(--surface);border-radius:10px;align-items:end;width:76%;height:144px;margin:0 auto;padding:3px;display:flex}.trend-column-bar{background:linear-gradient(#4f46e5,#14b8a6);border-radius:8px;width:100%}.trend-bar-blue{background:linear-gradient(#4f46e5,#14b8a6)}.trend-bar-orange{background:linear-gradient(#f97316,#f59e0b)}.trend-bar-red{background:linear-gradient(#ef4444,#f97316)}.mastery-card{display:none}.mastery-card h3{margin:0}.mastery-donut-wrap{justify-content:center;display:flex}.mastery-donut{width:120px;height:120px}.mastery-stat-list{gap:8px;display:grid}.mastery-stat-row{grid-template-columns:10px 1fr auto;align-items:center;gap:8px;font-size:.86rem;display:grid}.mastery-dot{border-radius:50%;width:10px;height:10px;display:block}.efficiency-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:8px;display:grid}.efficiency-stat{background:var(--surface);border:1px solid var(--border);text-align:center;border-radius:10px;flex-direction:column;gap:2px;padding:7px;display:flex}.efficiency-label{color:var(--muted);text-transform:uppercase;letter-spacing:.05em;font-size:.66rem;font-weight:600}.efficiency-value{color:var(--accent);font-size:1.1rem;line-height:1.2}.efficiency-meta{color:var(--muted);font-size:.68rem;line-height:1.2}.difficult-list{gap:8px;max-height:214px;padding-right:2px;display:grid;overflow-y:auto}.difficult-empty{text-align:center;color:var(--muted);margin:0;padding:20px;font-size:.9rem}.difficult-row{background:var(--surface);border:1px solid var(--border);border-radius:10px;grid-template-columns:22px 1fr auto;align-items:center;gap:6px;padding:6px 8px;display:grid}.difficult-rank{text-align:center;color:var(--accent);font-size:.8rem;font-weight:600}.difficult-word-cell{flex-direction:column;gap:2px;min-width:0;display:flex}.difficult-word{color:var(--ink);white-space:nowrap;text-overflow:ellipsis;font-size:.85rem;font-weight:600;overflow:hidden}.difficult-meaning{color:var(--muted);white-space:nowrap;text-overflow:ellipsis;font-size:.72rem;overflow:hidden}.difficult-metrics{gap:8px;display:flex}.difficult-metric{flex-direction:column;align-items:center;gap:2px;min-width:38px;display:flex}.metric-label{color:var(--muted);text-transform:uppercase;letter-spacing:.05em;font-size:.7rem}.metric-value{color:var(--ink);font-size:.8rem;font-weight:600}.cumulative-grid{flex:1;grid-template-columns:repeat(3,minmax(0,1fr));align-content:start;gap:8px;min-height:0;padding:2px 0;display:grid}.cumulative-stat{background:var(--surface);border:1px solid var(--border);text-align:center;border-radius:10px;flex-direction:column;gap:3px;min-width:0;padding:8px;display:flex}.cumulative-label{color:var(--muted);text-transform:uppercase;letter-spacing:.05em;font-size:.68rem;font-weight:600;line-height:1.2}.cumulative-value{color:var(--accent);font-size:1.55rem;font-weight:700;line-height:1.2}.cumulative-meta{color:var(--muted);font-size:.72rem;line-height:1.2}.stats-grid-5{grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;display:grid}.stats-grid-5 span{color:var(--muted);font-size:.8rem;display:block}.stats-grid-5 strong{font-size:1.15rem}.trend-list,.forecast-list,.unit-metric-list{gap:8px;display:grid}.trend-row,.forecast-row{grid-template-columns:40px minmax(0,1fr) 68px;align-items:center;gap:8px;display:grid}.trend-label,.forecast-label{color:var(--muted);font-size:.82rem}.trend-meta,.forecast-meta{text-align:right;color:var(--muted);font-size:.8rem}.trend-bar-wrap,.forecast-bar-wrap{background:var(--surface);border:1px solid var(--border);border-radius:999px;height:10px;overflow:hidden}.trend-bar,.forecast-bar{border-radius:inherit;height:100%}.trend-bar{background:linear-gradient(90deg,#4f46e5,#14b8a6)}.forecast-bar{background:linear-gradient(90deg,#f97316,#f59e0b)}.mastery-stack{background:var(--surface);border:1px solid var(--border);border-radius:999px;height:18px;display:flex;overflow:hidden}.mastery-segment{height:100%}.mastery-segment.new{background:#9ca3af}.mastery-segment.learning{background:#f59e0b}.mastery-segment.mastered{background:#22c55e}.mastery-legend{color:var(--muted);justify-content:space-between;gap:8px;margin-top:8px;font-size:.82rem;display:flex}.unit-metric-head,.unit-metric-row{grid-template-columns:1.4fr repeat(3,.6fr);align-items:center;gap:8px;display:grid}.unit-metric-head{color:var(--muted);margin-bottom:6px;font-size:.8rem}.unit-metric-row{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:8px;font-size:.86rem}.group-panel{background:var(--panel);border:1px solid var(--border);border-radius:14px;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px;padding:12px;display:grid}.import-label{text-align:center;cursor:pointer;background:var(--accent-soft);color:var(--accent);border:1px solid var(--accent-ghost-border);font-weight:inherit;border-radius:12px;justify-content:center;align-items:center;transition:filter .15s;display:inline-flex}.import-label:hover{filter:brightness(1.05)}.import-label input{display:none}.group-field{gap:6px;display:grid}.group-field label{color:var(--muted);font-size:.9rem}.unit-progress-panel{background:var(--panel);border:1px solid var(--border);border-radius:14px;margin-top:14px;padding:12px}.unit-progress-head{justify-content:space-between;align-items:baseline;margin-bottom:8px;display:flex}.unit-progress-head h3{margin:0}.unit-progress-head p{color:var(--muted);margin:0;font-size:.85rem}.unit-progress-list{gap:8px;display:grid}.unit-progress-item{text-align:left;background:var(--surface);border:1px solid var(--border);width:100%;color:var(--ink);grid-template-columns:1.3fr repeat(3,.7fr);align-items:center;gap:8px;display:grid}.unit-progress-item.active{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}.card-wrap{margin-top:18px}.flashcard{cursor:pointer;background:var(--panel);border:1px solid var(--border);min-height:190px;box-shadow:0 14px 30px var(--shadow-color);border-radius:20px;flex-direction:column;justify-content:center;gap:10px;padding:22px;display:flex}.face-label{text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin:0;font-size:.75rem}.flashcard h2{margin:0;font-size:1.9rem}.phonetic-row{justify-content:space-between;align-items:center;gap:10px;display:flex}.phonetic-main{align-items:baseline;gap:10px;min-width:0;display:inline-flex}.answer-word-inline{color:var(--ink);font-size:1rem;font-weight:600}.phonetic-text{color:var(--muted);font-size:.9rem}.tts-button{background:var(--accent-soft);color:var(--accent);border-color:var(--accent-ghost-border);border-radius:999px;min-width:58px;padding:6px 10px;font-size:.82rem}.tts-button.active{background:var(--accent);color:var(--button-text)}.tts-controls{align-items:center;gap:8px;display:inline-flex}.accent-toggle{border:1px solid var(--accent-ghost-border);border-radius:999px;display:inline-flex;overflow:hidden}.accent-button{background:var(--surface);color:var(--muted);border:0;border-radius:0;min-width:34px;padding:5px 8px;font-size:.75rem}.accent-button+.accent-button{border-left:1px solid var(--accent-ghost-border)}.accent-button.active{background:var(--accent-soft);color:var(--accent)}.tts-hint{color:var(--muted);opacity:.85;margin:-4px 0 0;font-size:.66rem;line-height:1.25}.flashcard small,.example,.empty{color:var(--muted)}.card-meta{opacity:.62;font-size:.82rem}.actions{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:12px;display:grid}button,input,select{font:inherit}button{background:var(--accent);color:var(--button-text);cursor:pointer;border:1px solid #0000;border-radius:12px;padding:10px 12px}button:hover{filter:brightness(1.05)}button:disabled{opacity:.55;cursor:not-allowed;filter:none}button.ghost{background:var(--accent-soft);color:var(--accent);border-color:var(--accent-ghost-border)}.add-form{background:var(--panel);border:1px solid var(--border);border-radius:16px;margin-top:22px;padding:16px}.add-form h3{margin:0 0 10px}.add-form form{gap:10px;display:grid}input,select{border:1px solid var(--border);background:var(--surface);color:var(--ink);border-radius:10px;padding:10px}.group-hint{color:var(--muted);margin:0 0 10px;font-size:.9rem}.form-actions{gap:10px;display:flex}@media (width<=760px){.topbar-main{flex-direction:column;align-items:stretch}.topbar-actions{flex-direction:column;width:100%;margin-left:0}.user-controls{width:100%}.user-controls select{flex:1;min-width:0}.theme-controls{width:100%}.theme-controls .theme-toggle{flex:1}.stats,.group-panel,.stats-overview{grid-template-columns:1fr}.insights-slot{min-height:320px}.mastery-card{display:none}.mastery-donut-wrap{flex:none}.efficiency-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.efficiency-value{font-size:1rem}.difficult-row{grid-template-columns:20px 1fr 80px;gap:6px;padding:6px 8px}.difficult-metrics{gap:6px}.difficult-metric{min-width:36px}.metric-label{font-size:.68rem}.metric-value{font-size:.8rem}.cumulative-grid{grid-template-columns:repeat(2,1fr)}.cumulative-value{font-size:1.4rem}.stats-chart-head{flex-direction:column;align-items:flex-start}.trend-columns{gap:6px;min-height:186px}.trend-column-bar-wrap{width:72%;height:120px}.difficult-list{max-height:214px}.stats-grid-5{grid-template-columns:repeat(2,minmax(0,1fr))}.trend-row,.forecast-row{grid-template-columns:32px minmax(0,1fr) 54px}.mastery-legend{flex-direction:column;align-items:flex-start}.actions{grid-template-columns:repeat(2,minmax(0,1fr))}}
