:root {
    --font-stack: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "SF Mono", "Menlo", "Consolas", "Monaco", monospace;
    --radius-window: 24px;
    --radius-card: 20px;
    --radius-btn: 14px;
    --border-width-hairline: 0.5px;
    --border-width-thin: 1px;
    --bg-body: #f5f5f7;
    --bg-card: #ffffff;
    --sidebar-bg: rgba(250, 250, 252, 0.85);
    --primary: #6C5CE7;
    --primary-light: #e0dcfc;
    --duo-green: #58CC02;
    --success: #34c759;
    --warning: #ffcc00;
    --danger: #ff3b30;
    --text-main: #1d1d1f;
    --text-sub: #86868b;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-float: 0 20px 40px rgba(0,0,0,0.12);
    --shadow-card: 0 4px 12px rgba(0,0,0,0.03);
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.04);
}

body, button, input, select, textarea,
.card-title, .nav-label-cn, .modal-title, .word-huge {
    font-family: var(--font-stack);
}

.input-box, .hint-ghost, #measure-span, .phonetic-badge {
    font-family: var(--font-mono) !important;
    letter-spacing: 0 !important;
}

html.dark-mode-preload,
html.dark-mode-preload body {
    background-color: #000000 !important;
    background-image: none !important;
    color: #ffffff !important;
    margin: 0 !important;
    height: 100vh !important;
    overflow: hidden !important;
}

html.dark-mode-preload #app {
    opacity: 0 !important;
    visibility: hidden !important;
}

.card, .modal-box, .sent-box, .choice-btn {
    border-radius: var(--radius-card);
}

.btn-main, .btn-skip, .btn-modal, .input-box,
.search-wrapper, .c-select-trigger, .c-options,
.nav-item, .btn-text, .filter-group, .btn-anki, .token {
    border-radius: var(--radius-btn);
}

.filter-btn { border-radius: calc(var(--radius-btn) - 4px); }

#app.theme-dark {
    --bg-body: #050505;
    --bg-card: #141416;
    --sidebar-bg: rgba(20, 20, 22, 0.7);
    --text-main: #FFFFFF;
    --text-sub: #E5E5EA;
    --border-color: rgba(255, 255, 255, 0.12);
    --primary-light: rgba(108, 92, 231, 0.25);
}

#app.theme-dark .card-sub,
#app.theme-dark .card-info,
#app.theme-dark .nav-label-en,
#app.theme-dark .btn-main-en,
#app.theme-dark .stats-label,
#app.theme-dark .btn-en {
    color: rgba(255, 255, 255, 0.85) !important;
}

::-webkit-scrollbar { display: none; }
* { -ms-overflow-style: none; scrollbar-width: none; box-sizing: border-box; user-select: none; outline: none; -webkit-font-smoothing: antialiased; }

body {
    margin: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    font-family: var(--font-stack);
    background-color: var(--bg-body);
    background-image:
        radial-gradient(at 100% 0%, hsla(250,100%,96%,1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(140,100%,96%,1) 0px, transparent 50%);
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

body:has(#app.theme-dark) {
    background-color: #000000;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 0 0 2px rgba(255, 255, 255, 0.05),
        inset 0 0 40px rgba(0, 0, 0, 0.8);
    background-image:
        radial-gradient(circle at 90% 10%, rgba(108, 92, 231, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 10% 90%, rgba(88, 204, 2, 0.35) 0%, transparent 50%);
}

#app {
    width: 100%;
    height: 100%;
    max-width: 1800px;
    background: var(--bg-card);
    border-radius: var(--radius-window);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.05), var(--shadow-float);
    display: flex;
    overflow: hidden;
    position: relative;
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
                filter 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
                transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 1;
    filter: blur(0px);
    transform: scale(1) translate3d(0,0,0);
    will-change: opacity, filter, transform;
}

#app.theme-dark {
    background: rgba(20, 20, 22, 0.6);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.15),
        0 20px 50px rgba(0, 0, 0, 0.5);
}

.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: var(--border-width-thin) solid var(--border-color);
    display: flex; flex-direction: column; padding: 24px 16px;
    z-index: 10;
    transition: width 0.3s ease;
}

.brand-logo {
    font-size: 1.8rem; font-weight: 800; margin-bottom: 24px; padding-left: 8px;
    letter-spacing: -0.5px; line-height: 1;
}
.logo-toef { color: var(--primary); }
.logo-ingo { color: var(--duo-green); }
.logo-l { display: inline-block; background: linear-gradient(90deg, var(--primary) 50%, var(--duo-green) 50%); -webkit-background-clip: text; color: transparent; }

.clock-widget { margin-bottom: 24px; padding-left: 8px; }
.clock-time { font-size: 2rem; font-weight: 700; color: var(--text-main); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.clock-date { font-size: 0.85rem; color: var(--text-sub); margin-top: 6px; font-weight: 500; }

.nav { flex: 1; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }

.nav-item {
    padding: 10px 14px;
    border-radius: var(--radius-btn);
    color: var(--text-main); cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: space-between;
    border: 1px solid transparent;
    background: transparent;
}

.nav-item:not(.active) { border-color: rgba(0,0,0,0.03); }
#app.theme-dark .nav-item:not(.active) { border-color: rgba(255,255,255,0.05); }

.nav-item:hover {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.08);
}
#app.theme-dark .nav-item:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
}

.nav-item.active {
    background: #f0f0ff;
    border-color: rgba(108, 92, 231, 0.15);
}
#app.theme-dark .nav-item.active {
    background: rgba(108, 92, 231, 0.15);
    border-color: rgba(108, 92, 231, 0.3);
}

.nav-item.active .nav-label-cn { color: var(--primary); font-weight: 600; }

.nav-content { display: flex; flex-direction: column; }
.nav-label-cn { font-size: 0.95rem; line-height: 1.3; font-weight: 500; }
.nav-label-en { font-size: 0.7rem; color: var(--text-sub); }

.nav-badge { background: var(--danger); color: white; font-size: 0.75rem; padding: 2px 8px; border-radius: 10px; font-weight: 700; opacity: 0; transform: scale(0.8); transition: 0.3s; }
.nav-badge.show { opacity: 1; transform: scale(1); }

.stats-card {
    background: rgba(255,255,255,0.5); padding: 15px; border-radius: var(--radius-btn);
    margin-top: 10px; border: 1px solid var(--border-color);
}
#app.theme-dark .stats-card { background: rgba(255,255,255,0.05); }

.stats-num { font-size: 1.6rem; font-weight: 700; color: var(--text-main); line-height: 1; letter-spacing: -0.5px; }
.stats-label { font-size: 0.75rem; color: var(--text-sub); text-transform: uppercase; margin-top: 4px; font-weight: 600; letter-spacing: 0.5px; }

.stats-wrap {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-text {
    appearance: none; -webkit-appearance: none;
    background: transparent;
    text-align: left;
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-btn);
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid transparent;
    margin: 0;
    font-family: inherit;
    cursor: pointer;
}

#app.theme-dark .btn-text { border-color: transparent; }
.btn-text:hover { background: rgba(0,0,0,0.04); }
#app.theme-dark .btn-text:hover { background: rgba(255,255,255,0.08); }

.btn-cn {
    font-size: 0.95rem; color: var(--text-main); font-weight: 500; line-height: 1.3;
    display: flex; align-items: center;
}
.btn-en {
    font-size: 0.7rem; color: var(--text-sub); font-weight: 400; margin-top: 0; line-height: 1.2;
}

.main { flex: 1; position: relative; overflow: hidden; background: transparent; }
.view-container {
    position: absolute; inset: 0; overflow-y: auto; padding: 32px 48px;
    opacity: 0; pointer-events: none; transform: translateY(10px);
    transition: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.view-container.active { opacity: 1; pointer-events: all; transform: translateY(0); }

.header-group { margin-bottom: 30px; }
.header-cn { font-size: 2rem; font-weight: 800; color: var(--text-main); letter-spacing: -0.5px; }
.header-en { font-size: 0.85rem; color: var(--text-sub); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

.root-section { margin-bottom: 50px; }
.root-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid var(--border-color); }
.root-title { font-size: 1.4rem; font-weight: 700; color: var(--text-main); letter-spacing: -0.3px; }
.cat-group { margin-bottom: 30px; }
.cat-title { font-size: 1rem; font-weight: 600; color: var(--text-sub); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.cat-title::before { content: ''; width: 6px; height: 6px; background: var(--duo-green); border-radius: 50%; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card {
    padding: 20px; border-radius: var(--radius-card); background: #fff;
    border: 1px solid var(--border-color); box-shadow: var(--shadow-card);
    cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); position: relative; display: flex; flex-direction: column;
}
#app.theme-dark .card { background: var(--bg-card); }

.card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 10px 25px rgba(108,92,231,0.15); }
.card.locked { opacity: 0.6; filter: grayscale(1); pointer-events: none; background: #fafafa; }
#app.theme-dark .card.locked { background: #111; }

.card-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card-num { font-size: 0.75rem; font-weight: 700; color: var(--primary); background: #f0f0ff; padding: 4px 8px; border-radius: 6px; }
#app.theme-dark .card-num { background: rgba(108,92,231,0.2); }
.card-title { font-size: 1.1rem; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
.card-info { font-size: 0.8rem; color: var(--text-sub); }

.session-wrap { max-width: 900px; margin: 0 auto; height: 100%; display: flex; flex-direction: column; }
.session-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding-top: 10px; }
.progress-bar { flex: 1; height: 6px; background: var(--border-color); margin: 0 24px; border-radius: 4px; overflow: hidden; }
.progress-val { height: 100%; width: 0%; background: var(--primary); transition: width 0.3s ease; }
.btn-exit { cursor: pointer; color: var(--text-sub); text-align: right; font-weight: 600; font-size: 0.8rem; transition: 0.2s; }
.btn-exit:hover { color: var(--text-main); }

.stage-card {
    flex: 1; background: #fff; border-radius: var(--radius-window); box-shadow: var(--shadow-float);
    border: 1px solid var(--border-color); padding: 40px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: relative; overflow-y: auto; margin-bottom: 24px;
}
#app.theme-dark .stage-card { background: var(--bg-card); }

.word-huge {
    font-size: 3.5rem; font-weight: 800; margin-bottom: 8px; line-height: 1.1; text-align: center;
    color: var(--text-main); letter-spacing: -1px;
}
.phonetic-badge {
    font-family: "SF Mono", Menlo, monospace;
    color: var(--text-sub); background: #f2f2f7;
    padding: 6px 14px; border-radius: 20px; margin-bottom: 32px;
    cursor: pointer; transition: 0.2s; font-size: 0.9rem;
}
#app.theme-dark .phonetic-badge { background: #2d2d30; }
.phonetic-badge:hover { background: #e5e5ea; color: var(--primary); }

.def-cn {
    font-size: 1.5rem; margin-bottom: 12px; font-weight: 600; text-align: center;
    color: var(--text-main); letter-spacing: -0.5px;
}

.sent-box {
    background: #f8f9fa;
    padding: 20px 24px;
    border-radius: var(--radius-card);
    border-left: 4px solid var(--primary);
    width: 100%;
    max-width: 600px;
    color: var(--text-main);
}
.sent-box div { color: inherit !important; }
.sent-box div:last-child { opacity: 0.8; }
#app.theme-dark .sent-box { background: #0d1117; }

.btn-main {
    background: var(--primary); color: white; border: none;
    height: 52px; min-width: 160px; padding: 0 24px;
    border-radius: var(--radius-card); cursor: pointer;
    box-shadow: 0 4px 12px rgba(108,92,231,0.3); transition: all 0.2s;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    margin-top: 32px;
}
.btn-main:hover { background: #5a4bd4; transform: translateY(-1px); }
.btn-main-cn { font-size: 1rem; font-weight: 600; line-height: 1.1; }
.btn-main-en { font-size: 0.7rem; opacity: 0.9; font-weight: 400; }
.btn-main.disabled {
    background: #e5e5ea; color: #bbb; cursor: default; box-shadow: none; transform: none;
}
#app.theme-dark .btn-main.disabled {
    background: #2c2c2e; color: #555;
}
.btn-main.wrong { background: var(--danger); animation: shake 0.4s; }
.btn-main.correct { background: var(--success); }

.btn-skip {
    background: #f2f2f7; color: var(--text-sub); border: none;
    height: 44px; min-width: 140px; padding: 0 20px; border-radius: var(--radius-btn);
    cursor: pointer; margin-top: 12px; font-weight: 600; font-size: 0.9rem;
    transition: 0.2s; display: none;
}
#app.theme-dark .btn-skip { background: #2d2d30; }
.btn-skip:hover { background: #e5e5ea; color: var(--text-main); }
.btn-skip.show { display: block; animation: fadeIn 0.3s ease; }

.quiz-prompt {
    font-size: 1.3rem; margin-bottom: 24px; font-weight: 700; text-align: center;
    color: var(--text-main);
}

.input-box {
    font-size: 2rem; padding: 12px; border: 2px solid var(--border-color); border-radius: var(--radius-card);
    width: 100%; max-width: 400px; text-align: center; transition: 0.2s;
    background: transparent; color: var(--text-main); font-weight: 600;
}
#app.theme-dark .input-box { border-color: rgba(255,255,255,0.2); }
.input-box:focus { border-color: var(--primary); }

.drop-area { min-height: 70px; width: 100%; max-width: 700px; border-bottom: 2px solid var(--border-color); display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; margin-bottom: 24px; transition: 0.2s; align-content: flex-start; }
.drop-area.active { background: rgba(108,92,231,0.05); border-color: var(--primary); }
.pool-area { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; max-width: 700px; }

.token { background: white; border: 1px solid var(--border-color); padding: 8px 16px; border-radius: 10px; font-weight: 600; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.05); font-size: 1rem; position: relative; z-index: 1; transition: transform 0.1s, background 0.2s; }
#app.theme-dark .token { background: #21262d; color: #fff; }
.token:hover { border-color: var(--primary); background: #f9fcff; }
#app.theme-dark .token:hover { background: #161b22; }
.token:active { transform: scale(0.96); }
.token.sortable { cursor: grab; }
.token.sortable:active { cursor: grabbing; }
.token.dragging { opacity: 0.5; background: #eef7ff; border-color: var(--primary); transform: scale(1.05); z-index: 100; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 700px; }
.choice-btn { background: white; border: 2px solid var(--border-color); padding: 18px; border-radius: var(--radius-card); font-size: 1rem; cursor: pointer; transition: 0.2s; text-align: left; font-weight: 500; color: var(--text-main); }
#app.theme-dark .choice-btn { background: #21262d; }
.choice-btn:hover { border-color: var(--primary); background: #f9fcff; }
#app.theme-dark .choice-btn:hover { background: #161b22; }
.choice-btn.correct { background: var(--success); border-color: var(--success); color: white; }
.choice-btn.wrong { background: var(--danger); border-color: var(--danger); color: white; }

.vocab-toolbar {
    display: flex; gap: 12px; margin-bottom: 24px; align-items: center;
    justify-content: flex-end;
    background: white; padding: 12px; border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm); flex-wrap: wrap; border: 1px solid var(--border-color);
}
#app.theme-dark .vocab-toolbar { background: var(--bg-card); }

.search-wrapper {
    flex: 1; height: 40px; position: relative; display: flex; align-items: center;
    background: #f2f2f7; border-radius: var(--radius-btn); transition: 0.2s; border: 2px solid transparent;
}
#app.theme-dark .search-wrapper { background: #0d1117; }
.search-wrapper:focus-within { background: white; border-color: var(--primary); box-shadow: 0 4px 12px rgba(108,92,231,0.1); }
#app.theme-dark .search-wrapper:focus-within { background: #161b22; }
.search-icon { margin-left: 12px; font-size: 1rem; color: var(--text-sub); display: flex; align-items: center; }
.vocab-search {
    width: 100%; height: 100%; border: none; background: transparent; padding: 0 12px;
    font-size: 0.9rem; color: var(--text-main);
}

.c-select-container { position: relative; min-width: 160px; z-index: 50; height: 40px; }
.c-select-trigger {
    height: 100%; background: #f2f2f7; padding: 0 14px; border-radius: var(--radius-btn);
    font-size: 0.85rem; font-weight: 600; color: var(--text-main);
    display: flex; justify-content: space-between; align-items: center; cursor: pointer;
    transition: 0.2s; border: 2px solid transparent;
}
#app.theme-dark .c-select-trigger { background: #0d1117; }
.c-select-trigger:hover { background: #e5e5ea; }
.c-select-trigger.disabled { opacity: 0.5; pointer-events: none; cursor: default; }
.c-select-trigger.open { background: white; border-color: var(--primary); }
#app.theme-dark .c-select-trigger.open { background: #161b22; }
.c-select-arrow { font-size: 0.8rem; margin-left: 8px; color: var(--text-sub); transition: 0.2s; }
.c-select-trigger.open .c-select-arrow { transform: rotate(180deg); color: var(--primary); }

.c-options {
    position: absolute; top: 115%; left: 0; right: 0;
    background: white; border-radius: var(--radius-btn); box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 6px; display: none; flex-direction: column; gap: 2px;
    animation: fadeIn 0.15s ease; border: 1px solid var(--border-color);
}
#app.theme-dark .c-options { background: #161b22; }
.c-options.show { display: flex; }
.c-option {
    padding: 8px 10px; border-radius: 6px; font-size: 0.85rem; cursor: pointer; color: var(--text-main);
    transition: 0.1s;
}
.c-option:hover { background: #f2f2f7; color: var(--primary); }
#app.theme-dark .c-option:hover { background: #2d2d30; }
.c-option.selected { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.filter-group { display: flex; background: #f2f2f7; padding: 3px; border-radius: var(--radius-btn); gap: 2px; height: 40px; align-items: center; }
#app.theme-dark .filter-group { background: #0d1117; }
.filter-btn {
    border: none; background: transparent; padding: 0 14px; height: 34px; border-radius: 8px;
    font-size: 0.85rem; font-weight: 600; color: var(--text-sub); cursor: pointer; transition: 0.2s;
}
.filter-btn:hover { color: var(--text-main); }
.filter-btn.active { background: white; color: var(--text-main); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
#app.theme-dark .filter-btn.active { background: #21262d; color: #fff; }

.vocab-list-container { padding-bottom: 50px; }

.vocab-row {
    display: grid;
    grid-template-columns: 24px 1fr auto 40px;
    align-items: center;
    gap: 16px;
    background: white;
    padding: 16px 20px;
    border-radius: var(--radius-card);
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}
#app.theme-dark .vocab-row { background: var(--bg-card); }
.vocab-row:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.06); border-color: var(--primary-light); }

.v-status {
    width: 24px; height: 24px; border-radius: 50%; border: 2px solid #d1d1d6;
    display: flex; align-items: center; justify-content: center; color: white; font-size: 14px;
    transition: 0.3s;
}
.v-status.done { background: var(--success); border-color: var(--success); }
.v-status.done::after { content: '✓'; font-weight: 800; }

.v-main { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.v-word-wrap { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.v-word { font-size: 1.1rem; font-weight: 700; color: var(--text-main); word-break: break-word; line-height: 1.2; }
.v-ph { font-family: "SF Mono", Menlo, monospace; font-size: 0.85rem; color: var(--text-sub); flex-shrink: 0; }
.v-def { font-size: 0.95rem; color: #555; line-height: 1.4; margin-top: 2px; }
#app.theme-dark .v-def { color: #8b949e; }

.v-meta { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; text-align: right; min-width: fit-content; max-width: 50%; }
.v-tag {
    font-size: 0.7rem; background: #f2f2f7; padding: 4px 10px; border-radius: 20px; color: #888; font-weight: 500; line-height: 1.3;
    width: fit-content; white-space: nowrap; text-align: right;
}
#app.theme-dark .v-tag { background: #2d2d30; }
.v-lvl { font-size: 0.7rem; color: var(--success); font-weight: 700; opacity: 0; transition:0.2s; margin-top: 4px; text-align: right; width: 100%; }
.v-status.done ~ .v-main + .v-meta .v-lvl { opacity: 1; }

.v-action-btn {
    font-size: 1.1rem; color: #ccc; width: 100%; height: 32px;
    display: flex; align-items: center; justify-content: center; border-radius: 8px; transition: 0.2s; margin: 0;
}
.vocab-row:hover .v-action-btn { color: var(--text-main); }
.v-action-btn:hover { background: #f0f0f5; color: var(--primary); }
#app.theme-dark .v-action-btn:hover { background: #21262d; }

.report-section { width: 100%; max-width: 800px; margin: 0 auto; text-align: left; }
.report-header { text-align: center; margin-bottom: 30px; }
.report-item { background: #f8f9fa; padding: 15px; border-radius: 12px; margin-bottom: 10px; border-left: 4px solid var(--danger); }
#app.theme-dark .report-item { background: #161b22; }
.report-word { font-weight: 700; font-size: 1.1rem; color: var(--text-main); display: flex; justify-content: space-between; }
.report-def { color: #666; margin-top: 4px; font-size: 0.95rem; }
#app.theme-dark .report-def { color: #8b949e; }
.report-sent { margin-top: 8px; font-size: 0.9rem; color: var(--primary); font-style: italic; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: 0.3s ease; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box { background: white; width: 380px; padding: 32px 24px; border-radius: var(--radius-window); box-shadow: 0 25px 50px rgba(0,0,0,0.15); transform: scale(0.9) translateY(20px); transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); display: flex; flex-direction: column; align-items: center; text-align: center; max-height: 85vh; overflow-y: auto; border: 1px solid var(--border-color); }
#app.theme-dark .modal-box { background: #1c1c1e; }
.modal-overlay.open .modal-box { transform: scale(1) translateY(0); }
.modal-icon { font-size: 3.5rem; margin-bottom: 16px; line-height: 1; animation: pop 0.5s ease backwards 0.2s; }
.modal-title { font-size: 1.4rem; font-weight: 800; color: var(--text-main); margin: 0 0 10px 0; letter-spacing: -0.5px; }
.modal-msg { font-size: 1rem; color: var(--text-sub); margin: 0 0 24px 0; line-height: 1.5; padding: 0 10px; }
.modal-select { width: 100%; padding: 12px; border-radius: var(--radius-btn); border: 2px solid #e5e5ea; font-size: 1rem; margin-bottom: 25px; outline: none; transition: 0.2s; background: transparent; color: var(--text-main); }
.modal-select:focus { border-color: var(--primary); }
.modal-actions { display: flex; gap: 12px; width: 100%; justify-content: center; }
.modal-actions.vertical { flex-direction: column; }
.btn-modal { flex: 1; border: none; padding: 14px; border-radius: var(--radius-btn); font-size: 1rem; font-weight: 700; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 10px rgba(108,92,231,0.3); }
.btn-primary:hover { background: #5a4bd4; transform: translateY(-2px); }
.btn-success { background: var(--success); color: white; box-shadow: 0 4px 10px rgba(52,199,89,0.3); }
.btn-success:hover { background: #2db84d; transform: translateY(-2px); }
.btn-danger { background: var(--danger); color: white; box-shadow: 0 4px 10px rgba(255,59,48,0.3); }
.btn-danger:hover { background: #d6352c; transform: translateY(-2px); }
.btn-ghost { background: #f2f2f7; color: var(--text-sub); }
#app.theme-dark .btn-ghost { background: #2d2d30; }
.btn-ghost:hover { background: #e5e5ea; color: var(--text-main); }

@keyframes pop { 0%{transform:scale(0.5);opacity:0} 60%{transform:scale(1.1)} 100%{transform:scale(1)} }
@keyframes fadeIn { from{opacity:0;transform:translateY(-5px)} to{opacity:1;transform:translateY(0)} }

#theme-transition-overlay {
    position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0; background-color: transparent;
    transform: translate3d(0,0,0); will-change: opacity, background-color;
    transition: background-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.2s linear;
}
#theme-transition-overlay.active { opacity: 1; pointer-events: all; }

#app.fade-blur-out { opacity: 0; filter: blur(12px) brightness(1.1); transform: scale(0.96) translate3d(0,0,0); }

.input-wrapper { position: relative; width: 100%; max-width: 400px; margin: 0 auto; height: 60px; display: flex; justify-content: center; align-items: center; }

.hint-ghost, .input-box {
    grid-area: 1 / 1; font-size: 2rem;
    font-family: "Menlo", "Consolas", "Monaco", monospace;
    font-weight: 600; letter-spacing: normal; padding: 12px; width: 100%; box-sizing: border-box; text-align: center; background: transparent;
}

.input-box {
    position: absolute; z-index: 2; width: 100%; height: 100%; background: transparent;
    border: 2px solid var(--border-color); border-radius: var(--radius-card);
    color: var(--text-main); font-size: 2rem; font-weight: 600; text-align: center;
    padding: 0; margin: 0; font-family: var(--font-stack); transition: border-color 0.2s;
}

.hint-ghost {
    position: absolute; z-index: 1; pointer-events: none;
    top: 50%; transform: translateY(-50%); left: 50%;
    font-size: 2rem; font-family: var(--font-stack); font-weight: 600;
    color: rgba(0,0,0,0.2); text-align: left; white-space: pre; margin: 0; padding: 0; line-height: 1;
}

#measure-span {
    position: absolute; visibility: hidden; height: auto; width: auto; white-space: pre;
    font-size: 2rem; font-weight: 600; font-family: var(--font-stack); padding: 0; margin: 0; border: 0;
}

#app.theme-dark .hint-ghost { color: rgba(255,255,255,0.3); }

@keyframes macShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-8px); }
}
.shake-error { animation: macShake 0.4s cubic-bezier(.36,.07,.19,.97) both; }

.btn-main.correct { background: var(--success) !important; transform: scale(1.05); }
.btn-main.wrong { background: var(--danger) !important; }

body:has(#app.theme-dark) .modal-box {
    background: #1c1c1e !important; border: 1px solid rgba(255, 255, 255, 0.1) !important; box-shadow: 0 25px 50px rgba(0,0,0,0.5) !important;
}
body:has(#app.theme-dark) .modal-title { color: #ffffff !important; }
body:has(#app.theme-dark) .modal-msg { color: rgba(255, 255, 255, 0.85) !important; }
body:has(#app.theme-dark) .btn-ghost { background: #2c2c2e !important; color: #ffffff !important; }
body:has(#app.theme-dark) .btn-ghost:hover { background: #3a3a3d !important; }
body:has(#app.theme-dark) .modal-select { background-color: #2c2c2e !important; color: white !important; border-color: rgba(255,255,255,0.2) !important; }

.anki-wrap {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: 100%; max-width: 640px; margin-top: 40px;
}

.btn-anki {
    border: none; border-radius: var(--radius-btn); padding: 14px 8px; cursor: pointer;
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.anki-again { background: linear-gradient(180deg, #ff5f56 0%, #ff3b30 100%); }
.anki-hard  { background: linear-gradient(180deg, #ffb340 0%, #ff9500 100%); }
.anki-good  { background: linear-gradient(180deg, #3adb6a 0%, #34c759 100%); }
.anki-easy  { background: linear-gradient(180deg, #00aaff 0%, #007aff 100%); }

.btn-anki:hover { transform: translateY(-4px); filter: brightness(1.1); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.2); }
.btn-anki:active { transform: scale(0.94); filter: brightness(0.9); }

.btn-anki .anki-label { font-size: 1rem; font-weight: 700; color: #ffffff; letter-spacing: 0.5px; margin-bottom: 2px; text-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.btn-anki .time-hint { font-size: 0.75rem; font-weight: 500; color: rgba(255, 255, 255, 0.8); font-family: var(--font-stack); }

#app.theme-dark .btn-anki { border: 1px solid rgba(255, 255, 255, 0.08); }
.btn-main.hidden { display: none; }
.input-box, .hint-ghost, #measure-span { font-family: "SF Mono", "Menlo", "Consolas", "Monaco", monospace !important; letter-spacing: 0 !important; }
.word-meta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px; /* 两个胶囊之间的间距 */
    margin-bottom: 32px;
    flex-wrap: wrap;
}

/* 2. 重写音标徽章样式，使其不再单独占一行 */
.phonetic-badge {
    margin-bottom: 0 !important; /* 去掉原有的下边距 */
    height: 36px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color); /* 统一边框 */
    background: #f2f2f7;
}
#app.theme-dark .phonetic-badge {
    background: #2d2d30;
    border-color: rgba(255,255,255,0.1);
}

/* 3. 新的 COCA 胶囊样式 */
.coca-badge {
    height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 4px 0 12px; /* 左边文字留白，右边紧贴数字框 */
    border-radius: 20px; /* 保持圆角 */
    background: #f2f2f7;
    color: var(--text-sub);
    font-size: 0.85rem;
    font-family: var(--font-stack);
    font-weight: 700;
    cursor: help;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

#app.theme-dark .coca-badge {
    background: #2d2d30;
    color: #a0a0a5;
    border-color: rgba(255,255,255,0.1);
}

.coca-badge:hover {
    background: #e5e5ea;
    transform: translateY(-1px);
}
#app.theme-dark .coca-badge:hover {
    background: #3a3a3d;
}

/* 4. 分数单独的框（胶囊里的右半部分） */
.coca-rank-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--text-main);
    padding: 2px 8px;
    border-radius: 14px;
    margin-left: 8px;
    margin-right: 2px;
    font-family: var(--font-mono);
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    min-width: 40px;
}

#app.theme-dark .coca-rank-box {
    background: #151517;
    color: #fff;
    box-shadow: none;
    border: 1px solid rgba(255,255,255,0.1);
}

/* 5. 词汇表列表视图中的样式调整 */
.v-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.v-meta-row {
    display: flex;
    align-items: center;      /* 关键：Y轴居中 */
    justify-content: flex-end;
    gap: 8px;                 /* 两个标签之间的间距 */
    margin-top: 6px;          /* 整体与上方分类标签的间距 */
    height: 20px;             /* 固定高度，防止抖动 */
}
.list-coca-tag {
    font-size: 0.7rem;
    font-family: var(--font-mono); /* 使用等宽字体，数字更好看 */
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 6px;       /*稍微圆润一点的边框*/
    cursor: help;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;             /* 撑满行高，便于对齐 */
    transition: all 0.2s;
}
#app.theme-dark .list-coca-tag {
    filter: brightness(1.2);
}
.v-lvl {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 700;
    opacity: 0;
    transition: 0.2s;
    margin: 0 !important;     /* 关键：强制去掉 margin-top */
    line-height: 1;           /* 确保行高紧凑 */
    padding-top: 1px;         /* 微调视觉中心 */
}