/* ================================================
 *  Kids English Garden - Rainbow & Playful Theme
 *  
 *  Design Language:
 *    - Primary: Soft sky blue (#E3F2FD → #BBDEFB)
 *    - Accent: Warm sunshine yellow (#FFD54F / #FFC107)
 *    - Text: Friendly charcoal (#424242 / #616161)
 *    - Glassmorphism cards with rounded corners
 *    - Rainbow color palette for different categories
 *    - Large rounded shapes (kid-friendly)
 *
 *  Color Palette (20 categories × unique hues):
 *    电器        → Warm Orange  (#FF9800 / #FFF3E0)
 *    家具/日常用品 → Teal       (#009688 / #E0F2F1)
 *    洗护用品    → Soft Pink    (#E91E63 / #FCE4EC)
 *    餐具        → Purple      (#9C27B0 / #F3E5F5)
 *    植物        → Green       (#4CAF50 / #E8F5E9)
 *    交通工具    → Red         (#F44336 / #FFEBEE)
 *    气象/自然事物 → Blue       (#2196F3 / #E3F2FD)
 *    动物        → Amber       (#FF9800 / #FFF8E1)
 *    蔬菜水果    → Lime        (#8BC34A / #F1F8E9)
 *    饮食        → Deep Orange (#FF5722 / #FBE9E7)
 *    衣服/配饰   → Indigo      (#3F51B5 / #E8EAF6)
 *    身体部位    → Cyan        (#00BCD4 / #E0F7FA)
 *    球类        → Yellow      (#FFEB3B / #FFFDE7)
 *    动作        → Light Green (#8BC34A / #F1F8E9)
 *    形状        → Pink        (#E91E63 / #FCE4EC)
 *    游乐/户外设施 → Deep Purple(#673AB7 / #EDE7F6)
 *    节日相关    → Red         (#F44336 / #FFEBEE)
 *    公共设施/标识 → Grey       (#607D8B / #ECEFF1)
 *    形容词      → Light Blue  (#03A9F4 / #E1F5FE)
 *    其他        → Brown       (#795548 / #EFEBE9)
 *  ================================================ */

/* ===== CSS Custom Properties ===== */
:root {
    /* Primary rainbow theme */
    --sky-50:  #E3F2FD;
    --sky-100: #BBDEFB;
    --sky-200: #90CAF9;
    --sky-300: #64B5F6;
    --sky-400: #42A5F5;
    --sky-500: #2196F3;
    
    --sun-50:  #FFFDE7;
    --sun-100: #FFF9C4;
    --sun-200: #FFF59D;
    --sun-300: #FFEE58;
    --sun-400: #FFD54F;
    --sun-500: #FFC107;
    
    --grass-50:  #E8F5E9;
    --grass-100: #C8E6C9;
    --grass-400: #66BB6A;
    --grass-500: #4CAF50;
    
    --coral:         #FF6B6B;
    --coral-light:   #FF8A8A;
    --coral-deep:    #E55B5B;
    --charcoal:      #424242;
    --charcoal-dark: #212121;
    --muted:         #757575;
    --muted-light:   #9E9E9E;
    --subtle:        #BDBDBD;
    
    --bg-gradient:   linear-gradient(160deg, #E3F2FD 0%, #BBDEFB 40%, #FFF8E1 70%, #FCE4EC 100%);
    --border-soft:   rgba(100, 181, 246, 0.2);
    --shadow-soft:   rgba(100, 181, 246, 0.15);
    --shadow-coral:  rgba(255, 107, 107, 0.2);
    
    --glass-bg:      rgba(255, 255, 255, 0.9);
    --glass-border:  rgba(255, 255, 255, 0.6);
    --glass-blur:    blur(16px);
    
    --radius-sm:     10px;
    --radius-md:     16px;
    --radius-lg:     24px;
    --radius-xl:     32px;
    --radius-pill:   9999px;
    
    --font-display: 'Comic Sans MS', 'Georgia', 'Times New Roman', 'Noto Serif SC', cursive;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 
                 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
                 sans-serif;
    
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring:   cubic-bezier(0.22, 1, 0.36, 1);
    --ease-smooth:   cubic-bezier(0.4, 0, 0.2, 1);

    /* Category colors */
    --cat-appliance:     #FF9800; --cat-appliance-bg:   #FFF3E0;
    --cat-furniture:     #009688; --cat-furniture-bg:   #E0F2F1;
    --cat-toiletries:    #E91E63; --cat-toiletries-bg:  #FCE4EC;
    --cat-tableware:     #9C27B0; --cat-tableware-bg:   #F3E5F5;
    --cat-plant:         #4CAF50; --cat-plant-bg:        #E8F5E9;
    --cat-vehicle:       #F44336; --cat-vehicle-bg:     #FFEBEE;
    --cat-weather:       #2196F3; --cat-weather-bg:     #E3F2FD;
    --cat-animal:        #FF9800; --cat-animal-bg:      #FFF8E1;
    --cat-fruit:         #8BC34A; --cat-fruit-bg:       #F1F8E9;
    --cat-food:          #FF5722; --cat-food-bg:        #FBE9E7;
    --cat-clothes:       #3F51B5; --cat-clothes-bg:     #E8EAF6;
    --cat-body:          #00BCD4; --cat-body-bg:        #E0F7FA;
    --cat-ball:          #FFEB3B; --cat-ball-bg:         #FFFDE7;
    --cat-action:        #8BC34A; --cat-action-bg:       #F1F8E9;
    --cat-shape:         #E91E63; --cat-shape-bg:        #FCE4EC;
    --cat-playground:    #673AB7; --cat-playground-bg:   #EDE7F6;
    --cat-holiday:       #F44336; --cat-holiday-bg:      #FFEBEE;
    --cat-facility:      #607D8B; --cat-facility-bg:     #ECEFF1;
    --cat-adjective:      #03A9F4; --cat-adjective-bg:    #E1F5FE;
    --cat-other:         #795548; --cat-other-bg:         #EFEBE9;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    overflow: hidden;
    font-family: var(--font-body);
    background: var(--bg-gradient);
    color: var(--charcoal);
    min-height: 100vh;
}

/* ===== Canvas Container ===== */
#canvas-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}

#canvas-container canvas {
    display: block;
}

/* ========================================
 *  TOP CONTROL BAR
 *  ======================================== */

/* ---- Back to Home Button ---- */
.back-home-btn {
    position: fixed;
    bottom: 16px;
    left: 12px;
    z-index: 200;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 18px;
    border-radius: 9999px;
    background: rgba(255, 107, 107, 0.92);
    color: #fff;
    font-size: 14px;
    font-family: -apple-system, 'PingFang SC', sans-serif;
    font-weight: 300;
    text-decoration: none;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.35);
    transition: all 0.2s;
}
.back-home-btn:hover { background: rgba(255, 107, 107, 1); transform: scale(1.05); }
.back-home-btn:active { transform: scale(0.95); }

.top-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px 14px 24px;
    background: 
        linear-gradient(
            180deg,
            rgba(227, 242, 253, 0.97) 0%,
            rgba(227, 242, 253, 0.88) 55%,
            rgba(227, 242, 253, 0.60) 80%,
            transparent 100%
        );
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 2px solid var(--border-soft);
    box-shadow: 0 4px 20px var(--shadow-soft);
}

/* ---- Left Section ---- */
.top-bar-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
}

/* Logo */
.garden-logo {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: #1976D2;
    letter-spacing: 0.5px;
    white-space: nowrap;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 4px;
    text-shadow: 0 2px 4px rgba(25, 118, 210, 0.15);
}

.garden-logo span {
    color: var(--coral);
    font-style: italic;
}

.garden-logo::before {
    content: '🌟';
    font-size: 20px;
    margin-right: 2px;
}

/* ---- Category Filter Chips ---- */
.category-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 700px;
}

.category-chip {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: all 0.28s var(--ease-spring);
    border: 2px solid transparent;
    white-space: nowrap;
    user-select: none;
    font-weight: 600;
    opacity: 0.85;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.category-chip:hover {
    transform: translateY(-3px) scale(1.05);
    opacity: 1;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.category-chip.active {
    opacity: 1 !important;
    border-width: 2.5px;
    transform: scale(1.06) translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.category-chip.dimmed {
    opacity: 0.2 !important;
    filter: grayscale(0.5);
    transform: scale(0.94) !important;
}

.category-chip.dimmed:hover {
    opacity: 0.5 !important;
}

/* Category chips with rainbow colors */
.cat-电器 { background: var(--cat-appliance-bg); color: var(--cat-appliance); }
.cat-电器.active { border-color: var(--cat-appliance); }
.cat-家具\/日常用品 { background: var(--cat-furniture-bg); color: var(--cat-furniture); }
.cat-家具\/日常用品.active { border-color: var(--cat-furniture); }
.cat-洗护用品 { background: var(--cat-toiletries-bg); color: var(--cat-toiletries); }
.cat-洗护用品.active { border-color: var(--cat-toiletries); }
.cat-餐具 { background: var(--cat-tableware-bg); color: var(--cat-tableware); }
.cat-餐具.active { border-color: var(--cat-tableware); }
.cat-植物 { background: var(--cat-plant-bg); color: var(--cat-plant); }
.cat-植物.active { border-color: var(--cat-plant); }
.cat-交通工具 { background: var(--cat-vehicle-bg); color: var(--cat-vehicle); }
.cat-交通工具.active { border-color: var(--cat-vehicle); }
.cat-气象\/自然事物 { background: var(--cat-weather-bg); color: var(--cat-weather); }
.cat-气象\/自然事物.active { border-color: var(--cat-weather); }
.cat-动物 { background: var(--cat-animal-bg); color: var(--cat-animal); }
.cat-动物.active { border-color: var(--cat-animal); }
.cat-蔬菜水果 { background: var(--cat-fruit-bg); color: var(--cat-fruit); }
.cat-蔬菜水果.active { border-color: var(--cat-fruit); }
.cat-饮食 { background: var(--cat-food-bg); color: var(--cat-food); }
.cat-饮食.active { border-color: var(--cat-food); }
.cat-衣服\/配饰 { background: var(--cat-clothes-bg); color: var(--cat-clothes); }
.cat-衣服\/配饰.active { border-color: var(--cat-clothes); }
.cat-身体部位 { background: var(--cat-body-bg); color: var(--cat-body); }
.cat-身体部位.active { border-color: var(--cat-body); }
.cat-球类 { background: var(--cat-ball-bg); color: #F9A825; }
.cat-球类.active { border-color: var(--cat-ball); }
.cat-动作 { background: var(--cat-action-bg); color: var(--cat-action); }
.cat-动作.active { border-color: var(--cat-action); }
.cat-形状 { background: var(--cat-shape-bg); color: var(--cat-shape); }
.cat-形状.active { border-color: var(--cat-shape); }
.cat-游乐\/户外设施 { background: var(--cat-playground-bg); color: var(--cat-playground); }
.cat-游乐\/户外设施.active { border-color: var(--cat-playground); }
.cat-节日相关 { background: var(--cat-holiday-bg); color: var(--cat-holiday); }
.cat-节日相关.active { border-color: var(--cat-holiday); }
.cat-公共设施\/标识 { background: var(--cat-facility-bg); color: var(--cat-facility); }
.cat-公共设施\/标识.active { border-color: var(--cat-facility); }
.cat-形容词 { background: var(--cat-adjective-bg); color: var(--cat-adjective); }
.cat-形容词.active { border-color: var(--cat-adjective); }
.cat-其他 { background: var(--cat-other-bg); color: var(--cat-other); }
.cat-其他.active { border-color: var(--cat-other); }

/* ---- Right Section ---- */
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

/* Search Box */
.search-box {
    position: relative;
}

.search-input {
    width: 160px;
    height: 36px;
    padding: 0 16px 0 38px;
    border-radius: var(--radius-pill);
    border: 2px solid var(--border-soft);
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: all 0.35s var(--ease-spring);
    color: var(--charcoal);
}

.search-input::placeholder {
    color: var(--subtle);
    font-weight: 400;
}

.search-input:focus {
    width: 220px;
    border-color: var(--sky-400);
    background: rgba(255,255,255,0.98);
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.15);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--subtle);
    pointer-events: none;
}

.search-input:focus + .search-icon,
.search-box:focus-within .search-icon {
    color: var(--sky-500);
}

/* View Mode Toggle */
.view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 5px;
    border: 2px solid var(--border-soft);
    box-shadow: 0 2px 8px var(--shadow-soft);
}

.view-btn {
    padding: 6px 14px;
    border: none;
    background: none;
    font-size: 14px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.25s var(--ease-spring);
    color: var(--muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.view-btn:hover:not(.active) {
    color: var(--charcoal);
    background: rgba(33, 150, 243, 0.1);
}

.view-btn.active {
    background: var(--sky-500);
    color: white;
    box-shadow: 0 3px 10px rgba(33, 150, 243, 0.3);
    font-weight: 650;
}

/* ========================================
 *  BOTTOM STATS BAR
 *  ======================================== */

.bottom-stats {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 32px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-pill);
    border: 2px solid var(--border-soft);
    box-shadow: 0 6px 28px var(--shadow-soft);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
}

.stat-number {
    font-weight: 750;
    color: var(--sky-500);
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    min-width: 32px;
    text-align: center;
}

.stat-divider {
    width: 1px;
    height: 22px;
    background: linear-gradient(180deg, transparent 0%, var(--sky-300) 30%, var(--sky-300) 70%, transparent 100%);
}

/* ========================================
 *  WORD CARD (Detail Panel)
 *  ======================================== */

.word-card {
    position: fixed;
    z-index: 200;
    width: 320px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-xl);
    border: 2px solid var(--border-soft);
    box-shadow: 0 12px 48px var(--shadow-soft);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(15px) scale(0.92);
    transition: opacity 0.3s var(--ease-out-back), transform 0.3s var(--ease-out-back);
    overflow: hidden;
}

.word-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--sky-400), var(--coral), var(--sun-400));
    opacity: 0.9;
}

.word-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.word-card > div {
    padding: 22px 22px 20px;
    position: relative;
    z-index: 1;
}

/* Category tag */
.card-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: 0.5px;
}

.card-category-tag::before {
    content: '🏷️';
    font-size: 10px;
}

/* Category-specific card styling */
.card-category-tag.cat-电器 { background: var(--cat-appliance-bg); color: var(--cat-appliance); }
.card-category-tag.cat-家具\/日常用品 { background: var(--cat-furniture-bg); color: var(--cat-furniture); }
.card-category-tag.cat-洗护用品 { background: var(--cat-toiletries-bg); color: var(--cat-toiletries); }
.card-category-tag.cat-餐具 { background: var(--cat-tableware-bg); color: var(--cat-tableware); }
.card-category-tag.cat-植物 { background: var(--cat-plant-bg); color: var(--cat-plant); }
.card-category-tag.cat-交通工具 { background: var(--cat-vehicle-bg); color: var(--cat-vehicle); }
.card-category-tag.cat-气象\/自然事物 { background: var(--cat-weather-bg); color: var(--cat-weather); }
.card-category-tag.cat-动物 { background: var(--cat-animal-bg); color: var(--cat-animal); }
.card-category-tag.cat-蔬菜水果 { background: var(--cat-fruit-bg); color: var(--cat-fruit); }
.card-category-tag.cat-饮食 { background: var(--cat-food-bg); color: var(--cat-food); }
.card-category-tag.cat-衣服\/配饰 { background: var(--cat-clothes-bg); color: var(--cat-clothes); }
.card-category-tag.cat-身体部位 { background: var(--cat-body-bg); color: var(--cat-body); }
.card-category-tag.cat-球类 { background: var(--cat-ball-bg); color: #F9A825; }
.card-category-tag.cat-动作 { background: var(--cat-action-bg); color: var(--cat-action); }
.card-category-tag.cat-形状 { background: var(--cat-shape-bg); color: var(--cat-shape); }
.card-category-tag.cat-游乐\/户外设施 { background: var(--cat-playground-bg); color: var(--cat-playground); }
.card-category-tag.cat-节日相关 { background: var(--cat-holiday-bg); color: var(--cat-holiday); }
.card-category-tag.cat-公共设施\/标识 { background: var(--cat-facility-bg); color: var(--cat-facility); }
.card-category-tag.cat-形容词 { background: var(--cat-adjective-bg); color: var(--cat-adjective); }
.card-category-tag.cat-其他 { background: var(--cat-other-bg); color: var(--cat-other); }

/* Word display */
.card-word {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--charcoal-dark);
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: 1px;
}

.card-meaning {
    font-size: 16px;
    color: var(--muted);
    text-align: center;
    padding: 10px 0;
    background: linear-gradient(180deg, transparent, rgba(33, 150, 243, 0.05));
    border-radius: var(--radius-md);
    margin: 0 -10px;
}

.card-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--sky-200), transparent);
    margin: 14px 0;
}

.card-hint {
    font-size: 12px;
    color: var(--subtle);
    text-align: center;
    font-style: italic;
}

/* ========================================
 *  LOADING SCREEN
 *  ======================================== */

.loading-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: linear-gradient(145deg, var(--sky-100) 0%, var(--sky-200) 35%, var(--sun-100) 65%, var(--coral-light) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.9s var(--ease-smooth), visibility 0.9s;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    position: relative;
    margin-bottom: 28px;
}

.loading-spinner::before,
.loading-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.loading-spinner::before {
    inset: 0;
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.loading-spinner::after {
    inset: 6px;
    border: 4px solid transparent;
    border-top-color: var(--coral);
    border-right-color: var(--coral);
    animation: spin 0.7s cubic-bezier(0.5, 0.05, 0.5, 1) infinite;
    filter: drop-shadow(0 0 8px rgba(255, 107, 107, 0.4));
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-family: var(--font-display);
    font-size: 26px;
    color: #1976D2;
    letter-spacing: 3px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.loading-subtext {
    font-size: 15px;
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 1px;
    animation: loading-pulse 2s ease-in-out infinite;
}

@keyframes loading-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ========================================
 *  HELP HINT OVERLAY
 *  ======================================== */

.hint-overlay {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 90;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 8px 22px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-soft);
    pointer-events: none;
    animation: hint-fade 6s var(--ease-smooth) forwards;
    opacity: 0;
    letter-spacing: 0.3px;
    box-shadow: 0 3px 12px var(--shadow-soft);
}

@keyframes hint-fade {
    0%   { opacity: 0; transform: translateX(-50%) translateY(15px); }
    12%  { opacity: 1; transform: translateX(-50%) translateY(0); }
    82%  { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ========================================
 *  SCROLLBAR
 *  ======================================== */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sky-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--sky-400); }

/* ========================================
 *  RIGHT SIDE VOCABULARY LIST PANEL
 *  ======================================== */

/* Toggle Button */
.vocab-list-toggle {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 150;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: white;
    border: none;
    padding: 14px 18px;
    border-radius: 50px 0 0 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: -4px 4px 20px rgba(255, 107, 107, 0.4);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 2px;
}

.vocab-list-toggle:hover {
    padding-right: 24px;
    transform: translateY(-50%) scale(1.05);
    box-shadow: -6px 6px 25px rgba(255, 107, 107, 0.5);
}

.vocab-list-toggle.active {
    right: 380px;
    border-radius: 50px 0 0 50px;
}

/* Vocabulary List Panel */
.vocab-list-panel {
    position: fixed;
    right: -420px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,252,255,0.98) 100%);
    backdrop-filter: blur(20px);
    box-shadow: -8px 0 40px rgba(0,0,0,0.15);
    z-index: 140;
    transition: right 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    border-left: 3px solid rgba(255, 107, 107, 0.3);
}

.vocab-list-panel.open {
    right: 0;
}

.vocab-panel-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.vocab-panel-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    font-family: var(--font-display);
}

.vocab-panel-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.25);
    color: white;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vocab-panel-close:hover {
    background: rgba(255,255,255,0.4);
    transform: scale(1.1) rotate(90deg);
}

.vocab-list-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.vocab-list-content::-webkit-scrollbar {
    width: 8px;
}

.vocab-list-content::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
}

.vocab-list-content::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 107, 0.3);
    border-radius: 4px;
}

.vocab-list-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 107, 0.5);
}

/* Vocabulary Section */
.vocab-section {
    margin-bottom: 20px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.vocab-section-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 700;
    font-size: 14px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid rgba(0,0,0,0.05);
}

.vocab-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.vocab-word-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
}

.vocab-word-item {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 2px solid transparent;
}

.vocab-word-item:hover {
    background: linear-gradient(135deg, #fff8f0 0%, #fff3e0 100%);
    border-color: #FF8E53;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 142, 83, 0.2);
}

.vocab-word-item.highlight {
    background: #FF8E53;
    border-color: #FF6B6B;
    animation: vocab-pulse 0.3s ease;
}

@keyframes vocab-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.vocab-word-en {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #495057;
    margin-bottom: 4px;
}

.vocab-word-cn {
    display: block;
    font-size: 12px;
    color: #868e96;
}

/* ========================================
 *  TIMELINE 时间轴（细条版）
 *  ======================================== */

.timeline-bar {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 95;
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(560px, 92vw);
    height: 54px;
    padding: 0 16px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--border-soft);
    box-shadow: 0 4px 18px var(--shadow-soft);
    transition: opacity 0.35s var(--ease-spring), transform 0.35s var(--ease-spring);
}

.timeline-toggle {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(33, 150, 243, 0.14);
    font-size: 13px;
    cursor: pointer;
    opacity: 0.55;
    transition: all 0.25s var(--ease-spring);
}

.timeline-toggle.active {
    background: linear-gradient(135deg, #FFD54F 0%, #FFC107 100%);
    opacity: 1;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.45);
}

.timeline-toggle:hover { opacity: 1; transform: scale(1.12); }

/* 轨道容器：轴线 + 月份刻度 */
.timeline-track-wrap {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-axis {
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
}

.timeline-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, #C8E6C9 0%, #81C784 35%, #4CAF50 70%, #2E7D32 100%);
    outline: none;
    cursor: pointer;
    margin: 0;
}

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid #2E7D32;
    cursor: grab;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.timeline-slider::-webkit-slider-thumb:hover {
    transform: scale(1.22);
    box-shadow: 0 3px 10px rgba(46, 125, 50, 0.55);
}

.timeline-slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.1); }

.timeline-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid #2E7D32;
    cursor: grab;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* 日期圆点层（覆盖在轨道上，按真实刻度定位） */
.timeline-marks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.tm-dot {
    position: absolute;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #66BB6A;
    transform: translate(-50%, -50%);
    transition: all 0.2s var(--ease-spring);
    z-index: 1;
}

.tm-dot.active {
    background: #2E7D32;
    border-color: #2E7D32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.22);
    transform: translate(-50%, -50%) scale(1.3);
}

/* 月份刻度行 */
.timeline-months {
    position: relative;
    height: 12px;
}

.tm-month {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 9px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    letter-spacing: 0.2px;
}

/* 右侧只读日期/词数 */
.timeline-readout {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    color: #2E7D32;
    white-space: nowrap;
    min-width: 74px;
    text-align: right;
    line-height: 1.2;
}

.timeline-readout .rdate { display: block; }
.timeline-readout .rcount { display: block; color: #1976D2; font-size: 10px; }

@media (max-width: 600px) {
    .timeline-bar { width: calc(100vw - 20px); height: 50px; bottom: 72px; }
    .timeline-toggle { width: 22px; height: 22px; font-size: 11px; }
    .timeline-slider::-webkit-slider-thumb { width: 14px; height: 14px; }
    .timeline-readout { font-size: 10px; min-width: 66px; }
    .tm-month { font-size: 8px; }
}

/* ========================================
 *  RESPONSIVE DESIGN
 *  ======================================== */

@media (max-width: 1024px) {
    .category-filters { max-width: 520px; }
    .garden-logo { font-size: 19px; }
    .vocab-list-panel { width: 340px; }
    .vocab-list-toggle.active { right: 320px; }
    .vocab-word-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .top-bar { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
    .top-bar-left { flex-wrap: wrap; gap: 8px; width: 100%; }
    .garden-logo { font-size: 16px; }
    .category-filters { max-width: 100%; width: 100%; order: 3; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; -webkit-overflow-scrolling: touch; scrollbar-width: none; touch-action: pan-x; overscroll-behavior-x: contain; }
    .category-filters::-webkit-scrollbar { display: none; }
    .category-chip { font-size: 10px; padding: 4px 10px; flex-shrink: 0; }
    .search-input { width: 120px; font-size: 12px; }
    .search-input:focus { width: 150px; }
    .word-card { width: 280px; }
    .card-word { font-size: 24px; }
    .bottom-stats { gap: 16px; padding: 10px 22px; }
    .stat-item { font-size: 12px; }
    .stat-number { font-size: 16px; }
}

@media (max-width: 600px) {
    .top-bar { padding: 8px 10px; }
    .garden-logo { font-size: 15px; }
    .garden-logo::before { font-size: 16px; }
    .category-filters { gap: 4px; }
    .category-chip { font-size: 9px; padding: 3px 8px; }
    .search-box { display: none; }
    .word-card { width: calc(100vw - 24px); max-width: 280px; left: 12px !important; }
    .bottom-stats { width: calc(100vw - 16px); gap: 10px; padding: 8px 12px; }
    .stat-divider { display: none; }
    .hint-overlay { font-size: 11px; padding: 5px 14px; bottom: 78px; }
    .loading-text { font-size: 18px; }
    .loading-subtext { font-size: 12px; }
    .vocab-list-toggle { padding: 8px 10px; font-size: 12px; }
    .vocab-list-panel { width: 100%; right: -100%; }
    .vocab-list-toggle.active { right: calc(100% - 44px); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
    .word-card { transition: opacity 0.1s ease; }
}
