
:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-glass: rgba(31, 41, 55, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(239, 68, 68, 0.35);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --cinnabar: #ef4444;
    --cinnabar-hover: #dc2626;
    --cinnabar-glow: rgba(239, 68, 68, 0.25);

    --imperial-gold: #f59e0b;
    --imperial-gold-glow: rgba(245, 158, 11, 0.25);

    --jade: #10b981;
    --jade-glow: rgba(16, 185, 129, 0.2);

    --sky-blue: #3b82f6;

    --tone-1: #f87171;
    --tone-2: #fbbf24;
    --tone-3: #34d399;
    --tone-4: #60a5fa;
    --tone-5: #94a3b8;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --font-latin: 'Plus Jakarta Sans', 'Outfit', system-ui, sans-serif;
    --font-hanzi: 'Noto Serif SC', 'PingFang SC', 'Microsoft YaHei', serif;
    --font-seal: 'Ma Shan Zheng', cursive, serif;

    --transition-fast: 0.18s ease;
    --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

html.light {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-glass: rgba(241, 245, 249, 0.8);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(239, 68, 68, 0.3);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --cinnabar: #dc2626;
    --cinnabar-glow: rgba(220, 38, 38, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-latin);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.45;
}

.glow-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--cinnabar) 0%, transparent 70%);
    top: -150px;
    right: -100px;
}

.glow-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
}

.glow-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--imperial-gold) 0%, transparent 70%);
    top: 40%;
    left: 45%;
    opacity: 0.2;
}

.app-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-seal {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #ef4444, #991b1b);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px var(--cinnabar-glow), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(254, 202, 202, 0.4);
}

.seal-character {
    font-family: var(--font-seal);
    font-size: 1.85rem;
    color: #fff;
    line-height: 1;
    user-select: none;
}

.brand-text .brand-title {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.hanzi-title {
    font-family: var(--font-hanzi);
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1;
    display: inline-block;
    color: #ffffff;
    letter-spacing: 0.04em;
    text-shadow: 0 0 16px rgba(239, 68, 68, 0.45), 0 2px 4px rgba(0, 0, 0, 0.5);
    -webkit-font-smoothing: antialiased;
}

html.light .hanzi-title {
    color: #dc2626;
    text-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
}

.latin-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.badge-ai {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-transform: uppercase;
    vertical-align: middle;
}

.brand-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.key-status-pill {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.95rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: var(--radius-full);
    color: #34d399;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.key-status-pill:hover {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--jade-glow);
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.icon-circle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.icon-circle-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.badge-ver {
    font-size: 0.7rem;
    padding: 0.15rem 0.55rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border-radius: var(--radius-full);
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    vertical-align: middle;
}

.nav-cards-wrapper {
    margin-bottom: 1.6rem;
    width: 100%;
}

.nav-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.85rem;
    width: 100%;
}

.nav-web-card {
    position: relative;
    background: linear-gradient(180deg, rgba(23, 32, 54, 0.75) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.95rem 1.05rem;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    user-select: none;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.nav-web-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    background: linear-gradient(180deg, rgba(28, 40, 68, 0.85) 0%, rgba(18, 27, 48, 0.95) 100%);
}

.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.card-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.nav-web-card:hover .card-icon-box {
    transform: scale(1.08);
}

.icon-trans {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.icon-ruby {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.icon-hanzi {
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.icon-tutor {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.12);
    border: 1px solid rgba(192, 132, 252, 0.25);
}

.icon-hsk {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.card-badges {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.card-pill-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

.tag-trans {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.tag-ruby {
    background: rgba(56, 189, 248, 0.16);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.tag-hanzi {
    background: rgba(52, 211, 153, 0.16);
    color: #6ee7b7;
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.tag-tutor {
    background: rgba(192, 132, 252, 0.16);
    color: #d8b4fe;
    border: 1px solid rgba(192, 132, 252, 0.35);
}

.tag-hsk {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.45);
    font-weight: 800;
}

.card-popout-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    text-decoration: none;
    transition: all 0.18s ease;
}

.card-popout-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.12);
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.01em;
    margin: 0;
}

.card-desc {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.35;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-glow-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: all 0.22s ease;
}

.nav-web-card.active {
    background: linear-gradient(180deg, rgba(32, 44, 74, 0.95) 0%, rgba(17, 24, 39, 0.98) 100%);
    transform: translateY(-2px);
}

.nav-web-card[data-tab="tab-translate"].active {
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.22);
}
.nav-web-card[data-tab="tab-translate"].active .card-glow-indicator {
    background: #ef4444;
}

.nav-web-card[data-tab="tab-ruby"].active {
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.22);
}
.nav-web-card[data-tab="tab-ruby"].active .card-glow-indicator {
    background: #38bdf8;
}

.nav-web-card[data-tab="tab-hanzi"].active {
    border-color: rgba(52, 211, 153, 0.55);
    box-shadow: 0 6px 20px rgba(52, 211, 153, 0.22);
}
.nav-web-card[data-tab="tab-hanzi"].active .card-glow-indicator {
    background: #34d399;
}

.nav-web-card[data-tab="tab-tutor"].active {
    border-color: rgba(192, 132, 252, 0.55);
    box-shadow: 0 6px 20px rgba(192, 132, 252, 0.22);
}
.nav-web-card[data-tab="tab-tutor"].active .card-glow-indicator {
    background: #c084fc;
}

.nav-web-card[data-tab="tab-notebook"].active {
    border-color: rgba(245, 158, 11, 0.55);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.22);
}
.nav-web-card[data-tab="tab-notebook"].active .card-glow-indicator {
    background: #f59e0b;
}

.nav-web-card.active .card-title {
    color: #fff;
}

.nav-web-card.active .card-desc {
    color: #cbd5e1;
}

.nav-web-card.active .card-icon-box {
    transform: scale(1.08);
}

html.light .nav-web-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.9) 100%);
    border-color: rgba(0, 0, 0, 0.08);
}

html.light .nav-web-card:hover {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.16);
}

html.light .card-title {
    color: #0f172a;
}

html.light .nav-web-card.active {
    background: #fff;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transition: var(--transition-normal);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.translator-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-panel {
    padding: 1.25rem 1.5rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.lang-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.control-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    font-weight: 500;
}

.select-wrapper {
    position: relative;
}

.custom-select {
    appearance: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.5rem 2rem 0.5rem 0.85rem;
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: var(--transition-fast);
}

.custom-select:focus {
    border-color: var(--cinnabar);
}

.btn-swap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-top: 1rem;
    transition: var(--transition-fast);
}

.btn-swap:hover {
    color: var(--cinnabar);
    border-color: var(--border-hover);
    transform: rotate(180deg);
}

.mode-pills {
    display: flex;
    gap: 0.4rem;
}

.mode-pill {
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.mode-pill:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.mode-pill.active {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--cinnabar);
    color: #fca5a5;
}

.source-textarea {
    width: 100%;
    min-height: 120px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.12rem;
    line-height: 1.7;
    outline: none;
    resize: vertical;
    font-family: var(--font-latin);
}

.source-textarea::placeholder {
    color: var(--text-muted);
}

.quick-chips {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-color);
}

.chip-label {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 600;
}

.chip-btn {
    padding: 0.25rem 0.65rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.74rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.chip-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.char-count {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.action-btn.recording {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--cinnabar);
    color: var(--cinnabar);
    animation: pulse 1.2s infinite;
}

.btn-primary-glow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.6rem;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 18px var(--cinnabar-glow);
    transition: var(--transition-normal);
}

.btn-primary-glow:hover {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 24px rgba(239, 68, 68, 0.4);
}

.btn-primary-glow:active {
    transform: translateY(0);
}

.result-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-result-card {
    padding: 1.75rem;
    background: linear-gradient(180deg, rgba(23, 30, 48, 0.95) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 1px solid rgba(239, 68, 68, 0.25);
    position: relative;
    overflow: hidden;
}

.hero-result-card::after {
    content: "智";
    position: absolute;
    right: 1.5rem;
    bottom: -1rem;
    font-family: var(--font-seal);
    font-size: 14rem;
    color: rgba(255, 255, 255, 0.02);
    pointer-events: none;
    line-height: 1;
}

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.hero-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.22rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1.2;
}

.hsk-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 2px 8px var(--imperial-gold-glow);
    white-space: nowrap;
    flex-shrink: 0;
}

.model-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.latency-badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.latency-badge.instant {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.35));
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.4);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.25);
    font-weight: 700;
}

.latency-badge.fast {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.35);
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.15);
    font-weight: 600;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.speed-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 2px;
    border: 1px solid var(--border-color);
}

.speed-btn {
    padding: 0.2rem 0.55rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.speed-btn.active {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.btn-audio-hero {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 1rem;
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-full);
    color: #fca5a5;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-audio-hero:hover {
    background: var(--cinnabar);
    color: #fff;
    transform: scale(1.03);
}

.icon-btn-round {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.icon-btn-round:hover {
    color: var(--cinnabar);
    border-color: var(--cinnabar);
    transform: translateY(-1px);
}

.hanzi-display-wrap {
    margin-bottom: 1.25rem;
}

.main-hanzi {
    font-family: var(--font-hanzi);
    font-size: 2.3rem;
    line-height: 1.4;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.traditional-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.traditional-text {
    font-family: var(--font-hanzi);
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.linguistic-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.linguistic-item {
    background: rgba(0, 0, 0, 0.25);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.item-title {
    display: block;
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.pinyin-text-box {
    font-family: var(--font-latin);
    font-size: 1.18rem;
    font-weight: 600;
    color: #fde047;
    letter-spacing: 0.02em;
}

.hanviet-text-box {
    font-size: 1.05rem;
    font-weight: 600;
    color: #38bdf8;
    letter-spacing: 0.01em;
}

.vietnamese-translation-box {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--cinnabar);
    padding: 0.85rem 1.15rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 1rem;
}

.vn-label {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
    margin-bottom: 0.2rem;
}

.vn-content {
    font-size: 1.08rem;
    color: var(--text-primary);
    font-weight: 500;
}

.culture-note-box {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: #cbd5e1;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 0.65rem 0.95rem;
    border-radius: var(--radius-sm);
}

.culture-note-box i {
    color: var(--imperial-gold);
    margin-top: 0.2rem;
}

.analysis-section {
    padding: 1.5rem;
}

.section-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.section-title-bar h3 {
    font-size: 1.12rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subtitle-hint {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
}

.word-card {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-fast);
    position: relative;
}

.word-card:hover {
    border-color: rgba(239, 68, 68, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.word-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.word-hanzi {
    font-family: var(--font-hanzi);
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: var(--transition-fast);
}

.word-hanzi:hover {
    color: var(--cinnabar);
}

.word-actions {
    display: flex;
    gap: 0.3rem;
}

.btn-word-mini {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition-fast);
}

.btn-word-mini:hover {
    background: var(--cinnabar);
    color: #fff;
}

.btn-word-mini.saved {
    color: #f59e0b;
}

.word-pinyin {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fde047;
    margin-bottom: 0.2rem;
}

.word-hanviet {
    font-size: 0.78rem;
    color: #38bdf8;
    margin-bottom: 0.4rem;
}

.word-meaning {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.word-type-tag {
    align-self: flex-start;
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--text-muted);
}

.grammar-list, .examples-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.grammar-item {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--jade);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0.95rem 1.15rem;
}

.grammar-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #34d399;
    margin-bottom: 0.35rem;
}

.grammar-exp {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.example-item {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.15rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.ex-hanzi {
    font-family: var(--font-hanzi);
    font-size: 1.15rem;
    color: #fff;
    margin-bottom: 0.15rem;
}

.ex-pinyin {
    font-size: 0.82rem;
    color: #fde047;
    margin-bottom: 0.15rem;
}

.ex-vn {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.empty-state {
    padding: 3.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.seal-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-seal);
    font-size: 22rem;
    color: rgba(255, 255, 255, 0.02);
    pointer-events: none;
    user-select: none;
}

.empty-icon-ring {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--cinnabar);
}

.empty-content h2 {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.empty-content p {
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0 auto 2rem;
    font-size: 0.95rem;
}

.feature-badges-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.feat-badge {
    padding: 0.4rem 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.feat-badge i {
    color: var(--jade);
    margin-right: 0.35rem;
}

.ruby-reader-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.reader-heading h2 {
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
}

.reader-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.reader-toggle {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    cursor: pointer;
    user-select: none;
}

.ruby-input {
    min-height: 100px;
    font-family: var(--font-hanzi);
    font-size: 1.18rem;
}

.ruby-display-card {
    padding: 1.75rem;
}

.ruby-display-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.ruby-rendered-content {
    font-size: 1.85rem;
    line-height: 2.8;
    color: #fff;
    font-family: var(--font-hanzi);
    letter-spacing: 0.04em;
    margin-bottom: 1.75rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

ruby {
    ruby-position: over;
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 0 2px;
    border-radius: 4px;
}

ruby:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

rt {
    font-family: var(--font-latin);
    font-size: 0.95rem;
    font-weight: 600;
    color: #fde047;
    letter-spacing: 0.02em;
    user-select: none;
}

.ruby-translation-box {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid #38bdf8;
    padding: 1rem 1.25rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.box-title {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.hanzi-explorer-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hanzi-search-panel {
    padding: 1.5rem;
}

.hanzi-search-bar {
    display: flex;
    gap: 0.75rem;
    max-width: 500px;
    margin: 1.25rem 0 1rem;
}

.hanzi-input-box {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 0.65rem 1rem;
    font-size: 1.2rem;
    outline: none;
    font-family: var(--font-hanzi);
}

.popular-hanzi-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hanzi-quick-chip {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: #fff;
    font-family: var(--font-hanzi);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.hanzi-quick-chip:hover {
    background: var(--cinnabar);
    border-color: var(--cinnabar);
    transform: scale(1.1);
}

.hanzi-details-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .hanzi-details-grid {
        grid-template-columns: 1fr;
    }
}

.tianzige-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tianzige-box {
    width: 210px;
    height: 210px;
    background: rgba(239, 68, 68, 0.04);
    border: 3px solid rgba(239, 68, 68, 0.6);
    border-radius: 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
}

.tianzige-grid {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tianzige-grid::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(to right, transparent 49.5%, rgba(239, 68, 68, 0.25) 50%, transparent 50.5%),
        linear-gradient(to bottom, transparent 49.5%, rgba(239, 68, 68, 0.25) 50%, transparent 50.5%),
        linear-gradient(45deg, transparent 49.5%, rgba(239, 68, 68, 0.15) 50%, transparent 50.5%),
        linear-gradient(-45deg, transparent 49.5%, rgba(239, 68, 68, 0.15) 50%, transparent 50.5%);
    pointer-events: none;
}

.tianzige-character {
    font-family: var(--font-hanzi);
    font-size: 8.5rem;
    color: #fff;
    line-height: 1;
    z-index: 2;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

.tianzige-controls {
    display: flex;
    gap: 0.65rem;
    width: 100%;
}

.btn-secondary-sm {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-secondary-sm:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.hanzi-info-card {
    padding: 1.75rem;
}

.hanzi-head-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

.hanzi-title-pinyin {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fde047;
}

.hanzi-title-hanviet {
    font-size: 1.1rem;
    color: #38bdf8;
    font-weight: 600;
}

.stats-pills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.stat-pill {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
}

.stat-lbl {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.stat-val {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.hanzi-meaning-block {
    margin-bottom: 1.25rem;
}

.hanzi-meaning-block h4, .compound-words-block h4 {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.compound-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.compound-tag {
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.tutor-chat-layout {
    display: flex;
    flex-direction: column;
    height: 640px;
    overflow: hidden;
}

.tutor-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.tutor-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #047857);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px var(--jade-glow);
}

.avatar-seal {
    font-family: var(--font-seal);
    font-size: 1.5rem;
    color: #fff;
}

.tutor-info {
    flex: 1;
}

.tutor-info h3 {
    font-size: 1rem;
    color: #fff;
}

.status-online {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.74rem;
    color: #34d399;
}

.dot-online {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-bubble {
    max-width: 82%;
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.6;
}

.tutor-bubble {
    align-self: flex-start;
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid var(--border-color);
    border-top-left-radius: 4px;
}

.user-bubble {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(239, 68, 68, 0.15));
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fff;
    border-top-right-radius: 4px;
}

.bubble-sender {
    font-size: 0.72rem;
    color: var(--cinnabar);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.chat-quick-prompts {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 1.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid var(--border-color);
}

.chat-prompt-chip {
    padding: 0.3rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.74rem;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.chat-prompt-chip:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.25);
}

.chat-textarea {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    outline: none;
    resize: none;
    font-family: var(--font-latin);
}

.chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--cinnabar);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.chat-send-btn:hover {
    background: var(--cinnabar-hover);
    transform: scale(1.05);
}

.notebook-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.notebook-toolbar {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.toolbar-title h2 {
    font-size: 1.25rem;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.custom-input-sm {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    outline: none;
}

.btn-danger-sm {
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    cursor: pointer;
    font-size: 0.82rem;
    transition: var(--transition-fast);
}

.btn-danger-sm:hover {
    background: var(--cinnabar);
    color: #fff;
}

.flashcard-view {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, rgba(20, 27, 45, 0.95), rgba(11, 15, 25, 0.9));
}

.flashcard-nav-bar {
    width: 100%;
    max-width: 440px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.flashcard-progress {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--imperial-gold);
}

.flashcard-box {
    width: 100%;
    max-width: 440px;
    height: 270px;
    perspective: 1000px;
    cursor: pointer;
    margin-bottom: 1.5rem;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flashcard-box.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.flashcard-front {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95), rgba(17, 24, 39, 0.9));
    border-color: rgba(239, 68, 68, 0.35);
}

.fc-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.fc-hanzi {
    font-family: var(--font-hanzi);
    font-size: 4.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
}

.fc-audio-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    cursor: pointer;
    transition: var(--transition-fast);
}

.fc-audio-btn:hover {
    background: var(--cinnabar);
    color: #fff;
    transform: scale(1.1);
}

.flashcard-back {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
    border-color: rgba(16, 185, 129, 0.4);
    transform: rotateY(180deg);
}

.fc-pinyin {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fde047;
    margin-bottom: 0.3rem;
}

.fc-hanviet {
    font-size: 1rem;
    color: #38bdf8;
    margin-bottom: 0.6rem;
}

.fc-meaning {
    font-size: 1.15rem;
    color: #fff;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.fc-example {
    font-size: 0.82rem;
    color: #cbd5e1;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.85rem;
    max-width: 90%;
    text-align: center;
    line-height: 1.4;
    border-left: 2px solid var(--jade);
}

.flashcard-controls {
    display: flex;
    gap: 0.75rem;
}

.vocab-table-card {
    padding: 1.5rem;
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.vocab-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    table-layout: auto;
}

.vocab-table th {
    padding: 0.85rem 1rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: rgba(255, 255, 255, 0.02);
    white-space: nowrap;
}

.vocab-table tbody tr {
    transition: var(--transition-fast);
}

.vocab-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.vocab-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
    vertical-align: middle;
}

.table-hanzi {
    font-family: var(--font-hanzi);
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.table-hanzi:hover {
    color: #fde047;
    transform: scale(1.05);
}

.table-pinyin {
    color: #fde047;
    font-weight: 600;
    white-space: nowrap;
}

.table-hanviet {
    color: #38bdf8;
    font-style: italic;
    white-space: nowrap;
}

.table-meaning {
    font-size: 0.92rem;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 0.2rem;
}

.table-sub-ex {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.table-center-col {
    text-align: center;
    white-space: nowrap;
}

.vocab-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-page {
    padding: 0.45rem 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-page:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.btn-page:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.page-current-pill {
    padding: 0.42rem 0.95rem;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-sm);
    color: #fbbf24;
    font-size: 0.82rem;
    font-weight: 700;
}

.page-jump-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.22rem 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.page-jump-input {
    width: 58px;
    padding: 0.25rem 0.4rem;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    color: #fff;
    font-size: 0.84rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: var(--transition-fast);
}

.page-jump-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.btn-page-jump {
    padding: 0.25rem 0.65rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0b0f19;
    font-weight: 800;
    font-size: 0.78rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-page-jump:hover {
    background: #fbbf24;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.no-data-msg {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.no-data-msg i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--border-color);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-overlay.hidden {
    display: none;
}

.modal-card {
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0f172a;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.modal-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.modal-body {
    padding: 1.5rem 1.75rem;
    overflow-y: auto;
}

.pool-overview-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.ov-lbl {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.ov-val {
    font-size: 0.95rem;
    color: #fff;
}

.highlight-model {
    color: #34d399;
}

.keys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.key-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

.key-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.key-card.status-healthy {
    border-left: 4px solid #10b981;
}

.key-card.status-rate-limited {
    border-left: 4px solid #f59e0b;
}

.key-card.status-daily-exhausted {
    border-left: 4px solid #64748b;
    opacity: 0.65;
}

.key-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.key-num {
    font-weight: 700;
    font-size: 0.88rem;
    color: #fff;
}

.key-status-badge {
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.key-token-masked {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
}

.key-stats-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.74rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.main-footer {
    margin-top: auto;
    padding: 2rem 0 1rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.separator {
    margin: 0 0.5rem;
    opacity: 0.4;
}

.hidden {
    display: none !important;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.75rem 1.25rem;
    background: #1e293b;
    border: 1px solid var(--border-color);
    color: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    font-size: 0.88rem;
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.hsk-category-bar {
    padding: 1.4rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    background: linear-gradient(180deg, rgba(24, 30, 48, 0.9) 0%, rgba(15, 20, 32, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.hsk-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.hsk-cat-title-group {
    display: flex;
    align-items: center;
    gap: 0.95rem;
}

.hsk-header-icon-seal {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

.hsk-main-title {
    font-size: 1.22rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
}

.hsk-sub-title {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-total {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.74rem;
}

.hsk-segmented-control {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    padding: 0.3rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.1);
    gap: 0.3rem;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.seg-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1.05rem;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s ease;
    white-space: nowrap;
}

.seg-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.seg-btn.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.seg-badge {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 0.68rem;
    padding: 0.12rem 0.45rem;
    border-radius: var(--radius-full);
    font-weight: 800;
    letter-spacing: 0.02em;
}

.hsk-cat-pills {
    display: flex;
    gap: 0.55rem;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}

.hsk-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.52rem 1.1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hsk-cat-pill:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.18);
}

.lvl-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
}

.pill-lvl-1 .lvl-dot { background: #34d399; color: #34d399; }
.pill-lvl-2 .lvl-dot { background: #10b981; color: #10b981; }
.pill-lvl-3 .lvl-dot { background: #38bdf8; color: #38bdf8; }
.pill-lvl-4 .lvl-dot { background: #60a5fa; color: #60a5fa; }
.pill-lvl-5 .lvl-dot { background: #f59e0b; color: #f59e0b; }
.pill-lvl-6 .lvl-dot { background: #ef4444; color: #ef4444; }
.pill-lvl-7 .lvl-dot { background: #c084fc; color: #c084fc; }

.pill-count {
    font-size: 0.72rem;
    padding: 0.12rem 0.52rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-weight: 700;
}

.highlight-count {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.hsk-cat-pill.active {
    color: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.hsk-cat-pill.active .pill-count {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.pill-my-vocab.active {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.55);
    color: #fde047;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
}

.pill-all.active {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.55);
    color: #93c5fd;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
}

.pill-lvl-1.active {
    background: rgba(52, 211, 153, 0.18);
    border-color: rgba(52, 211, 153, 0.55);
    color: #6ee7b7;
    box-shadow: 0 4px 16px rgba(52, 211, 153, 0.25);
}

.pill-lvl-2.active {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.55);
    color: #34d399;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

.pill-lvl-3.active {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.55);
    color: #7dd3fc;
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25);
}

.pill-lvl-4.active {
    background: rgba(96, 165, 250, 0.18);
    border-color: rgba(96, 165, 250, 0.55);
    color: #93c5fd;
    box-shadow: 0 4px 16px rgba(96, 165, 250, 0.25);
}

.pill-lvl-5.active {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.55);
    color: #fde047;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
}

.pill-lvl-6.active {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.28), rgba(220, 38, 38, 0.18));
    border-color: rgba(239, 68, 68, 0.7);
    color: #fca5a5;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.pill-lvl-7.active {
    background: rgba(192, 132, 252, 0.18);
    border-color: rgba(192, 132, 252, 0.6);
    color: #d8b4fe;
    box-shadow: 0 4px 18px rgba(192, 132, 252, 0.3);
}

.hsk-stat-hud {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.hud-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.hud-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.16);
}

.hud-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.hud-icon.icon-lvl {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.hud-icon.icon-words {
    background: rgba(56, 189, 248, 0.14);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.hud-icon.icon-pages {
    background: rgba(192, 132, 252, 0.14);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.3);
}

.hud-icon.icon-star {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.hud-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hud-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.1rem;
}

.hud-value {
    font-size: 0.95rem;
    color: #fff;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-example {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 320px;
}

.table-example strong {
    color: #cbd5e1;
    font-family: var(--font-hanzi);
}

@media (max-width: 1100px) {
    .nav-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .hsk-stat-hud {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .app-container {
        padding: 0.75rem;
    }
    .main-hanzi {
        font-size: 1.8rem;
    }
    .words-grid {
        grid-template-columns: 1fr;
    }
    .nav-cards-grid {
        grid-template-columns: 1fr;
    }
    .hsk-stat-hud {
        grid-template-columns: 1fr;
    }
    .hsk-cat-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }
    .hsk-segmented-control {
        width: 100%;
        display: flex;
    }
    .seg-btn {
        flex: 1;
        justify-content: center;
    }
    .vocab-pagination-bar {
        flex-direction: column;
        align-items: center;
        gap: 0.85rem;
    }
    .pagination-controls {
        justify-content: center;
    }
    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}