/* ============================================
   高中生网络安全自测与防诈知识库
   设计风格：苹果风格 - 简洁、现代、流畅
   ============================================ */

/* CSS变量定义 */
:root {
    /* 主色调 - 苹果蓝 */
    --primary: #007AFF;
    --primary-light: #5AC8FA;
    --primary-dark: #0051D5;
    
    /* 辅助色 */
    --success: #34C759;
    --warning: #FF9500;
    --danger: #FF3B30;
    --purple: #AF52DE;
    --teal: #5AC8FA;
    
    /* 背景色 */
    --bg-primary: #F5F5F7;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F0F0F2;
    
    /* 文字色 */
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --text-tertiary: #C7C7CC;
    
    /* 边框和阴影 */
    --border-color: #D2D2D7;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 50%;
    
    /* 过渡 */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* 字体 */
    --font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* 侧边栏宽度 */
    --sidebar-width: 260px;
}

/* 深色模式 */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1C1C1E;
    --bg-tertiary: #2C2C2E;
    --text-primary: #FFFFFF;
    --text-secondary: #98989D;
    --text-tertiary: #636366;
    --border-color: #38383A;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

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

/* ============================================
   加载动画
   ============================================ */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
}

.shield-icon {
    font-size: 80px;
    margin-bottom: 24px;
    animation: shieldPulse 2s ease-in-out infinite;
}

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

.loading-content h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.loading-content p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 40px;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    height: 100%;
    background: white;
    border-radius: 2px;
    animation: loadingProgress 2s ease-in-out infinite;
}

@keyframes loadingProgress {
    0% { width: 0%; transform: translateX(-100%); }
    50% { width: 100%; transform: translateX(0); }
    100% { width: 100%; transform: translateX(100%); }
}

/* ============================================
   主应用布局
   ============================================ */
#app {
    display: flex;
    min-height: 100vh;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ============================================
   侧边栏
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 28px;
}

.user-avatar {
    position: relative;
    width: 40px;
    height: 40px;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-secondary);
}

.nav-menu {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 28px;
}

.nav-section h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-left: 12px;
}

.nav-section ul {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 4px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.badge {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.badge.new {
    background: var(--danger);
    color: white;
}

.nav-item.active .badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.sidebar-footer {
    display: none;
}

.progress-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
}

.progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px;
    transition: width var(--transition-slow);
}

/* ============================================
   主内容区
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    height: 72px;
    background: rgba(245, 245, 247, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(210, 210, 215, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    margin-bottom: 8px;
}

[data-theme="dark"] .top-bar {
    background: rgba(28, 28, 30, 0.95);
    border-bottom: 1px solid rgba(56, 56, 58, 0.5);
}

.breadcrumb {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

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

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

.btn-icon:hover {
    background: var(--border-color);
    color: var(--text-primary);
    transform: scale(1.05);
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: var(--radius-full);
}

.content-wrapper {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.content-section {
    display: none;
    animation: sectionFadeIn 0.4s ease;
}

.content-section.active {
    display: block;
}

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

/* ============================================
   首页样式
   ============================================ */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-bottom: 60px;
    padding: 40px 0;
}

.hero-content {
    max-width: 600px;
}

.hero-title {
    font-size: 52px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.8;
}

.hero-stats {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.stat-card {
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.72s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.72s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 14px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-6px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.72s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.72s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-6px);
}

.btn-large {
    padding: 18px 36px;
    font-size: 18px;
}

/* 盾牌动画 */
.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.shield-animation {
    position: relative;
    width: 300px;
    height: 300px;
}

.shield-ring {
    position: absolute;
    border-radius: var(--radius-full);
    border: 2px solid;
    animation: ringExpand 3s ease-out infinite;
}

.ring-1 {
    width: 100%;
    height: 100%;
    border-color: rgba(0, 122, 255, 0.1);
    animation-delay: 0s;
}

.ring-2 {
    width: 75%;
    height: 75%;
    top: 12.5%;
    left: 12.5%;
    border-color: rgba(0, 122, 255, 0.15);
    animation-delay: 0.5s;
}

.ring-3 {
    width: 50%;
    height: 50%;
    top: 25%;
    left: 25%;
    border-color: rgba(0, 122, 255, 0.2);
    animation-delay: 1s;
}

@keyframes ringExpand {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.shield-core {
    position: absolute;
    width: 35%;
    height: 35%;
    top: 32.5%;
    left: 32.5%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    box-shadow: var(--shadow-lg);
    animation: corePulse 2s ease-in-out infinite;
}

@keyframes corePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 功能卡片网格 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 28px;
    cursor: pointer;
    transition: transform 0.72s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.72s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 20px;
    color: white;
}

.feature-icon.blue {
    background: linear-gradient(135deg, #007AFF, #5AC8FA);
}

.feature-icon.green {
    background: linear-gradient(135deg, #34C759, #30D158);
}

.feature-icon.orange {
    background: linear-gradient(135deg, #FF9500, #FFCC00);
}

.feature-icon.purple {
    background: linear-gradient(135deg, #AF52DE, #BF5AF2);
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.feature-arrow {
    position: absolute;
    bottom: 28px;
    right: 28px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.feature-card:hover .feature-arrow {
    background: var(--primary);
    color: white;
    transform: translateX(4px);
}

/* ============================================
   通用部分样式
   ============================================ */
.section-header {
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-header p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* ============================================
   自测页面样式
   ============================================ */
.quiz-start {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 60px 0;
}

.quiz-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    margin: 0 auto 32px;
    box-shadow: var(--shadow-lg);
}

.quiz-intro h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
}

.quiz-intro p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.8;
}

.quiz-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.info-item i {
    color: var(--primary);
}

.quiz-progress {
    margin-bottom: 40px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
}

/* 题目样式 */
.question-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.question-number {
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 16px;
}

.question-text {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 32px;
    line-height: 1.6;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.option-item:hover {
    background: var(--border-color);
    transform: translateX(8px);
}

.option-item.selected {
    background: rgba(0, 122, 255, 0.1);
    border-color: var(--primary);
}

.option-item.correct {
    background: rgba(52, 199, 89, 0.1);
    border-color: var(--success);
}

.option-item.wrong {
    background: rgba(255, 59, 48, 0.1);
    border-color: var(--danger);
}

.option-letter {
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.option-item.selected .option-letter {
    background: var(--primary);
    color: white;
}

.option-item.correct .option-letter {
    background: var(--success);
    color: white;
}

.option-item.wrong .option-letter {
    background: var(--danger);
    color: white;
}

.option-text {
    font-size: 16px;
    flex: 1;
}

.question-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
}

/* 结果页面 */
.result-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 60px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 0 auto;
}

.result-icon {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    margin: 0 auto 32px;
}

.result-icon.excellent {
    background: linear-gradient(135deg, #34C759, #30D158);
    color: white;
}

.result-icon.good {
    background: linear-gradient(135deg, #007AFF, #5AC8FA);
    color: white;
}

.result-icon.average {
    background: linear-gradient(135deg, #FF9500, #FFCC00);
    color: white;
}

.result-icon.poor {
    background: linear-gradient(135deg, #FF3B30, #FF6B6B);
    color: white;
}

.result-card h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 24px;
}

.result-score {
    font-size: 72px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.score-total {
    font-size: 36px;
    color: var(--text-secondary);
}

.result-description {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.result-details {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 32px;
    text-align: left;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* ============================================
   知识库样式
   ============================================ */
.knowledge-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
}

.knowledge-sidebar {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 96px;
}

.search-box {
    position: relative;
    margin-bottom: 24px;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
}

.category-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.category-item.active {
    background: var(--primary);
    color: white;
}

.category-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.knowledge-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid var(--border-color);
    transition: transform 0.72s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.72s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

.knowledge-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.knowledge-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.knowledge-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.knowledge-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.knowledge-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.knowledge-card-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.knowledge-tag {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ============================================
   案例页面样式
   ============================================ */
.cases-filter {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 28px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: transform 0.72s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.72s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-6px);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
}

.case-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.72s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.72s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.case-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.case-header {
    padding: 24px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.case-type {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.case-type.phishing {
    background: rgba(255, 59, 48, 0.1);
    color: var(--danger);
}

.case-type.impersonation {
    background: rgba(175, 82, 222, 0.1);
    color: var(--purple);
}

.case-type.loan {
    background: rgba(255, 149, 0, 0.1);
    color: var(--warning);
}

.case-type.part-time {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary);
}

.case-date {
    font-size: 13px;
    color: var(--text-secondary);
}

.case-card h3 {
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 600;
}

.case-content {
    padding: 0 24px 24px;
}

.case-section {
    margin-bottom: 20px;
}

.case-section:last-child {
    margin-bottom: 0;
}

.case-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.case-section p {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.7;
}

.case-warning {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.1), rgba(255, 107, 107, 0.1));
    border-left: 4px solid var(--danger);
    padding: 16px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-top: 20px;
}

.case-warning h4 {
    color: var(--danger);
    margin-bottom: 8px;
}

/* ============================================
   风险检测样式
   ============================================ */
.risk-check-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.check-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.check-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.check-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.check-panel {
    display: none;
}

.check-panel.active {
    display: block;
}

.check-input-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.check-input-area textarea,
.check-input-area input {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: all var(--transition-fast);
}

.check-input-area input {
    min-height: auto;
}

.check-input-area textarea:focus,
.check-input-area input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.check-result {
    margin-top: 24px;
    padding: 24px;
    border-radius: var(--radius-md);
    animation: slideUp 0.3s ease;
}

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

.check-result.safe {
    background: rgba(52, 199, 89, 0.1);
    border: 1px solid var(--success);
}

.check-result.warning {
    background: rgba(255, 149, 0, 0.1);
    border: 1px solid var(--warning);
}

.check-result.danger {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid var(--danger);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.result-header i {
    font-size: 24px;
}

.check-result.safe .result-header i {
    color: var(--success);
}

.check-result.warning .result-header i {
    color: var(--warning);
}

.check-result.danger .result-header i {
    color: var(--danger);
}

.result-header h4 {
    font-size: 18px;
    font-weight: 600;
}

.check-result p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ============================================
   紧急求助样式
   ============================================ */
.emergency-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.emergency-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.72s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.72s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.emergency-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.emergency-card.urgent {
    border-color: var(--danger);
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.05), rgba(255, 107, 107, 0.05));
}

.emergency-icon {
    width: 64px;
    height: 64px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--primary);
    margin: 0 auto 20px;
}

.emergency-card.urgent .emergency-icon {
    background: var(--danger);
    color: white;
}

.emergency-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.emergency-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.emergency-card.urgent .emergency-number {
    color: var(--danger);
}

.emergency-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.btn-emergency {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.72s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.72s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 14px rgba(0, 122, 255, 0.3);
    min-width: 140px;
    margin-top: auto;
    flex-shrink: 0;
}

.btn-emergency:hover {
    background: var(--primary-dark);
    transform: translateY(-6px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.emergency-card.urgent .btn-emergency {
    background: var(--danger);
    box-shadow: 0 4px 14px rgba(255, 59, 48, 0.3);
}

.emergency-card.urgent .btn-emergency:hover {
    background: #D70015;
    box-shadow: 0 6px 20px rgba(255, 59, 48, 0.4);
}

.emergency-guide {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.emergency-guide h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 32px;
}

.guide-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.guide-step {
    display: flex;
    gap: 16px;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.step-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   AI对话窗口样式
   ============================================ */
.ai-chat-widget {
    position: fixed;
    bottom: 100px;
    right: 32px;
    width: 380px;
    height: 500px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.ai-chat-widget.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    position: relative;
}

.ai-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-secondary);
}

.ai-info {
    display: flex;
    flex-direction: column;
}

.ai-name {
    font-weight: 600;
    font-size: 15px;
}

.ai-status-text {
    font-size: 12px;
    color: var(--success);
}

.chat-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.chat-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.3s ease;
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
    flex-shrink: 0;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: white;
}

.message-content {
    background: var(--bg-tertiary);
    padding: 14px 18px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    max-width: calc(100% - 60px);
}

.ai-message .message-content {
    background: rgba(0, 122, 255, 0.1);
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 4px;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-content {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 18px;
}

.message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 4px 0;
}

.chat-input-area {
    padding: 16px 20px 20px;
    border-top: 1px solid var(--border-color);
}

.input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.input-wrapper input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    background: var(--bg-tertiary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.btn-send {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--primary);
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all var(--transition-fast);
}

.btn-send:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.quick-replies {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-reply {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 50px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-reply:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-secondary);
}

/* AI聊天悬浮按钮 */
.ai-chat-toggle {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.4);
    transition: all var(--transition-normal);
    z-index: 999;
    padding-bottom: env(safe-area-inset-bottom);
}

.ai-chat-toggle:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 6px 30px rgba(0, 122, 255, 0.5);
}

.toggle-tooltip {
    position: absolute;
    right: 70px;
    background: var(--text-primary);
    color: white;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all var(--transition-fast);
}

.ai-chat-toggle:hover .toggle-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 1200px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .emergency-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .guide-steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .shield-animation {
        width: 200px;
        height: 200px;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .knowledge-layout {
        grid-template-columns: 1fr;
    }
    
    .knowledge-sidebar {
        position: static;
    }
    
    .category-list {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .category-item {
        flex: 1;
        min-width: 140px;
        justify-content: center;
    }
    
    .cases-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .top-bar {
        padding: 0 16px;
    }
    
    .content-wrapper {
        padding: 16px;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .emergency-grid {
        grid-template-columns: 1fr;
    }
    
    .guide-steps {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 14px;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .section-header h2 {
        font-size: 24px;
    }
    
    .cases-filter {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .knowledge-grid {
        grid-template-columns: 1fr;
    }
    
    .result-card {
        padding: 32px 20px;
    }
    
    .result-score {
        font-size: 48px;
    }
    
    .emergency-number {
        font-size: 28px;
    }
    
    .ai-chat-widget {
        right: 8px;
        left: 8px;
        bottom: 90px;
        width: auto;
        height: 420px;
    }
    
    .ai-chat-toggle {
        right: 16px;
        bottom: 20px;
        width: 56px;
        height: 56px;
        font-size: 22px;
    }
    
    .quiz-info {
        flex-direction: column;
        gap: 16px;
    }
    
    .question-card {
        padding: 24px 16px;
    }
    
    .question-text {
        font-size: 16px;
    }
    
    .option-item {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 24px;
    }
    
    .hero-subtitle {
        font-size: 13px;
    }
    
    .feature-card {
        padding: 20px;
    }
    
    .feature-card h3 {
        font-size: 18px;
    }
    
    .emergency-card {
        padding: 24px 16px;
    }
    
    .btn-emergency {
        width: 100%;
        min-width: auto;
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .emergency-guide {
        padding: 24px 16px;
    }
    
    .guide-step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin: 0 auto 12px;
    }
    
    .quick-replies {
        flex-direction: column;
    }
    
    .quick-reply {
        width: 100%;
    }
    
    .category-item {
        min-width: 100%;
        justify-content: flex-start;
    }
    
    .search-box input {
        font-size: 13px;
    }
}

/* ============================================
   滚动条样式
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ============================================
   选中文字样式
   ============================================ */
::selection {
    background: rgba(0, 122, 255, 0.3);
    color: var(--text-primary);
}

/* ============================================
   移动端菜单按钮
   ============================================ */
.mobile-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 22px;
    margin-right: 16px;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
}

/* ============================================
   稳定性增强
   ============================================ */
* {
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    -webkit-appearance: none;
    appearance: none;
}

button {
    -webkit-user-select: none;
    user-select: none;
}

a {
    -webkit-touch-callout: none;
}

.sidebar {
    -webkit-overflow-scrolling: touch;
}

.content-wrapper {
    -webkit-overflow-scrolling: touch;
}

.chat-messages {
    -webkit-overflow-scrolling: touch;
}

/* 防止iOS橡皮筋效果导致的页面抖动 */
@supports (-webkit-overflow-scrolling: touch) {
    body {
        overscroll-behavior: none;
    }
}

/* GPU加速 */
.feature-card,
.knowledge-card,
.case-card,
.emergency-card,
.btn-primary,
.btn-secondary,
.filter-btn {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
