/* 循理 · 组织行为分析台 */
:root {
  --bg: #f2eee5;
  --bg-deep: #e9e2d4;
  --paper: #fbf8f1;
  --paper-bright: #fffdf7;
  --ink: #17211f;
  --ink-soft: #2a3733;
  --muted: #6d746b;
  --muted-light: #969b90;
  --line: rgba(23, 33, 31, 0.14);
  --line-strong: rgba(23, 33, 31, 0.28);
  --accent: #b7472a;
  --accent-bright: #cf5b35;
  --teal: #2c5e59;
  --gold: #ad8a56;
  --green: #2f6a4e;
  --amber: #a66e24;
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Consolas, "Liberation Mono", monospace;
  --shadow: 0 24px 80px rgba(23, 33, 31, 0.09);
  --max: 1360px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 112px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  max-width: 100%;
}

::selection {
  background: rgba(183, 71, 42, 0.22);
}

.page-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.48;
  background-image:
    linear-gradient(rgba(23, 33, 31, 0.038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 31, 0.038) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 72%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 72%);
}

.site-header,
.app-shell,
.site-footer {
  position: relative;
  z-index: 1;
}

.app-shell {
  min-height: calc(100vh - 220px);
  outline: none;
}

.mono-label,
.eyebrow,
.report-meta-line,
.toolbar-sep,
.brand-text small {
  font-family: var(--mono);
}

/* ------------------------------ Header ------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 72px;
  padding: 0 clamp(20px, 3vw, 44px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 30px;
  background: rgba(242, 238, 229, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  position: relative;
  display: block;
  width: 28px;
  height: 28px;
  background: var(--ink);
  flex: 0 0 auto;
}

.brand-mark i {
  position: absolute;
  left: 6px;
  right: 6px;
  height: 1px;
  background: var(--bg);
  opacity: 0.82;
}

.brand-mark i:nth-child(1) { top: 8px; }
.brand-mark i:nth-child(2) { top: 14px; right: 10px; }
.brand-mark i:nth-child(3) { top: 20px; right: 8px; }

.brand-mark::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  right: 4px;
  bottom: 4px;
  background: var(--accent);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.brand-text small {
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-top: 4px;
}

.site-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 30px);
  font-size: 12px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.site-nav a {
  position: relative;
  padding: 8px 0;
  color: var(--muted);
  transition: color 0.2s ease;
}

.site-nav a span {
  font-family: var(--mono);
  font-size: 8px;
  margin-right: 4px;
  color: var(--muted-light);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transition: right 0.25s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--ink);
}

.site-nav a.active::after {
  right: 0;
}

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

.local-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.local-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 106, 78, 0.12);
}

/* ------------------------------ Buttons ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 1px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn-small {
  padding: 8px 13px;
  font-size: 11px;
}

.btn-ink {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.btn-ink:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff8f2;
}

.btn-accent:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
}

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

.btn-ghost:hover {
  background: var(--paper);
  border-color: var(--ink);
}

.btn-text {
  padding: 0;
  border: 0;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.btn-text:hover {
  color: var(--ink);
}

.btn:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ------------------------------ Shared ------------------------------ */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}

.eyebrow i {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--line-strong);
}

.eyebrow.light {
  color: rgba(242, 238, 229, 0.55);
}

.eyebrow.light i {
  background: rgba(242, 238, 229, 0.28);
}

.text-accent {
  color: var(--accent);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.chip-accent {
  border-color: rgba(183, 71, 42, 0.35);
  color: var(--accent);
  background: rgba(183, 71, 42, 0.05);
}

.chip-evidence {
  border-color: rgba(47, 106, 78, 0.28);
  color: var(--green);
  background: rgba(47, 106, 78, 0.05);
}

.chip-muted {
  color: var(--muted);
}

.chip-small {
  padding: 3px 7px;
  font-size: 9px;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  vertical-align: middle;
}

.dot-fact { background: var(--green); }
.dot-assumption { background: var(--amber); }
.dot-gap { background: var(--muted-light); border: 1px solid var(--muted); }
.dot-conclusion { background: var(--accent); }

.reveal {
  animation: rise 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.delay-1 {
  animation-delay: 0.12s;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ------------------------------ Home / Hero ------------------------------ */

.home-page {
  overflow: hidden;
}

.hero {
  width: min(var(--max), calc(100% - 64px));
  margin: 0 auto;
  padding: clamp(56px, 7vw, 104px) 0 clamp(42px, 5vw, 68px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: clamp(40px, 6vw, 92px);
  align-items: start;
}

.hero-main {
  max-width: 880px;
}

.hero h1 {
  margin: 26px 0 28px;
  font-family: var(--serif);
  font-size: clamp(48px, 5.9vw, 84px);
  line-height: 1.13;
  letter-spacing: -0.035em;
  font-weight: 600;
}

.hero h1 em {
  position: relative;
  font-style: normal;
  color: var(--accent);
  white-space: nowrap;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 0;
  bottom: 5px;
  height: 8px;
  background: rgba(183, 71, 42, 0.13);
  z-index: -1;
}

.hero-lead {
  max-width: 650px;
  margin: 0;
  font-size: 16px;
  line-height: 1.95;
  color: var(--muted);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.hero-points span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.hero-points b {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  color: var(--ink);
}

.hero-manifesto {
  align-self: end;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding-top: 17px;
}

.manifesto-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding-bottom: 7px;
}

.manifesto-head b {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  color: var(--muted-light);
}

.principle {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 11px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
}

.principle-no {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--accent);
  padding-top: 4px;
}

.principle h3 {
  margin: 0 0 3px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.principle p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--muted);
}

.manifesto-foot {
  display: flex;
  align-items: center;
  gap: 11px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 9.5px;
  line-height: 1.55;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.manifesto-foot b {
  color: var(--ink-soft);
  font-weight: 500;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 106, 78, 0.1);
  flex: 0 0 auto;
}

/* ------------------------------ Intake ------------------------------ */

.intake-panel {
  position: relative;
  width: min(var(--max), calc(100% - 64px));
  margin: 0 auto;
  padding: clamp(30px, 4vw, 48px) clamp(24px, 4.2vw, 56px) 40px;
  background: var(--ink);
  color: #f3ede0;
  box-shadow: 0 30px 80px rgba(23, 33, 31, 0.18);
}

.intake-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 96px;
  height: 3px;
  background: var(--accent);
}

.intake-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: start;
}

.intake-head h2 {
  margin: 13px 0 8px;
  font-family: var(--serif);
  font-size: clamp(27px, 2.7vw, 38px);
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.intake-head p {
  max-width: 650px;
  margin: 0;
  font-size: 12px;
  line-height: 1.85;
  color: rgba(243, 237, 224, 0.58);
}

.intake-mark {
  font-family: var(--serif);
  font-size: clamp(64px, 9vw, 126px);
  line-height: 1;
  font-weight: 600;
  color: transparent;
  -webkit-text-stroke: 1px rgba(243, 237, 224, 0.14);
  user-select: none;
  letter-spacing: -0.08em;
  padding-right: 4px;
}

#analysis-form {
  margin-top: 30px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(243, 237, 224, 0.72);
}

.field-label span {
  padding: 1px 6px;
  border: 1px solid rgba(243, 237, 224, 0.22);
  border-radius: 100px;
  font-size: 8px;
  color: rgba(243, 237, 224, 0.48);
  letter-spacing: 0.05em;
}

#problem-input {
  width: 100%;
  min-height: 148px;
  padding: 18px 20px;
  border: 1px solid rgba(243, 237, 224, 0.16);
  background: rgba(243, 237, 224, 0.025);
  color: #f7f1e4;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.85;
  resize: vertical;
  border-radius: 1px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#problem-input::placeholder {
  color: rgba(243, 237, 224, 0.3);
}

#problem-input:focus {
  outline: none;
  background: rgba(243, 237, 224, 0.04);
  border-color: rgba(207, 91, 53, 0.72);
}

#problem-input.has-error {
  border-color: var(--accent-bright);
}

.char-line {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 9px;
  font-size: 9.5px;
  color: rgba(243, 237, 224, 0.36);
  letter-spacing: 0.03em;
}

.char-line b {
  font-weight: 400;
  font-family: var(--mono);
}

.example-block {
  margin-top: 24px;
}

.example-label {
  display: block;
  margin-bottom: 10px;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(243, 237, 224, 0.42);
}

.example-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.example-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 88px;
  padding: 12px 13px;
  border: 1px solid rgba(243, 237, 224, 0.13);
  background: transparent;
  color: rgba(243, 237, 224, 0.72);
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.example-card:hover {
  background: rgba(243, 237, 224, 0.06);
  border-color: rgba(243, 237, 224, 0.35);
  color: #fff8ea;
}

.example-card > span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: rgba(207, 91, 53, 0.9);
}

.example-card > b {
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.55;
}

.example-card > i {
  margin-top: auto;
  font-style: normal;
  font-size: 9px;
  color: rgba(243, 237, 224, 0.4);
}

.optional-fields {
  margin-top: 24px;
  border-top: 1px solid rgba(243, 237, 224, 0.12);
  border-bottom: 1px solid rgba(243, 237, 224, 0.12);
}

.optional-fields summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 0;
  cursor: pointer;
  list-style: none;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(243, 237, 224, 0.75);
}

.optional-fields summary::-webkit-details-marker {
  display: none;
}

.optional-fields summary em {
  font-style: normal;
  font-size: 9px;
  color: rgba(243, 237, 224, 0.36);
}

.optional-fields summary i {
  margin-left: auto;
  font-style: normal;
  font-size: 16px;
  line-height: 1;
  color: rgba(243, 237, 224, 0.5);
  transition: transform 0.2s ease;
}

.optional-fields[open] summary i {
  transform: rotate(45deg);
}

.optional-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 4px 0 20px;
}

.field-compact {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-compact.wide {
  grid-column: 1 / -1;
}

.field-compact > span {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(243, 237, 224, 0.48);
}

.field-compact input,
.field-compact textarea {
  width: 100%;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid rgba(243, 237, 224, 0.17);
  background: transparent;
  color: #f4eee2;
  font-size: 12px;
  line-height: 1.6;
}

.field-compact input::placeholder,
.field-compact textarea::placeholder {
  color: rgba(243, 237, 224, 0.28);
}

.field-compact input:focus,
.field-compact textarea:focus {
  outline: none;
  border-color: rgba(207, 91, 53, 0.8);
}

.form-error {
  min-height: 16px;
  margin-top: 8px;
  font-size: 11px;
  color: #e88a6d;
  letter-spacing: 0.02em;
}

.intake-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-top: 16px;
  padding-top: 22px;
  border-top: 1px solid rgba(243, 237, 224, 0.12);
}

#evidence-panel {
  width: min(330px, 42%);
}

.evidence-wrap {
  width: 100%;
}

.evidence-top {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(243, 237, 224, 0.5);
}

.evidence-top b {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 400;
  color: #f3ede0;
}

.evidence-top b small {
  font-size: 9px;
  color: rgba(243, 237, 224, 0.35);
}

.evidence-top em {
  font-style: normal;
  padding: 2px 7px;
  border: 1px solid currentColor;
  border-radius: 100px;
  font-size: 8px;
  letter-spacing: 0.06em;
}

.evidence-top em[data-tone="low"] { color: #d58c6a; }
.evidence-top em[data-tone="mid"] { color: #cdb27e; }
.evidence-top em[data-tone="high"] { color: #86b89b; }

.evidence-track {
  height: 3px;
  margin-top: 8px;
  background: rgba(243, 237, 224, 0.12);
  overflow: hidden;
}

.evidence-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #d9a16b);
  transition: width 0.3s ease;
}

.evidence-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
  font-size: 9px;
  color: rgba(243, 237, 224, 0.38);
}

.evidence-reasons span::before {
  content: "·";
  margin-right: 4px;
}

.evidence-note {
  margin-top: 5px;
  font-size: 8.5px;
  color: rgba(243, 237, 224, 0.27);
  letter-spacing: 0.02em;
}

.intake-controls {
  display: flex;
  align-items: flex-end;
  gap: 22px;
  flex: 0 0 auto;
}

.control-label {
  display: block;
  margin-bottom: 8px;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: rgba(243, 237, 224, 0.42);
}

.level-switch {
  display: flex;
  border: 1px solid rgba(243, 237, 224, 0.18);
}

.level-switch button {
  min-width: 48px;
  padding: 8px 10px;
  border: 0;
  border-right: 1px solid rgba(243, 237, 224, 0.13);
  background: transparent;
  color: rgba(243, 237, 224, 0.48);
  font-size: 10px;
  letter-spacing: 0.04em;
  transition: background 0.2s ease, color 0.2s ease;
}

.level-switch button:last-child {
  border-right: 0;
}

.level-switch button:hover {
  color: #f3ede0;
}

.level-switch button.active {
  background: rgba(243, 237, 224, 0.1);
  color: #f8f2e5;
}

.btn-analyze {
  min-width: 154px;
  padding: 14px 18px;
  font-size: 13px;
  letter-spacing: 0.08em;
  justify-content: space-between;
}

.btn-analyze i {
  font-style: normal;
  font-size: 16px;
  transition: transform 0.2s ease;
}

.btn-analyze:hover i {
  transform: translate(2px, -2px);
}

/* ------------------------------ Home sections ------------------------------ */

.output-map,
.theory-strip {
  width: min(var(--max), calc(100% - 64px));
  margin: 0 auto;
}

.output-map {
  padding: 92px 0 74px;
}

.section-intro {
  margin-bottom: 32px;
}

.section-intro-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-top: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-strong);
}

.section-intro-row h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.42;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.section-index {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  color: var(--muted);
  padding-bottom: 6px;
}

.output-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.output-item {
  position: relative;
  min-height: 190px;
  padding: 23px 24px 20px 0;
  border-right: 1px solid var(--line);
  transition: background 0.2s ease;
}

.output-item:last-child {
  border-right: 0;
}

.output-item + .output-item {
  padding-left: 24px;
}

.output-item:hover {
  background: rgba(251, 248, 241, 0.7);
}

.output-item > span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.output-item h3 {
  margin: 53px 0 10px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.output-item p {
  margin: 0;
  max-width: 240px;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--muted);
}

.theory-strip {
  padding: 0 0 86px;
}

.theory-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.11em;
  color: var(--muted);
}

.theory-strip-head a {
  color: var(--accent);
}

.theory-ticker {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.theory-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  border-right: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease;
}

.theory-mini:last-child {
  border-right: 0;
}

.theory-mini:hover {
  background: var(--paper);
  color: var(--ink);
}

.theory-mini span {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--muted-light);
}

/* ------------------------------ Report toolbar / grid ------------------------------ */

.report-page {
  animation: fadeIn 0.35s ease both;
}

.report-toolbar {
  position: sticky;
  top: 72px;
  z-index: 60;
  min-height: 54px;
  padding: 0 clamp(20px, 3vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(242, 238, 229, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.report-toolbar-left,
.report-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-link {
  font-size: 11px;
  color: var(--muted);
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--accent);
}

.toolbar-sep {
  width: 1px;
  height: 13px;
  background: var(--line-strong);
}

.report-toolbar .mono-label {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.report-grid {
  width: min(1420px, calc(100% - 44px));
  margin: 0 auto;
  padding: 32px 0 96px;
  display: grid;
  grid-template-columns: 172px minmax(0, 800px) 238px;
  gap: clamp(24px, 2.5vw, 38px);
  justify-content: center;
  align-items: start;
}

.report-toc {
  position: sticky;
  top: 142px;
  padding-top: 10px;
}

.toc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line-strong);
}

.toc-head span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--muted-light);
}

.toc-head b {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
}

.report-toc > a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  transition: color 0.2s ease, padding 0.2s ease;
}

.report-toc > a span {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--muted-light);
  width: 18px;
}

.report-toc > a:hover,
.report-toc > a.active {
  color: var(--ink);
  padding-left: 4px;
}

.report-toc > a.active::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
}

.toc-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.toc-foot button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 10px;
  text-align: left;
  line-height: 1.7;
}

/* ------------------------------ Report paper ------------------------------ */

.report-paper {
  background: var(--paper-bright);
  border: 1px solid rgba(23, 33, 31, 0.1);
  box-shadow: 0 28px 90px rgba(23, 33, 31, 0.08);
  padding: clamp(28px, 4vw, 62px);
  min-width: 0;
}

.report-meta-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--muted-light);
}

.report-header h1 {
  margin: 25px 0 10px;
  font-family: var(--serif);
  font-size: clamp(32px, 3.1vw, 45px);
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.report-subtitle {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.report-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 19px;
}

.report-question {
  margin-top: 28px;
  padding: 17px 20px;
  border-left: 3px solid var(--accent);
  background: var(--paper);
}

.report-question > span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--muted-light);
}

.report-question p {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink-soft);
}

.report-section {
  margin-top: 58px;
  scroll-margin-top: 142px;
}

.section-head {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
}

.section-number {
  padding-top: 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.75;
  color: var(--muted);
}

.tension-callout {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.tension-callout span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  color: var(--accent);
}

.tension-callout p {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.85;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.fact-block {
  padding: 17px 16px 14px;
  background: var(--paper);
  border-top: 2px solid var(--line-strong);
  min-width: 0;
}

.fact-block:nth-child(1) { border-top-color: var(--green); }
.fact-block:nth-child(2) { border-top-color: var(--amber); }
.fact-block:nth-child(3) { border-top-color: var(--muted-light); }

.fact-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.fact-head b {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--muted-light);
}

.fact-list,
.assumption-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.fact-list li,
.assumption-list li {
  margin-bottom: 11px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.fact-list li:last-child,
.assumption-list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.fact-list p,
.assumption-list p {
  margin: 3px 0 0;
  font-size: 10.5px;
  line-height: 1.75;
  color: var(--ink-soft);
  word-break: break-word;
}

.fact-tag {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.assumption-list li {
  display: grid;
  grid-template-columns: 15px 1fr;
  gap: 5px;
}

.assumption-list li > span {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--amber);
  padding-top: 3px;
}

.gap-list li > span {
  color: var(--muted);
}

.block-note {
  margin: 12px 0 0;
  font-size: 8.5px;
  line-height: 1.65;
  color: var(--muted-light);
}

/* Theory report cards */

.theory-report-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.theory-report-card {
  padding: 22px 24px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
}

.theory-report-card.secondary {
  border-left-color: var(--teal);
}

.theory-report-top {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.theory-role {
  padding: 2px 7px;
  background: var(--accent);
  color: #fff9f2;
}

.theory-report-card.secondary .theory-role {
  background: var(--teal);
}

.theory-category {
  color: var(--muted);
}

.theory-fit {
  margin-left: auto;
  color: var(--muted-light);
}

.theory-report-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
}

.theory-report-title h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.theory-report-title p {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  color: var(--muted-light);
}

.theory-year {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-light);
  padding-top: 4px;
}

.theory-scholar {
  margin: 7px 0 0;
  font-size: 10px;
  color: var(--muted);
}

.theory-core {
  margin: 13px 0 0;
  font-size: 12px;
  line-height: 1.9;
  color: var(--ink-soft);
}

.fit-bar {
  height: 2px;
  margin-top: 14px;
  background: var(--line);
}

.fit-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.theory-report-card.secondary .fit-bar i {
  background: var(--teal);
}

.theory-relevance {
  margin-top: 14px;
  padding: 12px 13px;
  background: var(--paper-bright);
  border: 1px solid var(--line);
}

.theory-relevance span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.09em;
  color: var(--muted-light);
}

.theory-relevance p {
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.theory-mechanisms,
.matched-terms,
.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.theory-mechanisms span,
.modal-tags span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 8.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.matched-terms {
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.matched-terms > span {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  color: var(--muted-light);
}

.matched-terms b {
  padding: 2px 6px;
  background: rgba(183, 71, 42, 0.06);
  border: 1px solid rgba(183, 71, 42, 0.18);
  font-size: 8px;
  font-weight: 400;
  color: var(--accent);
}

/* Knowledge refs in report */

.knowledge-ref {
  margin-top: 12px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  background: rgba(252, 248, 239, 0.6);
}

.knowledge-ref.has-ref {
  border-left: 2px solid var(--gold);
}

.knowledge-ref-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.knowledge-ref-head b {
  font-weight: 400;
  color: var(--muted-light);
}

.knowledge-note {
  margin: 7px 0 0;
  font-size: 9px;
  line-height: 1.7;
  color: var(--muted-light);
}

.ref-item {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.ref-item > span {
  font-size: 9.5px;
  color: var(--accent);
}

.ref-item p {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 11.5px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.ref-item > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.ref-item i {
  font-style: normal;
  padding: 2px 6px;
  border: 1px solid var(--line);
  font-size: 7.5px;
  color: var(--muted);
}

/* Causes */

.cause-list {
  display: grid;
  gap: 11px;
  margin-top: 18px;
}

.cause-card {
  padding: 19px 20px 17px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.cause-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.cause-rank {
  flex: 0 0 auto;
  padding-top: 4px;
  width: 24px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--accent);
}

.cause-title {
  min-width: 0;
  flex: 1;
}

.cause-title h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
}

.cause-title > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.cause-theory {
  font-size: 8.5px;
  color: var(--muted);
}

.support-badge {
  display: inline-flex;
  padding: 2px 6px;
  border: 1px solid currentColor;
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.04em;
}

.support-badge.tone-high { color: var(--green); background: rgba(47, 106, 78, 0.04); }
.support-badge.tone-mid { color: var(--amber); background: rgba(166, 110, 36, 0.04); }
.support-badge.tone-low { color: var(--muted); background: rgba(109, 116, 107, 0.03); }
.support-badge.tone-none { color: var(--muted-light); }

.cause-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.mini-label {
  display: block;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  color: var(--muted-light);
}

.cause-body p {
  margin: 5px 0 0;
  font-size: 10.5px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.cause-evidence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  padding: 7px 9px;
  background: var(--paper-bright);
  border: 1px solid var(--line);
}

.cause-evidence > span {
  margin-right: 2px;
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--muted-light);
  letter-spacing: 0.08em;
}

.cause-evidence b {
  padding: 1px 5px;
  border: 1px solid var(--line);
  font-size: 8px;
  font-weight: 400;
  color: var(--muted);
}

.cause-evidence em {
  font-style: normal;
  font-size: 8.5px;
  color: var(--muted-light);
}

.cause-verify {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  margin-top: 11px;
}

.cause-verify > span {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding-top: 2px;
}

.cause-verify p {
  margin: 0;
  font-size: 9.5px;
  line-height: 1.7;
  color: var(--muted);
}

.reverse-check {
  margin-top: 14px;
  padding: 21px 22px;
  background: var(--ink);
  color: #eee8dc;
}

.reverse-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reverse-head span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: rgba(238, 232, 220, 0.45);
}

.reverse-head b {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  color: #f9f4e9;
}

.reverse-check p {
  margin: 11px 0 0;
  font-size: 11px;
  line-height: 1.9;
  color: rgba(238, 232, 220, 0.72);
}

/* Mechanism */

.mechanism-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  margin-top: 20px;
}

.mechanism-node {
  padding: 16px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  min-width: 0;
}

.mechanism-node-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.mechanism-node-head span {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--accent);
}

.mechanism-node-head b {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.mechanism-node p {
  margin: 9px 0 0;
  font-size: 9.5px;
  line-height: 1.8;
  color: var(--muted);
}

.mechanism-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-light);
  font-size: 13px;
  font-family: var(--mono);
}

.mechanism-note {
  margin-top: 12px;
  padding: 15px 18px;
  background: var(--paper);
  border-left: 2px solid var(--line-strong);
}

.mechanism-note p {
  margin: 0 0 7px;
  font-size: 9.5px;
  line-height: 1.8;
  color: var(--muted);
}

.mechanism-note p:last-child {
  margin-bottom: 0;
}

.mechanism-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.mechanism-tags span {
  font-family: var(--mono);
  font-size: 7.5px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  color: var(--muted);
}

/* Tables */

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--paper-bright);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9.5px;
  line-height: 1.7;
}

.report-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--paper);
  text-align: left;
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

.report-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-soft);
}

.report-table tbody tr:last-child td {
  border-bottom: 0;
}

.report-table tbody tr:hover {
  background: rgba(23, 33, 31, 0.018);
}

.report-table td b {
  font-weight: 500;
  color: var(--ink);
}

.table-rank {
  display: inline-block;
  margin-right: 6px;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--accent);
}

.table-caption {
  margin: 8px 0 0;
  font-size: 8.5px;
  color: var(--muted-light);
}

.priority-action {
  margin-top: 22px;
  padding: 24px 26px;
  background: var(--ink);
  color: #f1ebdf;
}

.priority-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(241, 235, 223, 0.14);
}

.priority-kicker span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: rgba(241, 235, 223, 0.45);
}

.priority-kicker b {
  font-size: 9px;
  font-weight: 400;
  color: rgba(241, 235, 223, 0.55);
}

.priority-action h3 {
  margin: 18px 0 16px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  color: #f8f2e6;
}

.priority-grid {
  display: grid;
  grid-template-columns: 1fr 0.95fr;
  gap: 28px;
}

.mini-label.light {
  color: rgba(241, 235, 223, 0.4);
}

.priority-steps ol {
  margin: 7px 0 0;
  padding-left: 17px;
  font-size: 10.5px;
  line-height: 1.8;
  color: rgba(241, 235, 223, 0.75);
}

.priority-steps li {
  margin-bottom: 6px;
  padding-left: 3px;
}

.priority-meta {
  border-left: 1px solid rgba(241, 235, 223, 0.14);
  padding-left: 22px;
}

.priority-meta > div {
  margin-bottom: 10px;
}

.priority-meta span {
  display: block;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  color: rgba(241, 235, 223, 0.35);
}

.priority-meta b {
  display: block;
  margin-top: 2px;
  font-size: 9.5px;
  font-weight: 400;
  line-height: 1.65;
  color: rgba(241, 235, 223, 0.78);
}

/* Implementation */

.phase-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.phase-card {
  padding: 17px 16px;
  background: var(--paper);
  border-top: 2px solid var(--line-strong);
}

.phase-card:nth-child(1) { border-top-color: var(--muted-light); }
.phase-card:nth-child(2) { border-top-color: var(--accent); }
.phase-card:nth-child(3) { border-top-color: var(--teal); }

.phase-top {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--muted-light);
}

.phase-index {
  color: var(--ink);
}

.phase-period {
  letter-spacing: 0.05em;
}

.phase-top b {
  margin-left: auto;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 7.5px;
  font-weight: 400;
  color: var(--muted);
}

.phase-card h3 {
  margin: 14px 0 7px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
}

.phase-card p {
  margin: 0;
  font-size: 9.5px;
  line-height: 1.8;
  color: var(--muted);
}

.phase-owner {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 8px;
  color: var(--muted-light);
}

.metric-block,
.review-block {
  margin-top: 26px;
}

.subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line-strong);
}

.subhead span {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.subhead b {
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted-light);
}

.metric-table td {
  font-size: 9px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.review-item {
  padding: 14px 14px 13px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.review-item span {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.review-item b {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 500;
}

.review-item p {
  margin: 5px 0 0;
  font-size: 9px;
  line-height: 1.75;
  color: var(--muted);
}

/* Insights & conclusion */

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.insight-card {
  padding: 18px 17px;
  background: var(--paper);
  border-top: 1px solid var(--line-strong);
}

.insight-card > span {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--accent);
}

.insight-card h3 {
  margin: 18px 0 7px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
}

.insight-card p {
  margin: 0;
  font-size: 9.5px;
  line-height: 1.85;
  color: var(--muted);
}

.conclusion-card {
  position: relative;
  margin-top: 26px;
  padding: 28px 28px 22px;
  background: var(--ink);
  color: #f1eadc;
  overflow: hidden;
}

.conclusion-card::before {
  content: "“";
  position: absolute;
  right: 18px;
  top: -24px;
  font-family: var(--serif);
  font-size: 150px;
  color: rgba(241, 234, 220, 0.06);
  line-height: 1;
}

.conclusion-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(241, 234, 220, 0.14);
}

.conclusion-top span {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.14em;
  color: rgba(241, 234, 220, 0.4);
}

.conclusion-top b {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: #fbf5e9;
}

.conclusion-card > p {
  position: relative;
  margin: 17px 0 18px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 2;
  color: rgba(241, 234, 220, 0.85);
}

.conclusion-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(241, 234, 220, 0.14);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  color: rgba(241, 234, 220, 0.38);
}

.report-footer {
  margin-top: 55px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
}

.report-footer-mark {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
}

.report-footer p {
  max-width: 440px;
  margin: 0;
  font-size: 8.5px;
  line-height: 1.8;
  color: var(--muted-light);
  text-align: right;
}

/* Rail */

.report-rail {
  position: sticky;
  top: 142px;
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

.rail-card {
  padding: 17px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.rail-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.rail-title span {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}

.rail-title b {
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--muted-light);
}

.rail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 13px;
}

.rail-stats > div {
  text-align: center;
  border-right: 1px solid var(--line);
}

.rail-stats > div:last-child {
  border-right: 0;
}

.rail-stats b {
  display: block;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
}

.rail-stats span {
  display: block;
  font-size: 8px;
  color: var(--muted-light);
}

.rail-evidence {
  margin-top: 14px;
}

.rail-evidence .evidence-top {
  color: var(--muted);
}

.rail-evidence .evidence-top b {
  color: var(--ink);
}

.rail-evidence .evidence-track {
  background: var(--line);
}

.rail-evidence .evidence-note {
  color: var(--muted-light);
}

.rail-theory {
  margin-top: 11px;
}

.rail-theory > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.rail-theory span {
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--muted-light);
}

.rail-theory b {
  font-size: 9.5px;
  font-weight: 500;
}

.rail-theory em {
  margin-left: auto;
  font-style: normal;
  font-size: 7px;
  color: var(--muted-light);
}

.rail-bar {
  height: 2px;
  margin-top: 5px;
  background: var(--line);
}

.rail-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.rail-theory:nth-child(3) .rail-bar i {
  background: var(--teal);
}

.rail-note {
  margin: 12px 0 0;
  font-size: 8px;
  line-height: 1.7;
  color: var(--muted-light);
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  font-size: 8.5px;
  color: var(--muted);
}

.rail-boundary {
  border-left: 2px solid var(--accent);
}

.rail-boundary p {
  margin: 10px 0 0;
  font-size: 8.5px;
  line-height: 1.8;
  color: var(--muted);
}

.rail-boundary a {
  display: inline-block;
  margin-top: 9px;
  font-size: 8.5px;
  color: var(--accent);
}

/* ------------------------------ Inner pages ------------------------------ */

.inner-page {
  width: min(var(--max), calc(100% - 64px));
  margin: 0 auto;
  padding: clamp(48px, 6vw, 84px) 0 100px;
}

.inner-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 50px;
  align-items: end;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line-strong);
}

.inner-hero.compact {
  padding-bottom: 30px;
}

.inner-hero h1 {
  margin: 24px 0 18px;
  font-family: var(--serif);
  font-size: clamp(38px, 4.8vw, 64px);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.inner-hero p {
  max-width: 700px;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--muted);
}

.inner-count {
  display: flex;
  align-items: flex-end;
  gap: 13px;
  justify-content: flex-end;
  padding-bottom: 6px;
}

.inner-count b {
  font-family: var(--serif);
  font-size: clamp(70px, 8vw, 108px);
  line-height: 0.82;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.07em;
}

.inner-count span {
  font-family: var(--mono);
  font-size: 7.5px;
  line-height: 1.7;
  letter-spacing: 0.1em;
  color: var(--muted-light);
  padding-bottom: 4px;
}

/* Theory library */

.theory-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px 0 22px;
  border-bottom: 1px solid var(--line);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 260px;
  flex: 1;
  max-width: 430px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--line-strong);
}

.search-box span {
  font-size: 18px;
  color: var(--muted-light);
}

.search-box input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 4px 0;
  font-size: 12px;
  outline: none;
}

.search-box input::placeholder {
  color: var(--muted-light);
}

.filter-row {
  display: flex;
  gap: 2px;
}

.filter-row button {
  padding: 6px 12px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-row button:hover {
  color: var(--ink);
}

.filter-row button.active {
  border-color: var(--ink);
  color: var(--ink);
}

.theory-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--muted-light);
}

.theory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-left: 1px solid var(--line);
  margin-top: 2px;
}

.theory-tile {
  display: flex;
  flex-direction: column;
  min-height: 305px;
  padding: 24px 24px 18px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  transition: background 0.22s ease, transform 0.22s ease;
}

.theory-tile:hover {
  background: var(--paper);
}

.theory-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tile-index {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.tile-level {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 8px;
  color: var(--muted);
}

.theory-tile h3 {
  margin: 33px 0 4px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.35;
}

.tile-en {
  margin: 0;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.03em;
  color: var(--muted-light);
}

.tile-core {
  margin: 15px 0 20px;
  font-size: 11px;
  line-height: 1.85;
  color: var(--muted);
}

.tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: 8.5px;
  color: var(--muted-light);
}

.tile-foot b {
  font-weight: 400;
  color: var(--accent);
  opacity: 0.65;
  transition: opacity 0.2s ease;
}

.theory-tile:hover .tile-foot b {
  opacity: 1;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 60px 30px;
  text-align: center;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.empty-state > span {
  font-family: var(--serif);
  font-size: 44px;
  color: var(--muted-light);
}

.empty-state h3 {
  margin: 8px 0 4px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.empty-state p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

/* Modal */

.modal-root:empty {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(16, 25, 22, 0.72);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease both;
}

.modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px 42px 34px;
  background: var(--paper-bright);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.28);
  animation: rise 0.3s ease both;
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
}

.modal-close:hover {
  color: var(--accent);
}

.modal-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--muted-light);
}

.modal-kicker b {
  font-weight: 400;
  color: var(--accent);
}

.theory-modal-card h2 {
  margin: 24px 0 6px;
  font-family: var(--serif);
  font-size: 37px;
  line-height: 1.25;
  font-weight: 600;
}

.modal-en {
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--muted-light);
}

.modal-author {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 9px;
  margin-top: 20px;
  padding: 11px 13px;
  background: var(--paper);
  border-left: 2px solid var(--accent);
  font-size: 10px;
}

.modal-author span {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  color: var(--muted-light);
}

.modal-author b {
  font-weight: 500;
}

.modal-author em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--muted);
}

.modal-section {
  margin-top: 24px;
}

.modal-section h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.modal-section p {
  margin: 0;
  font-size: 12px;
  line-height: 1.95;
  color: var(--ink-soft);
}

.modal-warning {
  padding: 12px 14px;
  background: rgba(166, 110, 36, 0.06);
  border-left: 2px solid var(--amber);
  color: var(--ink-soft) !important;
}

.modal-tags {
  margin-top: 0;
}

.signal-tags span {
  border-color: rgba(47, 106, 78, 0.22);
  color: var(--green);
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 30px;
  padding-top: 14px;
  border-top: 1px solid var(--line-strong);
}

.modal-foot a {
  font-size: 11px;
  color: var(--accent);
}

.modal-foot span {
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--muted-light);
  line-height: 1.6;
  text-align: right;
}

/* ------------------------------ Cases ------------------------------ */

.saved-empty {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 30px;
  padding: 18px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.saved-empty-mark {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.saved-empty h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.saved-empty p {
  margin: 3px 0 0;
  font-size: 10px;
  color: var(--muted);
}

.saved-empty .btn {
  margin-left: auto;
  flex: 0 0 auto;
}

.saved-block {
  margin-top: 30px;
  border-top: 2px solid var(--ink);
}

.saved-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.saved-head span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.saved-head b {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.saved-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.saved-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 18px 16px 0;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.saved-item:nth-child(even) {
  padding-left: 18px;
  border-right: 0;
}

.saved-item-main span {
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--muted-light);
  letter-spacing: 0.04em;
}

.saved-item-main h3 {
  margin: 5px 0 4px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}

.saved-item-main p {
  margin: 0;
  font-size: 9px;
  line-height: 1.7;
  color: var(--muted);
}

.saved-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.saved-item-actions > button[data-open-saved] {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 9px;
  color: var(--accent);
}

.saved-delete {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 14px;
  color: var(--muted-light);
  line-height: 1;
}

.saved-delete:hover {
  color: var(--accent);
}

.case-intro {
  margin-top: 54px;
}

.case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.case-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  padding: 22px 25px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 248, 241, 0.35);
  transition: background 0.25s ease;
}

.case-card:hover {
  background: var(--paper);
}

.case-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.case-card:hover::before {
  width: 54px;
}

.case-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.case-id {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.case-tag {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 8px;
  color: var(--muted);
}

.case-card h3 {
  margin: 38px 0 8px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.015em;
}

.case-summary {
  margin: 0 0 18px;
  max-width: 440px;
  font-size: 10.5px;
  line-height: 1.85;
  color: var(--muted);
}

.case-meta {
  display: flex;
  gap: 20px;
  margin-top: auto;
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--muted-light);
  letter-spacing: 0.04em;
}

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

.case-foot > span {
  font-size: 8px;
  color: var(--muted-light);
}

.case-foot .btn-text i {
  font-style: normal;
  font-size: 12px;
}

/* ------------------------------ Knowledge ------------------------------ */

.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: clamp(24px, 4vw, 56px);
  margin-top: 42px;
  align-items: start;
}

.kb-editor {
  padding: 28px 28px 24px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.kb-editor-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line-strong);
}

.kb-editor-head span,
.kb-library-head > div > span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.11em;
  color: var(--accent);
}

.kb-editor-head b {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 27px 16px 24px;
  margin-top: 20px;
  border: 1px dashed var(--line-strong);
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.dropzone:hover,
.dropzone.dragging {
  background: rgba(183, 71, 42, 0.035);
  border-color: var(--accent);
}

.drop-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-bottom: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}

.dropzone b {
  font-size: 10.5px;
  font-weight: 500;
}

.dropzone small {
  font-size: 9px;
  color: var(--muted-light);
}

.kb-file-status {
  padding: 7px 0 0;
  font-size: 8.5px;
  color: var(--muted-light);
}

.kb-editor .field-compact {
  margin-top: 16px;
}

.kb-editor .field-compact > span {
  color: var(--muted);
  font-size: 8.5px;
}

.kb-editor .field-compact input,
.kb-editor .field-compact textarea {
  border-bottom-color: var(--line-strong);
  color: var(--ink);
  font-size: 11.5px;
}

.kb-editor .field-compact input::placeholder,
.kb-editor .field-compact textarea::placeholder {
  color: var(--muted-light);
}

.kb-editor .field-compact textarea {
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: var(--paper-bright);
  resize: vertical;
  line-height: 1.8;
}

.kb-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.kb-actions > span {
  font-size: 8.5px;
  color: var(--muted-light);
}

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

.kb-library-head h2 {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
}

.kb-library-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--muted-light);
}

.kb-library-actions button {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 8.5px;
  color: var(--accent);
}

.kb-library-actions button:disabled {
  color: var(--muted-light);
  cursor: default;
}

.kb-docs {
  margin-top: 0;
}

.kb-doc {
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.kb-doc-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.kb-doc-top > span {
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--muted-light);
}

.kb-doc-top b {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.kb-doc-top button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted-light);
  font-size: 17px;
  line-height: 1;
}

.kb-doc-top button:hover {
  color: var(--accent);
}

.kb-doc p {
  margin: 6px 0 0;
  font-size: 10px;
  line-height: 1.8;
  color: var(--muted);
}

.kb-doc-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--muted-light);
}

.kb-principle {
  margin-top: 26px;
  padding: 16px 18px;
  background: var(--paper);
  border-left: 2px solid var(--gold);
}

.kb-principle span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--muted-light);
}

.kb-principle p {
  margin: 6px 0 0;
  font-size: 9.5px;
  line-height: 1.8;
  color: var(--muted);
}

/* ------------------------------ Method ------------------------------ */

.method-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 42px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.method-step {
  display: flex;
  gap: 20px;
  padding: 25px 26px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 248, 241, 0.25);
}

.method-no {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding-top: 5px;
}

.method-step h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.method-step p {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.85;
  color: var(--muted);
}

.method-section {
  margin-top: 72px;
}

.level-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.level-card {
  min-height: 230px;
  padding: 24px 23px;
  background: var(--paper);
  border-top: 2px solid var(--ink);
}

.level-card:nth-child(2) { border-top-color: var(--teal); }
.level-card:nth-child(3) { border-top-color: var(--accent); }

.level-card > span {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted-light);
}

.level-card h3 {
  margin: 44px 0 9px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
}

.level-card p {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.85;
  color: var(--muted);
}

.level-card b {
  display: block;
  margin-top: 17px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--muted-light);
}

.method-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.legend-card {
  padding: 22px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.legend-card .dot {
  margin-bottom: 15px;
}

.legend-card h3 {
  margin: 0 0 7px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.legend-card p {
  margin: 0;
  font-size: 10px;
  line-height: 1.85;
  color: var(--muted);
}

.boundaries {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 50px;
  padding-top: 26px;
  border-top: 1px solid var(--line-strong);
}

.boundaries-copy span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.boundaries-copy h2 {
  margin: 16px 0 0;
  font-family: var(--serif);
  font-size: 35px;
  line-height: 1.35;
  font-weight: 600;
}

.boundary-list {
  display: grid;
  gap: 0;
}

.boundary-list > div {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.boundary-list > div:first-child {
  padding-top: 0;
}

.boundary-list b {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  color: var(--accent);
}

.boundary-list p {
  margin: 0;
  font-size: 11px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.method-cta {
  margin-top: 66px;
  padding: 30px 32px;
  background: var(--ink);
  color: #f1ebdf;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 22px;
  align-items: center;
}

.method-cta > span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: rgba(241, 235, 223, 0.38);
}

.method-cta h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  color: #faf4e8;
}

.method-cta > div {
  display: flex;
  gap: 8px;
}

.method-cta .btn-ink {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff7ef;
}

.method-cta .btn-ghost {
  border-color: rgba(241, 235, 223, 0.25);
  color: #f1ebdf;
}

.method-cta .btn-ghost:hover {
  background: rgba(241, 235, 223, 0.08);
  border-color: rgba(241, 235, 223, 0.5);
}

/* ------------------------------ Footer ------------------------------ */

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 80px;
  gap: 40px;
  align-items: center;
  width: min(var(--max), calc(100% - 64px));
  margin: 0 auto;
  padding: 29px 0 34px;
  border-top: 1px solid var(--line-strong);
}

.footer-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.footer-brand strong {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.05em;
}

.footer-brand span {
  font-size: 9.5px;
  color: var(--muted);
}

.footer-note {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 8px;
  line-height: 1.65;
  color: var(--muted-light);
  text-align: right;
}

.footer-index {
  justify-self: end;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--muted-light);
}

/* ------------------------------ Toast / Loading ------------------------------ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 400;
  max-width: calc(100% - 40px);
  padding: 11px 18px;
  background: var(--ink);
  color: #f5efe2;
  font-size: 11px;
  letter-spacing: 0.03em;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.analyzing {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(16, 25, 22, 0.72);
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.analyzing.show {
  opacity: 1;
  visibility: visible;
}

.analyzing-card {
  width: min(430px, 100%);
  padding: 34px 32px 28px;
  background: var(--ink);
  color: #f2ecdf;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.32);
}

.analyzing-kicker {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: rgba(242, 236, 223, 0.35);
}

.analyzing-title {
  margin-top: 17px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
}

.analyzing-line {
  height: 2px;
  margin-top: 20px;
  background: rgba(242, 236, 223, 0.12);
  overflow: hidden;
}

.analyzing-line i {
  display: block;
  width: 35%;
  height: 100%;
  background: var(--accent);
  animation: loadingLine 1.6s ease-in-out infinite;
}

@keyframes loadingLine {
  0% { transform: translateX(-110%); }
  60% { transform: translateX(210%); }
  100% { transform: translateX(310%); }
}

.analyzing-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 15px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.04em;
  color: rgba(242, 236, 223, 0.35);
}

.analyzing-steps span {
  opacity: 0;
  animation: stepIn 0.6s ease forwards;
}

.analyzing-steps span:nth-child(1) { animation-delay: 0.08s; }
.analyzing-steps span:nth-child(2) { animation-delay: 0.28s; }
.analyzing-steps span:nth-child(3) { animation-delay: 0.48s; }
.analyzing-steps span:nth-child(4) { animation-delay: 0.68s; }

@keyframes stepIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.analyzing-live {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(242, 236, 223, 0.12);
}

.analyzing-live[hidden] {
  display: none;
}

.analyzing-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: rgba(242, 236, 223, 0.38);
}

.analyzing-live-head b {
  font-weight: 400;
  color: #d9a16b;
}

.analyzing-live-text {
  margin: 8px 0 0;
  max-height: 68px;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.7;
  color: rgba(242, 236, 223, 0.6);
  word-break: break-all;
}

/* ------------------------------ Real mode ------------------------------ */

.local-chip.is-live i {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(183, 71, 42, 0.14);
}

.local-chip.is-offline i {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(166, 110, 36, 0.16);
}

.status-dot.live {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(183, 71, 42, 0.12);
}

.chip-ai {
  border-color: rgba(183, 71, 42, 0.35);
  color: var(--accent);
  background: rgba(183, 71, 42, 0.05);
  gap: 6px;
}

.chip-ai i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(183, 71, 42, 0.16);
}

.engine-control {
  flex: 0 0 auto;
}

.engine-switch button {
  min-width: 0;
  font-size: 9.5px;
  white-space: nowrap;
}

.engine-switch button[data-engine="deepseek"].active {
  background: rgba(183, 71, 42, 0.22);
  color: #fbe7dc;
}

.ai-modal-card {
  width: min(660px, 100%);
}

.ai-modal-card h2 {
  margin: 24px 0 6px;
  font-family: var(--serif);
  font-size: 33px;
  line-height: 1.25;
  font-weight: 600;
}

.ai-status-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 22px;
  padding: 15px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 2px solid var(--muted-light);
}

.ai-status-box b {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 600;
}

.ai-status-box p {
  margin: 0;
  font-size: 11px;
  line-height: 1.75;
  color: var(--muted);
}

.ai-state-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--muted-light);
}

.ai-state-dot.checking {
  background: var(--gold);
  animation: aiPulse 1.2s ease-in-out infinite;
}

.ai-state-dot.live {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 106, 78, 0.12);
}

.ai-state-dot.offline {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(166, 110, 36, 0.12);
}

@keyframes aiPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.model-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.model-option {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name tag" "note tag";
  align-items: center;
  gap: 2px 12px;
  padding: 14px 15px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.model-option span {
  grid-area: name;
  font-size: 13px;
  font-weight: 600;
}

.model-option b {
  grid-area: note;
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
}

.model-option i {
  grid-area: tag;
  font-style: normal;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--muted-light);
}

.model-option:hover {
  border-color: var(--ink);
}

.model-option.active {
  border-color: var(--accent);
  background: rgba(183, 71, 42, 0.06);
}

.model-option.active i {
  color: var(--accent);
}

.modal-card code {
  padding: 1px 5px;
  background: rgba(23, 33, 31, 0.06);
  font-family: var(--mono);
  font-size: 0.92em;
}

.modal-foot.settings-actions {
  flex-wrap: wrap;
}

.settings-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 780px) {
  .model-options {
    grid-template-columns: 1fr;
  }

  .settings-actions span {
    flex: 1 1 100%;
    text-align: left;
  }
}

/* ------------------------------ Responsive ------------------------------ */

@media (max-width: 1240px) {
  .report-grid {
    grid-template-columns: 150px minmax(0, 1fr);
    width: min(1080px, calc(100% - 44px));
  }

  .report-rail {
    display: none;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 55px;
  }
}

@media (max-width: 1080px) {
  .site-nav {
    gap: 18px;
  }

  .local-chip {
    display: none;
  }

  .example-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .theory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .output-item p {
    max-width: none;
  }

  .theory-ticker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .theory-mini:nth-child(4) {
    border-right: 0;
  }

  .theory-mini:nth-child(n+5) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 960px) {
  .site-header {
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    min-height: auto;
    padding: 12px 24px 0;
    gap: 8px 20px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    justify-content: flex-start;
    gap: 22px;
    overflow-x: auto;
    padding: 9px 0 9px;
    border-top: 1px solid var(--line);
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    font-size: 11px;
  }

  .report-toolbar {
    top: 101px;
  }

  .report-grid {
    grid-template-columns: minmax(0, 1fr);
    width: min(850px, calc(100% - 34px));
    padding-top: 20px;
  }

  .report-toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 16px;
    padding: 0 0 10px;
    border-bottom: 1px solid var(--line);
  }

  .toc-head {
    width: 100%;
    border-bottom: 0;
    padding-bottom: 5px;
  }

  .report-toc > a {
    border-bottom: 0;
    padding: 5px 0;
  }

  .report-toc > a.active::before {
    display: none;
  }

  .toc-foot {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 55px;
    padding-top: 64px;
  }

  .hero-manifesto {
    max-width: 560px;
  }

  .intake-foot {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  #evidence-panel {
    width: 100%;
  }

  .intake-controls {
    margin-left: auto;
  }

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

  .output-item:nth-child(2) {
    border-right: 0;
  }

  .output-item:nth-child(n+3) {
    border-top: 1px solid var(--line);
  }

  .output-item h3 {
    margin-top: 28px;
  }

  .inner-hero {
    grid-template-columns: 1fr;
  }

  .inner-count {
    justify-content: flex-start;
  }

  .inner-count b {
    font-size: 76px;
  }

  .knowledge-layout {
    grid-template-columns: 1fr;
  }

  .kb-library {
    margin-top: 10px;
  }

  .saved-list {
    grid-template-columns: 1fr;
  }

  .saved-item,
  .saved-item:nth-child(even) {
    padding-left: 0;
    border-right: 0;
  }

  .saved-empty {
    flex-wrap: wrap;
  }

  .saved-empty .btn {
    margin-left: 0;
  }

  .boundaries {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .method-cta {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .method-cta > span {
    margin-bottom: 0;
  }

  .footer-note {
    display: none;
  }

  .site-footer {
    grid-template-columns: 1fr auto;
  }
}

@media (max-width: 780px) {
  .hero,
  .intake-panel,
  .output-map,
  .theory-strip,
  .inner-page,
  .site-footer {
    width: calc(100% - 38px);
  }

  .hero {
    padding-top: 52px;
  }

  .hero h1 {
    font-size: clamp(40px, 9vw, 58px);
  }

  .hero h1 em {
    white-space: normal;
  }

  .hero-lead {
    font-size: 14.5px;
  }

  .intake-panel {
    padding: 28px 22px 26px;
  }

  .intake-mark {
    display: none;
  }

  .intake-head {
    grid-template-columns: 1fr;
  }

  #problem-input {
    font-size: 17px;
    padding: 15px;
  }

  .intake-controls {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .btn-analyze {
    min-width: 130px;
  }

  .output-map {
    padding: 70px 0 56px;
  }

  .section-intro-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

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

  .output-item,
  .output-item + .output-item {
    min-height: 0;
    padding: 22px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .output-item h3 {
    margin: 18px 0 6px;
  }

  .theory-ticker {
    grid-template-columns: 1fr 1fr;
  }

  .theory-mini:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .theory-mini:nth-child(even) {
    border-right: 0;
  }

  .theory-mini:nth-child(n+3) {
    border-top: 1px solid var(--line);
  }

  .report-toolbar {
    position: static;
    padding: 10px 18px;
    flex-wrap: wrap;
    min-height: 0;
  }

  .report-toolbar-left .mono-label,
  .toolbar-sep {
    display: none;
  }

  .report-toolbar-actions {
    gap: 6px;
  }

  .report-toolbar-actions .btn {
    padding: 7px 9px;
    font-size: 9.5px;
  }

  .report-grid {
    width: calc(100% - 24px);
    padding-top: 14px;
  }

  .report-paper {
    padding: 24px 20px 32px;
  }

  .report-meta-line {
    font-size: 7px;
  }

  .report-header h1 {
    font-size: 31px;
  }

  .report-question p {
    font-size: 13.5px;
  }

  .report-section {
    margin-top: 46px;
  }

  .section-head {
    grid-template-columns: 30px 1fr;
    gap: 10px;
  }

  .section-head h2 {
    font-size: 23px;
  }

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

  .fact-block {
    padding: 14px 14px 12px;
  }

  .theory-report-card {
    padding: 18px 16px 16px;
  }

  .theory-report-title h3 {
    font-size: 21px;
  }

  .cause-body {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mechanism-flow {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .mechanism-arrow {
    transform: rotate(90deg);
    height: 16px;
  }

  .mechanism-node {
    padding: 13px 14px;
  }

  .priority-action {
    padding: 20px 18px;
  }

  .priority-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .priority-meta {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid rgba(241, 235, 223, 0.14);
    padding-top: 13px;
  }

  .phase-list,
  .insight-grid,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .subhead {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .conclusion-card {
    padding: 22px 20px 19px;
  }

  .conclusion-card > p {
    font-size: 13.5px;
  }

  .report-footer {
    flex-direction: column;
    gap: 10px;
  }

  .report-footer p {
    text-align: left;
  }

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

  .theory-tile {
    min-height: 0;
    padding: 21px 20px 16px;
  }

  .theory-tile h3 {
    margin-top: 23px;
  }

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

  .case-card {
    min-height: 0;
    padding: 20px 18px 16px;
  }

  .case-card h3 {
    margin-top: 25px;
    font-size: 21px;
  }

  .method-steps {
    grid-template-columns: 1fr;
  }

  .level-cards,
  .method-legend {
    grid-template-columns: 1fr;
  }

  .level-card {
    min-height: 0;
  }

  .level-card h3 {
    margin-top: 25px;
  }

  .modal-overlay {
    padding: 12px;
  }

  .modal-card {
    padding: 30px 22px 26px;
  }

  .theory-modal-card h2 {
    font-size: 30px;
  }

  .modal-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-foot span {
    text-align: left;
  }

  .kb-editor {
    padding: 22px 18px;
  }

  .inner-hero h1 {
    font-size: 38px;
  }

  .inner-hero p {
    font-size: 12.5px;
  }

  .theory-controls {
    gap: 14px;
  }

  .search-box {
    max-width: none;
    min-width: 100%;
  }

  .theory-count {
    margin-left: 0;
  }

  .method-cta > div {
    flex-wrap: wrap;
  }

  .site-footer {
    padding-bottom: 26px;
  }

  .footer-brand {
    flex-direction: column;
    gap: 2px;
  }

  .footer-index {
    display: none;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .site-header {
    padding-left: 18px;
    padding-right: 18px;
  }

  .brand-text small {
    display: none;
  }

  .header-actions .btn {
    font-size: 10px;
    padding: 7px 10px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero-points {
    gap: 17px;
  }

  .example-list {
    grid-template-columns: 1fr;
  }

  .example-card {
    min-height: 0;
  }

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

  .field-compact.wide {
    grid-column: auto;
  }

  .intake-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .level-switch {
    width: 100%;
  }

  .level-switch button {
    flex: 1;
  }

  .btn-analyze {
    width: 100%;
  }

  .report-toolbar-actions {
    width: 100%;
    overflow-x: auto;
  }

  .report-chip-row .chip {
    font-size: 9px;
  }

  .cause-verify {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .table-wrap {
    margin-left: -20px;
    margin-right: -20px;
    border-left: 0;
    border-right: 0;
  }

  .report-table {
    min-width: 560px;
  }

  .metric-table {
    min-width: 620px;
  }

  .modal-card {
    padding: 28px 18px 24px;
  }

  .modal-kicker {
    font-size: 7px;
  }

  .category,
  .tile-foot {
    font-size: 8px;
  }

  .saved-empty {
    padding: 16px;
  }

  .saved-empty-mark {
    width: 42px;
    height: 42px;
  }

  .kb-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ------------------------------ Print ------------------------------ */

/* Multi-round clarification */

.round-block {
  margin: 18px 0 4px;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  background: var(--paper-bright);
}

.round-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.round-head span {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.14em;
  color: var(--muted-light);
}

.round-head b {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}

.round-supplement {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.round-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: start;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.round-compare > div:not(.round-arrow) > span {
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.round-compare p {
  margin: 5px 0 6px;
  font-family: var(--serif);
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.round-compare b {
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 400;
  color: var(--muted-light);
}

.round-arrow {
  align-self: center;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--muted-light);
}

.inline-clarify {
  margin: 16px 0 0;
  border: 1px solid var(--line);
  background: var(--paper-bright);
}

.inline-clarify summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}

.inline-clarify summary::-webkit-details-marker {
  display: none;
}

.inline-clarify summary span {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
}

.inline-clarify summary em {
  flex: 1;
  font-style: normal;
  font-size: 9px;
  color: var(--muted-light);
}

.inline-clarify summary i {
  font-style: normal;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.inline-clarify[open] summary i {
  transform: rotate(45deg);
}

.inline-clarify .clarify-panel {
  margin: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}

.clarify-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.clarify-panel textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--paper-bright);
  font-size: 11px;
  line-height: 1.75;
  resize: vertical;
}

.clarify-panel textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.clarify-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
}

.clarify-actions > span {
  flex: 1;
  min-width: 120px;
  font-size: 8px;
  line-height: 1.6;
  color: var(--muted-light);
}

.ref-sim {
  margin-left: 8px;
  font-style: normal;
  color: var(--muted);
}

/* Team space */

.team-notice {
  margin-top: 22px;
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--gold);
  background: var(--paper);
  font-size: 11.5px;
  color: var(--muted);
}

.team-notice p {
  margin: 0;
}

.team-notice p + p {
  margin-top: 6px;
}

.team-auth,
.team-list-wrap {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.team-auth-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.team-auth .kb-actions {
  flex-wrap: wrap;
}

.team-list-wrap {
  margin-top: 18px;
}

.team-list {
  display: grid;
  gap: 1px;
  margin-top: 16px;
  background: var(--line);
  border: 1px solid var(--line);
}

.team-report {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 18px;
  padding: 16px 18px;
  background: var(--paper-bright);
}

.team-report-main > span {
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--muted-light);
}

.team-report-main h3 {
  margin: 5px 0 4px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.team-report-main p {
  margin: 0;
  font-size: 11px;
  line-height: 1.75;
  color: var(--muted);
}

.team-report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.team-report-meta b {
  padding: 2px 7px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 400;
  color: var(--muted);
}

.team-report-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.team-report-actions > button[data-team-open] {
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-size: 10px;
  color: var(--ink);
}

.team-report-actions > button[data-team-open]:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-bright);
}

.team-report-delete {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 13px;
  line-height: 1;
  color: var(--muted-light);
}

.team-report-delete:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.team-discussion {
  margin-top: 30px;
}

.team-comment-list {
  margin-top: 14px;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.team-comment {
  padding: 13px 15px;
  background: var(--paper-bright);
}

.team-comment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.team-comment-head b {
  font-size: 11px;
  font-weight: 600;
}

.team-comment-head span {
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--muted-light);
}

.team-comment p {
  margin: 5px 0 0;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.team-comment-empty {
  margin: 0;
  padding: 16px;
  background: var(--paper-bright);
  font-size: 11px;
  color: var(--muted-light);
}

.team-comment-form {
  margin-top: 12px;
}

.team-comment-form textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: var(--paper-bright);
  font-size: 11.5px;
  line-height: 1.75;
  resize: vertical;
}

.team-comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.team-comment-form > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.team-comment-form > div > span {
  flex: 1;
  min-width: 160px;
  font-size: 9px;
  color: var(--muted-light);
}

@media (max-width: 760px) {
  .round-compare {
    grid-template-columns: 1fr;
  }

  .round-arrow {
    display: none;
  }

  .team-auth-fields {
    grid-template-columns: 1fr;
  }

  .team-report {
    grid-template-columns: 1fr;
  }

  .team-report-actions {
    justify-content: flex-start;
  }
}

@media print {
  @page {
    size: A4;
    margin: 15mm;
  }

  html,
  body {
    background: #fff;
    color: #111;
  }

  .page-grid,
  .site-header,
  .site-footer,
  .report-toolbar,
  .report-toc,
  .report-rail,
  .toast,
  .analyzing {
    display: none !important;
  }

  .report-grid {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
  }

  .report-paper {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .report-section {
    margin-top: 28px;
    break-inside: auto;
  }

  .section-head,
  .theory-report-card,
  .cause-card,
  .phase-card,
  .insight-card {
    break-inside: avoid;
  }

  .priority-action,
  .conclusion-card,
  .reverse-check {
    background: #1f2724 !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .table-wrap {
    overflow: visible;
  }

  .report-table {
    font-size: 8pt;
  }

  .report-footer {
    margin-top: 24px;
  }

  a {
    text-decoration: none;
  }
}

/* ------------------------------ 分析进度（页面内，非阻塞） ------------------------------ */

.analysis-progress {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 120;
  width: min(320px, calc(100vw - 32px));
  padding: 14px 16px 12px;
  background: rgba(251, 248, 241, 0.96);
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 50px rgba(23, 33, 31, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: rise 0.35s ease both;
}

.analysis-progress[hidden] {
  display: none;
}

.ap-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.ap-head i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: apPulse 1.2s ease-in-out infinite;
}

.ap-head b {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ap-head span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

.ap-track {
  position: relative;
  height: 2px;
  margin: 10px 0 8px;
  background: var(--line);
  overflow: hidden;
}

.ap-track i {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  background: var(--accent);
  animation: apSlide 1.6s ease-in-out infinite;
}

.analysis-progress.is-writing .ap-track i {
  animation-duration: 1.1s;
}

.analysis-progress p {
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
}

@keyframes apSlide {
  0% { left: -38%; }
  100% { left: 100%; }
}

@keyframes apPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.82); }
}

/* ------------------------------ 首页补充信息可见性 ------------------------------ */

.optional-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: rgba(243, 237, 224, 0.4);
}

.optional-actions .btn-text {
  color: rgba(243, 237, 224, 0.62);
  font-size: 10px;
}

.optional-actions .btn-text:hover {
  color: #fff;
}

.optional-supplement {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px dashed rgba(243, 237, 224, 0.18);
  background: rgba(243, 237, 224, 0.03);
}

.optional-supplement span {
  display: block;
  margin-bottom: 4px;
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: rgba(243, 237, 224, 0.42);
}

.optional-supplement p {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: rgba(243, 237, 224, 0.78);
}

@media (max-width: 760px) {
  .analysis-progress {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
  }
}
