/* 楞严咒助背 · 基础样式
   设计对照：design/design-tokens.json（brandAccent #D16612 / mantra #7356A5） */

:root {
  color-scheme: light;
  --bg: #f7f2e8;
  --bg-soft: #f1e9da;
  --surface: #fffdf9;
  --surface-2: #f6efe2;
  --ink: #241c14;
  --ink-2: #57493a;
  --muted: #8b7a65;
  --line: rgba(72, 52, 30, 0.14);
  --line-strong: rgba(72, 52, 30, 0.28);
  --accent: #b65308;
  --accent-hover: #a04606;
  --accent-soft: #f4e2cd;
  --accent-ink: #fff8f0;
  --violet: #6b4e9e;
  --jade: #2e7d5b;
  --blue: #3d6fb4;
  --shadow-sm: 0 1px 2px rgba(60, 40, 18, 0.05), 0 6px 18px rgba(60, 40, 18, 0.05);
  --shadow-md: 0 2px 6px rgba(60, 40, 18, 0.06), 0 18px 40px rgba(60, 40, 18, 0.09);
  --serif: "Songti SC", "Songti TC", "Noto Serif CJK TC", "Noto Serif TC",
    "Source Han Serif TC", "Source Han Serif SC", "STSong", "RareSerif",
    "PingFang TC", "SimSun-ExtB", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC",
    "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 20px;
  --text-size: 20px;
  --page-max: 1080px;
  --mask-fill: color-mix(in srgb, var(--ink) 6.5%, transparent);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14110e;
  --bg-soft: #100d0b;
  --surface: #1d1814;
  --surface-2: #241e18;
  --ink: #f1e8da;
  --ink-2: #cdbda7;
  --muted: #93826c;
  --line: rgba(241, 232, 218, 0.13);
  --line-strong: rgba(241, 232, 218, 0.26);
  --accent: #e8894a;
  --accent-hover: #f1995f;
  --accent-soft: #342219;
  --accent-ink: #241707;
  --violet: #a98cd8;
  --jade: #63b894;
  --blue: #7ba4dd;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 20px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.45), 0 22px 48px rgba(0, 0, 0, 0.4);
  --mask-fill: color-mix(in srgb, var(--ink) 9%, transparent);
}

/* 咒文里有两个生僻字：𤙖（U+24656，系统字体回退）与 㘑（U+3611，随站内嵌）。
   这里只嵌入 㘑 一个字形，2KB，避免 Android 上出现豆腐块。 */
@font-face {
  font-family: "RareSerif";
  src: url("rare-serif.woff") format("woff");
  font-display: swap;
  unicode-range: U+3611;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(209, 102, 18, 0.14), transparent 62%),
    radial-gradient(900px 520px at 100% 0%, rgba(107, 78, 158, 0.12), transparent 58%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14110e;
    --bg-soft: #100d0b;
    --surface: #1d1814;
    --surface-2: #241e18;
    --ink: #f1e8da;
    --ink-2: #cdbda7;
    --muted: #93826c;
    --line: rgba(241, 232, 218, 0.13);
    --line-strong: rgba(241, 232, 218, 0.26);
    --accent: #e8894a;
    --accent-hover: #f1995f;
    --accent-soft: #342219;
    --accent-ink: #241707;
    --violet: #a98cd8;
    --jade: #63b894;
    --blue: #7ba4dd;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 20px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.45), 0 22px 48px rgba(0, 0, 0, 0.4);
    --mask-fill: color-mix(in srgb, var(--ink) 9%, transparent);
  }
}

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-2);
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.language-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.language-link:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-2); }

.icon-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 8px 20px rgba(182, 83, 8, 0.22);
}

.btn:hover:not(:disabled) {
  background: var(--accent-hover);
  color: var(--accent-ink);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
  box-shadow: none;
}

.btn.ghost:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn:disabled,
.icon-btn:disabled,
.dock button:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

.btn.small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: 11px;
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.spacer {
  flex: 1;
}

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

/* ---------- 首页 ---------- */

.shell {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 20px 80px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 32px;
  align-items: center;
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent);
  opacity: 0.7;
}

.hero h1 {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-size: clamp(34px, 5.4vw, 56px);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: 0.1em;
}

.hero h1 small {
  display: block;
  margin-top: 12px;
  font-size: clamp(14px, 1.7vw, 17px);
  font-weight: 400;
  letter-spacing: 0.34em;
  color: var(--muted);
}

.hero-lead {
  margin: 20px 0 0;
  max-width: 34em;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.9;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.hero-meta li {
  font-size: 13px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}

.hero-art {
  position: relative;
  aspect-ratio: 1 / 0.92;
  border-radius: 28px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface) 55%),
    var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  overflow: hidden;
  container-type: size;
}

.hero-art::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(72%, 72cqh);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}

.hero-art svg {
  position: relative;
  width: 62%;
  height: auto;
  color: color-mix(in srgb, var(--ink) 78%, var(--accent));
}

.hero-art .seal {
  position: absolute;
  right: 18px;
  bottom: 16px;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

/* 结构总览 */

.section-block {
  padding: 56px 0 8px;
}

.block-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.block-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: 0.14em;
  font-weight: 600;
}

.block-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.structure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.sec-card {
  --sec: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 20px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}

.sec-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--sec);
  opacity: 0.85;
}

.sec-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--sec) 40%, var(--line));
  box-shadow: var(--shadow-sm);
  color: inherit;
}

.sec-card .row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.sec-code {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--sec);
  letter-spacing: 0.1em;
  min-width: 1.4em;
}

.sec-title {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.sec-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sec-excerpt {
  font-family: var(--serif);
  font-size: 13.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
}

.sec-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 0.2s ease, transform 0.2s ease;
}

.dot.on {
  background: var(--sec);
  transform: scale(1.15);
}

.sec-foot .hint {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* 用法 */

.how {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 4px;
}

.how-card {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.how-card b {
  display: block;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.how-card span {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.8;
}

.how-card em {
  font-style: normal;
  font-family: var(--serif);
  color: var(--accent);
  margin-right: 6px;
}

/* 附錄 + 页脚 */

.appendix {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.appendix a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 14.5px;
}

.appendix a:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.appendix a span:last-child {
  color: var(--muted);
  font-size: 12px;
}

footer.site-foot {
  margin-top: 64px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.9;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: space-between;
}

/* ---------- 阅读页 ---------- */

.reader-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  background: transparent;
  z-index: 40;
}

.reader-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  transition: width 0.3s ease;
}

.reader-top .topbar-inner {
  max-width: 1180px;
  padding: 8px 16px;
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13.5px;
  padding: 8px 10px 8px 6px;
  border-radius: 10px;
}

.crumb:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.crumb svg {
  width: 16px;
  height: 16px;
}

.chapter-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
  max-width: 100%;
}

.chapter-tabs::-webkit-scrollbar {
  display: none;
}

.chapter-tabs a {
  flex: none;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.chapter-tabs a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.chapter-tabs a[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.reader-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 22px 128px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.page-head .kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.page-head .kicker b {
  color: var(--sec, var(--accent));
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.12em;
}

.page-head h1 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: 0.16em;
}

.page-head .subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.05em;
}

.page-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.text-article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 56px;
  margin-top: 26px;
  position: relative;
}

.text-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.line {
  display: block;
  margin: 0;
  padding: 6px 10px 6px 8px;
  border-radius: 10px;
  font-family: var(--serif);
  font-size: var(--text-size);
  line-height: 1.95;
  letter-spacing: 0.035em;
  color: var(--ink);
  transition: background 0.16s ease;
  scroll-margin-top: 120px;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.line .txt {
  min-width: 0;
}

.line.blank {
  height: 0.8em;
  padding: 0;
}

.line.blank .txt {
  display: none;
}

.line[hidden] {
  display: none;
}

/* 手册原文的下划线：标出重复出现的字词 */
.rep {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 72%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.28em;
}

.text-article[data-density="tight"] .line {
  letter-spacing: 0;
  font-size: calc(var(--text-size) - 1px);
}

@media (hover: hover) {
  .line:not(.blank):hover {
    background: color-mix(in srgb, var(--accent) 6%, transparent);
  }
}

.line.masked {
  cursor: pointer;
}

.line.masked .txt {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  color: transparent;
  background: var(--mask-fill);
  border-radius: 8px;
  user-select: none;
}

.line.masked .rep {
  text-decoration-color: transparent;
}

.line.masked .txt::after {
  content: "· · · · · · · · · · · ·";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 0.55em;
  color: var(--muted);
  letter-spacing: 0.3em;
  font-size: 0.7em;
  white-space: nowrap;
  overflow: hidden;
}

.line.masked:focus-visible {
  outline: none;
}

.line.masked:focus-visible .txt {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.page-note {
  margin-top: 30px;
  padding: 14px 18px;
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-radius: 0 12px 12px 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.85;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.pager a {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  max-width: 46%;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.pager a:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  color: var(--ink);
}

.pager a span {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.12em;
}

.pager a b {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0.08em;
  font-size: 15px;
}

.pager a.next {
  margin-left: auto;
  text-align: right;
}

.pager .counter {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* 底部工具条（移动端） */

.dock {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dock button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  min-width: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  transition: background 0.16s ease, color 0.16s ease;
}

.dock button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.dock button svg {
  width: 18px;
  height: 18px;
}

.dock button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  padding: 0 16px;
}

.dock button.primary:hover {
  background: var(--accent-hover);
}

.dock button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.dock .divider {
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: var(--line);
  flex: none;
}

.dock .label {
  display: none;
}

/* 已背状态 */

.done-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--jade);
}

.done-pill svg {
  width: 14px;
  height: 14px;
}

.page-head .done-pill {
  margin-top: 10px;
}

/* 附錄页 */

.links {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.links a:hover {
  border-color: var(--line-strong);
}

.links small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  letter-spacing: 0.04em;
}

/* 更小屏 */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 40px 0 36px;
    gap: 26px;
  }

  .hero-art {
    aspect-ratio: 16 / 10;
  }

  .hero-art svg {
    width: 52%;
  }

  .how {
    grid-template-columns: 1fr;
  }

  .text-article {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .text-col + .text-col {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
  }


  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 0 16px 64px;
  }

  .topbar-inner {
    padding: 8px 12px;
  }

  .brand-sub {
    display: none;
  }

  .reader-main {
    padding: 22px 16px 136px;
  }

  .line {
    grid-template-columns: 2.1em minmax(0, 1fr);
    padding: 8px 6px;
  }

  .structure-grid {
    grid-template-columns: 1fr;
  }

  .hero-art {
    display: none;
  }

  .hero {
    padding-top: 34px;
  }

  .chapter-tabs {
    display: none;
  }

  .pager .counter {
    display: none;
  }
}

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

@media print {
  .topbar,
  .dock,
  .page-tools,
  .pager,
  .reader-progress {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .text-article {
    grid-template-columns: 1fr 1fr;
    gap: 0 36px;
  }

  .line {
    font-size: 13pt;
    line-height: 1.9;
  }

  .line.masked .txt {
    color: #000;
    background: none;
  }

  .line.masked .txt::after {
    display: none;
  }
}
