/* ============ 软考学习平台 · 自定义样式（基于 Bootstrap 5） ============ */
:root {
  --brand: #2f6fed;
  --brand2: #22b8a6;
  --vip: #f5a623;
  --vip-grad: linear-gradient(135deg, #ffcf5c, #f5a623);
  --ink: #22303f;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  background: #f5f7fa;
  color: var(--ink);
}

/* ---------- 顶部导航 ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 1020;
  background: #fff; border-bottom: 1px solid #eef1f5;
  box-shadow: 0 1px 8px rgba(31, 45, 61, 0.06);
  padding: 0;
}
.site-nav .container { min-height: 60px; }
.navbar-brand.brand { font-weight: 800; font-size: 20px; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.brand-icon {
  width: 34px; height: 34px; border-radius: 9px; color: #fff; font-size: 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  display: inline-flex; align-items: center; justify-content: center;
}
.site-nav .nav-link {
  color: #5a6b7b; font-weight: 500; padding: 8px 14px !important;
  border-radius: 8px; margin: 0 2px; white-space: nowrap;
}
.site-nav .nav-link:hover { color: var(--brand); background: #eef5ff; }
.site-nav .nav-link.active { color: var(--brand); background: #e8f2ff; font-weight: 700; }
.navbar-uname { font-size: 13px; color: #6b7c8d; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vip-open-btn { background: var(--vip-grad); color: #fff !important; border: none; font-weight: 600; box-shadow: 0 2px 8px rgba(245,166,35,.4); }
.vip-badge { background: var(--vip-grad); color: #fff; border-radius: 16px; padding: 6px 14px; font-size: 13px; font-weight: 700; cursor: pointer; }
.btn-login { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff !important; border: none; font-weight: 600; padding: 8px 18px !important; box-shadow: 0 2px 8px rgba(47,111,237,.3); }

/* ---------- 页脚 ---------- */
.site-footer {
  background: #fff; border-top: 1px solid #eef1f5; margin-top: 40px;
  padding: 20px; text-align: center; color: #93a1af; font-size: 13px;
  display: flex; justify-content: center; gap: 20px; flex-wrap: wrap;
}
.footer-vip { color: var(--vip); cursor: pointer; font-weight: 700; }

/* ---------- 首页横幅 ---------- */
.hero {
  background: linear-gradient(135deg, #1f2d3d 0%, #235784 55%, #22b8a6 130%);
  border-radius: 18px; padding: 48px 40px; color: #fff; margin-bottom: 30px;
}
.hero-badge {
  display: inline-block; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  border-radius: 20px; padding: 5px 16px; font-size: 13px; margin-bottom: 18px;
}
.hero h1 { font-size: 34px; font-weight: 800; margin-bottom: 14px; line-height: 1.35; }
.hero h1 .hl { color: #ffd666; }
.hero p { opacity: .92; font-size: 16px; margin-bottom: 24px; }
.hero .btn-hero { padding: 12px 28px; font-size: 16px; border-radius: 10px; font-weight: 700; }
.btn-vip-solid { background: var(--vip-grad); color: #fff; border: none; box-shadow: 0 6px 18px rgba(245,166,35,.45); }
.btn-ghost-white { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.55); }
.hero-tip { margin-top: 20px; font-size: 14px; }
.link-vip { color: #ffd666; font-weight: 700; cursor: pointer; text-decoration: none; }

/* ---------- 模块卡片 ---------- */
.module-card {
  background: #fff; border: 1px solid #eef1f5; border-radius: 14px; padding: 22px;
  display: flex; align-items: center; gap: 16px; cursor: pointer; text-decoration: none; color: inherit;
  transition: transform .15s, box-shadow .15s; height: 100%;
}
.module-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(31,45,61,.1); color: inherit; }
.mc-icon { width: 56px; height: 56px; border-radius: 14px; font-size: 28px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.m-blue .mc-icon { background: #eaf3ff; }
.m-green .mc-icon { background: #ecf8e8; }
.m-orange .mc-icon { background: #fdf3e6; }
.mc-title { font-size: 17px; font-weight: 800; }
.mc-desc { font-size: 13px; color: #8a97a5; margin: 2px 0 0; }
.mc-go { color: var(--brand); font-size: 14px; white-space: nowrap; font-weight: 600; }

/* ---------- 章节卡片 ---------- */
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 18px; }
.section-head h2 { font-size: 20px; font-weight: 800; margin: 0; }
.section-head .muted { color: #93a1af; font-size: 13px; }
.chapter-card {
  background: #fff; border: 1px solid #eef1f5; border-radius: 12px; padding: 16px;
  display: flex; align-items: center; gap: 14px; cursor: pointer; text-decoration: none; color: inherit;
  transition: all .15s; height: 100%; position: relative;
}
.chapter-card:hover { border-color: var(--brand); box-shadow: 0 8px 20px rgba(47,111,237,.12); color: inherit; }
.ch-no {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px;
}
.ch-title { font-size: 15px; font-weight: 700; }
.ch-meta { font-size: 12px; color: #93a1af; }
.ch-lock { font-size: 18px; }

/* ---------- 首页软考资讯 ---------- */
.news-card {
  background: #fff; border: 1px solid #eef1f5; border-radius: 12px; padding: 18px 20px;
  height: 100%; transition: all .15s;
}
.news-card:hover { border-color: var(--brand); box-shadow: 0 8px 20px rgba(47,111,237,.12); }
.news-head { margin-bottom: 10px; }
.news-tag {
  display: inline-block; font-size: 12px; font-weight: 700; border-radius: 12px; padding: 3px 12px;
}
.news-tag.t-blue { background: #eaf3ff; color: var(--brand); }
.news-tag.t-green { background: #ecf8e8; color: #47a63c; }
.news-tag.t-orange { background: #fdf3e6; color: #d98a12; }
.news-title { font-size: 15px; font-weight: 800; margin: 0 0 8px; }
.news-desc { font-size: 13px; color: #7c8a99; line-height: 1.75; margin: 0; }
.news-note { font-size: 12px; color: #a6b2bf; margin: 12px 2px 0; }

/* ---------- 首页常见知识 ---------- */
.faq-list { display: grid; gap: 10px; }
.faq-item {
  background: #fff; border: 1px solid #eef1f5; border-radius: 10px;
  padding: 14px 18px; transition: all .15s;
}
.faq-item[open] { border-color: var(--brand); box-shadow: 0 6px 16px rgba(47,111,237,.1); }
.faq-item summary {
  font-size: 15px; font-weight: 700; cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "＋"; color: var(--brand); font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.faq-item[open] summary::after { content: "－"; }
.faq-item summary:hover { color: var(--brand); }
.faq-a {
  font-size: 13px; color: #5a6b7b; line-height: 1.9; margin-top: 12px;
  padding-top: 12px; border-top: 1px dashed #eef1f5;
}

/* ---------- 在线学习课程卡 ---------- */
.course-card {
  background: #fff; border: 1px solid #eef1f5; border-radius: 14px; padding: 22px;
  height: 100%; cursor: pointer; transition: all .15s; display: block; color: inherit; text-decoration: none;
}
.course-card:hover { border-color: var(--brand); box-shadow: 0 10px 24px rgba(47,111,237,.12); color: inherit; }
.course-card h3 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.course-card .desc { color: #7c8a99; font-size: 14px; min-height: 42px; }

/* ---------- 课程详情 ---------- */
.learn-layout { display: flex; gap: 20px; align-items: flex-start; }
.unit-sider {
  width: 300px; flex-shrink: 0; background: #fff; border: 1px solid #eef1f5;
  border-radius: 12px; overflow: hidden; position: sticky; top: 80px;
}
.unit-sider-title { padding: 14px 16px; font-weight: 700; border-bottom: 1px solid #f0f3f6; background: #fafbfc; }
.unit-item {
  padding: 12px 16px; display: flex; align-items: center; gap: 10px; cursor: pointer;
  border-bottom: 1px solid #f5f7f9; font-size: 14px;
}
.unit-item:last-child { border-bottom: none; }
.unit-item:hover { background: #f3f8ff; }
.unit-item.active { background: #e8f2ff; color: var(--brand); font-weight: 700; border-left: 3px solid var(--brand); padding-left: 13px; }
.unit-no {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; background: #eaf3ff;
  color: var(--brand); display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.unit-name { flex: 1; }
.unit-content {
  flex: 1; min-width: 0; background: #fff; border: 1px solid #eef1f5; border-radius: 12px; padding: 26px 28px;
}
.unit-content pre {
  background: #1f2d3d; color: #d6e2f0; padding: 16px; border-radius: 10px;
  font-size: 13px; overflow-x: auto; margin: 12px 0;
}
.unit-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; }

/* ---------- 小节选择（练习） ---------- */
.free-tip {
  background: #fffaf0; border: 1px solid #ffe6b0; color: #b8770b;
  border-radius: 10px; padding: 12px 16px; font-size: 14px; margin-bottom: 16px;
}
.unit-pick {
  background: #fff; border: 1px solid #eef1f5; border-radius: 10px; padding: 14px 18px;
  display: flex; align-items: center; gap: 12px; cursor: pointer; transition: all .15s; margin-bottom: 10px;
}
.unit-pick:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(47,111,237,.1); }
.unit-pick.locked { background: #fafbfc; }
.unit-pick.locked:hover { border-color: var(--vip); box-shadow: 0 4px 14px rgba(245,166,35,.15); }
.unit-pick .unit-no { background: #eaf3ff; }
.unit-pick.locked .unit-no { background: #fdf1dd; color: var(--vip); }
.unit-pick .unit-name { flex: 1; font-size: 14px; }
.unit-pick.locked .unit-name { color: #9aa7b4; }
.vip-tag {
  background: var(--vip-grad); color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 11px; border-radius: 12px; white-space: nowrap;
}
.free-tag {
  background: #ecf8e8; color: #47a63c; font-size: 12px; font-weight: 700;
  padding: 4px 11px; border-radius: 12px; white-space: nowrap;
}
.btn-lock { background: #fff; color: var(--vip) !important; border: 1px solid var(--vip) !important; }

/* ---------- 答题页 ---------- */
.exam-head {
  background: #fff; border: 1px solid #eef1f5; border-radius: 12px;
  padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px;
}
.q-block {
  background: #fff; border: 1px solid #eef1f5; border-radius: 12px; padding: 20px 22px; margin-bottom: 14px;
}
.q-stem { font-size: 15px; font-weight: 600; margin-bottom: 14px; line-height: 1.7; }
.q-type { font-size: 12px; color: #fff; background: var(--brand); border-radius: 10px; padding: 2px 10px; margin-left: 8px; font-weight: 500; }
.q-score { font-size: 12px; color: #93a1af; margin-left: 6px; font-weight: 400; }
.q-option {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; margin-bottom: 8px;
  border: 1px solid #e9edf2; border-radius: 8px; cursor: pointer; transition: all .12s; font-size: 14px;
}
.q-option:hover { border-color: var(--brand); background: #f5f9ff; }
.q-option.selected { border-color: var(--brand); background: #e8f2ff; font-weight: 600; }
.q-option input { margin-top: 4px; }
.q-option.correct { border-color: #52c41a; background: #f0fbe8; }
.q-option.wrong { border-color: #ff4d4f; background: #fff1f0; }

/* 结果解析 */
.score-hero { background: #fff; border: 1px solid #eef1f5; border-radius: 14px; padding: 30px; text-align: center; margin-bottom: 20px; }
.score-num { font-size: 52px; font-weight: 800; }
.detail-item {
  background: #fff; border: 1px solid #eef1f5; border-left: 4px solid #d9e1ea;
  border-radius: 10px; padding: 18px 20px; margin-bottom: 12px;
}
.detail-item.right { border-left-color: #52c41a; }
.detail-item.wrong { border-left-color: #ff4d4f; }
.analysis-box { background: #f7f9fc; border-radius: 8px; padding: 10px 14px; margin-top: 10px; font-size: 13px; color: #5a6b7b; }

/* ---------- VIP 弹窗 ---------- */
.vip-dialog { border: none; border-radius: 18px; overflow: hidden; }
.vip-crown { font-size: 48px; }
.vip-title { font-size: 24px; font-weight: 800; color: #b8770b; margin-top: 6px; }
.vip-sub { font-size: 13px; color: #93a1af; margin-top: 4px; }
.vip-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.vip-plan { border: 2px solid #e9edf2; border-radius: 14px; padding: 20px 10px; text-align: center; position: relative; }
.vip-plan.hot { border-color: var(--vip); background: #fffaf0; }
.vip-plan-tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--vip-grad); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 14px; border-radius: 12px; white-space: nowrap;
}
.vip-plan-name { font-size: 16px; font-weight: 700; }
.vip-plan-price { font-size: 32px; font-weight: 800; color: var(--vip); }
.vip-plan-price i { font-size: 16px; font-style: normal; }
.vip-plan-desc { font-size: 12px; color: #93a1af; margin-top: 6px; }
.vip-wechat { background: #f0f9eb; border-radius: 12px; padding: 16px; }
.vip-wechat b { color: #47a63c; font-size: 18px; letter-spacing: 1px; }
.vw-tip { font-size: 12px; color: #93a1af; margin-top: 6px; }
.vip-activate-btn { background: var(--vip-grad); color: #fff; font-weight: 700; border: none; padding: 10px 24px; border-radius: 10px; }
.vip-note { font-size: 12px; color: #a6b2bf; margin-top: 14px; }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: calc(100vh - 56px - 50px); display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1f2d3d 0%, #235784 60%, #22b8a6 140%); padding: 20px; }
.login-card { background: #fff; border-radius: 18px; width: 100%; max-width: 420px; padding: 36px 34px; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.login-logo { text-align: center; font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.login-tabs { display: flex; margin: 20px 0; border-bottom: 2px solid #eef1f5; }
.login-tabs div { flex: 1; text-align: center; padding: 10px; cursor: pointer; font-weight: 600; color: #93a1af; }
.login-tabs div.on { color: var(--brand); border-bottom: 2px solid var(--brand); margin-bottom: -2px; }

/* ---------- 通用 ---------- */
.page-loading { text-align: center; color: var(--brand); padding: 50px 0; }
.spinner {
  display: inline-block; width: 22px; height: 22px;
  border: 3px solid #d6e7ff; border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
.back-link { color: var(--brand); text-decoration: none; font-weight: 600; }
.back-link:hover { text-decoration: underline; }
.content-card { background: #fff; border: 1px solid #eef1f5; border-radius: 14px; padding: 24px; }

@media (max-width: 860px) {
  .learn-layout { flex-direction: column; }
  .unit-sider { width: 100%; position: static; }
  .vip-plans { grid-template-columns: 1fr; }
  .hero { padding: 32px 24px; }
  .hero h1 { font-size: 26px; }
}
