/* style.css - Global Styles */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --primary-bg: #eef2ff;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --bg: #f0f0f5;
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
    --radius: 12px;
    --radius-sm: 8px;
}

[data-theme="dark"] {
    --primary-bg: #312e81;
    --gray-50: #18181b;
    --gray-100: #1f2937;
    --gray-200: #374151;
    --gray-300: #4b5563;
    --gray-700: #d1d5db;
    --gray-800: #e5e7eb;
    --gray-900: #f3f4f6;
    --bg: #0f0f17;
    --card-bg: #1a1a2e;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --border: #374151;
    --shadow: 0 1px 3px rgba(0,0,0,.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background .3s, color .3s;
}
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }

/* Navbar */
.navbar {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky; top: 0; z-index: 1000;
    border-bottom: 1px solid var(--border);
}
.nav-container {
    max-width: 1280px; margin: 0 auto;
    display: flex; align-items: center; gap: 16px;
    padding: 0 24px; height: 64px;
}
.nav-logo { font-size: 20px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.nav-search { flex: 1; max-width: 480px; position: relative; }
.nav-search input {
    width: 100%; padding: 8px 16px;
    border: 2px solid var(--border); border-radius: 24px;
    background: var(--gray-100); color: var(--text);
    font-size: 14px; outline: none; transition: all .2s;
}
.nav-search input:focus { border-color: var(--primary); background: var(--card-bg); }
.search-suggest {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    margin-top: 4px; max-height: 320px; overflow-y: auto; z-index: 9999;
}
.search-suggest.show { display: block; }
.search-suggest-item {
    padding: 10px 16px; cursor: pointer; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 8px;
}
.search-suggest-item:last-child { border-bottom: none; }
.search-suggest-item:hover { background: var(--primary-bg); }
.search-suggest-item .word { font-weight: 600; color: var(--text); }
.search-suggest-item .phonetic { font-size: 12px; color: var(--text-muted); }
.search-suggest-item .trans { font-size: 13px; color: var(--text-muted); margin-left: auto; }
.nav-menu { display: flex; align-items: center; gap: 12px; }
.nav-link { color: var(--text); font-weight: 500; padding: 6px 16px; border-radius: var(--radius-sm); transition: all .2s; }
.nav-link:hover { color: var(--primary); background: var(--primary-bg); }
.nav-link-primary { background: var(--primary); color: #fff !important; }
.nav-link-primary:hover { background: var(--primary-dark); color: #fff !important; }
.nav-dropdown { position: relative; }
.nav-user { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text); padding: 6px 12px; border-radius: var(--radius-sm); transition: background .2s; }
.nav-user:hover { background: var(--primary-bg); }
.nav-avatar, .nav-avatar-placeholder { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.nav-avatar-placeholder { display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-weight: 600; font-size: 14px; }
.nav-dropdown-menu {
    display: none; position: absolute; right: 0; top: 100%;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    min-width: 180px; padding: 8px 0; margin-top: 4px; z-index: 9999;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a { display: block; padding: 8px 20px; color: var(--text); font-size: 14px; }
.nav-dropdown-menu a:hover { background: var(--primary-bg); color: var(--primary); }
.nav-dropdown-menu hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.theme-toggle { background: none; border: none; cursor: pointer; font-size: 20px; padding: 4px 8px; border-radius: var(--radius-sm); transition: background .2s; }
.theme-toggle:hover { background: var(--primary-bg); }

/* Flash messages */
.flash-message {
    max-width: 1280px; margin: 16px auto; padding: 12px 20px;
    border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: space-between;
    margin-left: 24px; margin-right: 24px;
}
.flash-success { background: #d1fae5; color: #065f46; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-info { background: #dbeafe; color: #1e40af; }
.flash-warning { background: #fef3c7; color: #92400e; }
.flash-close { cursor: pointer; font-size: 20px; }

/* Container */
.container { max-width: 1280px; margin: 0 auto; padding: 24px; }

/* Hero */
.hero {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff; padding: 60px 24px; text-align: center;
    border-radius: 0 0 24px 24px;
}
.hero h1 { font-size: 36px; margin-bottom: 12px; font-weight: 800; }
.hero p { font-size: 16px; opacity: .9; margin-bottom: 32px; }
.hero-search {
    max-width: 600px; margin: 0 auto; position: relative;
}
.hero-search input {
    width: 100%; padding: 16px 24px; font-size: 16px;
    border: none; border-radius: 32px; box-shadow: 0 4px 20px rgba(0,0,0,.15);
    outline: none;
}
.hero-search-suggest {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(0,0,0,.15);
    margin-top: 8px; max-height: 400px; overflow-y: auto; z-index: 999;
}
.hero-search-suggest.show { display: block; }

/* Cards */
.card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
    border: 1px solid var(--border); transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--primary); }

/* Grid */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Section */
.section { margin-bottom: 32px; }
.section-title {
    font-size: 22px; font-weight: 700; margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px; color: var(--text);
}
.section-title .icon { color: var(--primary); }

/* Daily word */
.daily-word-card {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff; border-radius: var(--radius); padding: 32px;
    text-align: center; margin-bottom: 24px;
}
.daily-word-card .label { font-size: 14px; opacity: .8; margin-bottom: 8px; }
.daily-word-card .word { font-size: 36px; font-weight: 800; margin-bottom: 8px; }
.daily-word-card .phonetic { font-size: 16px; opacity: .9; margin-bottom: 12px; }
.daily-word-card .pos { display: inline-block; background: rgba(255,255,255,.2); padding: 2px 10px; border-radius: 12px; font-size: 12px; margin-bottom: 12px; }
.daily-word-card .translation { font-size: 16px; opacity: .95; margin-bottom: 16px; }
.daily-word-card .btn { display: inline-block; padding: 8px 24px; background: rgba(255,255,255,.2); color: #fff; border-radius: 24px; font-weight: 600; transition: background .2s; }
.daily-word-card .btn:hover { background: rgba(255,255,255,.3); }

/* Word list */
.word-list { list-style: none; }
.word-list-item {
    padding: 16px 0; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 16px;
}
.word-list-item:last-child { border-bottom: none; }
.word-list-item .word-text { font-size: 18px; font-weight: 600; color: var(--primary); min-width: 140px; }
.word-list-item .phonetic { font-size: 14px; color: var(--text-muted); }
.word-list-item .pos { display: inline-block; background: var(--primary-bg); color: var(--primary); padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.word-list-item .translation { flex: 1; color: var(--text-muted); font-size: 14px; }
.word-list-item .views { font-size: 13px; color: var(--text-muted); }

/* Word detail */
.word-header {
    background: var(--card-bg); border-radius: var(--radius);
    padding: 32px; box-shadow: var(--shadow); margin-bottom: 24px;
    border: 1px solid var(--border);
}
.word-header .word-title { font-size: 32px; font-weight: 800; color: var(--text); }
.word-header .phonetics { display: flex; gap: 20px; margin-top: 8px; }
.word-header .phonetic-item { font-size: 14px; color: var(--text-muted); }
.word-header .phonetic-item strong { color: var(--text); }
.word-header .speak-btn { background: var(--primary-bg); border: none; color: var(--primary); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 16px; margin-left: 8px; transition: all .2s; }
.word-header .speak-btn:hover { background: var(--primary); color: #fff; }
.word-header .actions { display: flex; gap: 8px; margin-top: 16px; }
.word-header .action-btn { padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--card-bg); color: var(--text); cursor: pointer; font-size: 14px; transition: all .2s; display: flex; align-items: center; gap: 4px; }
.word-header .action-btn:hover { border-color: var(--primary); color: var(--primary); }
.word-header .action-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.word-content { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
@media (max-width: 1024px) { .word-content { grid-template-columns: 1fr; } }

.def-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.def-item:last-child { border-bottom: none; }
.def-item .pos-badge { display: inline-block; background: var(--primary-bg); color: var(--primary); padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; margin-right: 8px; }
.def-item .def-en { font-size: 15px; color: var(--text); margin-bottom: 4px; }
.def-item .def-cn { font-size: 14px; color: var(--text-muted); }
.def-item .example { margin-top: 8px; padding: 10px 14px; background: var(--gray-100); border-radius: var(--radius-sm); border-left: 3px solid var(--primary); }
.def-item .example-en { font-size: 14px; color: var(--text); font-style: italic; margin-bottom: 4px; }
.def-item .example-cn { font-size: 13px; color: var(--text-muted); }

.form-item { display: flex; gap: 12px; padding: 8px 0; }
.form-item .form-type { color: var(--text-muted); font-size: 14px; min-width: 80px; }
.form-item .form-value { color: var(--text); font-weight: 600; }

.syn-chip { display: inline-block; padding: 4px 12px; border-radius: 16px; font-size: 14px; margin: 4px; cursor: pointer; transition: all .2s; }
.syn-chip.synonym { background: #d1fae5; color: #065f46; }
.syn-chip.antonym { background: #fee2e2; color: #991b1b; }
.syn-chip:hover { opacity: .8; }

/* Sidebar */
.sidebar-card { background: var(--card-bg); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; border: 1px solid var(--border); }
.sidebar-card h4 { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.sidebar-card .item { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.sidebar-card .item:last-child { border-bottom: none; }
.mastery-bar { height: 8px; border-radius: 4px; background: var(--gray-200); overflow: hidden; margin-top: 8px; }
.mastery-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }

/* Comments */
.comment-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.comment-author { font-weight: 600; color: var(--text); }
.comment-date { font-size: 12px; color: var(--text-muted); }
.comment-content { color: var(--text); font-size: 14px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--text); font-size: 14px; }
.form-group input[type=text], .form-group input[type=email], .form-group input[type=password], .form-group select, .form-group textarea {
    width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: var(--radius-sm);
    font-size: 14px; background: var(--card-bg); color: var(--text); transition: border-color .2s; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.btn { display: inline-block; padding: 10px 24px; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s; text-align: center; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-200); color: var(--text); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 32px; font-size: 16px; }
.btn-block { display: block; width: 100%; }

/* Auth pages */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 64px); padding: 24px; }
.auth-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 40px; max-width: 420px; width: 100%; border: 1px solid var(--border); }
.auth-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.auth-card .subtitle { color: var(--text-muted); margin-bottom: 24px; }
.auth-card .alt-link { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); }

/* Dashboard */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 768px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
    background: var(--card-bg); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow); border: 1px solid var(--border); transition: transform .2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .stat-icon { font-size: 24px; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; color: var(--text); }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.stat-card.purple .stat-icon { color: var(--primary); }
.stat-card.green .stat-icon { color: var(--success); }
.stat-card.orange .stat-icon { color: var(--warning); }
.stat-card.red .stat-icon { color: var(--danger); }

/* Calendar */
.calendar { width: 100%; border-collapse: collapse; }
.calendar th, .calendar td { text-align: center; padding: 8px; border: 1px solid var(--border); }
.calendar th { background: var(--gray-100); font-size: 12px; color: var(--text-muted); }
.calendar .checked { background: var(--primary); color: #fff; font-weight: 600; border-radius: 50%; }
.calendar .today { border: 2px solid var(--primary); }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { background: var(--gray-100); font-weight: 600; color: var(--text); white-space: nowrap; }
.table tr:hover { background: var(--gray-50); }
.table .actions { display: flex; gap: 8px; }

/* Badge */
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* Wordlist card */
.wordlist-card {
    background: var(--card-bg); border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow); border: 1px solid var(--border);
    display: flex; align-items: center; gap: 16px; transition: all .2s; cursor: pointer;
}
.wordlist-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.wordlist-card .wl-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; }
.wordlist-card .wl-info { flex: 1; }
.wordlist-card .wl-name { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.wordlist-card .wl-desc { font-size: 14px; color: var(--text-muted); }
.wordlist-card .wl-count { font-size: 14px; color: var(--primary); font-weight: 600; }

/* Hot search */
.hot-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.hot-item:last-child { border-bottom: none; }
.hot-item .rank { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.hot-item .rank.top1 { background: var(--danger); color: #fff; }
.hot-item .rank.top2 { background: var(--warning); color: #fff; }
.hot-item .rank.top3 { background: var(--success); color: #fff; }
.hot-item .rank.other { background: var(--gray-200); color: var(--text-muted); }
.hot-item .keyword { font-weight: 600; color: var(--text); }
.hot-item .count { margin-left: auto; font-size: 12px; color: var(--text-muted); }

/* Announcement */
.announce-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.announce-item:last-child { border-bottom: none; }
.announce-item .title { font-weight: 600; color: var(--text); font-size: 14px; }
.announce-item .time { font-size: 12px; color: var(--text-muted); }

/* Pagination */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 24px; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; background: var(--card-bg); color: var(--text); }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Flashcard */
.flashcard {
    width: 100%; max-width: 500px; margin: 0 auto; perspective: 1000px; cursor: pointer;
}
.flashcard-inner {
    width: 100%; height: 300px; position: relative; transition: transform .6s;
    transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
    position: absolute; width: 100%; height: 100%; backface-visibility: hidden;
    border-radius: var(--radius); display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 32px; text-align: center;
    box-shadow: var(--shadow-lg);
}
.flashcard-front { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; }
.flashcard-back { background: var(--card-bg); color: var(--text); transform: rotateY(180deg); border: 2px solid var(--primary); }
.flashcard .word { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.flashcard .phonetic { font-size: 16px; opacity: .9; }
.flashcard .translation { font-size: 18px; margin-bottom: 8px; }
.flashcard .definition { font-size: 14px; opacity: .8; }
.flashcard-hint { text-align: center; color: var(--text-muted); margin-top: 12px; font-size: 14px; }

/* Quiz */
.quiz-card {
    background: var(--card-bg); border-radius: var(--radius); padding: 32px;
    box-shadow: var(--shadow-lg); max-width: 640px; margin: 0 auto; border: 1px solid var(--border);
}
.quiz-progress { height: 8px; background: var(--gray-200); border-radius: 4px; margin-bottom: 24px; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }
.quiz-question { font-size: 20px; font-weight: 700; margin-bottom: 24px; color: var(--text); }
.quiz-option {
    display: block; width: 100%; padding: 14px 20px; margin-bottom: 12px;
    border: 2px solid var(--border); border-radius: var(--radius-sm);
    background: var(--card-bg); color: var(--text); cursor: pointer; text-align: left;
    font-size: 15px; transition: all .2s;
}
.quiz-option:hover { border-color: var(--primary); background: var(--primary-bg); }
.quiz-option.correct { border-color: var(--success); background: #d1fae5; color: #065f46; }
.quiz-option.wrong { border-color: var(--danger); background: #fee2e2; color: #991b1b; }
.quiz-option:disabled { cursor: default; }

/* Progress ring */
.progress-ring { width: 120px; height: 120px; position: relative; margin: 0 auto; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.progress-ring .bg { stroke: var(--gray-200); }
.progress-ring .progress { stroke: var(--primary); transition: stroke-dashoffset .3s; }
.progress-ring .text { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; }
.progress-ring .text .num { font-size: 28px; font-weight: 800; color: var(--text); }
.progress-ring .text .label { font-size: 12px; color: var(--text-muted); }

/* Admin layout */
.admin-wrap { display: flex; gap: 0; min-height: calc(100vh - 64px); }
.admin-sidebar { width: 240px; background: var(--card-bg); border-right: 1px solid var(--border); padding: 16px 0; flex-shrink: 0; }
.admin-sidebar a { display: block; padding: 12px 24px; color: var(--text); font-size: 14px; transition: all .2s; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.admin-content { flex: 1; padding: 24px; overflow-x: auto; }
@media (max-width: 768px) { .admin-sidebar { display: none; } }

/* User dashboard layout */
.dashboard-wrap { display: flex; gap: 0; min-height: calc(100vh - 64px); }
.dashboard-sidebar { width: 220px; background: var(--card-bg); border-right: 1px solid var(--border); padding: 16px 0; flex-shrink: 0; }
.dashboard-sidebar a { display: block; padding: 12px 24px; color: var(--text); font-size: 14px; transition: all .2s; }
.dashboard-sidebar a:hover, .dashboard-sidebar a.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.dashboard-content { flex: 1; padding: 24px; }
@media (max-width: 768px) { .dashboard-sidebar { display: none; } }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state .title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }

/* Footer */
.footer { background: var(--card-bg); border-top: 1px solid var(--border); padding: 40px 24px 20px; margin-top: 40px; }
.footer-container { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
@media (max-width: 768px) { .footer-container { grid-template-columns: repeat(2, 1fr); } }
.footer-col h4 { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.footer-col a { display: block; padding: 4px 0; font-size: 14px; color: var(--text-muted); }
.footer-col a:hover { color: var(--primary); }
.footer-col p { font-size: 14px; color: var(--text-muted); }
.footer-bottom { max-width: 1280px; margin: 24px auto 0; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; font-size: 13px; color: var(--text-muted); }

/* Charts */
.chart-bar { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding: 16px 0; }
.chart-bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart-bar-fill { width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 4px; transition: height .3s; }
.chart-bar-label { font-size: 12px; color: var(--text-muted); }
.chart-bar-value { font-size: 12px; color: var(--text); font-weight: 600; }

/* Responsive */
@media (max-width: 768px) {
    .nav-search { display: none; }
    .nav-container { padding: 0 12px; }
    .hero h1 { font-size: 24px; }
    .hero { padding: 32px 16px; }
    .word-header .word-title { font-size: 24px; }
    .word-header .phonetics { flex-direction: column; gap: 4px; }
    .container { padding: 16px; }
}

/* Misc */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }

/* ===== 折叠式导航菜单 ===== */
.nav-toggle-all {
    display: flex; align-items: center; gap: 4px;
    padding: 6px 14px; border-radius: var(--radius-sm);
    color: var(--text); font-weight: 500; cursor: pointer; transition: all .2s;
}
.nav-toggle-all:hover { background: var(--primary-bg); color: var(--primary); }
.nav-toggle-all .caret {
    display: inline-block; width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform .2s;
}
.nav-dropdown:hover .nav-toggle-all .caret { transform: rotate(180deg); }

/* 多列下拉菜单 */
.nav-multi-col {
    display: none; flex-direction: row; gap: 0;
    min-width: 360px; padding: 0; overflow: hidden;
}
.nav-dropdown:hover .nav-multi-col { display: flex; }
.nav-col {
    flex: 1; padding: 12px 0;
    border-right: 1px solid var(--border);
}
.nav-col:last-child { border-right: none; }
.nav-col-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: var(--text-muted);
    padding: 4px 20px 8px;
}
.nav-col a {
    display: block; padding: 8px 20px;
    font-size: 14px; color: var(--text);
    transition: all .15s;
}
.nav-col a:hover { background: var(--primary-bg); color: var(--primary); }

/* 移动端折叠菜单 */
@media (max-width: 768px) {
    .nav-menu { flex-wrap: nowrap; }
    .nav-multi-col {
        position: fixed; top: 64px; left: 0; right: 0;
        min-width: 100%; flex-direction: column;
        max-height: 60vh; overflow-y: auto;
    }
    .nav-col { border-right: none; border-bottom: 1px solid var(--border); padding: 8px 0; }
    .nav-col:last-child { border-bottom: none; }
    /* 移动端用点击展开而非hover */
    .nav-dropdown:hover .nav-multi-col { display: none; }
    .nav-dropdown.expanded .nav-multi-col { display: flex; }
    .nav-toggle-all { white-space: nowrap; }
}
