/* =========================================================
   境界灵感 · 画卡  国画风样式
   宣纸米白 + 水墨墨黑 + 印章红
   ========================================================= */
:root {
  --paper: #f5efe3;        /* 宣纸底 */
  --ink: #26221c;          /* 墨黑 */
  --ink-light: #6b6254;    /* 淡墨 */
  --ink-faint: #9a8f7c;    /* 更淡 */
  --seal: #b03a2e;         /* 印章红 */
  --seal-dark: #8e2f24;
  --card: #fffdf8;         /* 卡面 */
  --border: #e2d7c2;       /* 描边 */
  --shadow: 0 6px 24px rgba(60, 42, 20, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, .serif {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "FangSong", "STSong", serif;
  font-weight: 600;
  letter-spacing: .04em;
}

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

.wrap { max-width: 1080px; margin: 0 0 0 6%; padding: 0 20px; }

/* ---------- 顶部 ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif;
  font-size: 20px; letter-spacing: .12em; color: var(--ink);
}
.brand .seal {
  width: 34px; height: 34px; flex: 0 0 auto;
  background: var(--seal); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; border-radius: 6px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
}
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.nav-right .btn { font-size: 13px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; font-size: 14px; letter-spacing: .06em;
  border-radius: 8px; cursor: pointer; border: 1px solid var(--seal);
  background: var(--seal); color: #fff; transition: .15s;
}
.btn:hover { background: var(--seal-dark); }
.btn.ghost { background: transparent; color: var(--seal); }
.btn.ghost:hover { background: rgba(176,58,46,.06); }
.btn.block { width: 100%; }

/* ---------- 全宽横幅（无圆角、自适应） ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  margin: 0;
  min-height: 300px;
  padding: 28px 0 0;
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  background: none;
}
/* 宣纸底（铺满） */
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: url('/static/hero_base.png') center / cover no-repeat;
}
/* 山水（透明，cover 铺满整个 hero） */
.hero-scene {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1; pointer-events: none;
}
/* 人物（透明，靠左一点，固定高度可调） */
/* 合成图（主标题+小标题+人物，透明，整体缩放） */
.hero-content {
  position: relative;
  z-index: 2;
  width: min(1600px, 100%);
  height: auto;
  margin: 0 auto;
}
.hero-inner { position: relative; z-index: 3; max-width: 1080px; margin: 0 0 0 6%; padding: 0 20px; }
.hero .kicker {
  display: inline-block;
  font-size: 14px; letter-spacing: .35em; opacity: .9; margin-bottom: 8px;
  background: linear-gradient(90deg, var(--paper) 0%, rgba(245,239,227,0) 100%);
  padding: 4px 24px 4px 12px;
  border-radius: 9999px;
}
.hero .kicker .seal-dot { position: relative; top: 1px; }
.hero-title {
  width: min(640px, 62%);
  height: auto;
  display: block;
  margin: 0 0 12px;
}
.hero .sub {
  display: inline-block;
  white-space: nowrap;
  font-size: clamp(13px, 1.8vw, 16px);
  color: var(--seal); max-width: none; margin-top: 4px;
  background: rgba(247, 243, 234, .94);  /* 接近整体宣纸底色 */
  border: 1px solid rgba(176, 58, 46, .12);  /* 淡淡的一圈，带点印章红的韵味 */
  border-radius: 9999px;  /* 椭圆 */
  padding: 5px 22px;
}
.hero .seal-dot { display: inline-block; width: 12px; height: 12px; background: var(--seal); border-radius: 3px; margin-right: 12px; }

/* ---------- 授权检查遮罩（防止未激活内容闪现） ---------- */
.boot {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper); color: var(--ink-faint);
  font-size: 14px; letter-spacing: .14em;
}

/* ---------- 激活闸门（独立前置界面） ---------- */
.gate {
  min-height: calc(100vh - 120px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(900px 400px at 50% -10%, rgba(176,58,46,.06), transparent 60%),
    var(--paper);
}
.gate .panel {
  width: 100%; max-width: 400px; text-align: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 36px 28px; box-shadow: var(--shadow);
}
.gate .seal {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 12px;
  background: var(--seal); color: #fff; font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
}
.gate h2 { font-size: 22px; margin-bottom: 8px; }
.gate .desc { font-size: 13px; color: var(--ink-light); margin-bottom: 22px; line-height: 1.6; }
.gate input {
  width: 100%; padding: 14px; font-size: 18px; text-align: center; letter-spacing: 4px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; outline: none; margin-bottom: 14px;
  text-transform: uppercase;
}
.gate input:focus { border-color: var(--seal); }
.gate .btn { font-size: 16px; padding: 13px; }
.gate .msg { font-size: 13px; color: var(--seal); min-height: 20px; margin-top: 12px; }

/* ---------- 分区标题 ---------- */
.section-title {
  display: flex; align-items: center; gap: 10px;
  margin: 8px 0 18px; font-size: 20px; color: var(--ink);
}
.section-title .icon {
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 7px;
  background: var(--seal); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.section-title small { font-size: 13px; color: var(--ink-faint); font-weight: 400; margin-left: auto; letter-spacing: 0; }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; box-shadow: var(--shadow); transition: .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(60,42,20,.14); }
.card .thumb { position: relative; aspect-ratio: 4/3; background: #efe8d8; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .badge {
  position: absolute; right: 10px; top: 10px; background: var(--seal); color: #fff;
  font-size: 12px; padding: 3px 8px; border-radius: 20px; letter-spacing: .05em;
}
.card .body { padding: 14px 16px 16px; }
.card .title { font-size: 16px; margin-bottom: 2px; }
.card .meta { font-size: 12.5px; color: var(--ink-faint); }
.card .meta .dot { margin: 0 6px; }

/* ---------- 激活卡 ---------- */
.activate-card {
  background: var(--card); border: 1px dashed var(--seal); border-radius: 14px;
  padding: 22px; text-align: center; box-shadow: var(--shadow);
}
.activate-card .seal {
  width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 10px;
  background: var(--seal); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
}
.activate-card h3 { font-size: 18px; margin-bottom: 6px; }
.activate-card p { font-size: 13px; color: var(--ink-light); margin-bottom: 16px; }
.activate-card input {
  width: 100%; padding: 12px; font-size: 17px; text-align: center; letter-spacing: 3px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; outline: none; margin-bottom: 12px;
  text-transform: uppercase;
}
.activate-card input:focus { border-color: var(--seal); }
.activate-card .msg { font-size: 13px; color: var(--seal); min-height: 20px; margin-top: 10px; }

/* ---------- 课程详情页 ---------- */
.course-head {
  display: flex; gap: 20px; align-items: flex-start; margin: 20px 0 28px;
}
.course-head .cover {
  width: 150px; height: 190px; flex: 0 0 auto; border-radius: 10px; overflow: hidden;
  background: #efe8d8; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.course-head .cover img { width: 100%; height: 100%; object-fit: cover; }
.course-head .info h1 { font-size: 24px; margin-bottom: 6px; }
.course-head .info .author { font-size: 13px; color: var(--ink-faint); }
.course-head .count {
  display: inline-flex; align-items: baseline; gap: 6px; margin-top: 14px;
  color: var(--seal); font-family: "Kaiti SC", serif;
}
.course-head .count b { font-size: 44px; font-weight: 700; }
.course-head .count span { font-size: 14px; }

/* ---------- 章节 + 课程行 ---------- */
.chapter { margin-bottom: 24px; }
.chapter-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border);
  font-size: 17px; color: var(--ink);
}
.chapter-head .toggle { font-size: 13px; color: var(--ink-faint); cursor: pointer; }

.lesson {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 10px; cursor: pointer; transition: .15s;
}
.lesson:hover { border-color: var(--seal); box-shadow: var(--shadow); }
.lesson .thumb { position: relative; width: 130px; flex: 0 0 auto; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: #efe8d8; }
.lesson .thumb img { width: 100%; height: 100%; object-fit: cover; }
.lesson .thumb .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; background: rgba(0,0,0,.18);
}
.lesson .thumb .dur {
  position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.72); color: #fff;
  font-size: 11px; padding: 2px 6px; border-radius: 4px;
}
.lesson .t { font-size: 15px; }
.lesson .no { font-size: 12px; color: var(--ink-faint); margin-bottom: 2px; }

/* ---------- 视频弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(20,16,10,.82);
}
.modal.open { display: flex; }
.modal .box { width: 100%; max-width: 900px; }
.modal .head { display: flex; align-items: center; justify-content: space-between; color: #fff; margin-bottom: 12px; }
.modal .head .t { font-size: 17px; }
.modal .close { cursor: pointer; font-size: 22px; color: #fff; opacity: .8; line-height: 1; padding: 6px; }
.modal video { width: 100%; border-radius: 12px; background: #000; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal .foot { display: flex; justify-content: space-between; margin-top: 14px; }
.modal .foot .btn { font-size: 13px; }

/* ---------- 未激活遮罩 ---------- */
.lock-banner {
  padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 13px;
  background: rgba(176,58,46,.08); color: var(--seal-dark); border: 1px solid rgba(176,58,46,.22);
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .hero { padding: 24px 0; min-height: 240px; }
  .hero-content { width: 100%; }
  .hero-scene { height: 96%; }
  .course-head { flex-direction: column; }
  .course-head .cover { width: 120px; height: 152px; }
  .lesson .thumb { width: 100px; }
  .grid { grid-template-columns: 1fr; }
}
