/* ========================================
   区域人工智能通识教育平台 - 公共样式
   风格仿照：aicx-zhixin.iflyaiedu.com
   设计特征：天空蓝主色、浅蓝白底、扁平设计、白底卡片+细边框
   ======================================== */

:root {
    --primary: #368fff;
    --primary-dark: #1890ff;
    --primary-light: #58a2ff;
    --primary-bg: #f0f7ff;
    --secondary: #3b71f3;
    --accent: #096dd9;
    --success: #24c366;
    --warning: #ffae00;
    --danger: #ff543a;
    --text-primary: #262626;
    --text-secondary: #595959;
    --text-light: #8c8c8c;
    --text-disabled: #bfbfbf;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f9fd;
    --bg-tertiary: #f0f1f4;
    --bg-hover: #f2f3f5;
    --border-color: #d9dce2;
    --border-light: #f0f1f4;
    --border-lighter: #f4f5f7;
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-xl: 0 8px 24px rgba(0,0,0,0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.2s ease;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: var(--primary); transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ====== 头部导航 ====== */
.site-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 1000;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; color: var(--text-primary); }
.logo-img { height: 32px; width: auto; object-fit: contain; }
.logo-text { color: var(--text-primary); }
.main-nav { display: flex; gap: 4px; }
.nav-link {
    padding: 8px 16px; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 14px; font-weight: 500;
    transition: var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--primary); background: var(--primary-bg); }
.header-right { display: flex; align-items: center; gap: 10px; }
.user-info {
    position: relative; display: flex; align-items: center; gap: 8px;
    cursor: pointer; padding: 6px 12px; border-radius: var(--radius-sm);
    transition: var(--transition);
}
.user-info:hover { background: var(--bg-hover); }
.user-name { font-size: 14px; color: var(--text-primary); font-weight: 500; }
.user-dropdown {
    display: none; position: absolute; top: 100%; right: 0;
    background: var(--bg-primary); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    min-width: 160px; padding: 4px 0; z-index: 100;
}
.user-dropdown a {
    display: block; padding: 10px 16px; font-size: 14px;
    color: var(--text-primary); border-bottom: 1px solid var(--border-light);
}
.user-dropdown a:last-child { border-bottom: none; }
.user-dropdown a:hover { background: var(--bg-hover); color: var(--primary); }

/* ====== 按钮 ====== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
    border: none; cursor: pointer; transition: var(--transition); text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }
.btn-white { background: #fff; color: var(--primary); border: 1px solid var(--border-color); }
.btn-white:hover { background: var(--bg-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-ghost:hover { color: var(--primary); border-color: var(--primary); }
.btn-lg { padding: 12px 32px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-workbench {
    background: var(--primary); color: #fff; font-weight: 500;
    padding: 7px 18px; border-radius: var(--radius-sm); border: none;
}
.btn-workbench:hover { background: var(--primary-dark); color: #fff; }

/* ====== Hero区域 - 浅色清爽风格 ====== */
.hero-section {
    position: relative; min-height: 420px; display: flex; align-items: center;
    background: var(--bg-secondary); color: var(--text-primary); overflow: hidden;
}
.hero-section::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 80% 20%, rgba(54,143,255,0.08) 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(54,143,255,0.05) 0%, transparent 50%);
}
.hero-content { position: relative; z-index: 1; max-width: 640px; }
.hero-title { font-size: 36px; font-weight: 700; line-height: 1.4; margin-bottom: 16px; color: var(--text-primary); }
.hero-subtitle { font-size: 16px; line-height: 1.8; color: var(--text-secondary); margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; }

/* ====== 页面Banner - 浅色风格 ====== */
.page-banner {
    position: relative; min-height: 200px; display: flex; align-items: center;
    background: var(--bg-secondary); color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}
.page-banner::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 70% 30%, rgba(54,143,255,0.06) 0%, transparent 50%);
}
.page-banner-content { position: relative; z-index: 1; }
.page-banner-title { font-size: 28px; font-weight: 700; margin-bottom: 8px; color: var(--text-primary); }
.page-banner-desc { font-size: 15px; color: var(--text-secondary); }

/* ====== Section ====== */
.section { padding: 48px 0; }
.section-header { text-align: center; margin-bottom: 36px; }
.section-title { font-size: 24px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.section-desc { font-size: 14px; color: var(--text-secondary); }

/* ====== 数据统计 ====== */
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.stat-item { text-align: center; }
.stat-number { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ====== 课程卡片 - 白底细边框 ====== */
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.course-card {
    background: var(--bg-primary); border-radius: var(--radius-md); overflow: hidden;
    border: 1px solid var(--border-light); transition: var(--transition); text-decoration: none;
    display: flex; flex-direction: column;
}
.course-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-light); transform: translateY(-2px); }
.course-card-cover {
    width: 100%; aspect-ratio: 16/9; overflow: hidden;
    background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center;
}
.course-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.course-card:hover .course-card-cover img { transform: scale(1.03); }
.placeholder-icon { font-size: 40px; color: var(--text-disabled); }
.course-card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.course-card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; line-height: 1.5; }
.course-card-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); margin-top: auto; }
.course-card-tag { background: var(--primary-bg); color: var(--primary); padding: 2px 8px; border-radius: var(--radius-sm); font-size: 12px; }

/* ====== 筛选栏 ====== */
.filter-bar { background: var(--bg-primary); border-radius: var(--radius-md); padding: 16px 20px; margin-bottom: 20px; border: 1px solid var(--border-light); }
.filter-bar-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.filter-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-tag {
    padding: 5px 14px; border-radius: var(--radius-sm); font-size: 13px;
    background: var(--bg-tertiary); color: var(--text-secondary);
    transition: var(--transition); cursor: pointer; border: 1px solid transparent;
}
.filter-tag:hover { color: var(--primary); border-color: var(--primary-light); }
.filter-tag.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ====== 新闻卡片 ====== */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.news-card { background: var(--bg-primary); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-light); transition: var(--transition); }
.news-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-light); transform: translateY(-2px); }
.news-card-cover { width: 100%; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; }
.news-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.news-card-body { padding: 14px 16px; }
.news-card-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.news-card-summary { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-light); }
.news-card-link { color: var(--primary); font-weight: 500; }

/* ====== 训练中心 - 应用工具卡片 ====== */
.training-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.training-card {
    background: var(--bg-primary); border-radius: var(--radius-md); padding: 24px 16px;
    text-align: center; border: 1px solid var(--border-light); transition: var(--transition);
    text-decoration: none; display: flex; flex-direction: column; align-items: center;
}
.training-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-light); transform: translateY(-2px); }
.training-card-icon { font-size: 36px; margin-bottom: 10px; }
.training-card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.training-card-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ====== 详情页 ====== */
.detail-card { background: var(--bg-primary); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-light); }
.detail-card-header { padding: 20px 24px; border-bottom: 1px solid var(--border-light); }
.detail-card-body { padding: 20px 24px; }
.rich-content { line-height: 1.8; color: var(--text-primary); }
.rich-content p { margin-bottom: 12px; }
.rich-content img { max-width: 100%; border-radius: var(--radius-sm); }
.rich-content h1, .rich-content h2, .rich-content h3 { margin: 20px 0 10px; }

/* ====== 分页 ====== */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.pagination a, .pagination span {
    padding: 6px 12px; border-radius: var(--radius-sm); font-size: 13px;
    background: var(--bg-primary); color: var(--text-secondary); border: 1px solid var(--border-color);
}
.pagination a:hover { color: var(--primary); border-color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ====== 空状态 ====== */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state-icon { font-size: 48px; margin-bottom: 10px; }
.empty-state-text { font-size: 14px; color: var(--text-light); }

/* ====== 认证页面 - 浅色背景 ====== */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-secondary); padding: 20px; }
.auth-box { background: #fff; border-radius: var(--radius-lg); padding: 36px; max-width: 440px; width: 100%; box-shadow: var(--shadow-lg); border: 1px solid var(--border-light); }
.auth-box h2 { text-align: center; font-size: 22px; margin-bottom: 6px; color: var(--text-primary); }
.auth-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 28px; font-size: 14px; }
.auth-form-group { margin-bottom: 16px; }
.auth-form-group label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--text-primary); }
.auth-form-group input, .auth-form-group select, .auth-form-group textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); font-size: 14px; transition: var(--transition); background: #fff;
}
.auth-form-group input:focus, .auth-form-group select:focus, .auth-form-group textarea:focus {
    border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px rgba(54,143,255,0.1);
}
.auth-btn {
    width: 100%; padding: 11px; background: var(--primary); color: #fff;
    border: none; border-radius: var(--radius-sm); font-size: 15px; cursor: pointer;
    transition: var(--transition); margin-top: 8px;
}
.auth-btn:hover { background: var(--primary-dark); }
.auth-footer { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-secondary); }
.auth-footer a { color: var(--primary); font-weight: 500; }
.auth-msg { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.auth-msg.error { background: #fef0f0; color: var(--danger); border: 1px solid #fde2e2; }
.auth-msg.success { background: #f6ffed; color: var(--success); border: 1px solid #d9f7be; }
.role-select { display: flex; gap: 12px; margin-bottom: 4px; }
.role-option {
    flex: 1; padding: 16px; border: 1px solid var(--border-color); border-radius: var(--radius-md);
    text-align: center; cursor: pointer; transition: var(--transition);
}
.role-option.selected { border-color: var(--primary); background: var(--primary-bg); }
.role-option-icon { font-size: 28px; margin-bottom: 6px; }
.role-option-label { font-size: 14px; font-weight: 600; }
.role-option input { display: none; }

/* ====== 尾部 ====== */
.site-footer { background: #fff; border-top: 1px solid var(--border-color); padding: 20px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.footer-desc { font-size: 13px; color: var(--text-secondary); }
.footer-right { font-size: 13px; color: var(--text-secondary); }

/* ====== 移动端菜单 ====== */
.mobile-menu-btn { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 8px; }
.mobile-menu-btn span { width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; }
.mobile-menu { display: none; flex-direction: column; padding: 10px 20px; background: var(--bg-primary); border-top: 1px solid var(--border-color); }
.mobile-menu.show { display: flex; }
.mobile-nav-link { padding: 10px 0; color: var(--text-secondary); font-size: 14px; border-bottom: 1px solid var(--border-light); }

/* ====== 响应式 ====== */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-menu-btn { display: flex; }
    .course-grid, .news-grid { grid-template-columns: 1fr; }
    .training-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-title { font-size: 24px; }
    .hero-subtitle { font-size: 14px; }
    .page-banner-title { font-size: 20px; }
    .section { padding: 32px 0; }
    .section-title { font-size: 20px; }
    .header-right .btn { display: none; }
    .header-right .btn-workbench { display: inline-flex; }
}