/* ===========================================================
   大富翁直播课 · 学习库
   light / paper theme
   =========================================================== */

:root {
  --paper: #f7f5f0;
  --paper-2: #f1eee7;
  --surface: #ffffff;
  --ink: #1b1a17;
  --ink-2: #403d37;
  --muted: #8a857c;
  --muted-2: #a8a29a;
  --line: #e5e0d6;
  --line-soft: #eeeae2;
  --accent: #9e2b25;
  --accent-2: #b8483f;
  --accent-soft: #f6eae7;
  --gold: #a9822f;
  --gold-soft: #f8f1e0;
  --green: #2f6b52;
  --green-soft: #e8f1ec;
  --shadow-sm: 0 1px 2px rgba(30, 26, 20, .04);
  --shadow-md: 0 6px 24px -12px rgba(30, 26, 20, .18);
  --shadow-lg: 0 18px 48px -24px rgba(30, 26, 20, .28);
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 245, 240, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(145deg, var(--accent) 0%, #7d1f1a 100%);
  color: #fff; font-size: 13px; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.brand .sub { color: var(--muted); font-weight: 400; font-size: 12.5px; letter-spacing: .06em; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a {
  padding: 7px 13px; border-radius: 999px; color: var(--ink-2);
  font-size: 14px; transition: background .16s, color .16s;
}
.nav-links a:hover { background: var(--paper-2); color: var(--ink); }
.nav-links a.on { background: var(--ink); color: #fff; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 340px at 12% -30%, #fbeee9 0%, rgba(251, 238, 233, 0) 62%),
    radial-gradient(700px 300px at 92% -10%, #eff2ec 0%, rgba(239, 242, 236, 0) 60%),
    var(--paper);
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(27, 26, 23, .032) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(27, 26, 23, .032) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 78%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; padding: 62px 0 44px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); font-weight: 600;
  padding: 5px 12px; border: 1px solid #e7cdc7; border-radius: 999px;
  background: rgba(255, 255, 255, .7);
}
.hero h1 {
  margin: 20px 0 0;
  font-size: 44px;
  line-height: 1.18;
  letter-spacing: -.01em;
  font-weight: 800;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead {
  margin: 16px 0 0; max-width: 640px;
  color: var(--ink-2); font-size: 15.5px; line-height: 1.85;
}
.hero .rule { width: 54px; height: 3px; background: var(--accent); border-radius: 2px; margin: 24px 0 0; }

.stats { display: flex; flex-wrap: wrap; gap: 0; margin-top: 38px; border-top: 1px solid var(--line); }
.stat {
  padding: 20px 40px 4px 0; margin-right: 40px;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.stat b {
  display: block; font-size: 30px; line-height: 1.1; font-weight: 800;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.stat span { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; letter-spacing: .06em; }

/* ---------- section ---------- */
.section { padding: 52px 0 8px; }
.section[id], .cat-section[id] { scroll-margin-top: 84px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 26px; }
.section-head h2 {
  margin: 0; font-size: 20px; font-weight: 700; letter-spacing: .01em;
  position: relative; padding-left: 14px;
}
.section-head h2::before {
  content: ""; position: absolute; left: 0; top: .34em; bottom: .28em;
  width: 4px; border-radius: 2px; background: var(--accent);
}
.section-head .hint { color: var(--muted); font-size: 13px; }

/* ---------- toolbar ---------- */
.toolbar {
  position: sticky; top: 62px; z-index: 40;
  background: rgba(247, 245, 240, .94);
  backdrop-filter: blur(10px);
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--line-soft);
}
.toolbar-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
  white-space: nowrap;
}
.chip:hover { border-color: #d5cec1; color: var(--ink); }
.chip .n { color: var(--muted-2); margin-left: 5px; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.on .n { color: rgba(255,255,255,.55); }

.search {
  margin-left: auto; position: relative; display: flex; align-items: center;
}
.search svg { position: absolute; left: 12px; width: 15px; height: 15px; color: var(--muted-2); }
.search input {
  width: 268px; padding: 8px 12px 8px 34px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-size: 13.5px; font-family: inherit; outline: none;
  transition: border-color .16s, box-shadow .16s, width .2s;
}
.search input::placeholder { color: var(--muted-2); }
.search input:focus { border-color: #cdbfb6; box-shadow: 0 0 0 3px rgba(158, 43, 37, .07); width: 300px; }
.search kbd {
  position: absolute; right: 10px; font-size: 11px; color: var(--muted-2);
  border: 1px solid var(--line); border-radius: 4px; padding: 0 5px;
  background: var(--paper); font-family: inherit;
}

/* ---------- cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
  padding: 26px 0 10px;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 18px 15px;
  display: flex; flex-direction: column;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .2s, border-color .2s;
  min-height: 196px;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 16px; bottom: 16px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
  opacity: 0; transition: opacity .2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #ded7ca; }
.card:hover::before { opacity: 1; }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.card-num {
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.card-cat {
  font-size: 11.5px; color: var(--muted); background: var(--paper-2);
  padding: 2px 8px; border-radius: 999px; letter-spacing: .02em;
}
.card h3 {
  margin: 0 0 8px; font-size: 16.5px; line-height: 1.45; font-weight: 700;
  letter-spacing: -.005em;
}
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card .subtitle {
  margin: -2px 0 8px; font-size: 12.5px; color: var(--accent); line-height: 1.5;
  letter-spacing: .005em;
}
.card .excerpt {
  margin: 0 0 12px; font-size: 13px; line-height: 1.72; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .outline { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.card .outline span {
  font-size: 11.5px; color: var(--muted); border: 1px solid var(--line-soft);
  padding: 1px 7px; border-radius: 4px; background: #fcfbf9;
}
.card .meta {
  margin-top: auto; padding-top: 11px; border-top: 1px solid var(--line-soft);
  display: flex; gap: 14px; font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.card .meta b { color: var(--ink-2); font-weight: 600; }

.empty {
  padding: 60px 0; text-align: center; color: var(--muted); display: none;
}
.empty b { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 6px; }

/* ---------- learning path ---------- */
.path { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.stage {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 17px 16px 14px;
}
.stage .tag {
  font-size: 11px; letter-spacing: .1em; color: var(--gold);
  background: var(--gold-soft); padding: 2px 8px; border-radius: 4px; font-weight: 600;
}
.stage h4 { margin: 10px 0 4px; font-size: 15px; font-weight: 700; }
.stage p { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.stage ol { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.stage ol li { margin-bottom: 4px; }
.stage ol a { border-bottom: 1px solid transparent; transition: border-color .15s; }
.stage ol a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- quotes ---------- */
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.quote {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0; padding: 16px 18px;
  font-size: 13.5px; line-height: 1.8; color: var(--ink-2);
}
.quote .src { display: block; margin-top: 10px; font-size: 12px; color: var(--muted); }

/* ---------- footer ---------- */
.footer {
  margin-top: 64px; padding: 26px 0 40px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px;
}
.footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }

/* ===========================================================
   catalog
   =========================================================== */
.cat-layout { display: grid; grid-template-columns: 208px 1fr; gap: 40px; padding: 34px 0 40px; }
.cat-nav { position: sticky; top: 84px; align-self: start; }
.cat-nav .title { font-size: 11.5px; letter-spacing: .14em; color: var(--muted); margin-bottom: 12px; }
.cat-nav a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 10px; border-radius: 6px; font-size: 13.5px; color: var(--ink-2);
  border-left: 2px solid transparent;
}
.cat-nav a:hover { background: var(--paper-2); }
.cat-nav a.on { background: var(--surface); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.cat-nav a .n { font-size: 11.5px; color: var(--muted-2); }

.cat-section { margin-bottom: 40px; scroll-margin-top: 84px; }
.cat-section > h2 {
  font-size: 17px; margin: 0 0 4px; padding-bottom: 10px;
  border-bottom: 2px solid var(--ink); display: flex; align-items: baseline; gap: 10px;
}
.cat-section > h2 .n { font-size: 12px; color: var(--muted); font-weight: 400; }
.cat-section > .desc { color: var(--muted); font-size: 13px; margin: 8px 0 14px; }

details.lesson {
  border-bottom: 1px solid var(--line-soft);
}
details.lesson > summary {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 4px; cursor: pointer; list-style: none;
  transition: background .14s;
}
details.lesson > summary::-webkit-details-marker { display: none; }
details.lesson > summary:hover { background: #fbfaf7; }
details.lesson .idx {
  font-size: 12px; color: var(--muted-2); width: 26px; flex: none;
  font-variant-numeric: tabular-nums; font-weight: 600;
}
details.lesson .name { font-size: 14.5px; font-weight: 600; color: var(--ink); flex: 1; }
details.lesson .cnt { font-size: 12px; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
details.lesson .cnt em { font-style: normal; color: var(--muted-2); margin: 0 3px; }
details.lesson[open] > summary .name { color: var(--accent); }
details.lesson .body { padding: 4px 4px 18px 40px; }
details.lesson .body p.sum { margin: 0 0 12px; font-size: 13px; color: var(--ink-2); line-height: 1.8; }
details.lesson .body ul { margin: 0 0 14px; padding-left: 0; list-style: none; }
details.lesson .body ul li {
  font-size: 12.8px; color: var(--ink-2); padding: 3px 0; line-height: 1.7;
}
details.lesson .body ul li::before {
  content: "—"; color: var(--muted-2); margin-right: 8px;
}
details.lesson .go {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--accent); font-weight: 600;
}
details.lesson .go:hover { text-decoration: underline; }

/* ===========================================================
   lesson page
   =========================================================== */
.lesson-hero { border-bottom: 1px solid var(--line); background: var(--surface); }
.lesson-hero .inner { max-width: var(--maxw); margin: 0 auto; padding: 30px 28px 26px; }
.crumb { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.crumb a:hover { color: var(--accent); }
.crumb .sep { color: var(--muted-2); }
.lesson-hero h1 { margin: 14px 0 12px; font-size: 30px; line-height: 1.3; font-weight: 800; letter-spacing: -.01em; }
.lesson-sub { margin: -2px 0 14px; font-size: 14px; color: var(--accent); }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.lesson-meta span {
  font-size: 12px; color: var(--ink-2); background: var(--paper);
  border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.lesson-meta span.hl { background: var(--accent-soft); border-color: #ecd5d1; color: var(--accent); }

.lesson-layout {
  max-width: var(--maxw); margin: 0 auto; padding: 30px 28px 60px;
  display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 44px;
  align-items: start;
}
.toc { position: sticky; top: 84px; font-size: 13px; }
.toc .title { font-size: 11.5px; letter-spacing: .14em; color: var(--muted); margin-bottom: 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a {
  display: block; padding: 5px 0 5px 12px; color: var(--muted);
  border-left: 2px solid transparent; margin-left: -1.5px; line-height: 1.55;
  transition: color .15s, border-color .15s;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.toc li a:hover { color: var(--ink); }
.toc li a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

.content { min-width: 0; font-size: 15px; line-height: 1.92; color: var(--ink-2); }
.content > *:first-child { margin-top: 0; }
.content h2 {
  margin: 46px 0 16px; padding-top: 22px; border-top: 1px solid var(--line);
  font-size: 21px; line-height: 1.45; color: var(--ink); font-weight: 700;
  scroll-margin-top: 86px;
}
.content h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 8px; }
.content h3 {
  margin: 30px 0 12px; font-size: 16.5px; color: var(--ink); font-weight: 700;
  scroll-margin-top: 86px;
}
.content h4 { margin: 22px 0 10px; font-size: 14.5px; color: var(--ink); font-weight: 700; }
.content p { margin: 0 0 14px; }
.content strong { color: var(--ink); font-weight: 700; }
.content em { font-style: normal; background: linear-gradient(transparent 62%, #fbe6b8 62%); padding: 0 1px; }

.content blockquote {
  margin: 0 0 26px; padding: 16px 20px;
  background: #fbf8f2; border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 13px; line-height: 1.85; color: var(--ink-2);
}
.content blockquote p { margin: 0 0 6px; }
.content blockquote p:last-child { margin-bottom: 0; }
.content blockquote code {
  background: rgba(0,0,0,.04); padding: 1px 5px; border-radius: 3px; font-size: 12px;
}

.content ul, .content ol { margin: 0 0 16px; padding-left: 22px; }
.content li { margin-bottom: 7px; }
.content li > ul, .content li > ol { margin-top: 7px; }

.content hr {
  border: 0; height: 1px; background: var(--line-soft); margin: 30px 0;
}

.content table {
  width: 100%; border-collapse: collapse; margin: 6px 0 24px;
  font-size: 13.5px; line-height: 1.7; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden;
  display: table;
}
.content thead th {
  background: #f6f3ec; color: var(--ink); text-align: left;
  font-weight: 700; font-size: 13px; letter-spacing: .01em;
  padding: 10px 13px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.content tbody td { padding: 9px 13px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.content tbody tr:last-child td { border-bottom: 0; }
.content tbody tr:nth-child(even) { background: #fcfbf8; }

.content img {
  display: block; max-width: 100%; height: auto; margin: 20px auto 8px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; padding: 0; box-shadow: var(--shadow-sm);
}
.content p > img + em, .content img + em { display: block; }

.content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; background: #f0ece3; padding: 1px 5px; border-radius: 3px;
}
.content pre {
  background: #f6f3ec; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 14px 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.7;
}
.content pre code { background: none; padding: 0; }

/* pager */
.pager {
  display: flex; gap: 12px; margin-top: 54px; padding-top: 22px;
  border-top: 1px solid var(--line);
}
.pager a {
  flex: 1; border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; background: var(--surface); transition: border-color .18s, box-shadow .18s;
}
.pager a:hover { border-color: #d8d0c2; box-shadow: var(--shadow-sm); }
.pager .k { display: block; font-size: 11.5px; color: var(--muted); letter-spacing: .06em; }
.pager .v { display: block; margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--ink); }
.pager a.next { text-align: right; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .cat-layout { grid-template-columns: 1fr; gap: 20px; }
  .cat-nav { position: static; display: flex; gap: 6px; flex-wrap: wrap; }
  .cat-nav .title { display: none; }
  .lesson-layout { grid-template-columns: 1fr; gap: 24px; }
  .toc { display: none; }
}
@media (max-width: 720px) {
  .nav-inner { padding: 0 16px; gap: 12px; }
  .brand .sub { display: none; }
  .nav-links a { padding: 6px 10px; font-size: 13px; }
  .wrap, .lesson-layout, .lesson-hero .inner { padding-left: 16px; padding-right: 16px; }
  .hero-inner { padding: 40px 0 32px; }
  .hero h1 { font-size: 30px; }
  .stat { padding: 14px 20px 2px 0; margin-right: 20px; }
  .stat b { font-size: 22px; }
  .toolbar { top: 62px; }
  .search { margin-left: 0; width: 100%; }
  .search input, .search input:focus { width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .content table { display: block; overflow-x: auto; }
}
