/* 全站字体：G 风格几何圆角无衬线（Mona Sans 同族 Manrope，OFL 1.1 授权，自托管） */
@font-face {
  font-family: "Mona Sans";
  src: url("assets/fonts/manrope.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #24211c;
  --ink-soft: #615a4f;
  --paper: #f3eddf;
  --paper-deep: #e2d7c3;
  --line: rgba(64, 53, 38, 0.18);
  --line-dark: rgba(64, 53, 38, 0.38);
  --seal: #7f2d24;
  --gold: #9f7a42;
  --shadow: rgba(35, 29, 20, 0.18);
  --font-body: "Mona Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --indigo: #131e3c;
  --mountain: #05090c;  /* hero 星图最底缘山体色，下方底图起点与之无缝衔接 */
  --indigo-soft: #c3cde6;
  --indigo-gold: #ead9b0;
  /* writings 区 · 深空过夜 + 朱砂橙 */
  --space: #0a0e1a;
  --space-soft: #131a2c;
  --cinnabar: #d96f3f;   /* 参考图朱砂橙 */
  --cinnabar-soft: #e89870;
  --ink-white: #f3eddf;
  --ink-white-soft: rgba(243, 237, 223, 0.62);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    "Songti SC", "Noto Serif CJK SC", "STSong", "PingFang SC", serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100dvh;
}

.landing {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background: #f2ece0;
}

.intro-video,
.final-painting,
.auth-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro-video,
.final-painting {
  position: absolute;
  inset: 0;
}

.intro-video {
  z-index: 2;
  transition: opacity 3000ms ease;
}

.final-painting {
  z-index: 1;
  opacity: 1;
}

.landing.painting-visible .intro-video,
.landing.intro-done .intro-video {
  opacity: 0;
}

.landing.intro-done .intro-video {
  pointer-events: none;
}

.landing-scrim {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(90deg, rgba(244, 238, 225, 0.36), transparent 36%),
    linear-gradient(0deg, rgba(38, 32, 23, 0.14), transparent 42%);
  opacity: 0;
  transition: opacity 1200ms ease;
}

.landing.intro-done .landing-scrim {
  opacity: 1;
}

.brand-mark {
  position: absolute;
  z-index: 4;
  left: calc(clamp(46px, 11vw, 176px) + 3em);
  top: clamp(160px, 34vh, 380px);
  border: 0;
  background: transparent;
  color: #11100e;
  font-size: clamp(64px, 9vw, 148px);
  letter-spacing: 0.12em;
  writing-mode: vertical-rl;
  text-shadow: 0 8px 30px rgba(33, 28, 20, 0.12);
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 1200ms ease 480ms,
    transform 1200ms ease 480ms;
}

.landing.intro-done .brand-mark {
  opacity: 1;
  transform: translateY(0);
}

.hut-hotspot {
  position: absolute;
  z-index: 5;
  right: 31.5%;
  bottom: 15%;
  width: clamp(56px, 7vw, 116px);
  aspect-ratio: 1.45;
  border: none;
  background: transparent;
  cursor: pointer;
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  min-height: 100dvh;
  background: var(--paper);
}

.auth-art {
  position: relative;
  overflow: hidden;
  min-height: 100dvh;
}

.auth-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 62%, rgba(243, 237, 223, 0.92));
}

.auth-seal {
  position: absolute;
  left: 9%;
  top: 27%;
  color: rgba(88, 62, 38, 0.7);
  font-size: clamp(52px, 7vw, 112px);
  letter-spacing: 0.12em;
  writing-mode: vertical-rl;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: clamp(28px, 6vw, 80px);
}

.eyeline {
  margin: 0;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.18em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(42px, 7vw, 82px);
  font-weight: 500;
  line-height: 1.05;
}

.auth-copy,
.section-page p,
.hall-desc,
.qr-shell p,
.form-hint {
  color: var(--ink-soft);
  line-height: 1.8;
}

.primary-action,
.secondary-action {
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--ink);
  min-height: 42px;
  padding: 0 18px;
}

.primary-action {
  background: var(--ink);
  color: var(--paper);
}

.login-body {
  min-height: 40px;
}

/* 验证码 */
.captcha-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.captcha-img {
  width: 140px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.captcha-img svg,
.captcha-img img {
  display: block;
  width: 100%;
  height: 100%;
}

.captcha-refresh {
  color: var(--gold);
  font-size: 22px;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
  padding: 4px;
  user-select: none;
}

.captcha-input {
  flex: 1;
  height: 44px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.52);
  font-size: 18px;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.2em;
}

.captcha-input:focus {
  border-color: var(--gold);
}

.slider-captcha {
  width: 100%;
  max-width: 420px;
  margin: 8px 0 4px;
}

.slider-track {
  position: relative;
  height: 52px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
  overflow: hidden;
  user-select: none;
}

.slider-tip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: rgba(68, 109, 74, 0.18);
}

.slider-handle {
  position: absolute;
  left: 0;
  top: 0;
  height: 52px;
  width: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 22px;
  line-height: 1;
  cursor: grab;
  touch-action: none;
}

.slider-handle:active {
  cursor: grabbing;
}

.slider-captcha.passed .slider-track {
  border-color: rgba(68, 109, 74, 0.5);
}

.slider-captcha.passed .slider-fill {
  background: rgba(68, 109, 74, 0.28);
}

.slider-captcha.passed .slider-handle {
  background: rgb(68, 109, 74);
}


.notice {
  padding: 10px 12px;
  border: 1px solid rgba(68, 109, 74, 0.38);
  border-radius: 8px;
  background: rgba(68, 109, 74, 0.08);
}

.notice.danger {
  border-color: rgba(127, 45, 36, 0.42);
  background: rgba(127, 45, 36, 0.08);
}

.portal {
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 42%),
    var(--paper);
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  --nav-h: 64px;
  min-height: var(--nav-h);
  padding: 0 clamp(18px, 4vw, 64px);
  background: rgba(243, 237, 223, 0.22);
  backdrop-filter: blur(28px) saturate(1.7);
  -webkit-backdrop-filter: blur(28px) saturate(1.7);
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(159, 122, 66, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 8px 32px rgba(20, 16, 8, 0.08);
  transition: background 320ms ease, border-color 320ms ease, box-shadow 320ms ease;
}

.wordmark {
  border: 0 !important;
  background: transparent !important;
  font-size: 22px;
  letter-spacing: 0.12em;
  color: var(--ink);
}

.portal-header nav {
  display: flex;
  justify-content: center;
  gap: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 玻璃光导航按钮 */
.nav-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 15px;
  letter-spacing: 0.08em;
  overflow: hidden;
  transition: color 280ms ease, background 280ms ease;
  cursor: pointer;
}

.nav-btn::after {
  content: "";
  position: absolute;
  left: -120%;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.5) 40%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0.5) 60%,
    transparent
  );
  transform: skewX(-15deg);
  transition: left 520ms cubic-bezier(0.25, 0.8, 0.25, 1);
  pointer-events: none;
}

.nav-btn:hover::after {
  left: 120%;
}

.nav-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.34);
}

.nav-btn.active {
  color: var(--ink);
  background: rgba(159, 122, 66, 0.14);
}

.nav-btn.logout {
  color: var(--ink-soft);
  font-size: 14px;
}

.nav-btn.admin-link {
  font-size: 14px;
}

/* 门户页导航 → 星光白（米色磨砂玻璃 + 星空透出，字改成星光白并加柔光） */
.home-portal > .portal-header .wordmark,
.home-portal > .portal-header .nav-btn {
  color: #f3eddf;
  text-shadow: 0 0 12px rgba(243, 237, 223, 0.45);
}

.home-portal > .portal-header .nav-btn:hover {
  color: #ffffff;
  background: rgba(243, 237, 223, 0.14);
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.55);
}

.home-portal > .portal-header .nav-btn.active {
  color: #ffffff;
  background: rgba(159, 122, 66, 0.22);
  text-shadow: 0 0 16px rgba(234, 217, 176, 0.6);
}

.home-portal > .portal-header .nav-btn.logout {
  color: #f3eddf;
}

.home-portal {
  --hall-line: rgba(234, 217, 176, 0.18);
  background: #080c18;
}

/* 夜空星图 · 首页全屏天幕 */
.home-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

/* 门户页：让 hero 向上延伸至导航栏后方，真正实现"玻璃糊住星空" */
.home-portal > .home-hero {
  margin-top: calc(-1 * var(--nav-h, 64px));
  padding-top: var(--nav-h, 64px);
}

.home-hero-img {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url(/assets/xinglu-portal-hero.jpg) center / cover no-repeat;
  transform: scale(1.04);
}

.home-hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: transparent;
}

.home-hero-inner {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 760px;
  padding: clamp(32px, 6vw, 96px);
  color: var(--paper);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1100ms ease, transform 1100ms ease;
}

.home-portal.ready .home-hero-inner {
  opacity: 1;
  transform: translateY(0);
}

.home-hero-eyeline {
  margin: 0 0 14px;
  color: var(--indigo-gold);
  letter-spacing: 0.34em;
  font-size: clamp(13px, 1.4vw, 15px);
  opacity: 0.92;
}

.home-hero-title {
  margin: 0 0 22px;
  font-family: var(--font-body);
  font-size: clamp(76px, 14vw, 176px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.1em;
  text-indent: 0.1em;
  color: var(--paper);
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(0, 0, 0, 0.7);
}

.home-hero-lead {
  margin: 0 auto 10px;
  max-width: 30ch;
  font-family: var(--font-body);
  color: #ded7c7;
  font-size: clamp(15px, 1.7vw, 19px);
  letter-spacing: 0.1em;
  line-height: 2;
}

.home-hero-subline {
  margin: 10px 0 0;
  font-family: var(--font-body);
  color: var(--paper);
  font-size: clamp(16px, 2vw, 22px);
  letter-spacing: 0.2em;
  line-height: 1.6;
  opacity: 0.92;
}

/* 著述区 · 观夏风图文排版（深空背景，与 hero 星空自然过渡） */
.writings {
  position: relative;
  padding: clamp(80px, 12vw, 160px) clamp(20px, 6vw, 64px) clamp(100px, 14vw, 180px);
  background: linear-gradient(180deg, #05090c 0%, #060a14 55%, #060a18 100%);
  color: var(--ink-white);
  overflow: hidden;
}

/* SideRays（OGL WebGL）光晕背景层，置于星光纹理之下、内容之上 */
.writings-rays {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.writings-rays canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* 微微星光纹理（CSS only，无图） */
.writings::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(234,217,176,.7), transparent 50%),
    radial-gradient(1px 1px at 28% 64%, rgba(234,217,176,.55), transparent 50%),
    radial-gradient(1.2px 1.2px at 47% 22%, rgba(234,217,176,.65), transparent 50%),
    radial-gradient(1px 1px at 63% 78%, rgba(234,217,176,.5), transparent 50%),
    radial-gradient(1.4px 1.4px at 78% 12%, rgba(234,217,176,.7), transparent 50%),
    radial-gradient(1px 1px at 88% 56%, rgba(234,217,176,.55), transparent 50%),
    radial-gradient(1px 1px at 9% 88%, rgba(234,217,176,.5), transparent 50%),
    radial-gradient(1.2px 1.2px at 38% 8%, rgba(234,217,176,.6), transparent 50%),
    radial-gradient(1px 1px at 55% 46%, rgba(234,217,176,.45), transparent 50%),
    radial-gradient(1.4px 1.4px at 82% 92%, rgba(234,217,176,.6), transparent 50%),
    radial-gradient(1px 1px at 22% 38%, rgba(234,217,176,.5), transparent 50%),
    radial-gradient(1px 1px at 70% 30%, rgba(234,217,176,.55), transparent 50%);
  background-size: 100% 100%;
  pointer-events: none;
  opacity: .45;
  z-index: 1;
}

.writings-inner {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  z-index: 2;
}

/* 章节标题 · 白色衬线大字 + 朱砂橙副字（参考图风格） */
.section-head {
  text-align: center;
  margin-bottom: clamp(72px, 10vw, 130px);
}
.section-head .en {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: .42em;
  color: var(--ink-white);
  text-transform: uppercase;
  margin-bottom: 18px;
  opacity: .95;
}
.section-head h2 {
  font-family: var(--font-body);
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink-white);
  line-height: 1.15;
  text-shadow: 0 4px 24px rgba(0,0,0,.4);
}
.section-head h2 .accent {
  color: var(--ink-white);
  display: block;
  font-size: clamp(28px, 4.4vw, 52px);
  font-weight: 600;
  margin-top: 9px;
  letter-spacing: .04em;
}
/* 长副标题：强制单行 + 下移 1/4 行（避免窄栏折行） */
.section-head h2 .accent-long {
  white-space: nowrap;
  font-size: clamp(22px, 3.4vw, 42px);
  margin-top: calc(9px + 0.25em);
  color: var(--indigo-gold);
}
.section-head .sub {
  margin-top: 22px;
  color: var(--ink-white-soft);
  font-size: 14px;
  letter-spacing: .3em;
}

/* 单篇文章 · 交替左右大图 */
.article {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 100px);
  align-items: center;
  margin-bottom: clamp(96px, 14vw, 180px);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 900ms ease, transform 900ms ease;
}
.home-portal.ready .article {
  opacity: 1;
  transform: translateY(0);
}
.article:nth-child(even) .art-media { order: 2; }

.art-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #0a0e1a;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.art-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1400ms ease;
  filter: saturate(.9) brightness(.95);
}
.article:hover .art-media img { transform: scale(1.04); }

/* 图片框上微微的金色细边 */
.art-media::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(234,217,176,.22);
  pointer-events: none;
}

.art-body { padding: 8px 0; }

.art-index {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: .35em;
  color: var(--ink-white);
  margin-bottom: 22px;
  font-weight: 500;
}
.art-body h3 {
  font-family: var(--font-body);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-white);
  line-height: 1.2;
  margin-bottom: 8px;
  text-shadow: 0 2px 16px rgba(0,0,0,.4);
}
/* 副字：星光白（参考图风格） */
.art-body .en {
  font-family: var(--font-body);
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 600;
  color: var(--ink-white);
  letter-spacing: .04em;
  margin-bottom: 28px;
  line-height: 1.4;
}
.art-body p {
  color: var(--ink-white-soft);
  font-size: 16px;
  line-height: 2;
  max-width: 44ch;
  margin-bottom: 32px;
}
.art-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-white);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 15px;
  letter-spacing: .2em;
  border-bottom: 1px solid rgba(243,237,223,.3);
  padding-bottom: 6px;
  transition: gap .3s, border-color .3s, color .3s;
}
.art-link:hover {
  gap: 18px;
  border-color: rgba(243,237,223,.6);
  color: var(--ink-white);
}

/* 末尾铭文 */
.writings-foot {
  text-align: center;
  margin-top: clamp(48px, 6vw, 90px);
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: .32em;
  color: var(--ink-white-soft);
  border-top: 1px solid rgba(234,217,176,.14);
  padding-top: 36px;
}

/* ── 理论区 · 星空图下方的哲思长卷 ── */
.theory {
  position: relative;
  background: linear-gradient(180deg, #05090c 0%, #060a16 58%, #070b18 100%);
  color: var(--ink-white);
  overflow: hidden;
}

/* SideRays（OGL WebGL）光晕背景层，置于星光纹理之下、内容之上 */
.theory-rays {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.theory-rays canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* 微微星光纹理（CSS only，无图） */
.theory::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 14% 20%, rgba(234,217,176,.65), transparent 50%),
    radial-gradient(1px 1px at 33% 70%, rgba(234,217,176,.5), transparent 50%),
    radial-gradient(1.2px 1.2px at 52% 30%, rgba(234,217,176,.6), transparent 50%),
    radial-gradient(1px 1px at 68% 82%, rgba(234,217,176,.45), transparent 50%),
    radial-gradient(1.4px 1.4px at 82% 16%, rgba(234,217,176,.65), transparent 50%),
    radial-gradient(1px 1px at 90% 60%, rgba(234,217,176,.5), transparent 50%),
    radial-gradient(1px 1px at 11% 90%, rgba(234,217,176,.45), transparent 50%),
    radial-gradient(1.2px 1.2px at 44% 10%, rgba(234,217,176,.55), transparent 50%),
    radial-gradient(1px 1px at 60% 52%, rgba(234,217,176,.4), transparent 50%),
    radial-gradient(1.4px 1.4px at 86% 94%, rgba(234,217,176,.55), transparent 50%);
  background-size: 100% 100%;
  pointer-events: none;
  opacity: .4;
  z-index: 1;
}

.theory-inner {
  position: relative;
  z-index: 2;
  /* 左右内边距与导航一致：左缘对齐「星庐」、右缘对齐「退出」 */
  padding: clamp(64px, 9vw, 128px) clamp(18px, 4vw, 64px) clamp(80px, 12vw, 150px);
}

/* 理论区章节标题与导航「星庐」左缘对齐（不再居中） */
.theory .section-head {
  text-align: left;
  margin-bottom: clamp(48px, 7vw, 92px);
}

.theory-list {
  position: relative;
}
/* 一道贯穿首尾的时间轴，串起从太一到八卦的十七段 */
.theory-list::before {
  content: "";
  position: absolute;
  left: 48px;
  top: 64px;
  bottom: 64px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(234,217,176,.30) 6%, rgba(234,217,176,.30) 94%, transparent);
  z-index: 0;
}

.theory-item {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: clamp(22px, 4vw, 56px);
  align-items: start;
  padding: clamp(38px, 5.5vw, 70px) 0;
  border-bottom: 1px solid rgba(234,217,176,.07);
}
.theory-item:last-child { border-bottom: none; }

.theory-mark {
  display: flex;
  justify-content: center;
}
.theory-idx {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 1px solid rgba(234,217,176,.45);
  background: radial-gradient(circle at 50% 38%, rgba(234,217,176,.12), rgba(5,9,12,.65) 70%);
  font-family: var(--font-body);
  font-size: 34px;
  font-weight: 600;
  color: var(--ink-white);
  box-shadow: 0 0 26px rgba(234,217,176,.12);
}
.theory-item.is-lead .theory-idx {
  width: 104px;
  height: 104px;
  font-size: 42px;
  border-color: rgba(234,217,176,.7);
  box-shadow: 0 0 40px rgba(234,217,176,.20);
}

.theory-title {
  font-family: var(--font-body);
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-white);
  line-height: 1.3;
  margin: 8px 0 22px;
  text-shadow: 0 2px 18px rgba(0,0,0,.45);
}
.theory-body p {
  color: var(--ink-white-soft);
  font-size: 17px;
  line-height: 2.05;
  letter-spacing: .01em;
  margin: 0 0 18px;
  max-width: 60ch;
}
.theory-body p:last-child { margin-bottom: 0; }

/* 理论区有图段（右图，太一段与赤道段共享）：图片顶边与该段标题持平，右缘对齐「退出」；尺寸大小统一 */
.theory-item.has-image {
  grid-template-columns: 96px minmax(0, 1fr) auto;
  grid-template-areas:
    "mark head  image"
    "mark body  image";
  column-gap: clamp(22px, 3.6vw, 48px);
  row-gap: 22px;
  align-items: start;
}
.theory-item.has-image .theory-mark  { grid-area: mark; }
.theory-item.has-image .theory-head  { grid-area: head; }
.theory-item.has-image .theory-media { grid-area: image; align-self: start; }
.theory-media { display: flex; flex-direction: column; gap: clamp(12px, 1.6vw, 18px); margin: 0; }
.theory-video { width: 100%; height: auto; display: block; border-radius: 4px; background: #0a0e1a; box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.theory-item.has-image .theory-body  { grid-area: body; }
.theory-item.has-image .theory-title { margin: 0; }
.theory-image {
  position: relative;
  margin: 0;
  width: clamp(340px, 44vw, 600px);
  align-self: start;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(234, 217, 176, .22);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(243, 237, 223, .04);
  background: #0a0e1a;
  container-type: size;
}
.theory-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.78) brightness(.78) contrast(1.05);
  transform: scale(1.02);
  transition: transform 1400ms ease, filter 1400ms ease;
}
.theory-image:hover img {
  transform: scale(1.04);
  filter: saturate(1) brightness(1) contrast(1.05);
}
.theory-image-glass {
  position: absolute;
  inset: 0;
  /* 默认压暗（高透明度黑色玻璃）；hover 时淡出使画面变清晰 */
  background:
    linear-gradient(180deg, rgba(8, 12, 24, .28) 0%, rgba(8, 12, 24, .55) 100%),
    rgba(8, 12, 24, .30);
  pointer-events: none;
  opacity: 1;
  transition: opacity 600ms ease;
}
.theory-image:hover .theory-image-glass { opacity: 0; }
/* 铜镜图（idx 三）：保持画面完整，不裁切；两侧以星空渐变背景填补，去除死黑框 */
.theory-image.full {
  background:
    radial-gradient(1.5px 1.5px at 22% 28%, rgba(234,217,176,.55), transparent 60%),
    radial-gradient(1px 1px at 68% 18%, rgba(234,217,176,.40), transparent 60%),
    radial-gradient(1.5px 1.5px at 42% 82%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 84% 64%, rgba(234,217,176,.35), transparent 60%),
    radial-gradient(1px 1px at 58% 46%, rgba(255,255,255,.30), transparent 60%),
    radial-gradient(1.5px 1.5px at 12% 70%, rgba(255,255,255,.30), transparent 60%),
    linear-gradient(160deg, #0a0e1a 0%, #12203f 55%, #0a0e1a 100%);
}
.theory-image.full img { object-fit: contain; }
/* 画面题字「太一将行」—— 靠画面右侧的单竖行，四字放大、紧密排列 */
.theory-image-caption {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0 clamp(12px, 3vw, 34px);
  pointer-events: none;
  opacity: 1;
  transition: opacity 500ms ease;
}
.theory-image-caption .cap-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}
.theory-image-caption .cap-text > span {
  font-family: var(--font-body);
  /* 每字约占画面 1/4 高，四字紧密铺满整幅高度 */
  font-size: 25cqh;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  color: rgba(243, 237, 223, .95);
  text-shadow: 0 3px 18px rgba(0, 0, 0, .65);
}
.theory-image-caption.left {
  justify-content: flex-start;
  padding: 0 0 0 clamp(12px, 3vw, 34px);
}
.theory-image:hover .theory-image-caption { opacity: 0; }

@media (max-width: 720px) {
  .theory-list::before { display: none; }
  .theory-item {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: clamp(34px, 8vw, 48px) 0;
  }
  .theory-item.has-image {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }
  .theory-item.has-image .theory-mark,
  .theory-item.has-image .theory-head,
  .theory-item.has-image .theory-media,
  .theory-item.has-image .theory-body { grid-area: auto; }
  .theory-item.has-image .theory-media { order: 3; }
  .theory-image {
    order: 3;
    margin-top: 8px;
    width: 100%;
    aspect-ratio: 4 / 3;
  }
  .theory-mark { justify-content: flex-start; }
  .theory-idx { width: 62px; height: 62px; font-size: 26px; }
  .theory-coda { margin-left: 0; }
  .theory-coda-figure { max-width: 100%; gap: 16px; }
  .theory-coda-img { max-width: 180px; }
  .theory-coda-caption { font-size: clamp(34px, 11vw, 56px); padding-left: 12px; }
}

.theory-divider {
  position: relative;
  z-index: 1;
  text-align: left;
  font-family: var(--font-body);
  color: var(--indigo-gold);
  /* 字号与「星庐观象」章节标题一致 */
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 600;
  letter-spacing: .14em;
  line-height: 1.4;
  margin: clamp(56px, 8vw, 104px) 0 clamp(56px, 8vw, 104px);
  max-width: 36ch;
  opacity: .92;
}
.theory-divider::before {
  content: "";
  display: block;
  width: clamp(48px, 8vw, 88px);
  height: 1px;
  margin: 0 0 clamp(20px, 3vw, 36px);
  background: linear-gradient(90deg, transparent, rgba(234,217,176,.6), transparent);
}

/* 尾声 · 收束段（非编号），文字左缘对齐竖线，图与题字横向居中 */
.theory-coda {
  position: relative;
  z-index: 1;
  text-align: left;
  margin: clamp(24px, 4vw, 48px) 0 0 48px;
  padding-top: clamp(40px, 6vw, 72px);
  border-top: 1px solid rgba(234,217,176,.14);
}
.theory-coda p {
  font-family: var(--font-body);
  color: var(--ink-white);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 2.1;
  letter-spacing: .02em;
  margin: 0 0 18px;
  text-indent: 2em;
}
.theory-coda p:last-child { margin-bottom: 0; }
.theory-coda-figure {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: clamp(16px, 2.4vw, 32px);
  margin-top: clamp(24px, 4vw, 40px);
  max-width: 1040px;
}
.theory-coda-img {
  display: block;
  flex: 0 1 auto;
  width: auto;
  max-width: 400px;
  height: auto;
  align-self: flex-start;
  border-radius: 6px;
  border: 1px solid rgba(234,217,176,.18);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.theory-coda-caption {
  writing-mode: horizontal-tb;
  display: flex;
  align-items: center;
  gap: .08em;
  flex: 0 0 auto;
  font-family: var(--font-body);
  font-size: clamp(64px, 9vw, 156px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: .06em;
  color: var(--ink-white);
  padding-left: clamp(14px, 1.8vw, 22px);
  border-left: 1px solid rgba(234,217,176,.28);
  text-shadow: 0 2px 18px rgba(0,0,0,.4);
}

/* 理论区滚动渐显 */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1000ms ease, transform 1000ms ease;
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

.hall:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -6px;
  border-radius: 4px;
}

.section-page {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 20px 70px var(--shadow);
}

.section-page {
  max-width: 880px;
  margin: clamp(28px, 7vw, 96px) auto;
  padding: clamp(28px, 5vw, 64px);
}

.yicang-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100dvh;
}

.yicang-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--paper);
}

/* 观星楼 · 星庐著述阅读器 */
.guanxing-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100dvh;
}

.guanxing-body {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  min-height: 0;
}

.guanxing-list {
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.28);
  padding: 20px 14px;
  overflow-y: auto;
}

.gx-list-title {
  margin: 0 0 12px;
  padding: 0 8px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.18em;
}

.gx-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.gx-item:hover {
  background: rgba(159, 122, 66, 0.1);
}

.gx-item.active {
  border-color: var(--line-dark);
  background: var(--ink);
  color: var(--paper);
}

.gx-item.missing {
  color: var(--ink-soft);
  cursor: not-allowed;
  opacity: 0.7;
}

.gx-flag {
  flex: none;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  color: var(--ink-soft);
}

.guanxing-reader {
  overflow-y: auto;
  padding: clamp(24px, 5vw, 64px);
}

.gx-placeholder {
  color: var(--ink-soft);
  padding-top: 40px;
  text-align: center;
}

.gx-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.gx-head h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.2;
}

.gx-source {
  color: var(--gold);
  font-size: 14px;
  text-decoration: none;
}

.gx-content {
  max-width: 820px;
  line-height: 1.95;
  font-size: 17px;
}

.gx-content h2,
.gx-content h3 {
  margin: 32px 0 12px;
  line-height: 1.35;
}

.gx-content p {
  margin: 0 0 18px;
  text-align: justify;
}

.gx-content blockquote {
  margin: 18px 0;
  padding: 8px 18px;
  border-left: 3px solid var(--gold);
  color: var(--ink-soft);
  background: rgba(159, 122, 66, 0.07);
}

.gx-content a {
  color: var(--gold);
}

.gx-figure {
  margin: 20px 0;
  text-align: center;
}

.gx-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 6px 20px var(--shadow);
}

@media (max-width: 860px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-art {
    min-height: 34dvh;
  }

  .auth-panel {
    padding: 24px;
  }

  .portal-header {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .portal-header nav {
    grid-column: 1 / -1;
    justify-content: start;
    overflow-x: auto;
    padding-bottom: 12px;
  }

  /* 移动端：取消 halls 样式，无引用 */
  .home-portal.ready .article { opacity: 1; transform: none; }
  .home-hero {
    min-height: 52dvh;
  }

  .brand-mark {
    left: calc(28px + 2em);
    top: 28vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ── 注册/登录表单 ── */
.auth-tabs { display: flex; gap: 8px; margin-bottom: 4px; }
.auth-tab {
  flex: 1; min-height: 40px; border: 1px solid var(--line-dark);
  border-radius: 999px; background: transparent; color: var(--ink-soft);
  font-family: inherit; font-size: 15px; cursor: pointer; transition: all .18s ease;
}
.auth-tab.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 13px; color: var(--ink-soft); letter-spacing: .08em; }
.field input {
  height: 46px; padding: 0 14px; border: 1px solid var(--line-dark);
  border-radius: 8px; background: rgba(255,255,255,.5); color: var(--ink);
  font-family: inherit; font-size: 16px; outline: none; transition: border-color .18s;
}
.field input:focus { border-color: var(--gold); }
.field[hidden] { display: none; }
.auth-submit {
  margin-top: 6px; height: 48px; border: none; border-radius: 999px;
  background: var(--gold); color: #fff; font-family: inherit; font-size: 17px;
  letter-spacing: .3em; cursor: pointer; transition: opacity .18s;
}
.auth-submit:disabled { opacity: .6; cursor: default; }
.notice { margin: 4px 0 0; font-size: 14px; color: var(--ink-soft); }
.notice.danger { color: #a4442f; }

/* 忘记密码链接 */
.forgot-link {
  display: inline-block; margin-top: 4px; align-self: flex-end;
  font-size: 13px; color: var(--ink-soft); text-decoration: none; cursor: pointer;
  letter-spacing: .04em; transition: color .18s;
}
.forgot-link:hover { color: var(--gold); }

/* 重置 / 找回密码页（与登录同款布局，单列居中） */
.reset-page .auth-panel { margin: auto; }
.reset-page .auth-form { max-width: 380px; margin: 0 auto; }

/* ── 弹窗（免责声明 / 修改密码）── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(6, 9, 18, .66); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  width: min(560px, 100%); max-height: 86vh; overflow-y: auto;
  background: var(--paper-deep, #11182e);
  border: 1px solid rgba(234,217,176,.22); border-radius: 14px;
  padding: 26px 28px; color: var(--ink, #f3eddf);
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
}
.modal-title {
  margin: 0 0 16px; font-size: 20px; letter-spacing: .12em; color: var(--gold, #ead9b0);
}
.modal-form { display: flex; flex-direction: column; gap: 14px; }
.modal-form .field span { font-size: 13px; color: var(--ink-soft, #b9b2a3); letter-spacing: .08em; }
.modal-form .field input {
  height: 44px; padding: 0 14px; border: 1px solid var(--line-dark, rgba(255,255,255,.18));
  border-radius: 8px; background: rgba(255,255,255,.06); color: var(--ink, #f3eddf);
  font-family: inherit; font-size: 15px; outline: none;
}
.modal-form .field input:focus { border-color: var(--gold, #ead9b0); }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 6px; }
.modal-btn {
  height: 42px; padding: 0 22px; border-radius: 999px; font-family: inherit;
  font-size: 15px; letter-spacing: .1em; cursor: pointer; border: 1px solid transparent;
}
.modal-cancel { background: transparent; border-color: var(--line-dark, rgba(255,255,255,.24)); color: var(--ink-soft, #b9b2a3); }
.modal-confirm { background: var(--gold, #ead9b0); color: #1c2c54; font-weight: 600; }
.modal-confirm:disabled { opacity: .45; cursor: default; }
.modal-msg { min-height: 18px; font-size: 13px; color: var(--ink-soft, #b9b2a3); }
.modal-msg.danger { color: #d98a6f; }

/* 免责声明正文 */
.disclaimer-body { max-height: 46vh; overflow-y: auto; font-size: 14px; line-height: 1.85; color: var(--ink-soft, #cfc7b6); }
.disclaimer-body ol { margin: 8px 0 0; padding-left: 20px; }
.disclaimer-body li { margin-bottom: 8px; }
.disclaimer-agree {
  display: flex; align-items: center; gap: 9px; margin: 18px 0 4px;
  font-size: 14px; color: var(--ink, #f3eddf); cursor: pointer;
}
.disclaimer-agree input { width: 17px; height: 17px; accent-color: var(--gold, #ead9b0); }

/* ── 后台统计 ── */
.admin-link { color: var(--gold) !important; }
.admin-page { max-width: 1180px; }
.admin-head { display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap; }
.admin-stat { color: var(--ink-soft); font-size: 15px; }
.admin-total { font-size: 26px; color: var(--gold); font-weight: 600; margin-right: 4px; }
.admin-note { margin: 10px 0 20px; font-size: 13px; color: var(--ink-soft); }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line-dark); border-radius: 10px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 11px 14px; text-align: left; white-space: nowrap; }
.admin-table thead th {
  background: var(--paper-deep); color: var(--ink); font-weight: 600;
  letter-spacing: .05em; border-bottom: 1px solid var(--line-dark);
}
.admin-table tbody tr { border-bottom: 1px solid rgba(0,0,0,.06); }
.admin-table tbody tr:hover { background: rgba(159,122,66,.07); }
.admin-loading { text-align: center; color: var(--ink-soft); padding: 24px; }

/* ── 后台密码验证 ── */
.admin-shell .section-page {
  max-width: none;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.admin-lock {
  text-align: center;
  padding: 20px 0;
}
.admin-lock h1 {
  margin-bottom: 8px;
  font-size: 28px;
}
.admin-lock-desc {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 24px;
}
.admin-lock-form {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.admin-lock-input {
  height: 44px;
  width: 220px;
  padding: 0 14px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: rgba(255,255,255,.5);
  font-family: inherit;
  font-size: 15px;
  outline: none;
}
.admin-lock-input:focus {
  border-color: var(--gold);
}
.admin-lock-btn {
  height: 44px;
  padding: 0 24px;
  border: none;
  border-radius: 8px;
  background: var(--gold);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: .1em;
  cursor: pointer;
}
.admin-lock-err {
  margin-top: 14px;
  color: #a4442f;
  font-size: 14px;
}

/* ── 序号列 ── */
.admin-seq {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
}

/* ── 权限开关 ── */
.perm-toggle {
  display: inline-block;
  min-width: 64px;
  padding: 4px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all 200ms ease;
}
.perm-toggle.on {
  background: rgba(68, 109, 74, 0.14);
  border-color: rgba(68, 109, 74, 0.32);
  color: #3d5e42;
}
.perm-toggle.off {
  background: transparent;
  color: var(--ink-soft);
}
.perm-toggle:hover {
  border-color: var(--gold);
}
.perm-toggle:disabled {
  opacity: .5;
  cursor: default;
}

/* ━━━ 移动端响应式 ━━━ */
/* 平板 / 小屏 */
@media (max-width: 860px) {
  .portal-section { padding: 0 16px 32px; }
  .home-hero-inner { padding: 24px 16px; }

  .admin-page { padding: 0 8px; }
  .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-table { font-size: .78rem; }
  .admin-lock { padding: 2rem 1rem; }

  .guanxing-reader { padding: 1.5rem 1rem 3rem; font-size: 1rem; }
  .guanxing-reader h1 { font-size: 1.5rem; }
  .guanxing-reader h2 { font-size: 1.25rem; }
  .guanxing-reader img { max-width: 100%; height: auto; }
}

/* 手机 */
@media (max-width: 480px) {
  html, body { font-size: 15px; }
  .portal-header { padding: 10px 12px; }
  .portal-header .wordmark { font-size: 1.1rem; }

  /* 理论区左缘与导航一致（≤480 时导航左内边距 12px） */
  .theory-inner { padding-left: 12px; padding-right: 12px; }
  .portal-header nav { gap: 2px; overflow-x: auto; flex-wrap: nowrap; }
  .nav-btn { font-size: .78rem; padding: 6px 10px; white-space: nowrap; }

  .home-hero-title { font-size: 3.4rem; }
  .home-hero-lead { font-size: .95rem; }

  .auth-panel { padding: 20px 16px; }
  .auth-art { min-height: 24dvh; }

  /* writings 移动端 */
  .article { grid-template-columns: 1fr; gap: 24px; margin-bottom: 64px; }
  .article:nth-child(even) .art-media { order: 0; }
  .art-media { aspect-ratio: 4 / 3; }
  .art-body p { max-width: none; }
  .section-head h2 { font-size: 32px; }
  .section-head h2 .accent { font-size: 24px; }

  .guanxing-reader { padding: 1.2rem .8rem 2.5rem; font-size: .95rem; line-height: 1.85; }
  .guanxing-reader h1 { font-size: 1.35rem; }
  .guanxing-reader h2 { font-size: 1.15rem; }

  .admin-page { padding: 0 4px; }
  .admin-lock h1 { font-size: 1.2rem; }
  .admin-table { font-size: .7rem; }
  .perm-toggle { font-size: .68rem; padding: 4px 8px; }
}


/* ── 星庐大观（隐藏模块）── */
.gx-title-entry {
  cursor: pointer;
  position: relative;
  transition: color .2s ease;
}
.gx-title-entry:hover { color: var(--gold); }

.daguan-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(1.5rem, 4vw, 4rem);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem) 4rem;
  align-items: start;
}

.daguan-content {
  font-size: 1rem;
  line-height: 2;
  color: var(--ink);
  max-width: 760px;
}
.daguan-content .dg-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 1.6rem;
  color: var(--ink);
}
.daguan-content .dg-h {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  margin: 2.4rem 0 1rem;
  padding-left: .8rem;
  border-left: 3px solid var(--gold);
  color: var(--ink);
}
.daguan-content p { margin: 0 0 1.15rem; text-align: justify; }

.daguan-content mark.term {
  background: linear-gradient(transparent 62%, rgba(159,122,66,.30) 0);
  color: inherit;
  padding: 0 .12em;
  border-radius: 2px;
  cursor: pointer;
  transition: background .15s ease;
}
.daguan-content mark.term:hover,
.daguan-content mark.term.selected {
  background: rgba(217,111,63,.22);
}

.daguan-annot {
  position: sticky;
  top: calc(var(--nav-h, 64px) + 1.5rem);
  align-self: start;
  padding: .4rem 0;
  font-size: .92rem;
  color: var(--ink-soft);
}
.daguan-annot .dg-annot-empty { line-height: 1.8; }
.dg-annot-head {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: .7rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid rgba(159,122,66,.25);
}
.dg-annot-text { line-height: 1.85; white-space: pre-wrap; }
.dg-annot-input {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid rgba(159,122,66,.35);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: .7rem;
  font: inherit;
  line-height: 1.7;
}
.dg-annot-actions { margin-top: .8rem; display: flex; align-items: center; gap: .8rem; }
.dg-annot-save {
  border: none;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: .45rem 1.3rem;
  cursor: pointer;
  font: inherit;
}
.dg-annot-save:hover { background: var(--gold); }
.dg-annot-msg { color: var(--gold); font-size: .85rem; }

.daguan-content.is-locked {
  min-height: calc(100vh - var(--nav-h, 0px) - 8rem);
  display: flex;
  align-items: center;
  justify-content: center;
}
.daguan-content.is-locked h2 { color: var(--gold); font-size: 2.4rem; margin: 0; letter-spacing: .15em; text-align: center; transform: translateX(5em); }

@media (max-width: 860px) {
  .daguan-body { grid-template-columns: 1fr; }
  .daguan-annot { position: static; order: -1; }
}
