/* ==================== CSS Variables ==================== */
@import url('https://fonts.googleapis.com/css2?family=Bangers&family=DM+Sans:wght@400;500;700&family=Fraunces:wght@600;700;800&family=Noto+Sans+SC:wght@400;500;700;800&display=swap');

:root {
    /* Colors - Warm educational palette */
    --primary: #0f766e;
    --primary-dark: #0f5e57;
    --primary-light: #2dd4bf;
    --secondary: #f97316;
    --secondary-dark: #ea580c;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    
    /* Neutrals */
    --bg-primary: #faf8f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f3f1ed;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    
    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 64px;
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* ==================== Reset & Base ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: 'Fraunces', 'Noto Serif SC', serif;
}

input, button, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ==================== Loading Screen ==================== */
.loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 1s ease infinite;
}

.loading-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: white;
    border-radius: 2px;
    animation: loading 1.5s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes loading {
    0% { width: 0; margin-left: 0; }
    50% { width: 70%; margin-left: 15%; }
    100% { width: 0; margin-left: 100%; }
}

/* ==================== Modal ==================== */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 100%;
    animation: modalIn 0.3s ease;
}

.guest-limit-card {
    width: min(520px, 100%);
    padding: 2rem;
    text-align: center;
}

.guest-limit-title {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
}

.guest-limit-text {
    margin: 0 0 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.drill-reminder-card {
    width: min(760px, 92vw);
    padding: 2.5rem 2.75rem;
    border: 2px solid #f87171;
    background: linear-gradient(135deg, #fff5f5 0%, #ffecec 100%);
}

.drill-reminder-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.drill-reminder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 700;
}

.drill-reminder-title {
    margin: 0;
    font-size: 1.6rem;
    color: #b91c1c;
}

.drill-reminder-text {
    margin: 0 0 0.75rem;
    color: #7f1d1d;
    line-height: 1.7;
    font-size: 1rem;
}

.drill-reminder-list {
    margin: 0 0 1.75rem;
    padding-left: 1.25rem;
    color: #7f1d1d;
    line-height: 1.7;
}

.drill-reminder-actions {
    display: flex;
    justify-content: flex-end;
}

.gamification-card {
    width: min(560px, 95vw);
    padding: 1.5rem 1.75rem 1.4rem;
    text-align: center;
    border: 1px solid rgba(15, 118, 110, 0.18);
    background: linear-gradient(160deg, #fefdf8 0%, #ffffff 55%, #f5f9f8 100%);
}

.gamification-close {
    position: absolute;
    top: 0.55rem;
    right: 0.7rem;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 50%;
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary-dark);
    font-size: 1.1rem;
    cursor: pointer;
}

.gamification-lottie {
    width: min(320px, 72vw);
    height: min(320px, 72vw);
    margin: 0 auto 0.35rem;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(15, 118, 110, 0.18);
    background: radial-gradient(circle at 30% 28%, #ffffff 0%, #f1fbf8 60%, #e7f5f1 100%);
    box-shadow: inset 0 10px 28px rgba(15, 118, 110, 0.12), 0 12px 36px rgba(15, 23, 42, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gamification-lottie > * {
    width: 100%;
    height: 100%;
}

.gamification-lottie svg {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.gamification-perfect-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.95;
    transition: opacity 240ms ease;
}

.gamification-perfect-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 22%, rgba(251, 113, 133, 0.26) 0%, transparent 42%),
        radial-gradient(circle at 78% 18%, rgba(56, 189, 248, 0.24) 0%, transparent 44%),
        radial-gradient(circle at 82% 74%, rgba(250, 204, 21, 0.26) 0%, transparent 40%),
        radial-gradient(circle at 18% 78%, rgba(52, 211, 153, 0.24) 0%, transparent 42%);
}

.gamification-perfect-burst {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 44%;
    height: 4%;
    transform-origin: 0 50%;
    transform: rotate(var(--angle)) translateX(6%);
}

.gamification-perfect-burst::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        hsla(var(--hue), 95%, 78%, 0),
        hsla(var(--hue), 95%, 62%, 0.95),
        hsla(calc(var(--hue) + 24), 96%, 56%, 0)
    );
    filter: drop-shadow(0 0 8px hsla(var(--hue), 95%, 65%, 0.55));
    animation: perfectBurst 0.9s ease-in-out infinite;
    animation-delay: var(--delay);
}

.gamification-perfect-label {
    position: absolute;
    left: 50%;
    top: 53%;
    transform: translate(-50%, -50%);
    font-family: 'Bangers', 'Noto Sans SC', sans-serif;
    font-size: clamp(2rem, 8vw, 3.5rem);
    letter-spacing: 0.08em;
    color: #fff8d6;
    text-shadow:
        0 0 8px rgba(249, 115, 22, 0.95),
        0 0 20px rgba(244, 63, 94, 0.7),
        0 0 30px rgba(14, 165, 233, 0.5);
    animation: perfectLabelGlow 0.8s ease-in-out infinite alternate;
}

.gamification-lottie.perfect-finale svg {
    opacity: 0;
}

.gamification-lottie.perfect-finale .gamification-perfect-overlay {
    opacity: 1;
}

.gamification-title {
    margin: 0.35rem 0 0.35rem;
    font-size: clamp(1.6rem, 3.2vw, 2.1rem);
    color: var(--primary-dark);
}

.gamification-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-weight: 700;
}

.gamification-card.level-up-mode .gamification-title {
    font-family: 'Bangers', 'Noto Sans SC', sans-serif;
    letter-spacing: 0.06em;
    color: var(--secondary-dark);
    text-shadow: 0 0 20px rgba(249, 115, 22, 0.35);
    animation: levelUpPulse 0.9s ease-in-out infinite alternate;
}

@keyframes levelUpPulse {
    from {
        transform: scale(1);
        opacity: 0.9;
    }
    to {
        transform: scale(1.06);
        opacity: 1;
    }
}

@keyframes perfectBurst {
    0% {
        opacity: 0.2;
        transform: scaleX(0.28);
    }
    35% {
        opacity: 1;
        transform: scaleX(1);
    }
    100% {
        opacity: 0.2;
        transform: scaleX(0.35);
    }
}

@keyframes perfectLabelGlow {
    0% {
        transform: translate(-50%, -50%) scale(0.95);
    }
    100% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==================== Login Card ==================== */
.login-card {
    width: 400px;
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.login-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-group input {
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.error-message {
    background: var(--danger-light);
    color: var(--danger);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    text-align: center;
}

.success-message {
    background: var(--success-light);
    color: var(--success);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    text-align: center;
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.register-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.register-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.input-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.input-row input {
    flex: 1;
}

.input-row.captcha-row {
    flex-direction: column;
    align-items: stretch;
}

.captcha-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.captcha-img {
    width: 96px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
}

.form-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.login-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.login-tab {
    flex: 1;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.login-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.25);
}

.login-panel {
    margin-top: 0.25rem;
}

.wechat-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.wechat-qr-box {
    width: 220px;
    height: 220px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wechat-qr-frame {
    width: 100%;
    height: 100%;
    border: none;
}

.wechat-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

.wechat-status.error {
    color: var(--danger);
}

.wechat-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wechat-link {
    text-align: center;
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
}

.wechat-link:hover {
    text-decoration: underline;
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:disabled {
    cursor: default;
    opacity: 0.55;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 118, 110, 0.45);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(15, 118, 110, 0.05);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--primary);
    background: rgba(15, 118, 110, 0.1);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-icon {
    font-size: 1.1em;
}

/* ==================== Main Layout ==================== */
.main-container {
    display: flex;
    min-height: 100vh;
}

.main-container.hidden {
    display: none;
}

/* ==================== Sidebar ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    overflow: hidden;
}

.sidebar-header {
    padding: 0.85rem 1rem 0.55rem;
    border-bottom: 1px solid var(--border-light);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.75rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    list-style: none;
    padding: 0.4rem 0.72rem 0.72rem;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0.18rem 0;
    list-style: none;
}

.nav-section-title {
    padding: 0.14rem 0.48rem;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}
.nav-section-title.nav-section-main {
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    text-transform: none;
    color: var(--text-primary);
    font-weight: 800;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.42rem 0.72rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 0.06rem;
    color: var(--text-secondary);
}

.nav-item.disabled {
    cursor: default;
    opacity: 0.45;
    pointer-events: none;
}

.nav-tag {
    margin-left: auto;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.nav-tag.muted {
    background: var(--border-light);
    color: var(--text-muted);
}

.nav-tag.hot {
    background: rgba(249, 115, 22, 0.15);
    color: var(--secondary-dark);
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.nav-icon {
    font-size: 1.25rem;
}

.nav-text {
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name-row {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-gamification-inline {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-logout {
    width: 100%;
    padding: 0.625rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-light);
}

/* ==================== Main Content ==================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
}

.main-container.learning-fullscreen .sidebar {
    display: none;
}

.main-container.learning-fullscreen .main-content {
    margin-left: 0;
    width: 100%;
}

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-header {
    margin-bottom: 2rem;
}

.view-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.view-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* ==================== Hero & Tracks ==================== */
.hero {
    position: relative;
    padding: 2rem 2.2rem;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 55%, #f97316 120%);
    color: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.25rem;
}

.hero::after {
    content: "";
    position: absolute;
    inset: -30% 20% auto auto;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(255,255,255,0.35), transparent 65%);
    opacity: 0.5;
    transform: rotate(15deg);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.2);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.hero-logout-btn {
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.36rem 0.72rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.hero-logout-btn:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.75);
    color: #fee2e2;
}

.hero h1 {
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 1.12;
    margin-bottom: 0.45rem;
}

.hero p {
    max-width: 560px;
    font-size: 1rem;
    line-height: 1.42;
    color: rgba(255,255,255,0.9);
    margin-bottom: 0.95rem;
}

.hero-actions {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.hero .btn-lg {
    padding: 0.72rem 1.35rem;
    font-size: 1rem;
}

.hero-progress {
    margin-top: 0.85rem;
    padding: 0.65rem 0.8rem 0.62rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.15);
}

.hero-progress-main {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.hero-progress-block {
    background: rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-md);
    padding: 0.42rem 0.58rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.hero-progress-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.hero-progress-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
}

#home-points,
#home-level,
#home-next-level {
    color: #fbbf24;
}

.hero-level-progress {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.hero-level-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #fde68a 0%, #f97316 100%);
    transition: width 0.35s ease;
}

.hero-level-progress-text {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.88);
}

.hero .btn-outline {
    border-color: rgba(255, 255, 255, 0.65);
    color: #fff;
}

.hero .btn-outline:hover {
    background: rgba(255, 255, 255, 0.12);
}

.track-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.3rem;
}

.track-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    border: 2px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.track-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.track-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    margin-bottom: 0.75rem;
}

.track-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.35rem;
}

.track-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.track-status {
    font-weight: 700;
    color: var(--secondary-dark);
}

.track-actions {
    display: flex;
}

/* ==================== Part Selection ==================== */
.part-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.part-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 2px solid var(--border-light);
    transition: all var(--transition-fast);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.part-card.active {
    border-color: rgba(15, 118, 110, 0.35);
}

.part-card.active:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.part-card.muted {
    cursor: default;
    opacity: 0.6;
}

.part-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.part-desc {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.part-status {
    font-weight: 700;
    color: var(--secondary-dark);
}

.part-actions {
    display: flex;
}

.part-helper {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.part-helper-title {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.part-helper-desc {
    font-size: 1rem;
    font-weight: 600;
}

.part-helper-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ==================== Stats Grid ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.stat-primary .stat-value { color: var(--primary); }
.stat-success .stat-value { color: var(--success); }
.stat-warning .stat-value { color: var(--warning); }
.stat-info .stat-value { color: #0ea5a6; }

.home-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.home-stats-grid .stat-card.compact {
    min-height: 72px;
    border-radius: 12px;
    padding: 0.7rem 0.75rem;
    justify-content: center;
}

.home-stats-grid .stat-card.compact:not(:last-child) {
    border-right: 1px solid rgba(148, 163, 184, 0.22);
}

.home-stats-grid .stat-card.compact .stat-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
}

.home-stats-grid .stat-card.compact .stat-value {
    font-size: 2rem;
    line-height: 1;
}

.home-stats-grid .stat-card.compact .stat-label {
    font-size: 0.76rem;
    margin-top: 0;
    white-space: nowrap;
}

/* ==================== Quick Actions ==================== */
.quick-actions h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.action-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid var(--border-light);
}

.action-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.action-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.action-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.action-desc {
    color: var(--text-secondary);
}

/* ==================== Content Grid ==================== */
.practice-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: -0.25rem 0 1rem;
}

.practice-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.practice-sort select {
    background: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    color: var(--text-primary);
    outline: none;
    min-width: 12.5rem;
    max-width: 100%;
}

.practice-sort select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.text-success {
    color: var(--success);
    font-weight: 700;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.content-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 2px solid var(--border-light);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.content-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.content-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.content-card-icon {
    font-size: 2rem;
}

.content-card-badge {
    background: var(--bg-tertiary);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.content-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.content-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.content-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.content-card-footer {
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
}

.difficulty-stars {
    font-size: 0.95rem;
    letter-spacing: 1px;
    color: var(--secondary);
}

/* ==================== Exercise View ==================== */
.exercise-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.back-btn {
    padding: 0.5rem 1rem;
}

.exercise-title {
    flex: 1;
}

.exercise-header-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.fullscreen-toggle {
    min-width: 5.25rem;
    white-space: nowrap;
}

.fullscreen-toggle[aria-pressed="true"] {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}

.exercise-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.exercise-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.exercise-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1.125rem;
}
.exercise-timer .timer-toggle {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
}

.passage-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
}

.passage-text {
    font-size: 1.1875rem;
    line-height: 2.2;
    color: var(--text-primary);
}

.passage-text p {
    margin-bottom: 1.5rem;
}

.blank-wrapper {
    display: inline;
}

.blank-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
}

.blank-input {
    display: inline-block;
    width: 15ch;
    padding: 0.375rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    text-align: center;
    transition: all var(--transition-fast);
    background: var(--bg-primary);
    margin: 0 0.2rem;
    vertical-align: baseline;
}

.blank-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.blank-input.example {
    background: var(--success-light);
    border-color: var(--success);
    color: var(--success);
    font-weight: 600;
}
.blank-input.prefill {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    color: #2563eb;
    font-weight: 600;
}
.blank-input.prefill[readonly] {
    cursor: default;
}

.blank-base {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.base-words-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.base-words-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.base-words-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.base-word-chip {
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--bg-tertiary);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.input-case-tip {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ==================== Part 1 Multiple Choice ==================== */
.blank-number-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
    margin: 0 0.25rem;
    vertical-align: middle;
}

.blank-underline {
    display: inline-block;
    border-bottom: 2px dashed var(--text-secondary);
    width: 3.5em;
    height: 0.5em;
    margin: 0 0.25rem;
    vertical-align: baseline;
}

.blank-answer-inline {
    display: inline;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 2px dashed var(--primary);
    padding-bottom: 2px;
}

.blank-answer-correct {
    display: inline;
    font-weight: 700;
    color: var(--success);
    border-bottom: 2px dashed var(--success);
    padding-bottom: 2px;
}

.mc-options-panel {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.mc-options-panel.hidden {
    display: none;
}

.mc-question-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.mc-question-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.mc-question-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 50%;
}

.mc-question-options {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
}

.mc-option-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 500;
    min-width: 100px;
}

.mc-option-btn .option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--text-secondary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.mc-option-btn:hover:not(.prefill) {
    border-color: var(--primary);
    background: rgba(15, 118, 110, 0.08);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.mc-option-btn.selected {
    background: #e0f2fe;
    border-color: #0ea5e9;
    color: #0369a1;
    font-weight: 600;
}

.mc-option-btn.selected .option-letter {
    background: #0ea5e9;
}

.mc-option-btn.prefill {
    cursor: default;
    opacity: 0.7;
}

.mc-option-btn.prefill.selected {
    background: rgba(15, 118, 110, 0.12);
    border-color: var(--primary);
    color: var(--primary);
}

.mc-option-btn.prefill.selected .option-letter {
    background: var(--primary);
}

.mc-option-btn.drill-required {
    border-color: var(--warning);
    border-width: 2px;
}

.mc-option-btn.drill-required .option-letter {
    background: var(--warning);
}

.mc-option-btn.drill-required.selected {
    background: #e0f2fe;
    border-color: #0ea5e9;
    color: #0369a1;
}

.mc-option-btn.drill-required.selected .option-letter {
    background: #0ea5e9;
}

.mc-option-btn.correct-answer {
    background: var(--success-light);
    border-color: var(--success);
    color: var(--success);
    font-weight: 600;
    cursor: default;
}

.mc-option-btn.correct-answer .option-letter {
    background: var(--success);
}

.mc-option-btn.dimmed {
    opacity: 0.4;
    cursor: default;
}

.mc-question-number.requires-answer {
    background: var(--warning);
}

.mc-question-number.correct {
    background: var(--success);
}

.exercise-actions {
    display: flex;
    justify-content: center;
}

/* ==================== Result View ==================== */
.result-container {
    max-width: 800px;
    margin: 0 auto;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.result-score-circle {
    position: relative;
    width: 150px;
    height: 150px;
    flex-shrink: 0;
}

.result-score-circle svg {
    transform: rotate(-90deg);
}

.score-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 8;
}

.score-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1s ease;
}

.score-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.score-total {
    font-size: 1rem;
    color: var(--text-muted);
}

.result-info h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.result-context {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.result-accuracy {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.result-time {
    color: var(--text-muted);
}

.result-details {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.result-details h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.result-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-primary);
}

.result-item.correct {
    background: var(--success-light);
}

.result-item.wrong {
    background: var(--danger-light);
}

.result-item-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.result-item.correct .result-item-number {
    background: var(--success);
    color: white;
}

.result-item.wrong .result-item-number {
    background: var(--danger);
    color: white;
}

.result-item-content {
    flex: 1;
}

.result-item-answer {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.result-item-user {
    font-weight: 600;
}

.result-item.correct .result-item-user {
    color: var(--success);
}

.result-item.wrong .result-item-user {
    color: var(--danger);
    text-decoration: line-through;
}

.result-item-correct {
    color: var(--success);
    font-weight: 600;
}

.result-item-explanation {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
    line-height: 1.7;
    white-space: pre-line;
}

.result-item-explanation-wrap {
    margin-top: 0.5rem;
}

.result-explanation-toggle {
    margin-top: 0.25rem;
}

.result-item-pos {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.result-item-kps {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.kp-tag {
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--primary);
    border: 1px solid var(--primary-light);
}

.result-translation {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.result-translation h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.result-translation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.result-translation-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.result-original {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    line-height: 2;
}

.result-original p {
    margin-bottom: 1rem;
}

.result-original .original-item {
    margin-bottom: 0.75rem;
    line-height: 1.9;
}

.answer-key {
    color: #dc2626;
    font-weight: 700;
}

.translation-text {
    line-height: 1.8;
    color: var(--text-secondary);
}

.transcript-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.transcript-block {
    margin-bottom: 0.85rem;
    line-height: 1.9;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ==================== History Filters ==================== */
.history-filters {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.filter-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.filter-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 180px;
}

.filter-select:hover {
  border-color: var(--primary);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.1);
}

/* ==================== History List ==================== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.history-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.history-score {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.history-score-value {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
}

.history-score-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.history-item.good .history-score {
    background: var(--success-light);
}
.history-item.good .history-score-value {
    color: var(--success);
}

.history-item.medium .history-score {
    background: var(--warning-light);
}
.history-item.medium .history-score-value {
    color: var(--warning);
}

.history-item.bad .history-score {
    background: var(--danger-light);
}
.history-item.bad .history-score-value {
    color: var(--danger);
}

.history-info {
    flex: 1;
}

.history-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.history-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.history-mode-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.history-mode-badge.mode-practice {
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary);
}

.history-mode-badge.mode-error-training {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.history-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.history-date .day {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1;
    display: block;
}

.history-date .month {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.history-date .year {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.history-date .time {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ==================== Drill Training ==================== */
.drill-jump-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(15, 118, 110, 0.2);
    background: #f0fdfa;
}

.drill-jump-label {
    font-weight: 700;
    color: var(--primary);
}

.drill-jump-control {
    min-width: 240px;
    flex: 1;
}

.drill-jump-select {
    width: 100%;
    padding: 0.6rem 2.25rem 0.6rem 0.9rem;
    border: 2px solid var(--primary);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'><path d='M3 6l5 5 5-5' stroke='%230f766e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.15);
}

.drill-jump-select:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.2), 0 6px 16px rgba(15, 118, 110, 0.2);
}
.drill-selection {
    max-width: 600px;
    margin: 0 auto;
}

.drill-intro {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.drill-options {
    display: grid;
    gap: 1rem;
}

.drill-option-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: default;
    transition: all 0.2s ease;
}

.drill-option-card:hover {
    border-color: var(--primary);
}

.drill-option-count {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--danger-light);
    color: var(--danger);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.drill-option-count .number {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.drill-option-count .label {
    font-size: 0.625rem;
    text-transform: uppercase;
}

.drill-option-info {
    flex: 1;
}

.drill-option-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.drill-option-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.drill-option-arrow {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.drill-option-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Drill Exercise */
.drill-exercise {
    max-width: none;
    margin: 0;
}

.drill-exercise-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.drill-info {
    flex: 1;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
}

.drill-exercise-body {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
}

.drill-sentence-container {
    margin-bottom: 2rem;
}

.drill-sentence {
    font-size: 1.25rem;
    line-height: 2;
    text-align: center;
}

.drill-sentence .drill-blank {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.drill-sentence .drill-blank-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

.drill-sentence input {
    width: 140px;
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.1rem;
    text-align: center;
    background: var(--bg-secondary);
    transition: all 0.2s ease;
}

.drill-sentence input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.drill-actions {
    text-align: center;
}

/* Drill Result */
.drill-result {
    max-width: 600px;
    margin: 0 auto;
}

.drill-result-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.drill-result-status {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
}

.drill-result-status.correct {
    background: var(--success-light);
    color: var(--success);
}

.drill-result-status.wrong {
    background: var(--danger-light);
    color: var(--danger);
}

.drill-result-content {
    text-align: left;
    margin-bottom: 2rem;
}

.drill-result-row {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.drill-result-row:last-child {
    border-bottom: none;
}

.drill-result-row .label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.drill-result-row .value {
    font-size: 1rem;
    color: var(--text-primary);
}

.drill-result-row .value.correct {
    color: var(--success);
    font-weight: 700;
}

.drill-result-row .value.wrong {
    color: var(--danger);
    text-decoration: line-through;
}

.drill-result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        align-items: center;
        padding: 0.5rem 1rem;
    }
    
    .sidebar-header {
        border: none;
        padding: 0.5rem;
    }
    
    .nav-menu {
        display: flex;
        padding: 0;
        flex: 1;
        justify-content: center;
        gap: 0.5rem;
        overflow-x: auto;
    }
    
    .nav-item {
        padding: 0.5rem;
        margin: 0;
    }
    
    .nav-text {
        display: none;
    }

    .nav-divider,
    .nav-section-title,
    .nav-tag,
    .nav-item.nav-part {
        display: none;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .hero {
        padding: 1.75rem;
    }

    .hero-top {
        align-items: flex-start;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-progress-main {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .hero-progress-value {
        font-size: 1rem;
    }
    
    .result-header {
        flex-direction: column;
        text-align: center;
    }
    
    .passage-container {
        padding: 1.5rem;
    }
    
    .blank-input {
        width: 15ch;
    }
}

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 160px;
    }

    .sidebar-header {
        padding: 0.85rem 0.75rem;
    }

    .nav-menu {
        padding: 0.6rem 0.5rem;
    }

    .nav-item {
        padding: 0.55rem 0.6rem;
        gap: 0.4rem;
    }

    .nav-text {
        font-size: 0.8rem;
    }

    .nav-tag {
        font-size: 0.55rem;
        padding: 0.1rem 0.4rem;
    }

    .main-content {
        padding: 1rem;
    }

    .hero {
        padding: 1.35rem 1.4rem;
        margin-bottom: 1rem;
    }

    .hero h1 {
        margin-bottom: 0.32rem;
    }

    .hero p {
        margin-bottom: 0.7rem;
        font-size: 0.95rem;
    }

    .hero-actions {
        gap: 0.5rem;
    }

    .hero .btn-lg {
        padding: 0.58rem 0.95rem;
        font-size: 0.9rem;
    }

    .hero-progress {
        margin-top: 0.58rem;
        padding: 0.52rem 0.58rem 0.48rem;
    }

    .hero-progress-main {
        gap: 0.45rem;
        margin-bottom: 0.35rem;
    }

    .home-stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.4rem;
    }

    .home-stats-grid .stat-card.compact {
        min-height: 64px;
        padding: 0.62rem 0.65rem;
    }

    .home-stats-grid .stat-card.compact .stat-value {
        font-size: 1.65rem;
    }

    .home-stats-grid .stat-card.compact .stat-label {
        font-size: 0.7rem;
    }

    .passage-container {
        padding: 1.2rem;
    }

    .exercise-header {
        padding: 0.5rem 0;
        margin-bottom: 0.75rem;
        gap: 0.75rem;
    }

    .exercise-title h2 {
        font-size: 1.25rem;
    }

    .exercise-meta {
        font-size: 0.8rem;
    }

    .exercise-header-actions {
        gap: 0.4rem;
    }

    .fullscreen-toggle {
        min-width: 4.8rem;
        padding: 0.35rem 0.55rem;
        font-size: 0.74rem;
    }

    .exercise-timer {
        padding: 0.4rem 0.6rem;
        font-size: 0.95rem;
        gap: 0.35rem;
    }

    .exercise-timer .timer-toggle {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }

    .drill-exercise-header {
        margin-bottom: 1rem;
        gap: 0.5rem;
    }

    .base-words-panel {
        position: sticky;
        top: 0.5rem;
        z-index: 20;
        padding: 0.6rem 0.8rem;
        margin-bottom: 0.75rem;
        box-shadow: var(--shadow-md);
    }

    .base-words-title {
        margin-bottom: 0.4rem;
        font-size: 0.75rem;
    }

    .base-words-list {
        gap: 0.4rem;
    }

    .base-word-chip {
        padding: 0.2rem 0.5rem;
        font-size: 0.7rem;
    }

    .passage-text {
        font-size: 1.1rem;
        line-height: 2.0;
    }

    .blank-wrapper {
        margin: 0;
    }

    .blank-input {
        width: 15ch;
        padding: 0.2rem 0.4rem;
        font-size: 0.9rem;
        margin: 0 0.08rem;
    }

    .sidebar-footer {
        padding: 0.75rem;
    }

    .user-info {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .user-avatar {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .user-name {
        font-size: 0.8rem;
    }

    .user-role {
        font-size: 0.7rem;
    }

    .user-gamification-inline {
        font-size: 0.64rem;
    }
}

@media (max-width: 820px) {
    .home-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ==================== Utilities ==================== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ==================== Part 4: Key Word Transformation ==================== */
.part4-instructions {
    background: var(--bg-tertiary);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.part4-instructions p {
    margin-bottom: 0.5rem;
}

.part4-instructions p:last-child {
    margin-bottom: 0;
}

.part4-questions {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.part4-question {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: var(--transition-fast);
}

.part4-question:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.part4-question.example {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: var(--success);
}

.part4-question-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.part4-question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2rem;
    padding: 0 0.75rem;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
}

.part4-example-badge {
    background: var(--success);
    color: white;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.part4-source,
.part4-keyword,
.part4-target {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    align-items: flex-start;
}

.part4-target {
    margin-bottom: 0;
}

.part4-label {
    flex-shrink: 0;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85rem;
    min-width: 5rem;
}

.part4-source-text {
    color: var(--text-primary);
    line-height: 1.5;
}

.part4-keyword-text {
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 1.1rem;
}

.part4-target-text {
    color: var(--text-primary);
    line-height: 1.5;
    flex: 1;
}

.part4-input {
      display: inline-block;
      width: 20ch;
      min-width: 20ch;
      max-width: 20ch;
      padding: 0.5rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: var(--transition-fast);
    background: var(--bg-primary);
}

.part4-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.part4-input::placeholder {
    text-transform: none;
    font-weight: 400;
    color: var(--text-muted);
}

.part4-example-answer {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--success-light);
    color: var(--success);
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: none;
    letter-spacing: 0.01em;
}

/* Part 4 Result Items */
.result-item.partial {
    border-left-color: var(--warning);
}

.result-item.partial .result-item-number {
    background: var(--warning);
}

.result-item-score {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.result-item-score.correct {
    background: var(--success-light);
    color: var(--success);
}

.result-item-score.partial {
    background: var(--warning-light);
    color: var(--warning);
}

.result-item-score.wrong {
    background: var(--danger-light);
    color: var(--danger);
}

.result-item-reason {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-style: italic;
}

.result-item-keyword {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.result-item-keyword strong {
    color: var(--primary);
    text-transform: uppercase;
}

/* Responsive Part 4 */
@media (max-width: 768px) {
    .part4-question {
        padding: 1rem;
    }
    
    .part4-source,
    .part4-keyword,
    .part4-target {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .part4-label {
        min-width: auto;
    }
    
    .part4-input {
        width: 100%;
        max-width: 100%;
    }
}

/* ==================== Management Interface Styles ==================== */
#view-management {
    max-width: 1400px;
    margin: 0 auto;
}

.management-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 0.5rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.management-tab-content {
    animation: fadeIn 0.3s ease;
}

.management-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.management-card h3 {
    font-size: 1.125rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.management-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.management-row input[type="file"] {
    padding: 0.6rem;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    flex: 1;
    min-width: 200px;
}

.management-row input,
.management-row select {
    padding: 0.6rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 150px;
}

.role-select {
    min-width: 110px;
    padding: 0.35rem 0.6rem;
    font-size: 0.9rem;
}

.user-level-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(15, 118, 110, 0.12);
    color: var(--primary-dark);
}

.stats-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stats-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.stats-stack,
.stats-panel .stats-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stats-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.stats-trend {
    justify-content: space-between;
    padding: 0.25rem 0.25rem 0;
}

.stats-title {
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: var(--text-primary);
}

.stats-chart {
    position: relative;
    height: 320px;
}

@media (max-width: 960px) {
    .stats-chart {
        height: 260px;
    }
}

.management-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
}

.management-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.management-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.management-item-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.management-item-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.management-item-meta span {
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.management-item-actions {
    display: flex;
    gap: 0.5rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead {
    background: var(--bg-tertiary);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-light);
}

.table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
    color: var(--text-primary);
}

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

.table tbody tr.mgmt-attempt-row {
    transition: background-color var(--transition-fast);
}

.table tbody tr.mgmt-attempt-row:hover {
    background: rgba(45, 212, 191, 0.1);
    cursor: pointer;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.small {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.small.ok {
    color: var(--success);
}

.small.bad {
    color: var(--danger);
}

.pre {
    white-space: pre-wrap;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
    max-height: 400px;
    overflow-y: auto;
}

/* Listening module */
.track-card.listening {
    background: linear-gradient(135deg, rgba(14, 116, 144, 0.08), rgba(249, 115, 22, 0.12));
    border: 1px solid rgba(14, 116, 144, 0.25);
}

.track-card.listening .track-tag {
    background: rgba(14, 116, 144, 0.15);
    color: #0e7490;
}

.audio-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.audio-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.audio-panel-title {
    font-weight: 700;
    color: var(--text-primary);
}

.audio-speed {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audio-speed select {
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.audio-progress-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.audio-progress {
    flex: 1;
    min-width: 160px;
    accent-color: var(--primary);
}

.listening-instructions {
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    margin-bottom: 1rem;
}

.listening-question-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.listening-question {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.listening-question-text {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.listening-question-number {
    color: var(--primary);
    margin-right: 0.35rem;
}

.listening-question-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.listening-input {
    text-transform: none;
}
