<!-- 零壹学堂 CSS -->
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #2c3e50;
    --primary-light: #3498db;
    --accent: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #ecf0f1;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* ====== 导航栏 ====== */
.navbar {
    background: var(--primary);
    color: white;
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.nav-container { display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: white; }
.logo-icon { font-size: 24px; }
.logo-text { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link { color: rgba(255,255,255,0.85); text-decoration: none; padding: 6px 14px; border-radius: 6px; font-size: 14px; transition: all 0.2s; }
.nav-link:hover { background: rgba(255,255,255,0.15); color: white; }
.nav-link-register { background: var(--primary-light); color: white; }
.nav-link-register:hover { background: #2980b9; }
.nav-link-logout { color: rgba(255,255,255,0.6); }
.nav-user { color: rgba(255,255,255,0.7); font-size: 13px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,0.2); }

/* ====== Flash消息 ====== */
.flash-container { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 200; width: 90%; max-width: 500px; }
.flash-message { padding: 12px 20px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; transition: opacity 0.3s; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.flash-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.flash-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.flash-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.flash-close { background: none; border: none; font-size: 16px; cursor: pointer; opacity: 0.5; padding: 0 4px; }
.flash-close:hover { opacity: 1; }

/* ====== 主内容 ====== */
.main-content { flex: 1; padding-top: 30px; padding-bottom: 60px; }

/* ====== Hero ====== */
.hero { text-align: center; padding: 40px 0 30px; }
.hero h1 { font-size: 28px; color: var(--primary); margin-bottom: 8px; }
.hero-subtitle { font-size: 16px; color: var(--primary-light); font-weight: 600; margin-bottom: 8px; }
.hero-desc { color: var(--text-light); font-size: 14px; margin-bottom: 20px; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-cta { margin-bottom: 24px; }
.hero-stats { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-num { display: block; font-size: 28px; font-weight: 700; color: var(--primary-light); }
.hero-label { font-size: 12px; color: var(--text-light); }

/* ====== Section Title ====== */
.section-title { text-align: center; font-size: 20px; margin: 40px 0 20px; color: var(--primary); }

/* ====== 会员套餐卡片 ====== */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-bottom: 40px; }
.plan-card { background: var(--card-bg); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; position: relative; transition: transform 0.2s; }
.plan-card:hover { transform: translateY(-3px); }
.plan-featured { border: 2px solid var(--primary-light); box-shadow: 0 4px 20px rgba(52,152,219,0.15); }
.plan-badge { position: absolute; top: 12px; right: 12px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; background: #e74c3c; color: white; }
.plan-featured .plan-badge { background: #f39c12; }
.plan-name { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.plan-price-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.plan-price { font-size: 30px; font-weight: 700; color: var(--accent); }
.plan-original-price { font-size: 15px; color: var(--text-light); text-decoration: line-through; }
.plan-desc { font-size: 13px; color: var(--text-light); margin-bottom: 16px; }
.plan-features { list-style: none; padding: 0; margin: 0 0 20px; }
.plan-features li { padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.plan-features li:last-child { border-bottom: none; }

/* ====== 教程卡片 ====== */
.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-bottom: 40px; }
.course-card { background: var(--card-bg); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.course-icon { font-size: 40px; text-align: center; margin-bottom: 8px; }
.course-tag { position: absolute;  }
.course-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; background: #e8f4fd; color: #2980b9; margin-bottom: 8px; align-self: flex-start; }
.course-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.course-desc { font-size: 13px; color: var(--text-light); margin-bottom: 12px; flex: 1; }
.course-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-light); margin-bottom: 14px; }
.course-lock { display: flex; gap: 8px; align-items: center; }
.lock-badge { padding: 6px 14px; border-radius: 6px; font-size: 12px; background: #f8f9fa; color: var(--text-light); border: 1px solid var(--border); }

/* ====== 目录列表 ====== */
.toc-list { margin-bottom: 16px; }
.toc-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.toc-item:last-child { border-bottom: none; }
.toc-num { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-light); color: white; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }

/* ====== 徽章 ====== */
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-success { background: #d4edda; color: #155724; }
.badge-pending { background: #fff3cd; color: #856404; }

/* ====== 按钮 ====== */
.btn { display: inline-block; padding: 10px 24px; border-radius: 8px; font-size: 14px; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn-primary { background: var(--primary-light); color: white; }
.btn-primary:hover { background: #2980b9; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #219a52; }
.btn-danger { background: var(--accent); color: white; }
.btn-danger:hover { background: #c0392b; }
.btn-outline { background: transparent; border: 2px solid var(--primary-light); color: var(--primary-light); }
.btn-outline:hover { background: var(--primary-light); color: white; }
.btn-full { width: 100%; text-align: center; }
.btn-lg { padding: 14px 36px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-back { background: var(--border); color: var(--text); }
.btn-back:hover { background: #d5dbdb; }

/* ====== 信任保障 ====== */
.trust-section { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-bottom: 40px; }
.trust-item { text-align: center; padding: 20px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); }
.trust-icon { font-size: 32px; margin-bottom: 8px; }
.trust-item h4 { font-size: 15px; margin-bottom: 4px; }
.trust-item p { font-size: 12px; color: var(--text-light); }

/* ====== 关于我们 ====== */
.about-section { background: var(--card-bg); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); margin-bottom: 30px; }
.about-section h2 { text-align: center; margin-bottom: 16px; font-size: 20px; }
.about-content p { margin-bottom: 8px; font-size: 14px; color: var(--text-light); line-height: 1.8; }

/* ====== 表单 ====== */
.form-card { background: var(--card-bg); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); max-width: 420px; margin: 0 auto; }
.form-card h2 { text-align: center; margin-bottom: 8px; font-size: 20px; }
.form-subtitle { text-align: center; color: var(--text-light); font-size: 13px; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input { width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: 8px; font-size: 14px; transition: border 0.2s; outline: none; background: white; }
.form-group input:focus { border-color: var(--primary-light); }
.form-hint { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.form-footer { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-light); }
.form-footer a { color: var(--primary-light); text-decoration: none; }
.form-footer a:hover { text-decoration: underline; }

/* ====== 商品详情页 ====== */
.detail-card { background: var(--card-bg); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); max-width: 700px; margin: 0 auto; }
.detail-header { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.detail-icon { font-size: 56px; }
.detail-info { flex: 1; }
.detail-category { font-size: 12px; color: var(--primary-light); font-weight: 600; margin-bottom: 4px; }
.detail-title { font-size: 22px; font-weight: 700; margin-bottom: 10px; line-height: 1.4; }
.detail-price-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.detail-price { font-size: 28px; font-weight: 700; color: var(--accent); }
.detail-original-price { font-size: 16px; color: var(--text-light); text-decoration: line-through; }
.detail-save { background: #fef3e2; color: #e67e22; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.detail-desc { font-size: 14px; color: var(--text-light); line-height: 1.8; margin-bottom: 24px; }

/* ====== 商品特点列表 ====== */
.feature-list { margin-bottom: 24px; }
.feature-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.feature-item:last-child { border-bottom: none; }

/* ====== 支付页面 ====== */
.payment-card { background: var(--card-bg); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); max-width: 500px; margin: 0 auto; text-align: center; }
.payment-amount { font-size: 36px; font-weight: 700; color: var(--accent); margin: 16px 0; }
.payment-order-no { font-size: 12px; color: var(--text-light); margin-bottom: 20px; }
.qr-placeholder { width: 220px; height: 220px; background: #f8f9fa; border: 2px dashed var(--border); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto 20px; }
.qr-placeholder span { font-size: 14px; color: var(--text-light); }
.qr-tip { font-size: 13px; color: var(--text-light); margin-bottom: 20px; }
.pay-methods { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; }
.pay-method-btn { padding: 10px 20px; border: 2px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 14px; background: white; transition: all 0.2s; }
.pay-method-btn:hover { border-color: var(--primary-light); }
.pay-method-btn.active { border-color: var(--primary-light); background: #eef6fc; }
.pay-status { padding: 10px; border-radius: 8px; font-size: 14px; margin-top: 12px; }
.pay-status.waiting { background: #fff3cd; color: #856404; }
.pay-status.success { background: #d4edda; color: #155724; }
.pay-status .loading { display: inline-block; width: 16px; height: 16px; border: 2px solid #856404; border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 8px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== 会员中心 ====== */
.member-card { background: var(--card-bg); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.member-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.member-header h2 { font-size: 18px; }
.member-info { font-size: 13px; color: var(--text-light); }
.purchase-item { display: flex; align-items: center; justify-content: space-between; padding: 16px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; }
.purchase-info { flex: 1; }
.purchase-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.purchase-date { font-size: 12px; color: var(--text-light); }
.purchase-actions { display: flex; gap: 8px; }
.purchase-empty { text-align: center; padding: 40px; color: var(--text-light); }
.purchase-empty .empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ====== 管理后台 ====== */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.admin-stat { background: var(--card-bg); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.admin-stat-num { font-size: 28px; font-weight: 700; color: var(--primary-light); }
.admin-stat-label { font-size: 12px; color: var(--text-light); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--card-bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 20px; }
.admin-table th, .admin-table td { padding: 10px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
.admin-table th { background: var(--primary); color: white; font-weight: 600; }
.admin-table tr:hover { background: #f8f9fa; }
.status-paid { color: var(--success); font-weight: 600; }
.status-pending { color: var(--warning); font-weight: 600; }
.admin-section { margin-bottom: 30px; }
.admin-section h3 { font-size: 16px; margin-bottom: 12px; color: var(--primary); }

/* ====== 底部 ====== */
.footer { background: var(--primary); color: white; text-align: center; padding: 20px 0; margin-top: auto; }
.footer p { font-size: 14px; margin-bottom: 4px; }
.footer-small { font-size: 12px; opacity: 0.6; }

/* ====== 响应式 ====== */
@media (max-width: 768px) {
    .hero h1 { font-size: 22px; }
    .hero-stats { gap: 16px; }
    .products-grid { grid-template-columns: 1fr; }
    .detail-header { flex-direction: column; align-items: center; text-align: center; }
    .purchase-item { flex-direction: column; gap: 12px; text-align: center; }
    .nav-links { gap: 4px; }
    .nav-link { padding: 6px 10px; font-size: 13px; }
}
