:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f8fafc;
  --white: #ffffff;
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

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

/* ===== 顶部导航 ===== */
.topbar { background: #111827; color: #d1d5db; font-size: 13px; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 36px; }
.topbar a { color: #9ca3af; margin-left: 16px; }
.topbar a:hover { color: #fff; }

.navbar { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.navbar .container { display: flex; align-items: center; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: var(--primary); }
.logo .logo-icon {
  width: 34px; height: 34px; background: linear-gradient(135deg, var(--primary), #7c3aed);
  border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 900;
}
.nav-links { display: flex; margin-left: 40px; gap: 6px; }
.nav-links a { padding: 8px 14px; border-radius: 8px; font-weight: 500; color: var(--text); }
.nav-links a:hover { background: var(--primary-light); color: var(--primary); }
.nav-links a.active { background: var(--primary-light); color: var(--primary); }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search-box { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 6px 6px 6px 14px; }
.search-box input { border: none; outline: none; background: transparent; width: 160px; font-size: 14px; }
.search-box button { border: none; background: var(--primary); color: #fff; border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13px; }
.btn { display: inline-block; padding: 8px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-lg { padding: 12px 32px; font-size: 16px; border-radius: 10px; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ===== 底部 ===== */
.footer { background: #111827; color: #9ca3af; margin-top: 60px; }
.footer-main { padding: 48px 0 32px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer h4 { color: #fff; font-size: 15px; margin-bottom: 16px; }
.footer ul li { margin-bottom: 10px; }
.footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1f2937; padding: 16px 0; text-align: center; font-size: 13px; }
.footer-logo { font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 12px; display: inline-block; }
.footer-desc { font-size: 14px; max-width: 320px; }

/* ===== Hero ===== */
.hero { background: linear-gradient(120deg, #312e81, #4f46e5 55%, #7c3aed); color: #fff; padding: 72px 0; }
.hero .container { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 40px; line-height: 1.3; margin-bottom: 16px; }
.hero p { color: #c7d2fe; font-size: 16px; margin-bottom: 28px; max-width: 480px; }
.hero-stats { display: flex; gap: 40px; margin-top: 36px; }
.hero-stats b { font-size: 28px; display: block; }
.hero-stats span { color: #c7d2fe; font-size: 14px; }
.hero-card { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: var(--radius); padding: 20px; backdrop-filter: blur(6px); }

/* ===== 区块 ===== */
.section { padding: 56px 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 28px; }
.section-head h2 { font-size: 26px; }
.section-head .more { color: var(--primary); font-size: 14px; }

/* ===== 课程卡片 ===== */
.course-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.course-card { background: var(--white); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); transition: transform 0.2s, box-shadow 0.2s; }
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.course-cover { position: relative; height: 150px; overflow: hidden; }
.course-cover img { width: 100%; height: 100%; object-fit: cover; }
.course-cover .tag { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.55); color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.course-cover .price-tag { position: absolute; bottom: 10px; right: 10px; background: var(--danger); color: #fff; font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.course-body { padding: 14px; }
.course-body h3 { font-size: 15px; margin-bottom: 8px; line-height: 1.4; min-height: 42px; }
.course-body h3 a:hover { color: var(--primary); }
.course-meta { display: flex; gap: 14px; color: var(--text-muted); font-size: 12px; }

/* ===== 分类 ===== */
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.cat-item { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; transition: all 0.2s; }
.cat-item:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.cat-item .cat-ico { font-size: 30px; margin-bottom: 10px; }
.cat-item b { display: block; margin-bottom: 4px; }
.cat-item span { color: var(--text-muted); font-size: 13px; }

/* ===== 名师 ===== */
.teacher-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.teacher-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; }
.teacher-card .avatar { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 14px; overflow: hidden; }
.teacher-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.teacher-card b { font-size: 16px; }
.teacher-card .role { color: var(--primary); font-size: 13px; margin: 4px 0 10px; }
.teacher-card p { color: var(--text-muted); font-size: 13px; }

/* ===== 面包屑 ===== */
.breadcrumb { background: var(--white); border-bottom: 1px solid var(--border); padding: 14px 0; font-size: 13px; color: var(--text-muted); }
.breadcrumb a { color: var(--primary); }

/* ===== 课程详情 ===== */
.detail-top { background: var(--white); border-bottom: 1px solid var(--border); padding: 32px 0; }
.detail-top .container { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 36px; }
.detail-cover { border-radius: var(--radius); overflow: hidden; }
.detail-cover img { width: 100%; }
.detail-info h1 { font-size: 26px; margin-bottom: 12px; }
.detail-info .subtitle { color: var(--text-muted); margin-bottom: 18px; }
.detail-tags { display: flex; gap: 8px; margin-bottom: 18px; }
.detail-tags span { background: var(--primary-light); color: var(--primary); font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.detail-meta { display: flex; gap: 24px; color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.detail-buy { display: flex; align-items: center; gap: 16px; }
.price { font-size: 26px; font-weight: 800; color: var(--danger); }
.price .origin { font-size: 14px; color: var(--text-muted); text-decoration: line-through; font-weight: 400; margin-left: 8px; }

.detail-main { padding: 32px 0; display: grid; grid-template-columns: 1fr 300px; gap: 32px; }
.detail-content { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.detail-content h2 { font-size: 20px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.detail-content h3 { font-size: 16px; margin: 20px 0 10px; }
.detail-content p { color: #374151; margin-bottom: 12px; }
.detail-content ul { padding-left: 20px; }
.detail-content ul li { list-style: disc; margin-bottom: 8px; color: #374151; }

.side-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.side-card h3 { font-size: 15px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.teacher-mini { display: flex; gap: 12px; align-items: center; }
.teacher-mini .avatar { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.teacher-mini .avatar img { width: 100%; height: 100%; object-fit: cover; }
.teacher-mini b { display: block; }
.teacher-mini span { color: var(--text-muted); font-size: 13px; }

/* ===== 结算页 ===== */
.checkout-main { padding: 32px 0; }
.checkout-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 28px; align-items: start; }
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.card h2 { font-size: 18px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.card h3 { font-size: 15px; margin-bottom: 12px; }
.order-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.order-item img { width: 84px; height: 60px; object-fit: cover; border-radius: 8px; }
.order-item .oi-info { flex: 1; }
.order-item .oi-info h4 { font-size: 14px; margin-bottom: 4px; }
.order-item .oi-info p { color: var(--text-muted); font-size: 12px; }
.order-item .oi-price { color: var(--danger); font-weight: 700; }

.pay-methods { display: flex; flex-direction: column; gap: 10px; }
.pay-method { display: flex; align-items: center; gap: 12px; border: 2px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: all 0.15s; }
.pay-method:hover { border-color: #c4b5fd; }
.pay-method.selected { border-color: var(--primary); background: var(--primary-light); }
.pay-method .pm-logo { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 800; }
.pay-method .pm-info b { display: block; font-size: 14px; }
.pay-method .pm-info span { color: var(--text-muted); font-size: 12px; }
.pay-method .pm-radio { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #cbd5e1; }
.pay-method.selected .pm-radio { border-color: var(--primary); border-width: 5px; }

.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; color: var(--text-muted); }
.summary-row.total { font-size: 16px; color: var(--text); font-weight: 700; border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 8px; }
.summary-row.total .amount { color: var(--danger); font-size: 22px; }

/* ===== 支付弹窗 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(17,24,39,0.6); display: none; align-items: center; justify-content: center; z-index: 999; }
.modal-mask.show { display: flex; }
.modal { background: var(--white); border-radius: 16px; width: 420px; max-width: 92vw; padding: 28px; text-align: center; animation: pop 0.25s ease; }
@keyframes pop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { font-size: 18px; margin-bottom: 6px; }
.modal .pay-amount { font-size: 32px; font-weight: 800; color: var(--primary); margin: 12px 0 4px; }
.modal .qr-wrap { width: 220px; height: 220px; margin: 20px auto; border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: #fff; }
.modal .qr-wrap canvas, .modal .qr-wrap img { width: 100%; height: 100%; }
.modal .pay-tip { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }
.modal .btn { width: 100%; }
.modal .cancel { color: var(--text-muted); font-size: 13px; cursor: pointer; margin-top: 12px; display: inline-block; }
.status-row { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--success); font-size: 14px; font-weight: 600; }
.spinner { width: 18px; height: 18px; border: 3px solid #d1fae5; border-top-color: var(--success); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 表单 ===== */
.auth-wrap { max-width: 420px; margin: 60px auto; background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 36px; }
.auth-wrap h1 { font-size: 22px; margin-bottom: 6px; }
.auth-wrap .sub { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; margin-bottom: 6px; color: #374151; }
.form-group input { width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.auth-switch a { color: var(--primary); }
.agree-check { display: flex !important; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.agree-check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.agree-check a { color: var(--primary); }
.btn[disabled] { background: #cbd5e1; cursor: not-allowed; }
.btn[disabled]:hover { background: #cbd5e1; }

/* ===== 个人中心 ===== */
.user-main { padding: 32px 0; display: grid; grid-template-columns: 240px 1fr; gap: 28px; }
.user-side { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; height: fit-content; }
.user-card { text-align: center; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.user-card .avatar { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px; overflow: hidden; }
.user-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-menu a { display: block; padding: 10px 14px; border-radius: 8px; font-size: 14px; color: #374151; }
.user-menu a:hover { background: var(--primary-light); color: var(--primary); }
.user-menu a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.user-content .card { padding: 24px; }

/* ===== 订单 ===== */
.order-row { display: grid; grid-template-columns: 90px 1fr 120px 90px 110px; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.order-row img { width: 90px; height: 62px; object-fit: cover; border-radius: 8px; }
.order-head { display: grid; grid-template-columns: 90px 1fr 120px 90px 110px; gap: 16px; font-size: 12px; color: var(--text-muted); padding: 8px 0; border-bottom: 1px solid var(--border); }
.status-paid { color: var(--success); }
.status-pending { color: var(--accent); }

/* ===== 帮助/关于 ===== */
.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.help-item { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.help-item h3 { font-size: 15px; margin-bottom: 8px; }
.help-item p { color: var(--text-muted); font-size: 13px; }
.about-section { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; margin-bottom: 24px; }
.about-section h2 { font-size: 20px; margin-bottom: 14px; }
.about-section p { color: #374151; margin-bottom: 12px; }
.about-section ul { padding-left: 20px; }
.about-section ul li { list-style: disc; margin-bottom: 8px; color: #374151; }

/* ===== 空状态/提示 ===== */
.empty { text-align: center; color: var(--text-muted); padding: 60px 0; }
.empty .icon { font-size: 48px; margin-bottom: 12px; }
.notice { background: var(--primary-light); border: 1px solid #c7d2fe; color: var(--primary-dark); padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }

/* ===== 搜索栏(列表页) ===== */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-btn { padding: 7px 18px; border: 1px solid var(--border); background: var(--white); border-radius: 999px; font-size: 13px; cursor: pointer; transition: all 0.15s; }
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .course-grid, .teacher-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .hero .container, .detail-top .container { grid-template-columns: 1fr; }
  .detail-main { grid-template-columns: 1fr; }
  .checkout-grid { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr 1fr; }
  .user-main { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .course-grid, .teacher-grid, .cat-grid { grid-template-columns: 1fr; }
  .search-box { display: none; }
  .nav-links { display: none; }
  .hero h1 { font-size: 28px; }
  .order-row, .order-head { grid-template-columns: 70px 1fr; }
}
