/* ===== 全局变量 ===== */
:root {
    --primary: #4A90D9;
    --primary-dark: #357ABD;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --dark: #2c3e50;
    --gray: #636e72;
    --light-gray: #dfe6e9;
    --bg: #f5f6fa;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 8px;
}

/* ===== 中国股市配色：红涨绿跌 ===== */
.positive { color: var(--danger) !important; }
.negative { color: var(--success) !important; }

/* ===== 重置与基础 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--dark);
    background: var(--bg);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 导航栏 ===== */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-brand {
    font-size: 1.4em;
    font-weight: 700;
}

.brand-gradient {
    background: linear-gradient(135deg, #4A90D9 0%, #764ba2 50%, #4A90D9 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: brand-shimmer 3s ease infinite;
}

@keyframes brand-shimmer {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    padding: 8px 16px;
    border-radius: var(--radius);
    color: var(--gray);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--primary);
    color: var(--white);
}

.nav-links .admin-link {
    background: var(--danger);
    color: var(--white);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-link {
    color: var(--dark);
    font-weight: 500;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    color: var(--gray);
    border-color: var(--light-gray);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ===== 导航栏按钮优化 ===== */
.nav-user .btn {
    padding: 7px 18px;
    border-radius: 10px;
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-user .btn-sm {
    padding: 6px 16px;
    font-size: 0.82em;
}

/* 登录按钮：描边变渐变边框 */
.nav-user .btn-outline {
    background: transparent;
    color: var(--gray);
    border: 2px solid var(--light-gray);
    box-shadow: none;
}

.nav-user .btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(74, 144, 217, 0.06);
    box-shadow: 0 2px 12px rgba(74, 144, 217, 0.12);
    transform: translateY(-2px);
}

.nav-user .btn-outline:active {
    transform: translateY(0);
    background: rgba(74, 144, 217, 0.1);
}

/* 注册按钮：渐变背景 */
.nav-user .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 200% 200%;
    color: var(--white);
    border: 2px solid transparent;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.25);
    animation: navBtnGradient 4s ease infinite;
}

@keyframes navBtnGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.nav-user .btn-primary:hover {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
    animation-play-state: paused;
}

.nav-user .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 按钮微光扫过效果 */
.nav-user .btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.nav-user .btn:hover::after {
    left: 120%;
}

.btn-outline-light {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-outline-light:hover {
    background: var(--white);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #c0392b;
    border-color: #c0392b;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.85em;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1.1em;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ===== Hero 轮播区域 ===== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

.hero-inner h1 {
    font-size: 2.8em;
    margin-bottom: 16px;
}

.hero-inner p {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 30px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* ===== 轮播图样式 ===== */
.hero-carousel {
    padding: 0 0 30px;
    position: relative;
    overflow: visible;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 420px;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: var(--white);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.carousel-slide .hero-inner {
    width: 100%;
}

.carousel-slide .hero-inner h1 {
    font-size: 2.8em;
    margin-bottom: 16px;
    animation: fadeInUp 0.6s ease forwards;
}

.carousel-slide .hero-inner p {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 30px;
    animation: fadeInUp 0.6s ease 0.2s forwards;
    opacity: 0;
}

.carousel-slide .hero-actions {
    animation: fadeInUp 0.6s ease 0.4s forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 左右切换箭头 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.4em;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

/* 指示器 */
.carousel-indicators {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.5);
}

.indicator.active {
    background: var(--white);
    border-color: var(--white);
    transform: scale(1.2);
}

/* ===== 统计栏 ===== */
.stats-bar {
    background: var(--white);
    box-shadow: var(--shadow);
    margin-top: -30px;
    border-radius: var(--radius);
    position: relative;
    z-index: 10;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 30px 0;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--gray);
    font-size: 0.95em;
}

/* ===== 区块 ===== */
.section {
    padding: 50px 0;
}

.section-alt {
    background: var(--white);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 1.6em;
    color: var(--dark);
}

/* ===== 课程卡片网格 ===== */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.course-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.course-card-cover {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: flex-start;
    padding: 12px;
    gap: 8px;
    position: relative;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

/* 封面图片样式 */
.course-card.has-cover .course-card-cover {
    position: relative;
}

.course-card-cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.45) 100%);
    z-index: 1;
}

.course-card-cover .course-badge {
    position: relative;
    z-index: 2;
}

/* "开始学习" 按钮 — 卡片标题行右侧 */
.course-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.course-title-row .course-title {
    flex: 1;
    margin-bottom: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.start-learning-btn {
    display: inline-block !important;
    flex-shrink: 0;
    font-size: 0.78em;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 4px;
    background: var(--primary) !important;
    color: var(--white) !important;
    border: none;
    text-decoration: none !important;
    white-space: nowrap;
    transition: all 0.2s;
}

a.start-learning-btn:hover {
    background: var(--primary-dark) !important;
    color: var(--white) !important;
}

.course-badge {
    background: rgba(255,255,255,0.9);
    color: var(--dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.course-badge.featured {
    background: var(--warning);
    color: var(--white);
}

.course-card-body {
    padding: 16px;
}

.course-title {
    font-size: 1.05em;
    margin-bottom: 8px;
}

.course-title a {
    color: var(--dark);
}

.course-title a:hover {
    color: var(--primary);
}

.course-desc {
    color: var(--gray);
    font-size: 0.9em;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85em;
    color: var(--gray);
}

.price {
    color: var(--danger);
    font-weight: 700;
    font-size: 1.1em;
}

.free {
    color: var(--success);
    font-weight: 600;
}

.member-free {
    color: #f39c12;
    font-weight: 600;
    font-size: 0.8em;
    padding: 2px 8px;
    border-radius: 4px;
    background: #fff3cd;
    border: 1px solid #f39c12;
}

/* ===== 学习路径卡片 ===== */
.path-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.path-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    display: block;
    color: var(--dark);
    border: 2px solid transparent;
    text-align: center;
}

.path-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(74,144,217,0.2);
    color: var(--dark);
}

.path-card-icon {
    font-size: 2.5em;
    margin-bottom: 16px;
}

.path-card h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.path-card p {
    color: var(--gray);
    font-size: 0.9em;
    margin-bottom: 16px;
}

.path-meta {
    display: flex;
    gap: 16px;
    justify-content: center;
    font-size: 0.85em;
    color: var(--gray);
    flex-wrap: wrap;
}

.path-card-large {
    padding: 40px;
}

.path-card-large h3 {
    font-size: 1.4em;
}

.path-card-large p {
    font-size: 1em;
}

/* ===== 筛选器 ===== */
.page-header {
    text-align: center;
    padding: 40px 0 20px;
}

.page-header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

.page-header p {
    color: var(--gray);
}

.search-form {
    display: flex;
    gap: 8px;
    max-width: 500px;
    margin: 16px auto;
}

.search-input {
    flex: 1;
}

.filters {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-weight: 600;
    color: var(--gray);
    min-width: 56px;
}

.filter-tag {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    color: var(--gray);
    background: var(--bg);
    border: 1px solid var(--light-gray);
    transition: all 0.2s;
}

.filter-tag:hover,
.filter-tag.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* ===== 课程详情 ===== */
.course-detail-header {
    background: linear-gradient(135deg, var(--primary), #764ba2);
    color: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    margin-bottom: 30px;
}

.course-detail-header h1 {
    font-size: 2em;
    margin: 16px 0;
}

.course-detail-info .course-badge {
    background: rgba(255,255,255,0.2);
    color: var(--white);
    margin-right: 8px;
}

.course-detail-meta {
    display: flex;
    gap: 20px;
    margin: 16px 0;
    opacity: 0.9;
}

.course-detail-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
}

.course-detail-body {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.course-content {
    line-height: 1.8;
    font-size: 1em;
}

.course-content p {
    margin-bottom: 16px;
}

/* ===== 进度条 ===== */
.progress-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--light-gray);
}

.progress-section h3 {
    margin-bottom: 12px;
}

.progress-bar-container {
    background: var(--light-gray);
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--success));
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s;
}

.progress-controls {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.related-section {
    margin-top: 40px;
}

.related-section h2 {
    margin-bottom: 24px;
}

/* ===== 路径详情 ===== */
.path-detail-header {
    background: linear-gradient(135deg, var(--success), #2ecc71);
    color: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    margin: 30px 0;
    text-align: center;
}

.path-detail-header h1 {
    font-size: 2em;
    margin-bottom: 12px;
}

.path-detail-header .path-meta {
    justify-content: center;
    margin-top: 16px;
}

.path-steps {
    padding: 20px 0 60px;
}

.path-steps h2 {
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--light-gray);
}

.step-item {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.step-item:hover {
    transform: translateX(4px);
}

.step-number {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary);
    min-width: 50px;
    text-align: center;
}

.step-content h3 {
    margin-bottom: 8px;
}

.step-content h3 a {
    color: var(--dark);
}

.step-content h3 a:hover {
    color: var(--primary);
}

.step-content p {
    color: var(--gray);
    margin-bottom: 10px;
}

.step-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85em;
    color: var(--gray);
    flex-wrap: wrap;
}

/* ===== 个人中心 ===== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    margin: 30px 0;
    box-shadow: var(--shadow);
    position: relative;
}

.profile-avatar {
    font-size: 4em;
    background: var(--primary);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-info h1 {
    font-size: 1.8em;
    margin-bottom: 4px;
}

.profile-info p {
    color: var(--gray);
}

.profile-badges {
    display: flex;
    gap: 8px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.profile-member-status {
    font-size: 0.9em;
    color: var(--success);
    font-weight: 600;
    margin-top: 6px;
}

.profile-member-status-inactive {
    color: var(--gray);
    font-weight: normal;
}

/* 右侧：购买/兑换 */
.profile-member-action {
    flex: 1;
    min-width: 0;
}

/* 兑换码输入框 */
.profile-redeem {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--light-gray);
    border-radius: var(--radius);
    padding: 20px;
}

.profile-redeem-label {
    display: block;
    font-size: 1em;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 12px;
}

.profile-redeem-form {
    margin-bottom: 12px;
}

.profile-redeem-form .form-control {
    width: 100%;
    font-family: monospace;
    font-size: 1.1em;
    letter-spacing: 2px;
    padding: 12px 14px;
}

.profile-redeem #redeemResult {
    margin-bottom: 12px;
}

/* 底部双按钮 */
.profile-redeem-actions {
    display: flex;
    gap: 12px;
}

.profile-redeem-actions .btn-buy-code {
    flex: 1;
    text-align: center;
    font-size: 1em;
    padding: 12px 20px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    background: var(--light-gray);
    color: var(--gray);
}

.badge-admin {
    background: var(--danger);
    color: var(--white);
}

.profile-stats {
    margin: 0 0 30px;
}

.profile-tabs {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.tab-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.tab-section h2 {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg);
}

.enrollment-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.enrollment-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
}

.enrollment-title {
    min-width: 180px;
    font-weight: 600;
    color: var(--dark);
}

.progress-text {
    min-width: 50px;
    font-weight: 600;
    color: var(--gray);
}

.completed-badge {
    color: var(--success);
    font-weight: 600;
}

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card h3 {
    font-size: 2em;
    color: var(--primary);
}

/* ===== 认证页面 ===== */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 420px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8em;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--gray);
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius);
    font-size: 1em;
    transition: border-color 0.2s;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--white);
    border-radius: 4px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label:hover {
    background: #e8f4fd;
}

/* ===== 管理后台 ===== */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
}

.admin-nav {
    display: flex;
    gap: 8px;
}

.admin-nav a {
    padding: 8px 16px;
    border-radius: var(--radius);
    color: var(--gray);
    font-weight: 500;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: var(--primary);
    color: var(--white);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card-primary h3 { color: var(--primary); }
.stat-card-success h3 { color: var(--success); }
.stat-card-warning h3 { color: var(--warning); }

.admin-form {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.admin-form .btn {
    margin-right: 8px;
}

/* 封面上传区域 */
.cover-upload-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cover-upload-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cover-preview-hint {
    font-size: 0.85em;
    color: var(--gray);
}

.cover-preview {
    max-width: 400px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--light-gray);
}

.cover-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.admin-table {
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border-collapse: collapse;
}

.admin-table thead {
    background: var(--bg);
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

.admin-table th {
    font-weight: 600;
    color: var(--gray);
    font-size: 0.9em;
}

.admin-table tr:hover {
    background: #f8f9fa;
}

.admin-table td a {
    color: var(--primary);
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-ellipsis {
    padding: 4px 8px;
    color: var(--gray);
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-state p {
    margin-bottom: 16px;
}

/* ===== 表单错误提示 ===== */
.form-error {
    display: block;
    margin-top: 4px;
    color: var(--danger);
    font-size: 0.85em;
}

/* ===== Toast 弹窗通知 ===== */
.toast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 80px;
}

.toast {
    position: relative;
    min-width: 320px;
    max-width: 500px;
    padding: 16px 28px;
    border-radius: 10px;
    font-size: 1.05em;
    font-weight: 700;
    text-align: center;
    line-height: 1.5;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: auto;
    z-index: 100000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast.hide {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
}

.toast-error {
    background: linear-gradient(135deg, #ffe0e0 0%, #fff0f0 100%);
    color: #c0392b;
    border: 2px solid #e74c3c;
    letter-spacing: 0.5px;
}

.toast-success {
    background: linear-gradient(135deg, #e0f8e0 0%, #f0fff0 100%);
    color: #1e8449;
    border: 2px solid #27ae60;
    letter-spacing: 0.5px;
}

.toast-warning {
    background: linear-gradient(135deg, #fff8e0 0%, #fffdf0 100%);
    color: #b7770a;
    border: 2px solid #f39c12;
    letter-spacing: 0.5px;
}

.toast-info {
    background: linear-gradient(135deg, #e0ecff 0%, #f0f6ff 100%);
    color: #2456a8;
    border: 2px solid #4A90D9;
    letter-spacing: 0.5px;
}

/* 弹窗前面的图标装饰 */
.toast::before {
    display: inline-block;
    margin-right: 8px;
    font-size: 1.2em;
    vertical-align: middle;
}

.toast-error::before   { content: '❌'; }
.toast-success::before { content: '✅'; }
.toast-warning::before { content: '⚠️'; }
.toast-info::before    { content: 'ℹ️'; }

/* ===== 会员相关 ===== */
.badge-member {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: var(--white);
}

/* 购买兑换码按钮 */
.btn-buy-code {
    display: inline-block;
    padding: 10px 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    font-weight: 600;
    font-size: 0.9em;
    border: none;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(74,144,217,0.25);
    cursor: pointer;
    white-space: nowrap;
}

.btn-buy-code:hover {
    background: linear-gradient(135deg, var(--primary-dark), #2a6498);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74,144,217,0.35);
    color: var(--white);
}

/* ===== 章节目录 ===== */
.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chapter-item {
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--light-gray);
    transition: all 0.2s;
}

.chapter-item.chapter-member-only {
    border-color: #f39c12;
    background: #fffcf5;
}

.chapter-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s;
    gap: 12px;
}

.chapter-header:hover {
    background: rgba(74, 144, 217, 0.05);
}

.chapter-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    font-weight: 700;
    font-size: 0.85em;
    flex-shrink: 0;
}

.chapter-member-only .chapter-number {
    background: #f39c12;
}

.chapter-title-text {
    flex: 1;
    font-weight: 600;
    color: var(--dark);
    font-size: 1em;
}

.chapter-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chapter-toggle {
    color: var(--gray);
    font-size: 0.8em;
    transition: transform 0.2s;
}

.chapter-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.chapter-badge-member {
    background: #fff3cd;
    color: #f39c12;
    border: 1px solid #f39c12;
}

.chapter-body {
    padding: 0 20px 20px;
    border-top: 1px solid var(--light-gray);
}

.chapter-content {
    padding: 16px 0;
    line-height: 1.8;
    color: var(--dark);
}

.chapter-content p {
    margin-bottom: 12px;
}

.chapter-content h2, .chapter-content h3 {
    margin: 16px 0 8px;
    color: var(--dark);
}

.chapter-resources {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid var(--light-gray);
}

.chapter-resource a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chapter-lock {
    text-align: center;
    padding: 30px 20px;
    color: var(--gray);
    border-top: 1px solid var(--light-gray);
}

.chapter-lock-icon {
    font-size: 2.5em;
    margin-bottom: 12px;
}

.chapter-lock p {
    margin-bottom: 16px;
    color: var(--gray);
}

/* ===== 任务列表 ===== */
.lesson-list {
    margin: 16px 0;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
}

.lesson-list-header {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: #f0f4f8;
    border-bottom: 1px solid var(--light-gray);
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.lesson-list-toggle {
    font-size: 0.75em;
    color: var(--gray);
    transition: transform 0.2s;
}

.lesson-list-title {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--dark);
}

.lesson-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
}

.lesson-item {
    border-radius: 6px;
    background: var(--bg);
}

.lesson-item.lesson-member-only {
    border-left: 3px solid #f39c12;
}

.lesson-header {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.2s;
    gap: 12px;
}

.lesson-header:hover {
    background: rgba(74, 144, 217, 0.04);
}

.lesson-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e8f0f8;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9em;
    flex-shrink: 0;
}

.lesson-item.lesson-member-only .lesson-number {
    background: #fff3cd;
    color: #f39c12;
}

.lesson-title-text {
    flex: 1;
    font-size: 0.95em;
    font-weight: 700;
    color: var(--dark);
}

.lesson-duration {
    font-size: 0.8em;
    color: var(--gray);
    white-space: nowrap;
}

.lesson-badge-locked {
    font-size: 0.85em;
}

.lesson-toggle {
    color: var(--gray);
    font-size: 0.75em;
    transition: transform 0.2s;
}

.lesson-body {
    padding: 0 20px 16px;
    border-top: 1px dashed var(--light-gray);
}

.lesson-desc {
    padding: 12px 0;
    font-size: 0.9em;
    color: var(--gray);
    line-height: 1.6;
}

.lesson-resources {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 8px;
}

a.lesson-resource-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 6px;
    background: var(--white);
    border: 2px solid var(--primary);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

a.lesson-resource-link:hover {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.3);
    transform: translateY(-1px);
}

.lesson-lock {
    text-align: center;
    padding: 14px 16px;
    color: var(--gray);
    border-top: 1px dashed var(--light-gray);
    font-size: 0.88em;
}

.chapter-row {
    cursor: grab;
}

.chapter-row:active {
    cursor: grabbing;
}

.drag-handle {
    user-select: none;
}

/* ===== 量化策略 ===== */
.strategy-table-wrapper {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.strategy-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93em;
}

.strategy-table thead {
    background: var(--bg);
}

.strategy-table th,
.strategy-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
    white-space: nowrap;
}

.strategy-table th {
    font-weight: 600;
    color: var(--gray);
    font-size: 0.88em;
}

.strategy-table tbody tr:hover {
    background: #f8f9fa;
}

.strategy-table .num-col {
    text-align: right;
    font-family: 'DIN Alternate', 'Roboto Mono', monospace;
    font-weight: 600;
}

.strategy-name {
    color: var(--dark);
    font-weight: 600;
}

.strategy-name:hover {
    color: var(--primary);
}

.strategy-featured {
    display: inline-block;
    background: var(--warning);
    color: var(--white);
    font-size: 0.75em;
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: 6px;
    font-weight: 600;
}

.strategy-category-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 0.82em;
    font-weight: 600;
    background: var(--bg);
    color: var(--gray);
    border: 1px solid var(--light-gray);
}

.positive {
    color: var(--success);
}

.negative {
    color: var(--danger);
}

.text-muted {
    color: var(--gray);
}

/* 策略详情 */
.strategy-detail-header {
    background: linear-gradient(135deg, var(--primary), #764ba2);
    color: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    margin-bottom: 30px;
}

.strategy-detail-header h1 {
    font-size: 2em;
    margin: 16px 0 8px;
}

.strategy-detail-header .strategy-featured {
    background: rgba(255,255,255,0.25);
    color: var(--white);
}

.strategy-desc-text {
    font-size: 1.05em;
    opacity: 0.9;
    margin-top: 8px;
}

.strategy-metrics {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.metric-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
}

.metric-label {
    font-size: 0.85em;
    color: var(--gray);
    margin-bottom: 8px;
}

.metric-value {
    font-size: 1.5em;
    font-weight: 700;
}

.metric-value.positive {
    color: var(--success);
}

.metric-value.negative {
    color: var(--danger);
}

.metric-value.primary {
    color: var(--primary);
}

.strategy-detail-body {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.strategy-detail-body h2 {
    margin-bottom: 20px;
}

.strategy-report-content {
    line-height: 1.8;
    font-size: 1em;
}

.strategy-report-content p {
    margin-bottom: 12px;
}

.strategy-report-content h2,
.strategy-report-content h3 {
    margin: 16px 0 8px;
    color: var(--dark);
}

/* 策略 Tab 切换 */
.strategy-tabs {
    margin-top: 30px;
}

.strategy-tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--light-gray);
    background: var(--white);
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.strategy-tab-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    background: transparent;
    font-size: 1em;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.strategy-tab-btn:hover {
    color: var(--primary);
    background: rgba(74, 144, 217, 0.04);
}

.strategy-tab-btn.active {
    color: var(--primary);
    background: var(--white);
}

.strategy-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.strategy-tab-content {
    background: var(--white);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
}

/* 报告 iframe */
.strategy-report-frame-wrapper {
    width: 100%;
    height: 90vh;
    min-height: 500px;
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
}

.strategy-report-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* 买卖详情表格 */
.trades-table-wrapper {
    overflow-x: auto;
    padding: 0;
}

.trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93em;
}

.trades-table thead {
    background: var(--bg);
}

.trades-table th,
.trades-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
    white-space: nowrap;
}

.trades-table th {
    font-weight: 600;
    color: var(--gray);
    font-size: 0.88em;
}

.trades-table tbody tr:hover {
    background: #f8f9fa;
}

.trades-table .num-col {
    text-align: right;
    font-family: 'DIN Alternate', 'Roboto Mono', monospace;
    font-weight: 600;
}

/* ===== 资源站 ===== */
.page-header .resource-toolbar-inline {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 600px;
    margin: 16px auto 0;
    flex-wrap: wrap;
    justify-content: center;
}

.resource-tabs-sm {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.resource-tabs-sm .tab-item {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--gray);
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid var(--light-gray);
    background: var(--white);
}

.resource-tabs-sm .tab-item:hover {
    color: var(--primary);
    background: rgba(74, 144, 217, 0.04);
}

.resource-tabs-sm .tab-item.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.sort-select {
    padding: 6px 14px;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    background: var(--white);
    color: var(--dark);
    font-size: 0.88em;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.sort-select:focus {
    border-color: var(--primary);
}

/* 资源网格布局 */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.resource-card-new {
    display: block;
    background: var(--white);
    border-radius: 12px;
    padding: 28px 20px 20px;
    text-align: center;
    border: 1px solid #eef1f6;
    transition: all 0.3s ease;
    color: var(--dark);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.resource-card-new::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.resource-card-new:hover::before {
    opacity: 1;
}

.resource-card-new:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 28px rgba(74, 144, 217, 0.15);
    transform: translateY(-4px);
    color: var(--dark);
    text-decoration: none;
}

.rc-icon {
    font-size: 2.8em;
    margin-bottom: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eaf6 100%);
    box-shadow: 0 2px 8px rgba(74, 144, 217, 0.1);
    transition: all 0.3s ease;
}

.resource-card-new:hover .rc-icon {
    background: linear-gradient(135deg, var(--primary), #764ba2);
    box-shadow: 0 4px 16px rgba(74, 144, 217, 0.3);
    transform: scale(1.05);
}

.rc-title {
    font-size: 0.95em;
    margin: 12px 0 14px;
    line-height: 1.5;
    color: var(--dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 600;
}

.rc-title a {
    color: var(--dark);
    text-decoration: none;
}

.rc-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.8em;
    color: var(--gray);
}

.rc-date,
.rc-size {
    color: var(--gray);
}

/* 资源详情页（保留原有样式） */

/* 类型标签颜色 */
.type-badge {
    font-size: 0.72em;
    font-weight: 600;
    padding: 2px 12px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    display: inline-block;
}

.type-badge[data-category="数据集"] {
    background: #e8f5e9;
    color: #2e7d32;
}

.type-badge[data-category="源码脚本"] {
    background: #f3e5f5;
    color: #7b1fa2;
}

.type-badge[data-category="策略模板"] {
    background: #fff3e0;
    color: #e65100;
}

.type-badge[data-category="研报"] {
    background: #e3f2fd;
    color: #1565c0;
}

.type-badge[data-category="案例项目"] {
    background: #fce4ec;
    color: #c62828;
}

.type-badge[data-category="文章"] {
    background: #e0f2f1;
    color: #00695c;
}

.type-badge[data-category="其他"] {
    background: #f5f5f5;
    color: #616161;
}

.member-badge {
    font-size: 0.68em;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: var(--white);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray);
    background: var(--white);
    border-radius: 12px;
    border: 1px dashed var(--light-gray);
}

.empty-state .empty-icon {
    font-size: 3em;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    color: var(--dark);
    font-weight: 500;
    margin: 0 0 6px;
    font-size: 1.2em;
}

.empty-state p {
    font-size: 0.9em;
    margin: 0;
}

/* 资源分页 */
.resource-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 36px;
    flex-wrap: wrap;
}

.resource-pagination a {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid #eef1f6;
    background: var(--white);
    color: var(--gray);
    text-decoration: none;
}

.resource-pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(74, 144, 217, 0.04);
}

.resource-pagination .active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(74, 144, 217, 0.25);
}

.resource-pagination .page-edge {
    border-color: #eef1f6;
    color: var(--gray);
}

.resource-pagination .page-edge:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-ellipsis {
    padding: 0 8px;
    color: var(--light-gray);
    font-size: 1em;
}

/* 资源站响应式 */
@media (max-width: 768px) {
    .resource-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .resource-toolbar-inline {
        justify-content: center;
    }
}

.resource-detail-header {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    margin: 30px 0;
    border: 1px solid #eef1f6;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.resource-detail-header h1 {
    font-size: 1.8em;
    margin: 0 0 12px;
    color: var(--dark);
}

.resource-category-badge {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    background: rgba(74, 144, 217, 0.08);
    color: var(--primary);
    border: 1px solid rgba(74, 144, 217, 0.15);
}

.resource-detail-content {
    margin-top: 20px;
    line-height: 1.8;
    font-size: 1em;
    color: var(--dark);
}

.resource-detail-content p {
    margin-bottom: 12px;
}

.resource-detail-content h1,
.resource-detail-content h2,
.resource-detail-content h3 {
    margin: 20px 0 10px;
    color: var(--dark);
}

.resource-detail-content code {
    background: #f5f6fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.resource-detail-content pre {
    background: #f5f6fa;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
}

.resource-detail-content pre code {
    background: none;
    padding: 0;
}

.resource-detail-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
}

.resource-detail-content table th,
.resource-detail-content table td {
    border: 1px solid var(--light-gray);
    padding: 8px 12px;
    text-align: left;
}

.resource-detail-content table th {
    background: #f5f6fa;
}

.resource-detail-content ul,
.resource-detail-content ol {
    padding-left: 24px;
    margin: 8px 0;
}

.resource-detail-content a {
    color: var(--primary);
}

.resource-detail-meta {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    font-size: 0.9em;
    color: var(--gray);
}

.member-only-badge {
    padding: 2px 12px;
    border-radius: 12px;
    background: #f39c12;
    color: var(--white);
    font-weight: 600;
    font-size: 0.85em;
}

.resource-detail-body {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.resource-download-section {
    text-align: center;
    padding: 20px 0;
}

/* ===== 首页量化策略卡片 ===== */
.strategy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.strategy-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    display: block;
    color: var(--dark);
    border: 2px solid transparent;
    text-decoration: none;
}

.strategy-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(74,144,217,0.2);
    color: var(--dark);
}

.strategy-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.strategy-card-header h3 {
    flex: 1;
    font-size: 1.05em;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.strategy-category-badge {
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 0.78em;
    font-weight: 600;
    background: var(--bg);
    color: var(--gray);
    border: 1px solid var(--light-gray);
    white-space: nowrap;
    flex-shrink: 0;
}

.strategy-desc {
    color: var(--gray);
    font-size: 0.9em;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.strategy-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.strategy-meta .metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.strategy-meta .metric-label {
    font-size: 0.78em;
    color: var(--gray);
}

.strategy-meta .metric-value {
    font-size: 1.15em;
    font-weight: 700;
    font-family: 'DIN Alternate', 'Roboto Mono', monospace;
}

/* ===== 页脚 ===== */
.footer {
    background: var(--dark);
    color: var(--white);
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
    opacity: 0.9;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal[style*="display: flex"],
.modal[style*="display:flex"] {
    display: flex !important;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg);
}

.modal-close {
    font-size: 1.5em;
    cursor: pointer;
    color: var(--gray);
    line-height: 1;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 20px;
}

/* ===== 公告弹窗 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: var(--white);
    border-radius: 12px;
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-box .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--light-gray);
}

.modal-box .modal-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: var(--dark);
}

.modal-box .modal-close-btn {
    font-size: 1.6em;
    cursor: pointer;
    color: var(--gray);
    line-height: 1;
    transition: color 0.2s;
}

.modal-box .modal-close-btn:hover {
    color: var(--danger);
}

.modal-box .modal-body {
    padding: 24px;
}

.modal-box .modal-body p {
    margin: 0;
    line-height: 1.7;
    color: var(--dark);
    white-space: pre-wrap;
    word-break: break-word;
}

/* 公告弹窗中的 Markdown 样式 */
.modal-box .modal-body #announcementContent h1,
.modal-box .modal-body #announcementContent h2,
.modal-box .modal-body #announcementContent h3 {
    margin: 14px 0 6px;
    font-weight: 700;
}

.modal-box .modal-body #announcementContent h1 { font-size: 1.3em; }
.modal-box .modal-body #announcementContent h2 { font-size: 1.15em; }
.modal-box .modal-body #announcementContent h3 { font-size: 1.05em; }

.modal-box .modal-body #announcementContent code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Consolas', 'Monaco', monospace;
}

.modal-box .modal-body #announcementContent pre {
    background: #f5f6fa;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
}

.modal-box .modal-body #announcementContent pre code {
    background: none;
    padding: 0;
}

.modal-box .modal-body #announcementContent blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 12px;
    color: var(--gray);
    margin: 10px 0;
}

.modal-box .modal-body #announcementContent ul,
.modal-box .modal-body #announcementContent ol {
    padding-left: 24px;
    margin: 8px 0;
}

.modal-box .modal-body #announcementContent a {
    color: var(--primary);
}

.modal-box .modal-body #announcementContent hr {
    border: none;
    border-top: 2px solid var(--light-gray);
    margin: 14px 0;
}

.modal-box .modal-body .announcement-time {
    display: block;
    margin-top: 12px;
    font-size: 0.85em;
    color: var(--gray);
}

.modal-box .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--light-gray);
}

/* ===== 资源查看弹窗 ===== */
.resource-dialog {
    display: none;
    position: fixed;
    top: 3%;
    left: 50%;
    width: 90vw;
    height: 90vh;
    max-width: 1200px;
    min-width: 500px;
    min-height: 400px;
    background: var(--white);
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border: 2px solid var(--light-gray);
    flex-direction: column;
    transition: height 0.3s ease;
}

.resource-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--primary);
    color: var(--white);
    cursor: move;
    user-select: none;
}

.resource-dialog-header span {
    font-size: 1em;
    font-weight: 600;
}

.resource-dialog-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5em;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resource-dialog-btn {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 2px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resource-dialog-btn:hover,
.resource-dialog-close:hover {
    color: #ffd700;
}

.resource-dialog-body {
    flex: 1;
    overflow: hidden;
}

.resource-dialog-body iframe {
    width: 100%;
    height: 100%;
}

/* 策略报告锁定遮罩 */
.member-lock-content {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.member-lock-icon {
    font-size: 3.5em;
    margin-bottom: 16px;
}

.member-lock-text {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.member-lock-hint {
    font-size: 0.95em;
    color: var(--gray);
    margin-bottom: 24px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .nav-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 0;
    }

    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }

    .hero-inner h1 {
        font-size: 1.8em;
    }

    .hero-carousel {
        min-height: auto;
    }

    .carousel-track {
        height: 320px;
    }

    .carousel-slide .hero-inner h1 {
        font-size: 1.8em;
    }

    .carousel-slide .hero-inner p {
        font-size: 1em;
    }

    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 1em;
    }

    .carousel-prev {
        left: 10px;
    }

    .carousel-next {
        right: 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .course-grid,
    .path-grid {
        grid-template-columns: 1fr;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    .strategy-metrics {
        grid-template-columns: repeat(3, 1fr);
    }

    .strategy-table {
        font-size: 0.83em;
    }

    .strategy-tab-nav {
        flex-direction: column;
    }

    .strategy-tab-btn {
        padding: 12px 16px;
    }

    .strategy-report-frame-wrapper {
        height: 60vh;
    }

    .trades-table {
        font-size: 0.85em;
    }

    .admin-table {
        font-size: 0.85em;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-member-action {
        width: 100%;
    }
}
