/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Lucide 线性图标基础样式（替代 Font Awesome <i>） */
.i {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.125em;
    fill: none;
    stroke: currentColor;
    flex-shrink: 0;
}

/* 旋转动画（替代 Font Awesome 的 fa-spin） */
.i-spin {
    animation: i-spin 1s linear infinite;
}

@keyframes i-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== 悦心致和设计系统 =====
 * 设计理念：温暖、治愈、平静
 * 灵感来源：Headspace, Calm, 冥想类应用
 * 核心特点：
 * - 柔和的渐变色彩
 * - 圆润的形状
 * - 充足的留白
 * - 温暖的色调
 */

:root {
    /* 主色调 - 温暖的紫色系 */
    --primary: #7c6fea;
    --primary-light: #a29bfe;
    --primary-dark: #6c5ce7;
    --primary-soft: rgba(124, 111, 234, 0.12);
    
    /* 辅助色 - 柔和的渐变 */
    --secondary: #a78bfa;
    --accent: #f0abfc;
    --accent-soft: rgba(240, 171, 252, 0.15);
    
    /* 功能色 - 柔和版本 */
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.12);
    
    /* 情绪色板 - 用于情绪记录等 */
    --mood-happy: #fbbf24;
    --mood-calm: #60a5fa;
    --mood-sad: #94a3b8;
    --mood-anxious: #f97316;
    
    /* 柔和色块 - 用于卡片背景 */
    --tint-lavender: #ede9fe;
    --tint-rose: #fce7f3;
    --tint-mint: #d1fae5;
    --tint-sky: #e0f2fe;
    --tint-peach: #ffedd5;
    --tint-cream: #fef3c7;
    
    /* 文字色 */
    --text: #1f2937;
    --text-light: #4b5563;
    --text-lighter: #9ca3af;
    --text-muted: #d1d5db;
    
    /* 背景色 */
    --bg: #faf8ff;
    --bg-soft: #f5f3ff;
    --bg-warm: #fffbf5;
    --card-bg: #ffffff;
    
    /* 边框和阴影 */
    --border: #e5e7eb;
    --border-soft: #f3f4f6;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 16px rgba(124, 111, 234, 0.08);
    --shadow-lg: 0 8px 32px rgba(124, 111, 234, 0.12);
    --shadow-glow: 0 0 24px rgba(124, 111, 234, 0.2);
    
    /* 圆角 - 更圆润 */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* 间距 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;
    
    --tab-height: 64px;
}

/* 深色模式 - 温暖的深色 */
[data-theme="dark"] {
    --primary: #a78bfa;
    --primary-light: #c4b5fd;
    --primary-dark: #8b5cf6;
    --primary-soft: rgba(167, 139, 250, 0.15);
    
    --secondary: #c4b5fd;
    --accent: #f0abfc;
    --accent-soft: rgba(240, 171, 252, 0.12);
    
    --text: #f3f4f6;
    --text-light: #d1d5db;
    --text-lighter: #9ca3af;
    --text-muted: #6b7280;
    
    --bg: #0f0d1a;
    --bg-soft: #1a1625;
    --bg-warm: #1a1625;
    --card-bg: #1e1b2e;
    
    --border: #2d2640;
    --border-soft: #252136;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 24px rgba(167, 139, 250, 0.15);
    
    /* 深色模式下的柔和色块 */
    --tint-lavender: rgba(167, 139, 250, 0.15);
    --tint-rose: rgba(244, 114, 182, 0.15);
    --tint-mint: rgba(52, 211, 153, 0.15);
    --tint-sky: rgba(96, 165, 250, 0.15);
    --tint-peach: rgba(251, 146, 60, 0.15);
    --tint-cream: rgba(251, 191, 36, 0.15);
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

#app {
    height: 100%;
    max-width: 430px;
    margin: 0 auto;
    position: relative;
    background: var(--bg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* ===== 页面容器 ===== */
#page-container {
    height: calc(100% - var(--tab-height));
    position: relative;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes fadeUpPage {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.page.active {
    display: flex;
    animation: fadeUpPage 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* ===== 页面头部 ===== */
.page-header {
    padding: 16px 20px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-soft);
    flex-shrink: 0;
}

.page-header h1 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions i {
    font-size: 18px;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.header-actions i:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

/* ===== 页面内容 ===== */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

/* ===== Banner ===== */
.banner-section {
    padding: var(--space-lg);
    position: relative;
}

.banner-slider {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 160px;
    box-shadow: var(--shadow);
}

.banner-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: var(--space-xl);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.banner-item.active {
    opacity: 1;
    pointer-events: auto;
}

.banner-text {
    color: #fff;
}

.banner-text h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.banner-text p {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 14px;
    line-height: 1.5;
}

.btn-banner {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-banner:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

.banner-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    width: 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* ===== 工具入口 ===== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    padding: 0 var(--space-lg) var(--space-lg);
}

.tools-group-label {
    font-size: 12px;
    color: var(--text-lighter);
    padding: 0 var(--space-lg) var(--space-sm);
}

.tool-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.tool-item:hover {
    background: var(--primary-soft);
}

.tool-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.tool-item:active .tool-icon {
    transform: scale(0.92);
}

.tool-item:hover .tool-icon {
    box-shadow: var(--shadow);
}

.tool-item span {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

/* ===== 区块 ===== */
.section {
    padding: 0 16px 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.more {
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
}

/* ===== 课程卡片 ===== */
.course-list {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    padding-bottom: var(--space-sm);
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.course-list::-webkit-scrollbar {
    display: none;
}

.course-card {
    min-width: 200px;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    scroll-snap-align: start;
    border: 1px solid var(--border-soft);
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.course-card:active {
    transform: scale(0.98);
}

.course-cover {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.course-cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, rgba(0,0,0,0.05));
}

.course-info {
    padding: var(--space-md);
}

.course-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.course-info p {
    font-size: 12px;
    color: var(--text-lighter);
    margin-bottom: 8px;
    line-height: 1.4;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.course-price {
    color: var(--danger);
    font-weight: 700;
    font-size: 15px;
}

.course-price.free {
    color: var(--success);
    background: var(--success-soft);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 12px;
}

.course-students {
    font-size: 11px;
    color: var(--text-lighter);
}

/* ===== 训练营卡片 ===== */
.camp-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.camp-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: var(--space-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-soft);
}

.camp-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-soft);
}

.camp-card:active {
    transform: scale(0.99);
}

.camp-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.camp-info {
    flex: 1;
    min-width: 0;
}

.camp-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}

.camp-info p {
    font-size: 12px;
    color: var(--text-lighter);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0;
}

.camp-tags {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
    align-items: flex-end;
}

.camp-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--tint-lavender);
    color: var(--primary);
}

.camp-base {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px !important;
    color: var(--primary) !important;
    -webkit-line-clamp: 1 !important;
    margin-top: 2px !important;
}

.camp-base .i, .base-card-info .i {
    width: 12px;
    height: 12px;
}

.camp-base-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--tint-lavender);
    border-radius: var(--radius);
    padding: var(--space-md);
    margin-bottom: 16px;
    cursor: pointer;
}

.camp-base-card .i {
    width: 24px;
    height: 24px;
    color: var(--primary);
    flex-shrink: 0;
}

.camp-base-card-info h5 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.camp-base-card-info p {
    font-size: 11px;
    color: var(--text-lighter);
}

/* ===== 线下基地卡片 ===== */
.base-list {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    padding-bottom: 4px;
}

.base-list-modal {
    flex-direction: column;
    overflow-x: visible;
}

.base-card {
    flex: 0 0 220px;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-soft);
    cursor: pointer;
    transition: all 0.3s ease;
}

.base-list-modal .base-card {
    flex: 1 1 auto;
    margin-bottom: var(--space-md);
}

.base-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.base-card-cover {
    height: 110px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.base-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.base-card-info {
    padding: 10px 12px;
}

.base-card-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.base-card-info p {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-lighter);
}

.base-detail-cover {
    height: 140px;
    border-radius: var(--radius);
    background-size: cover;
    background-position: center;
}

.base-facility-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ===== 底部导航 ===== */
.tab-bar {
    height: var(--tab-height);
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid var(--border-soft);
    position: relative;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px 16px;
    transition: all 0.2s ease;
    color: var(--text-lighter);
    border-radius: var(--radius);
    position: relative;
}

.tab.active {
    color: var(--primary);
}

.tab.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 0 0 3px 3px;
}

.tab i,
.tab .i {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.tab.active i,
.tab.active .i {
    transform: scale(1.1);
}

.tab span {
    font-size: 11px;
    font-weight: 500;
}

/* ===== 二级标签栏 ===== */
.tab-bar-secondary {
    display: flex;
    gap: 0;
    padding: 12px 16px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.tab-bar-secondary .tab-item {
    padding: 6px 16px;
    font-size: 13px;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s;
}

.tab-bar-secondary .tab-item.active {
    background: var(--primary);
    color: #fff;
}

/* ===== 课程网格 ===== */
.course-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
}

.course-grid .course-card {
    min-width: unset;
}

/* ===== 按钮 ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(124, 111, 234, 0.3);
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(124, 111, 234, 0.4);
}

.btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(124, 111, 234, 0.3);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: var(--bg-soft);
    border-color: var(--primary-light);
    color: var(--primary);
}

.btn-secondary:active {
    transform: scale(0.97);
}

.full-width {
    width: 100%;
}

/* 多按钮横排行：自动减小内边距，防止文字换行 */
.btn-action-row {
    display: flex;
    gap: 8px;
}
.btn-action-row .btn-primary,
.btn-action-row .btn-secondary {
    flex: 1;
    padding: 11px 8px;
    font-size: 13px;
    flex-direction: column;
    gap: 4px;
}
.btn-action-row .btn-primary .i,
.btn-action-row .btn-secondary .i {
    font-size: 16px;
}

/* ===== 模态框 ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    width: 100%;
    max-width: 430px;
    height: 72vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--space-xl);
    overflow-y: auto;
    animation: slideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

/* 内容较少时自动收缩（确认弹窗、简单提示等） */
.modal-content.modal-auto {
    height: auto;
    max-height: 72vh;
}

@keyframes slideUp {
    from { 
        transform: translateY(100%);
        opacity: 0.8;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-soft);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-light);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(31, 41, 55, 0.92);
    backdrop-filter: blur(12px);
    color: #fff;
    padding: 12px 22px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    animation: toastIn 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: var(--shadow-lg);
    max-width: 80vw;
    text-align: center;
    pointer-events: none;
}

.toast.hidden {
    display: none;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== 隐藏类 ===== */
.hidden {
    display: none !important;
}

/* ===== 徽章 ===== */
.badge {
    background: linear-gradient(135deg, var(--danger), #f97316);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}


/* ===== 已登录提示 ===== */
.logged-in-hint {
    text-align: center;
    padding: 20px;
}

.logged-in-hint p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.logged-in-hint .btn-continue {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 12px;
}

.logged-in-hint .btn-switch {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: var(--text-lighter);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
}

.logged-in-hint .btn-switch:hover {
    background: var(--bg);
}


/* 头像编辑提示 */
.avatar {
    position: relative;
}

.avatar-edit-hint {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    border: 2px solid #fff;
}


/* 通知按钮 */
.notification-btn {
    position: relative;
    cursor: pointer;
    padding: 8px;
}

.notification-btn .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}


/* ===== 深色模式额外样式 ===== */
[data-theme="dark"] .banner-item {
    filter: brightness(0.9);
}

[data-theme="dark"] .tool-icon {
    filter: brightness(0.85);
}

[data-theme="dark"] .camp-tag {
    background: rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .login-screen {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

[data-theme="dark"] .login-container {
    background: rgba(31, 41, 55, 0.95);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .modal-content {
    background: var(--card-bg);
}

[data-theme="dark"] .quiz-option {
    background: var(--bg);
    border-color: var(--border);
}

[data-theme="dark"] .quiz-option:hover {
    background: var(--bg-light);
}

/* ===== 全局搜索样式 ===== */
.global-search-container {
    padding: 0 4px;
    display: flex;
    flex-direction: column;
    height: calc(72vh - 80px);
}

.search-scroll-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: 25px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.search-input-wrapper i {
    color: var(--text-lighter);
    font-size: 16px;
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0 12px;
    font-size: 15px;
    outline: none;
    color: var(--text);
}

.search-input-wrapper .clear-search {
    cursor: pointer;
    opacity: 0.5;
}

.search-input-wrapper .clear-search:hover {
    opacity: 1;
}

.search-history, .search-hot {
    margin-bottom: 20px;
}

.search-history-header, .search-hot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-light);
}

.clear-history {
    color: var(--text-lighter);
    cursor: pointer;
    font-size: 12px;
}

.search-history-tags, .search-hot-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-tag, .hot-tag {
    padding: 6px 14px;
    background: var(--bg);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.history-tag:hover, .hot-tag:hover {
    background: var(--primary);
    color: #fff;
}

.search-category {
    padding: 12px 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.search-category h4 {
    font-size: 13px;
    color: var(--text-lighter);
    font-weight: normal;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--bg);
    margin: 0 -16px;
    padding: 12px 16px;
}

.result-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    margin-right: 12px;
    flex-shrink: 0;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-info h5 {
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-info h5 mark {
    background: rgba(102, 126, 234, 0.3);
    color: var(--primary);
    padding: 0 2px;
    border-radius: 2px;
}

.result-info p {
    font-size: 12px;
    color: var(--text-lighter);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-type {
    font-size: 11px;
    color: var(--text-lighter);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.search-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-lighter);
}

.search-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.search-empty p {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-light);
}

/* ===== 录制面板样式 ===== */
.recording-panel {
    padding: 0 4px;
}

.video-preview-container {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.video-preview-container video {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.audio-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    background: var(--bg);
    border-radius: 12px;
    margin-bottom: 16px;
}

.audio-visualizer {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #fff;
    margin-bottom: 16px;
}

.recording-time {
    font-size: 32px;
    font-weight: 300;
    color: var(--text);
    font-family: monospace;
}

.recording-indicator {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(244, 67, 54, 0.9);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.audio-preview-container .recording-indicator {
    position: static;
    margin-top: 12px;
}

.rec-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: recBlink 1s infinite;
}

@keyframes recBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.recording-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.btn-record {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #f44336, #e91e63);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.btn-record:hover {
    transform: scale(1.05);
}

.btn-record.stop {
    background: linear-gradient(135deg, #333, #555);
}

.recording-result {
    text-align: center;
}

.recording-result h4 {
    margin-bottom: 16px;
    color: var(--success);
}

.recording-result video,
.recording-result audio {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 16px;
}

.recording-actions {
    display: flex;
    gap: 12px;
}

.recording-actions button {
    flex: 1;
}

.recording-tip {
    text-align: center;
    font-size: 12px;
    color: var(--text-lighter);
    margin-top: 16px;
}

/* ===== 加载动画样式 ===== */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.global-loader.hidden {
    display: none;
}

.loader-content {
    background: var(--card-bg);
    padding: 30px 40px;
    border-radius: 12px;
    text-align: center;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    color: var(--text-light);
    font-size: 14px;
}

/* ===== 骨架屏样式 ===== */
.skeleton-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
}

.skeleton-image {
    height: 120px;
    background: linear-gradient(90deg, var(--bg) 25%, var(--bg-light) 50%, var(--bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-content {
    padding: 12px;
}

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, var(--bg) 25%, var(--bg-light) 50%, var(--bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-line.short {
    height: 12px;
}

.skeleton-list-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--bg) 25%, var(--bg-light) 50%, var(--bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-right: 12px;
    flex-shrink: 0;
}

.skeleton-text {
    padding: 16px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== 设置页开关样式 ===== */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 30px;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.switch input:checked + .slider {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.switch input:checked + .slider:before {
    transform: translateX(22px);
}


/* ===== 页面返回按钮 ===== */
.header-back {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    font-size: 18px;
    border-radius: 50%;
    transition: background 0.2s;
    flex-shrink: 0;
}

.header-back:hover {
    background: var(--bg);
}

.header-back:active {
    background: var(--border);
}

.header-placeholder {
    width: 36px;
    flex-shrink: 0;
}

/* 个人中心页面的返回按钮 */
.profile-back {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: background 0.2s;
}

.profile-back:hover {
    background: rgba(0, 0, 0, 0.4);
}

.profile-back:active {
    background: rgba(0, 0, 0, 0.5);
}

/* 调整页面头部布局 */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-header h1 {
    flex: 1;
    text-align: center;
}

/* 首页头部保持原样 */
#page-home .page-header {
    justify-content: space-between;
}

#page-home .page-header h1 {
    text-align: left;
    flex: none;
}

/* ===== 全局工具类 ===== */

/* 首页工具展开/收起按钮 */
#tools-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 0 4px;
    color: var(--text-lighter);
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}
#tools-toggle-btn:active { color: var(--primary); }

/* 工具区折叠动画容器 */
#extra-tools-wrap {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
}

/* 全局确认弹窗遮罩 */
#global-confirm-modal .admin-modal-content {
    border-radius: 16px;
}

/* 菜单 badge 位置修正（紧贴文字右侧，不挤 chevron） */
.menu-item .badge {
    flex: none;
    margin-left: auto;
    margin-right: 8px;
}
