:root {
    --bg-primary: #FFF8E7;
    --bg-secondary: #F5EDD6;
    --bg-tertiary: #ECE1C0;
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border-color: #E8D5A8;
    --accent: #2563EB;
    --accent-hover: #1D4ED8;
    --danger: #DC2626;
    --success: #16A34A;
    --freq-high: #DC2626;
    --freq-mid: #F59E0B;
    --freq-low: #6B7280;
    --bookmark-bg: rgba(251, 191, 36, 0.15);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="night"] {
    --bg-primary: #1A1A2E;
    --bg-secondary: #16213E;
    --bg-tertiary: #0F3460;
    --text-primary: #E0E0E0;
    --text-secondary: #A0A0A0;
    --text-tertiary: #707070;
    --border-color: #2A2A4A;
    --freq-high: #FCA5A5;
    --freq-mid: #FCD34D;
    --freq-low: #9CA3AF;
    --bookmark-bg: rgba(251, 191, 36, 0.2);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}

[data-theme="eye_care"] {
    --bg-primary: #E0F0E0;
    --bg-secondary: #C8E6C9;
    --bg-tertiary: #A5D6A7;
    --text-primary: #1B3A1B;
    --text-secondary: #3A5A3A;
    --text-tertiary: #5A7A5A;
    --border-color: #A5D6A7;
    --freq-high: #B71C1C;
    --freq-mid: #E65100;
    --freq-low: #546E7A;
    --bookmark-bg: rgba(129, 212, 113, 0.25);
}

body { background: var(--bg-primary); color: var(--text-primary); }

#app-container {
    display: flex; flex-direction: column; height: 100dvh;
    max-width: 768px; margin: 0 auto; position: relative; overflow: hidden;
}

#page-content {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.page { min-height: 100%; }
.page-header { padding: 20px 16px 12px; }
.page-header h1, .page-header h2 { font-size: 1.4em; font-weight: 700; }

#bottom-tab-bar {
    display: flex; justify-content: space-around; align-items: center;
    height: calc(56px + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg-secondary); border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.tab-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 12px; color: var(--text-tertiary); font-size: 0.7em;
    transition: color 0.2s; min-width: 56px;
}
.tab-item.active { color: var(--accent); }
.tab-icon { font-size: 1.4em; }

.empty-state {
    text-align: center; padding: 60px 20px; color: var(--text-secondary);
}
.empty-icon { font-size: 3em; margin-bottom: 12px; }
.empty-hint { font-size: 0.85em; color: var(--text-tertiary); margin-top: 6px; }

@media (min-width: 769px) {
    #app-container { border-left: 1px solid var(--border-color); border-right: 1px solid var(--border-color); }
}
