/* ============================================================
   LearnEnglish 鈥?Design System & Global Styles
   Premium Dark Theme with Glassmorphism
   ============================================================ */

/* --- CSS Variables --- */
:root {
    /* Colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --border-glass: rgba(255, 255, 255, 0.1);
    --border-glass-hover: rgba(255, 255, 255, 0.18);
    --text-primary: #f0f4ff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #6C63FF;
    --accent-primary-glow: rgba(108, 99, 255, 0.3);
    --accent-secondary: #818cf8;
    --accent-green: #43e97b;
    --accent-green-glow: rgba(67, 233, 123, 0.3);
    --accent-red: #ff6584;
    --accent-red-glow: rgba(255, 101, 132, 0.3);
    --accent-orange: #f7971e;
    --accent-yellow: #fee140;
    --accent-cyan: #00d2ff;
    --gradient-primary: linear-gradient(135deg, #6C63FF 0%, #818cf8 100%);
    --gradient-success: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --gradient-danger: linear-gradient(135deg, #ff6584 0%, #ff8fab 100%);
    --gradient-warm: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-primary-glow);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-xs: 0.75rem;
    --font-sm: 0.875rem;
    --font-base: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.25rem;
    --font-2xl: 1.5rem;
    --font-3xl: 2rem;
    --font-4xl: 2.5rem;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 60px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* --- Light Theme Variables --- */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(0, 0, 0, 0.03);
    --bg-glass-hover: rgba(0, 0, 0, 0.06);
    --border-glass: rgba(0, 0, 0, 0.1);
    --border-glass-hover: rgba(0, 0, 0, 0.2);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --accent-primary-glow: rgba(108, 99, 255, 0.15);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a { color: var(--accent-secondary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-primary); }

img { max-width: 100%; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* --- Utilities --- */
.hidden { display: none !important; }
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
}
.glass:hover {
    border-color: var(--border-glass-hover);
}

/* --- Views --- */
.view { display: none; min-height: 100vh; }
.view.active { display: flex; }

/* ============================================================
   AUTH PAGE
   ============================================================ */
#auth-view {
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
}

.auth-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: orbFloat 20s ease-in-out infinite;
}
.auth-orb-1 {
    width: 400px; height: 400px;
    background: var(--accent-primary);
    top: -10%; left: -5%;
    animation-delay: 0s;
}
.auth-orb-2 {
    width: 350px; height: 350px;
    background: var(--accent-green);
    bottom: -15%; right: -5%;
    animation-delay: -7s;
}
.auth-orb-3 {
    width: 300px; height: 300px;
    background: var(--accent-red);
    top: 50%; left: 60%;
    animation-delay: -14s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -30px) scale(1.1); }
    50% { transform: translate(-30px, 50px) scale(0.95); }
    75% { transform: translate(40px, 20px) scale(1.05); }
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: var(--space-lg);
}

.auth-card {
    padding: var(--space-2xl);
    animation: fadeInUp 0.6s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.logo-glow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-xl);
    background: var(--gradient-primary);
    box-shadow: var(--shadow-glow);
    margin-bottom: var(--space-md);
    animation: pulse 3s ease-in-out infinite;
}

.logo-icon {
    font-size: 36px;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px var(--accent-primary-glow); }
    50% { box-shadow: 0 0 40px var(--accent-primary-glow), 0 0 60px rgba(108, 99, 255, 0.15); }
}

.auth-header h1 {
    font-size: var(--font-3xl);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    margin-top: var(--space-xs);
}

/* Form Elements */
.auth-form { display: flex; flex-direction: column; gap: var(--space-md); }

.form-group { display: flex; flex-direction: column; gap: var(--space-xs); }
.form-group label {
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 16px;
    z-index: 1;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 44px 12px 42px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-base);
    font-family: var(--font-family);
    transition: all var(--transition-base);
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
    background: rgba(255, 255, 255, 0.08);
}

.input-wrapper input::placeholder { color: var(--text-muted); }

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}
.toggle-password:hover { opacity: 1; }

/* Password Strength */
.password-strength {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-xs);
}
.strength-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.strength-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-base), background var(--transition-base);
    width: 0%;
}
.strength-text {
    font-size: var(--font-xs);
    color: var(--text-muted);
    min-width: 50px;
}

/* Checkbox */
.checkbox-group { flex-direction: row !important; }
.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-sm) !important;
    color: var(--text-secondary) !important;
    cursor: pointer;
    line-height: 1.4;
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px var(--accent-primary-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-primary-glow);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.12);
    border-color: var(--border-glass-hover);
}

.btn-accent {
    background: var(--gradient-success);
    color: #0a0e1a;
    font-weight: 700;
}
.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-green-glow);
}

/* 绂佺敤鐘舵€?- 浣跨敤绫昏€屼笉鏄?disabled 灞炴€?*/
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: auto !important;
}
.btn.disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-full { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: var(--font-lg); }
.btn-sm { padding: 8px 16px; font-size: var(--font-sm); }
.btn-xs { padding: 4px 10px; font-size: 12px; }

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
    color: var(--text-secondary);
}
.btn-icon:hover {
    background: rgba(255,255,255,0.08);
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-switch {
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--font-sm);
    margin-top: var(--space-sm);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
#main-view {
    display: none;
    flex-direction: row;
    min-height: 100vh;
    background: var(--bg-primary);
}
#main-view.active { display: flex; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    z-index: 100;
    border-radius: 0;
    border-right: 1px solid var(--border-glass);
    border-left: none;
    border-top: none;
    border-bottom: none;
    transition: transform var(--transition-slow);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: var(--space-lg);
}
.sidebar-logo { font-size: 28px; }
.sidebar-title {
    font-size: var(--font-xl);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-list { list-style: none; flex: 1; display: flex; flex-direction: column; gap: var(--space-xs); }

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 12px var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-weight: 500;
}
.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
}
.nav-item.active {
    background: var(--accent-primary-glow);
    color: var(--accent-secondary);
    font-weight: 600;
}
.nav-icon { font-size: 20px; width: 24px; text-align: center; }

.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-glass);
}
.user-brief { display: flex; align-items: center; gap: var(--space-sm); }
.user-avatar {
    width: 36px; height: 36px;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: var(--font-sm);
    color: white;
}
.user-name { font-size: var(--font-sm); color: var(--text-secondary); }

/* Mobile header */
.hidden {
    display: none !important;
}
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(10, 14, 26, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-md);
    z-index: 200;
}
.mobile-title {
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Content Area */
.content-area {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: var(--space-2xl);
    min-height: 100vh;
}

.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }

.page-header {
    margin-bottom: var(--space-xl);
}
.page-header h2 {
    font-size: var(--font-3xl);
    font-weight: 800;
    letter-spacing: -0.5px;
}
.page-desc {
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    padding: var(--space-lg);
    text-align: center;
    transition: all var(--transition-base);
    cursor: default;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.stat-icon { font-size: 32px; margin-bottom: var(--space-sm); }
.stat-value {
    font-size: var(--font-3xl);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label { color: var(--text-secondary); font-size: var(--font-sm); margin-top: var(--space-xs); }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-lg);
}

.chart-card {
    padding: var(--space-lg);
}
.chart-card h3 {
    font-size: var(--font-lg);
    margin-bottom: var(--space-md);
    font-weight: 600;
}

.today-card {
    padding: var(--space-lg);
}
.today-card h3 {
    font-size: var(--font-lg);
    margin-bottom: var(--space-md);
    font-weight: 600;
}

.task-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: var(--space-sm);
    background: rgba(255,255,255,0.03);
}
.task-item:hover {
    background: rgba(255,255,255,0.08);
    transform: translateX(4px);
}
.task-icon { font-size: 24px; }
.task-info { flex: 1; }
.task-name { font-weight: 600; display: block; }
.task-desc { font-size: var(--font-sm); color: var(--text-secondary); }
.task-arrow { font-size: 18px; color: var(--text-muted); }

.progress-overview { margin-top: var(--space-lg); }
.progress-overview h4 { font-size: var(--font-sm); color: var(--text-secondary); margin-bottom: var(--space-sm); }
.progress-bar-container { display: flex; align-items: center; gap: var(--space-md); }
.progress-bar {
    flex: 1; height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
}
[data-theme="light"] .progress-bar { background: rgba(0,0,0,0.08); }
.progress-fill {
    height: 100%;
    background: var(--gradient-success);
    border-radius: var(--radius-full);
    transition: width 1s ease;
}
.progress-text { font-size: var(--font-sm); color: var(--text-secondary); min-width: 60px; }

/* Heatmap */
.heatmap-wrapper { overflow-x: auto; padding-bottom: 8px; }
.heatmap-container { display: flex; gap: 4px; min-width: max-content; }
.heatmap-col { display: flex; flex-direction: column; gap: 4px; }
.heatmap-cell {
    width: 12px; height: 12px;
    border-radius: 2px;
    background: rgba(255,255,255,0.05);
    transition: all var(--transition-fast);
}
[data-theme="light"] .heatmap-cell { background: rgba(0,0,0,0.05); }
.heatmap-cell:hover { opacity: 0.8; transform: scale(1.2); }
.heatmap-cell[data-level="1"] { background: #9be9a8; }
.heatmap-cell[data-level="2"] { background: #40c463; }
.heatmap-cell[data-level="3"] { background: #30a14e; }
.heatmap-cell[data-level="4"] { background: #216e39; }

/* ============================================================
   FLASHCARDS
   ============================================================ */
.flashcard-container {
    max-width: 640px;
    margin: 0 auto;
}

.flashcard-progress {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}
.fc-progress-bar {
    flex: 1; height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.fc-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}
.fc-progress-text { font-size: var(--font-sm); color: var(--text-secondary); }

.fc-empty {
    text-align: center;
    padding: var(--space-2xl);
}
.fc-empty-icon { font-size: 64px; margin-bottom: var(--space-md); }
.fc-empty h3 { font-size: var(--font-2xl); margin-bottom: var(--space-sm); }
.fc-empty p { color: var(--text-secondary); margin-bottom: var(--space-lg); }

.flashcard {
    perspective: 1000px;
}

.fc-card {
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    min-height: 480px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all var(--transition-slow);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    animation: cardSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cardSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.fc-front, .fc-back {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-md);
}

.fc-category {
    display: inline-block;
    padding: 4px 14px;
    background: var(--accent-primary-glow);
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    color: var(--accent-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.fc-word {
    font-size: var(--font-3xl); /* Slightly smaller for sentences */
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    max-width: 90%;
    margin: 0 auto;
}

.fc-sentence-cn {
    font-size: var(--font-lg);
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 85%;
    margin: 12px auto 0 auto;
    font-weight: 400;
}

.cloze-blank {
    display: inline-block;
    min-width: 80px;
    border-bottom: 3px solid var(--accent-primary);
    padding: 0 8px;
    margin: 0 4px;
    color: var(--accent-primary);
    text-shadow: 0 0 10px var(--accent-primary-glow);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; border-color: var(--accent-secondary); }
    100% { opacity: 0.8; }
}

.fc-phonetic {
    font-size: var(--font-lg);
    color: var(--text-muted);
    font-style: italic;
}

.fc-hint {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: rgba(108, 99, 255, 0.08);
    border-radius: var(--radius-md);
    border: 1px solid rgba(108, 99, 255, 0.15);
    width: 100%;
    margin-top: var(--space-sm);
}
.hint-label {
    font-size: var(--font-xs);
    color: var(--accent-secondary);
    font-weight: 600;
}
.hint-text {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

.fc-guess-area {
    margin-top: var(--space-lg);
    width: 100%;
}
.fc-guess-prompt {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    font-size: var(--font-sm);
}
.fc-guess-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-base);
    font-family: var(--font-family);
    outline: none;
    transition: all var(--transition-base);
    margin-bottom: var(--space-sm);
}
.fc-guess-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}
.fc-guess-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}
.fc-timer {
    font-size: var(--font-sm);
    color: var(--accent-orange);
    font-weight: 600;
    min-width: 80px;
}
.fc-guess-feedback {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
    margin-bottom: var(--space-sm);
    background: rgba(67, 233, 123, 0.1);
    color: var(--accent-green);
    text-align: center;
}
.fc-guess-compare {
    width: 100%;
    padding: var(--space-md);
    background: rgba(108, 99, 255, 0.08);
    border: 1px solid rgba(108, 99, 255, 0.15);
    border-radius: var(--radius-md);
    text-align: center;
    margin-bottom: var(--space-md);
}
.guess-result {
    font-size: 36px;
    margin-bottom: var(--space-xs);
}
.guess-result-text {
    font-size: var(--font-sm);
    color: var(--text-secondary);
}
.guess-result-text span {
    font-weight: 600;
    color: var(--accent-secondary);
}

/* Card Back (revealed) */
.fc-definition {
    width: 100%;
    padding: var(--space-lg);
    background: rgba(67, 233, 123, 0.06);
    border: 1px solid rgba(67, 233, 123, 0.15);
    border-radius: var(--radius-md);
}
.fc-def-cn {
    font-size: var(--font-xl);
    font-weight: 600;
    color: var(--accent-green);
    margin-bottom: var(--space-sm);
}

.reveal-sentence {
    font-size: var(--font-2xl);
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.reveal-sentence strong {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 6px;
}

.reveal-divider {
    height: 1px;
    width: 60px;
    background: var(--accent-green);
    margin: var(--space-md) auto;
    opacity: 0.3;
}

.fc-def-en {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    font-style: italic;
}

.fc-example {
    width: 100%;
    padding: var(--space-md);
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-md);
    text-align: left;
}
.fc-example-en {
    font-size: var(--font-base);
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    line-height: 1.6;
}
.fc-example-cn {
    font-size: var(--font-sm);
    color: var(--text-muted);
}

.fc-rating { width: 100%; margin-top: var(--space-md); }
.fc-rating-prompt {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    margin-bottom: var(--space-md);
}
.fc-rating-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}
.btn-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--text-primary);
    font-family: var(--font-family);
}
.btn-rating:hover { transform: translateY(-3px); }
.btn-hard:hover {
    border-color: var(--accent-red);
    background: rgba(255, 101, 132, 0.1);
    box-shadow: 0 4px 15px var(--accent-red-glow);
}
.btn-good:hover {
    border-color: var(--accent-primary);
    background: rgba(108, 99, 255, 0.1);
    box-shadow: 0 4px 15px var(--accent-primary-glow);
}
.btn-easy:hover {
    border-color: var(--accent-green);
    background: rgba(67, 233, 123, 0.1);
    box-shadow: 0 4px 15px var(--accent-green-glow);
}
.rating-emoji { font-size: 28px; }
.rating-label { font-weight: 600; font-size: var(--font-sm); }
.rating-interval { font-size: var(--font-xs); color: var(--text-muted); }

/* ============================================================
   AI CHAT
   ============================================================ */
.chat-layout {
    display: flex;
    gap: var(--space-lg);
    height: calc(100vh - 140px);
}

.chat-sidebar {
    width: 240px;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    flex-shrink: 0;
}
.chat-sidebar h3 { font-size: var(--font-lg); font-weight: 600; }

.scenario-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.scenario-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px var(--space-md);
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: var(--font-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}
.scenario-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.scenario-btn.active {
    background: var(--accent-primary-glow);
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
    font-weight: 600;
}

.chat-tips {
    padding: var(--space-md);
    font-size: var(--font-sm);
}
.chat-tips h4 { margin-bottom: var(--space-sm); font-size: var(--font-sm); }
.chat-tips ul { list-style: none; display: flex; flex-direction: column; gap: var(--space-xs); }
.chat-tips li { color: var(--text-secondary); padding-left: var(--space-md); position: relative; }
.chat-tips li::before { content: '路'; position: absolute; left: 0; color: var(--accent-primary); font-weight: bold; }

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.chat-welcome {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-secondary);
}
.welcome-icon { font-size: 48px; margin-bottom: var(--space-md); }
.chat-welcome h3 { font-size: var(--font-2xl); color: var(--text-primary); margin-bottom: var(--space-sm); }

.chat-bubble {
    max-width: 75%;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    font-size: var(--font-sm);
    line-height: 1.7;
    animation: bubbleIn 0.3s ease-out;
    word-wrap: break-word;
}
@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-bubble.user {
    align-self: flex-end;
    background: var(--gradient-primary);
    color: white;
    border-bottom-right-radius: var(--space-xs);
}
.chat-bubble.ai {
    align-self: flex-start;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    border-bottom-left-radius: var(--space-xs);
}

.chat-input-area {
    padding: var(--space-md);
    border-top: 1px solid var(--border-glass);
}
.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: var(--space-sm);
    transition: border-color var(--transition-base);
}
.chat-input-wrapper:focus-within {
    border-color: var(--accent-primary);
}

#chat-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--font-base);
    padding: var(--space-sm);
    resize: none;
    outline: none;
    max-height: 120px;
    line-height: 1.5;
}
#chat-input::placeholder { color: var(--text-muted); }

.btn-send {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.btn-send:hover { transform: scale(1.1); box-shadow: var(--shadow-glow); }

/* ============================================================
   PROFILE
   ============================================================ */
.profile-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--space-xl);
    max-width: 900px;
}

.profile-card {
    padding: var(--space-2xl);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    height: fit-content;
}

.profile-avatar-large {
    width: 80px; height: 80px;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--font-3xl); font-weight: 800;
    color: white;
}

.profile-email { color: var(--text-muted); font-size: var(--font-sm); }

.profile-badges { display: flex; gap: var(--space-sm); flex-wrap: wrap; justify-content: center; }
.badge {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 600;
    background: var(--accent-primary-glow);
    color: var(--accent-secondary);
}
.badge-streak { background: rgba(247, 151, 30, 0.2); color: var(--accent-orange); }

.profile-settings {
    padding: var(--space-xl);
}
.profile-settings h3 {
    font-size: var(--font-lg);
    margin-bottom: var(--space-md);
}
.profile-settings hr {
    border: none;
    border-top: 1px solid var(--border-glass);
    margin: var(--space-xl) 0;
}

.profile-settings input[type="text"],
.profile-settings input[type="password"],
.profile-settings input[type="time"] {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-base);
    font-family: var(--font-family);
    outline: none;
    transition: all var(--transition-base);
}
.profile-settings input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.profile-settings .form-group {
    margin-bottom: var(--space-md);
}
.profile-settings label {
    display: block;
    margin-bottom: var(--space-xs);
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

/* ============================================================
   ADMIN
   ============================================================ */
.admin-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    flex-wrap: wrap;
}
.admin-tab {
    padding: 8px 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: var(--font-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.admin-tab:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.admin-tab.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.admin-panel { display: none; animation: fadeIn 0.3s ease; margin-top: var(--space-xl); }
.admin-panel.active { display: block; }

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.admin-stat {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-sm);
}
.admin-stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}
.admin-stat-value { font-size: var(--font-3xl); font-weight: 800; color: var(--text-primary); }
.admin-stat-label { font-size: var(--font-sm); color: var(--text-secondary); }

.admin-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.admin-toolbar {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    align-items: center;
}
.admin-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--font-sm);
    outline: none;
    transition: border-color var(--transition-base);
}
.admin-search:focus { border-color: var(--accent-primary); }
.admin-search::placeholder { color: var(--text-muted); }

.admin-select {
    padding: 10px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--font-sm);
    outline: none;
    cursor: pointer;
}
.admin-select option { background: var(--bg-secondary); }

.admin-toolbar-actions {
    display: flex;
    gap: var(--space-sm);
    margin-left: auto;
}

/* Admin Table */
.admin-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    background: var(--bg-glass);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-sm);
}
.admin-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-glass);
    white-space: nowrap;
}
.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-primary);
}
.admin-table tr:hover td {
    background: rgba(255,255,255,0.03);
}
.admin-table .status-active { color: var(--accent-green); }
.admin-table .status-banned { color: var(--accent-red); }

.admin-pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}
.page-btn {
    padding: 6px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: var(--font-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.page-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.page-btn.active { background: var(--accent-primary); color: white; border-color: var(--accent-primary); }

/* Admin Settings */
.settings-section {
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
}
.settings-section h3 { font-size: var(--font-lg); margin-bottom: var(--space-lg); }

.config-item {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
    padding: var(--space-md);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    margin-bottom: var(--space-sm);
}
.config-item:last-child { border-bottom: none; }
.config-label {
    min-width: 180px;
    font-weight: 600;
    font-size: var(--font-sm);
    padding-top: var(--space-sm);
}
.config-desc {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: 2px;
}
.config-value {
    flex: 1;
}
.config-value textarea, .config-value input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--font-sm);
    outline: none;
    resize: vertical;
    transition: border-color var(--transition-base);
}
.config-value textarea:focus, .config-value input:focus { border-color: var(--accent-primary); }
.config-value textarea { min-height: 80px; }
.config-save {
    margin-top: var(--space-sm);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}
.modal {
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    padding: var(--space-xl);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}
.modal-header h3 { font-size: var(--font-xl); font-weight: 700; }
.modal-close { font-size: 16px; }
.modal-body .form-group { margin-bottom: var(--space-md); }
.modal-body label { display: block; margin-bottom: var(--space-xs); font-size: var(--font-sm); color: var(--text-secondary); }
.modal-body input, .modal-body textarea, .modal-body select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--font-sm);
    outline: none;
}
.modal-body textarea { min-height: 100px; resize: vertical; }
.modal-body input:focus, .modal-body textarea:focus { border-color: var(--accent-primary); }

/* ============================================================
   TOAST
   ============================================================ */
#toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    font-weight: 500;
    color: white;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
    animation: toastIn 0.3s ease-out;
    min-width: 250px;
    max-width: 400px;
}
.toast.success { background: rgba(67, 233, 123, 0.85); color: #0a0e1a; }
.toast.error { background: rgba(255, 101, 132, 0.85); }
.toast.info { background: rgba(108, 99, 255, 0.85); }
.toast.warning { background: rgba(255, 178, 107, 0.85); color: #0a0e1a; }
.toast.removing { animation: toastOut 0.3s ease-in forwards; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE 鈥?Tablet
   ============================================================ */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-charts-grid { grid-template-columns: 1fr; }
    .profile-layout { grid-template-columns: 1fr; }
    .chat-sidebar { display: none; }
}

/* ============================================================
   RESPONSIVE 鈥?Mobile
   ============================================================ */
.hidden-desktop { display: none !important; }

@media (max-width: 768px) {
    .hidden-desktop { display: flex !important; }

    :root { --sidebar-width: 0px; }

    .sidebar { 
        display: none !important; 
        width: 0 !important; 
        margin: 0 !important;
        position: absolute;
    }
    .sidebar-overlay { display: none !important; }
    
    #menu-toggle { display: none !important; }

    .mobile-header { 
        display: flex; 
        left: 0 !important;
        width: 100% !important;
    }

    /* 搴曢儴瀵艰埅鏍忚璁?*/
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 65px;
        background: var(--bg-secondary);
        border-top: 1px solid var(--border-glass);
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 1000 !important;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
        padding-bottom: env(safe-area-inset-bottom);
        pointer-events: auto !important;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-secondary);
        cursor: pointer;
        flex: 1;
        height: 100%;
        transition: all var(--transition-fast);
    }

    .bottom-nav-item.active {
        color: var(--accent-primary);
    }

    .bottom-nav-item .nav-icon {
        font-size: 24px;
        margin-bottom: 2px;
        margin-right: 0;
    }

    .bottom-nav-item .nav-text {
        font-size: 10px;
        font-weight: 500;
    }

    .content-area {
        margin-left: 0 !important;
        padding: var(--space-md);
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        padding-top: calc(var(--header-height) + var(--space-md));
        padding-bottom: calc(65px + env(safe-area-inset-bottom) + var(--space-md));
    }

    /* 浼樺寲杈撳叆閿洏瀵艰嚧鐨勯棶棰?*/
    body.keyboard-open .bottom-nav {
        display: none !important;
    }
    body.keyboard-open .content-area {
        padding-bottom: var(--space-md);
    }

    .stats-grid { 
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important; 
        gap: var(--space-md); 
        width: 100% !important;
        margin-left: 0 !important;
    }

    .stat-card { 
        padding: var(--space-md); 
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        min-height: 120px !important;
        box-sizing: border-box;
    }
    .stat-icon { font-size: 24px; margin-bottom: 4px; }
    .stat-value { font-size: var(--font-2xl); }

    .dashboard-grid { 
        display: flex !important; 
        flex-direction: column !important; 
        gap: var(--space-md); 
        width: 100% !important;
        margin-left: 0 !important;
    }
    .chart-card, .today-card { 
        width: 100% !important; 
        margin-top: 0 !important; 
        overflow-x: hidden;
    }
    
    .heatmap-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
    }
    .heatmap-container {
        min-width: 600px;
    }

    .page-header {
        text-align: center;
        margin-bottom: var(--space-lg);
    }
    .page-header h2 { font-size: var(--font-2xl); }

    .auth-card { padding: var(--space-lg); }
    .auth-container { padding: var(--space-md); }

    /* 闂崱鎻ず鐣岄潰锛氳繘涓€姝ュ帇缂╅棿璺?*/
    .fc-card { 
        padding: var(--space-sm); 
        min-height: auto; 
        width: 100%;
    }
    .fc-word { font-size: var(--font-2xl); margin-bottom: 4px; }
    .fc-phonetic-group { margin-bottom: var(--space-sm); }
    .fc-back { margin-top: var(--space-sm); }
    .fc-definition { margin-bottom: var(--space-sm); padding: var(--space-md); }
    .fc-example { margin-bottom: var(--space-sm); padding: var(--space-md); }
    
    .fc-rating-buttons { 
        grid-template-columns: 1fr; 
        gap: 8px; 
    }
    .btn-rating { 
        padding: 10px;
        flex-direction: row; 
        gap: var(--space-md); 
    }

    .chat-layout { flex-direction: column; height: auto; min-height: calc(100vh - 100px); }
    .chat-sidebar { display: none; }

    .admin-toolbar { flex-direction: column; }
    .admin-toolbar-actions { margin-left: 0; width: 100%; }
    .admin-toolbar-actions .btn { flex: 1; }

    .modal { width: 95%; padding: var(--space-lg); }

    .profile-layout { grid-template-columns: 1fr; }

    /* 纭繚搴曢儴瀵艰埅鏍忓缁堝浜庢渶涓婂眰涓斿彲浜や簰 */
    .bottom-nav {
        z-index: 1000 !important;
        pointer-events: auto !important;
        background: var(--bg-secondary);
    }
    .bottom-nav-item {
        pointer-events: auto !important;
    }
}

/* Co-learning Feed */
.co-learning-feed {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}
.co-post-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-base);
}
.co-post-card:hover {
    border-color: var(--border-glass-hover);
    box-shadow: var(--shadow-md);
}
.co-post-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}
.co-post-avatar {
    width: 36px; height: 36px;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: var(--font-sm);
    color: white;
}
.co-post-meta { flex: 1; }
.co-post-nickname { font-weight: 600; font-size: var(--font-sm); }
.co-post-time { font-size: var(--font-xs); color: var(--text-muted); }
.co-post-content {
    font-size: var(--font-base);
    line-height: 1.7;
    margin-bottom: var(--space-md);
    white-space: pre-wrap;
}
.co-post-footer {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}
.co-post-footer .btn { font-size: var(--font-sm); }
.co-reply-card {
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-top: var(--space-sm);
}

/* Mobile sidebar overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 250;
    display: none;
}
.sidebar-overlay.active { display: block; }

/* ============================================================
   Phase 9: PTE DI & TMR Styles
   ============================================================ */

/* PTE Describe Image */
.pte-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-xl);
    align-items: start;
}

.pte-card {
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    text-align: center;
}

.pte-image-wrapper {
    width: 100%;
    min-height: 300px;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.pte-image-wrapper img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.audio-recorder-box {
    background: rgba(255,255,255,0.03);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-glass);
}

.visualizer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 40px;
    margin-bottom: var(--space-md);
}

.visualizer .bar {
    width: 4px;
    height: 10px;
    background: var(--accent-primary);
    border-radius: 2px;
}

.visualizer.active .bar {
    animation: bounce 0.8s ease-in-out infinite;
}

.visualizer.active .bar:nth-child(2) { animation-delay: 0.1s; }
.visualizer.active .bar:nth-child(3) { animation-delay: 0.2s; }
.visualizer.active .bar:nth-child(4) { animation-delay: 0.3s; }
.visualizer.active .bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 100% { height: 10px; }
    50% { height: 35px; }
}

.recorder-status {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.pte-feedback {
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
}

.feedback-content {
    line-height: 1.8;
    color: var(--text-primary);
    font-size: var(--font-base);
}

/* Feynman Toggle */
.feynman-mode-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px; width: 14px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider { background-color: var(--accent-secondary); }
input:focus + .slider { box-shadow: 0 0 1px var(--accent-secondary); }
input:checked + .slider:before { transform: translateX(20px); }

.slider.round { border-radius: 20px; }
.slider.round:before { border-radius: 50%; }

.toggle-label { font-size: var(--font-xs); color: var(--text-muted); }

/* Blurred Message (Feynman Mode) */
.message-blurred {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
    opacity: 0.5;
    transition: filter 0.5s ease;
}

/* TMR Styles */
.tmr-list {
    margin-top: var(--space-xl);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
}

.tmr-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
}

.tmr-info { flex: 1; }
.tmr-date { font-size: var(--font-xs); color: var(--text-muted); }
.tmr-words { font-size: var(--font-sm); color: var(--accent-primary); }

@media (max-width: 900px) {
    .pte-container { grid-template-columns: 1fr; }
}
/* Heatmap Styling */
.heatmap-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: var(--space-md) 0;
    scrollbar-width: thin;
}

.heatmap-container {
    display: flex;
    flex-direction: row; /* Ensure horizontal */
    gap: 4px;
    min-width: max-content;
}

.heatmap-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.heatmap-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.heatmap-cell:hover {
    transform: scale(1.3);
    z-index: 10;
    box-shadow: 0 0 10px var(--accent-primary);
}

/* Activity Levels - Using app color scheme (indigo/purple) */
.heatmap-cell[data-level="0"] { background: rgba(255, 255, 255, 0.05); }
.heatmap-cell[data-level="1"] { background: #4a4599; }
.heatmap-cell[data-level="2"] { background: #6c63ff; }
.heatmap-cell[data-level="3"] { background: #8e87ff; }
.heatmap-cell[data-level="4"] { background: #b0abff; }

/* Light Theme overrides for Levels */
[data-theme="light"] .heatmap-cell[data-level="0"] { background: #ebedf0; }
[data-theme="light"] .heatmap-cell[data-level="1"] { background: #c6e48b; }
[data-theme="light"] .heatmap-cell[data-level="2"] { background: #7bc96f; }
[data-theme="light"] .heatmap-cell[data-level="3"] { background: #239a3b; }
[data-theme="light"] .heatmap-cell[data-level="4"] { background: #196127; }

/* Flashcard Typing Reinforcement */
.fc-confirm-typing {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin: var(--space-lg) 0;
    text-align: left;
    box-sizing: border-box;
}

.fc-type-hint {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.fc-type-input-box {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.fc-type-check {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: var(--font-lg);
    font-family: inherit;
    transition: all var(--transition-base);
}

.fc-type-check:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

.fc-type-check.type-success {
    border-color: #43e97b;
    background: rgba(67, 233, 123, 0.1);
    box-shadow: 0 0 0 3px rgba(67, 233, 123, 0.2);
    animation: successPulse 0.5s ease-out;
}

.fc-type-status {
    font-size: 20px;
    filter: grayscale(1);
    opacity: 0.3;
    transition: all 0.3s ease;
}

.fc-type-check.type-success + .fc-type-status {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.2);
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.reveal-sentence strong {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.target-highlight {
    color: #ef4444; /* Bright Red */
    font-weight: 700;
}

/* Flashcard Learning Focus Consolidation */
.fc-learning-focus {
    display: none; /* Hide the old box */
}

.fc-phonetic-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: var(--font-sm);
    color: var(--text-muted);
}

.fc-target-label {
    background: rgba(108, 99, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--accent-primary);
    font-weight: 600;
    font-size: var(--font-xs);
}

/* Sentence Master Styles */
.sm-card {
    padding: var(--space-xl);
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.sm-chinese-box {
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
}

#sm-chinese {
    font-size: var(--font-xl);
    color: var(--text-primary);
    font-weight: 500;
}

.sm-input-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
}

.sm-word-input {
    min-width: 60px;
    max-width: 200px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: var(--font-lg);
    text-align: center;
    transition: all 0.2s ease;
}

.sm-word-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
}

.sm-word-input.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.sm-word-input.correct {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.sm-controls {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.sm-insight-panel {
    text-align: left;
    background: rgba(108, 99, 255, 0.05);
    border: 1px solid rgba(108, 99, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    animation: fadeInUp 0.5s ease-out;
}

.insight-header {
    font-size: var(--font-md);
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-xs);
    border-bottom: 2px solid rgba(108, 99, 255, 0.2);
}

.insight-section {
    margin-bottom: var(--space-lg);
}

.insight-section strong {
    display: block;
    font-size: var(--font-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.insight-section p {
    font-size: var(--font-md);
    color: var(--text-primary);
    line-height: 1.6;
}

.correct-sentence {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--accent-primary);
    font-style: italic;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================ */
/* Exam Module Styles */
/* ============================================================ */

.exam-container {
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    max-width: 600px;
    margin: 0 auto;
}

.exam-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-surface-hover);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.exam-progress-fill {
    height: 100%;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

.exam-status {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-sm);
    color: var(--text-muted);
}

.exam-word-display {
    text-align: center;
    font-size: var(--font-4xl);
    font-weight: 800;
    color: var(--text-primary);
    padding: var(--space-lg) 0;
    letter-spacing: -0.5px;
}

.exam-options-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.exam-option-btn {
    width: 100%;
    text-align: left;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-surface);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: var(--font-lg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.exam-option-btn:hover,
.exam-option-btn:focus {
    border-color: var(--accent-primary);
    background: var(--bg-surface-hover);
    outline: none;
    transform: translateY(-2px);
}

.exam-option-btn .option-letter {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 16px;
    flex-shrink: 0;
}

.exam-option-btn.btn-success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.exam-option-btn.btn-success .option-letter {
    background: #10b981;
    color: white;
}

.exam-option-btn.btn-danger {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.exam-option-btn.btn-danger .option-letter {
    background: #ef4444;
    color: white;
}

/* ===== Theme Modal ===== */
.theme-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.theme-modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.theme-modal-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    padding: var(--space-2xl);
    border-radius: var(--radius-xl);
    text-align: center;
    animation: themeModalSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes themeModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.theme-modal-icon {
    font-size: 64px;
    margin-bottom: var(--space-lg);
    animation: themeIconRotate 0.8s ease-out;
}

@keyframes themeIconRotate {
    from {
        transform: rotate(-180deg) scale(0);
        opacity: 0;
    }
    to {
        transform: rotate(0) scale(1);
        opacity: 1;
    }
}

.theme-modal-content h2 {
    font-size: var(--font-2xl);
    color: var(--text-primary);
    margin: 0 0 var(--space-sm) 0;
    font-weight: 700;
}

.theme-modal-subtitle {
    font-size: var(--font-sm);
    color: var(--accent-primary);
    margin: 0 0 var(--space-lg) 0;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.theme-modal-quote {
    background: rgba(108, 99, 255, 0.1);
    border-left: 4px solid var(--accent-primary);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin: var(--space-lg) 0;
    animation: themeQuoteFadeIn 0.6s ease-out 0.2s both;
}

@keyframes themeQuoteFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.theme-modal-quote p {
    margin: var(--space-sm) 0;
    line-height: 1.6;
}

#theme-modal-quote-cn {
    font-size: var(--font-md);
    color: var(--text-primary);
    font-weight: 600;
}

#theme-modal-quote-en {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    font-style: italic;
}

.theme-modal-progress {
    margin-top: var(--space-lg);
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    animation: themeProgressFill 1.2s ease-out;
}

@keyframes themeProgressFill {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.theme-modal.hidden {
    display: none;
}

/* ===== 璇嶅簱鍒嗙被绠＄悊鏍峰紡 ===== */
.vocab-set-selector-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border-glass);
}

.vocab-set-selector-bar label {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.vocab-set-select {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
    cursor: pointer;
}

.vocab-set-select:hover {
    border-color: var(--border-glass-hover);
}

.vocab-set-info {
    font-size: var(--font-sm);
    color: var(--text-muted);
    white-space: nowrap;
}

.vocab-sets-management {
    margin-bottom: var(--space-2xl);
    padding: var(--space-lg);
    background: var(--bg-glass);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-glass);
}

.vocab-sets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.vocab-sets-header h3 {
    margin: 0;
    font-size: var(--font-lg);
    color: var(--text-primary);
}

.vocab-sets-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-md);
}

.vocab-set-item {
    display: flex;
    flex-direction: column;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.vocab-set-item:hover {
    border-color: var(--border-glass-hover);
    background: var(--bg-card);
    transform: translateY(-2px);
}

.vocab-set-item.active {
    border-color: var(--primary);
    background: rgba(108, 99, 255, 0.15);
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.25);
}

.vocab-set-item.active::after {
    content: '馃幆';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
}

.vocab-set-info {
    flex: 1;
    margin-bottom: var(--space-md);
}

.vocab-set-info h4 {
    margin: 0 0 var(--space-xs) 0;
    font-size: var(--font-md);
    color: var(--text-primary);
}

.vocab-set-info p {
    margin: var(--space-xs) 0;
    font-size: var(--font-sm);
    color: var(--text-muted);
}

.vocab-set-desc {
    font-size: var(--font-sm) !important;
    color: var(--text-secondary) !important;
    margin-top: var(--space-sm) !important;
}

.vocab-set-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex-wrap: wrap;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.toggle-switch input {
    width: 40px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.toggle-switch span {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    white-space: nowrap;
}

/* 鍝嶅簲寮忚璁?*/
@media (max-width: 768px) {
    .vocab-set-selector-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .vocab-set-select {
        width: 100%;
    }

    .vocab-sets-list {
        grid-template-columns: 1fr;
    }

    .vocab-set-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .vocab-set-info {
        margin-bottom: 0;
    }

    .vocab-set-actions {
        flex-direction: column;
        align-items: flex-end;
    }
}

/* ============================================================
   SPEECH PRACTICE (口语对练)
   ============================================================ */
.speech-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Segmented Control for SP Tabs */
.sp-tabs-container {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 12px;
    margin: 0 auto 20px auto;
    border: 1px solid var(--border-glass);
    max-width: 400px;
    width: 90%;
}

.sp-tabs-container .btn-tab {
    flex: 1;
    border: none !important;
    background: transparent !important;
    border-radius: 8px;
    padding: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sp-tabs-container .btn-tab.active {
    background: var(--bg-card) !important;
    color: var(--accent-primary) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* SP Progress Bar (Flashcard Style) */
.sp-progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto 24px auto;
    width: 90%;
    max-width: 600px;
}

.sp-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.sp-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    width: 0;
    transition: width 0.3s ease;
}

.sp-progress-text {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 40px;
}

/* Flashcard Style Practice Card */
.sp-flashcard {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.sp-card-content {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 32px 24px;
    width: 100%;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    margin-bottom: 30px;
}

.sp-text-area {
    margin-bottom: 24px;
}

.sp-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 12px;
}

.sp-text.word-large {
    font-size: 42px;
    color: var(--accent-primary);
}

.sp-word-details {
    margin-bottom: 16px;
}

.sp-phonetic {
    font-size: 18px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 8px;
}

.sp-definition {
    font-size: 16px;
    color: var(--text-secondary);
}

.btn-tts-round {
    width: 48px;
    height: 48px;
    background: rgba(108, 99, 255, 0.1);
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 16px auto 0 auto;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-tts-round:hover {
    background: rgba(108, 99, 255, 0.2);
    transform: scale(1.1);
}

/* Control Controls */
.sp-main-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    width: 100%;
    margin-bottom: 20px;
}

.record-btn {
    width: 110px; /* Even larger as requested */
    height: 110px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(108, 99, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.record-btn.recording {
    background: var(--accent-red);
    transform: scale(1.15);
    box-shadow: 0 0 35px rgba(255, 101, 132, 0.6);
    animation: sp-pulse 1.5s infinite;
}

@keyframes sp-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 101, 132, 0.7); }
    70% { box-shadow: 0 0 0 25px rgba(255, 101, 132, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 101, 132, 0); }
}

.btn-prev-next {
    width: 66px; /* Larger as requested */
    height: 66px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-prev-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.sp-feedback-area {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.score-pill {
    display: inline-block;
    padding: 6px 16px;
    background: var(--accent-primary-glow);
    color: var(--accent-primary);
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 10px;
}

.transcript-mini {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--accent-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
}

/* Waveform Pulse for Recording */
.recording-pulse {
    width: 40px;
    height: 40px;
    background: var(--accent-red);
    border-radius: 50%;
    margin: 0 auto;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 101, 132, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 15px rgba(255, 101, 132, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 101, 132, 0); }
}

/* History Table */
.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    text-align: left;
    padding: 12px;
    color: var(--text-secondary);
    font-size: var(--font-sm);
    border-bottom: 1px solid var(--border-glass);
}

.history-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.cell-text { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.cell-score { font-weight: bold; }
.text-high { color: var(--accent-green); }
.text-mid { color: var(--accent-primary); }
.text-low { color: var(--accent-red); }

@media (max-width: 480px) {
    .sp-card-content {
        padding: 24px 16px;
        min-height: 320px;
    }
    .sp-text { font-size: 20px; }
    .sp-text.word-large { font-size: 36px; }
    .sp-main-controls { gap: 20px; }
    .record-btn { width: 90px; height: 90px; font-size: 32px; }
    .btn-prev-next { width: 56px; height: 56px; font-size: 20px; }
}
