/* 课程手册 — 与 KB 资源库区分的「工坊手册」视觉 */

:root {
  --hb-ink: #1c1410;
  --hb-ink-soft: #3d3229;
  --hb-muted: #7a6a5c;
  --hb-line: rgba(28, 20, 16, 0.1);
  --hb-amber: #c45c26;
  --hb-amber-deep: #9a3f14;
  --hb-amber-soft: #f3e0d0;
  --hb-paper: #f7f1ea;
  --hb-paper-2: #efe6db;
  --hb-card: rgba(255, 252, 248, 0.92);
  --hb-serif: "Noto Serif SC", "Source Han Serif SC", serif;
  --hb-sans: "DM Sans", "Noto Sans SC", system-ui, sans-serif;
}

body.hb-body {
  font-family: var(--hb-sans);
  background: var(--hb-paper);
  color: var(--hb-ink);
}

body.hb-body .layout {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(196, 92, 38, 0.12), transparent 55%),
    radial-gradient(700px 380px at 92% 0%, rgba(28, 20, 16, 0.06), transparent 50%),
    linear-gradient(180deg, #faf6f1 0%, var(--hb-paper) 40%, var(--hb-paper-2) 100%);
}

/* 顶栏 */
body.hb-body .header {
  background: rgba(255, 252, 248, 0.86);
  border-bottom: 1px solid var(--hb-line);
  backdrop-filter: blur(10px);
}

body.hb-body .no-brand h1 {
  font-family: var(--hb-serif);
  letter-spacing: -0.02em;
}

body.hb-body .no-brand .sub {
  color: var(--hb-muted);
}

body.hb-body .no-brand-mark {
  background: linear-gradient(145deg, #c45c26, #e08a4d);
  box-shadow: 0 8px 20px rgba(196, 92, 38, 0.28);
}

body.hb-body .no-link-back {
  color: var(--hb-ink-soft);
  font-weight: 600;
}

body.hb-body .no-link-back:hover {
  color: var(--hb-amber);
}

/* 加载门 */
.hb-loading-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(600px 280px at 50% 30%, rgba(196, 92, 38, 0.14), transparent 60%),
    var(--hb-paper);
  color: var(--hb-muted);
  font-size: 14px;
}

/* 目录页 */
.hb-index {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.hb-hero {
  position: relative;
  margin-bottom: 28px;
  padding: 32px 28px 28px;
  border-radius: 20px;
  overflow: hidden;
  color: #fff7f0;
  background:
    radial-gradient(800px 240px at 15% 0%, rgba(224, 138, 77, 0.35), transparent 55%),
    linear-gradient(125deg, #2a1810 0%, #3d2216 45%, #1a242e 100%);
  border: 1px solid rgba(224, 138, 77, 0.35);
  box-shadow: 0 18px 40px rgba(28, 20, 16, 0.18);
}

.hb-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 247, 240, 0.07) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.5;
  pointer-events: none;
}

.hb-hero > * { position: relative; z-index: 1; }

.hb-hero-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f0b27a;
}

.hb-hero h2 {
  margin: 0 0 10px;
  font-family: var(--hb-serif);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hb-hero p {
  margin: 0;
  max-width: 38em;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255, 247, 240, 0.78);
}

.hb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.hb-toolbar-meta {
  font-size: 13px;
  color: var(--hb-muted);
}

.hb-toolbar-search {
  width: min(320px, 100%);
}

.hb-modules {
  display: grid;
  gap: 14px;
}

.hb-module {
  border-radius: 16px;
  border: 1px solid var(--hb-line);
  background: var(--hb-card);
  box-shadow: 0 4px 16px rgba(28, 20, 16, 0.04);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.hb-module.is-open {
  border-color: rgba(196, 92, 38, 0.35);
  box-shadow: 0 8px 24px rgba(196, 92, 38, 0.08);
}

.hb-module-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.hb-module-head:hover {
  background: rgba(196, 92, 38, 0.04);
}

.hb-module-ord {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--hb-serif);
  font-size: 15px;
  font-weight: 700;
  color: #fff7f0;
  background: linear-gradient(145deg, #c45c26, #9a3f14);
  box-shadow: 0 6px 14px rgba(196, 92, 38, 0.25);
}

.hb-module-copy { flex: 1; min-width: 0; }

.hb-module-name {
  margin: 0 0 2px;
  font-family: var(--hb-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--hb-ink);
}

.hb-module-hint {
  margin: 0;
  font-size: 12px;
  color: var(--hb-muted);
}

.hb-module-count {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--hb-amber-deep);
  background: var(--hb-amber-soft);
  padding: 4px 10px;
  border-radius: 999px;
}

.hb-module-chevron {
  flex-shrink: 0;
  width: 20px;
  color: var(--hb-muted);
  transition: transform 0.2s ease;
}

.hb-module.is-open .hb-module-chevron {
  transform: rotate(90deg);
  color: var(--hb-amber);
}

.hb-module-body {
  padding: 0 16px 16px;
  border-top: 1px solid transparent;
}

.hb-module.is-open .hb-module-body {
  border-top-color: var(--hb-line);
  padding-top: 12px;
}

.hb-article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.hb-article-btn {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--hb-line);
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  color: inherit;
}

.hb-article-btn:hover {
  border-color: rgba(196, 92, 38, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(28, 20, 16, 0.07);
}

.hb-article-id {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--hb-amber-deep);
  background: var(--hb-amber-soft);
  padding: 2px 8px;
  border-radius: 6px;
}

.hb-article-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--hb-ink);
}

.hb-article-meta {
  margin-top: auto;
  font-size: 12px;
  color: var(--hb-muted);
}

.hb-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--hb-muted);
}

/* 阅读态布局覆写 */
body.hb-body .kb-reader-layout {
  background: transparent;
}

body.hb-body .kb-sidebar-float {
  background: rgba(255, 252, 248, 0.95);
  border: 1px solid var(--hb-line);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(28, 20, 16, 0.06);
}

body.hb-body .kb-catalog-path {
  color: var(--hb-amber-deep);
  font-weight: 700;
}

body.hb-body .kb-catalog-articles button.active {
  background: var(--hb-amber-soft);
  color: var(--hb-amber-deep);
  border-color: transparent;
}

body.hb-body .kb-reader-wrap {
  background: #fffdfb;
  border: 1px solid var(--hb-line);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(28, 20, 16, 0.06);
}

body.hb-body .kb-reader-header h2 {
  font-family: var(--hb-serif);
  color: var(--hb-ink);
}

body.hb-body .kb-reader-meta {
  color: var(--hb-muted);
}

body.hb-body .kb-shield-badge {
  background: var(--hb-amber-soft);
  color: var(--hb-amber-deep);
  border-color: transparent;
}

body.hb-body .kb-protected {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--hb-ink-soft);
}

body.hb-body .kb-block-heading {
  font-family: var(--hb-serif);
  color: var(--hb-ink);
}

body.hb-body .kb-callout {
  border-left-color: var(--hb-amber);
  background: rgba(243, 224, 208, 0.45);
}

@media (max-width: 720px) {
  .hb-hero { padding: 24px 20px; }
  .hb-module-head { gap: 10px; padding: 14px; }
  .hb-module-name { font-size: 16px; }
  .hb-article-grid { grid-template-columns: 1fr; }
}
