:root {
    --primary: #6C5CE7;
    --primary-light: #A29BFE;
    --primary-dark: #5A4BD1;
    --accent: #FF6B6B;
    --accent-light: #FFA8A8;
    --bg: #F8F9FA;
    --bg-card: #FFFFFF;
    --text: #2D3436;
    --text-secondary: #636E72;
    --text-light: #B2BEC3;
    --border: #E9ECEF;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-reading: 'Noto Serif SC', serif;
    --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --reader-bg: #FFFFFF;
    --reader-text: #2D3436;
    --reader-line-height: 2;
    --reader-font-size: 18px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ========== 启动屏 ========== */
.splash-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #6C5CE7 0%, #A29BFE 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s, transform 0.6s;
}

.splash-screen.fade-out {
    opacity: 0;
    transform: scale(1.1);
}

.splash-content { text-align: center; }

.splash-logo {
    position: relative;
    margin-bottom: 24px;
}

.logo-pulse {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    margin: 0 auto 16px;
    animation: pulse 2s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-pulse::after {
    content: '📖';
    font-size: 36px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
}

.splash-tagline {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    margin-bottom: 40px;
}

.splash-loading {
    width: 120px;
    height: 3px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    margin: 0 auto;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    background: #fff;
    border-radius: 3px;
    animation: loading 1.5s ease-in-out;
}

@keyframes loading {
    0% { width: 0; }
    100% { width: 100%; }
}

/* ========== 主容器 ========== */
.main-container {
    min-height: 100vh;
    position: relative;
}

/* ========== iframe 容器 ========== */
.module-frame {
    width: 100%;
    height: calc(100vh - 64px);
    border: none;
    display: block;
    transition: height 0.3s ease;
}

.module-frame.reader-active {
    height: 100vh;
    position: fixed;
    inset: 0;
    z-index: 200;
}

/* ========== 底部导航 ========== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid var(--border);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
    transition: transform 0.3s ease;
}

.tab-bar.hidden-nav {
    transform: translateY(100%);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.tab-item svg {
    width: 22px;
    height: 22px;
    fill: var(--text-light);
    transition: var(--transition);
}

.tab-item span {
    font-size: 11px;
    color: var(--text-light);
    transition: var(--transition);
}

.tab-item.active svg { fill: var(--primary); }
.tab-item.active span { color: var(--primary); font-weight: 600; }

.tab-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    width: 16px;
    height: 16px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badge-bounce 2s infinite;
}

@keyframes badge-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ========== 活体指示器 ========== */
.living-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
}

.living-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: living-pulse 1.5s infinite;
}

@keyframes living-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255,107,107,0.4); }
    50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(255,107,107,0); }
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }