/* =====================================================================
   星际娱乐官网 · xingjiyule-ai.com.cn
   Interactive Cinema Story Lab / Generative Film Timeline / Narrative State Engine
   纯本地 CSS，无远程字体、无框架。
   ===================================================================== */

:root {
  --bg: #0a0d16;
  --bg-2: #0f1320;
  --bg-3: #151a28;
  --panel: #1a2030;
  --panel-2: #212a3c;
  --line: #2a3245;
  --line-2: #3a445b;
  --text: #e8e5dc;
  --text-2: #bab6ab;
  --muted: #8a877d;
  --accent: #5d5fef;
  --accent-2: #8789f7;
  --accent-soft: rgba(93, 95, 239, 0.16);
  --choice: #3ab7d4;
  --choice-soft: rgba(58, 183, 212, 0.14);
  --warn: #e6913d;
  --warn-soft: rgba(230, 145, 61, 0.14);
  --char: #c46bb8;
  --char-soft: rgba(196, 107, 184, 0.14);
  --ok: #5fbf8a;
  --radius: 14px;
  --radius-s: 8px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --maxw: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; display: block; }
/* 防止 grid / flex 子项因长英文词或宽组件撑破视口 */
.article-grid > *, .grid-2 > *, .grid-3 > *, .grid-4 > *, .state-grid > *, .latest-list > *, .qa-grid > *,
.cap-map > *, .flow-compare > *, .demo-body > *, .about-grid > *, .download-box > *, .observe-list > *,
.trend-grid > *, .feature-list > *, .footer-grid > *, .hero-inner > *, .firewall > *, .agency-map > *,
.char-sheet > *, .rel-row > *, .memory-log li > *, .scene-packet dl > *, .packet > *, .pipeline > li { min-width: 0; }
p, li, dd, dt, h1, h2, h3, h4, td, th, summary, figcaption { overflow-wrap: anywhere; word-break: normal; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--choice); }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .6em; font-weight: 600; letter-spacing: .01em; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.85rem); }
h3 { font-size: clamp(1.08rem, 1.6vw, 1.25rem); }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li { margin-bottom: .35em; }
dl { margin: 0; }
dt { color: var(--muted); font-size: .82rem; letter-spacing: .04em; }
dd { margin: 0 0 .5em; }
strong { color: #fff; font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
button { font-family: inherit; }
::selection { background: var(--accent); color: #fff; }

.container { width: min(100% - var(--gutter) * 2, var(--maxw)); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 999; }
.skip-link:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 13, 22, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand small { display: block; font-weight: 400; font-size: .7rem; color: var(--muted); letter-spacing: .12em; line-height: 1.2; }
.nav-toggle {
  display: none; background: transparent; border: 1px solid var(--line-2); color: var(--text);
  border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: .9rem;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; flex-wrap: wrap; }
.site-nav li { margin: 0; }
.site-nav a {
  display: block; padding: 8px 11px; border-radius: 8px; color: var(--text-2); font-size: .92rem; white-space: nowrap;
  border: 1px solid transparent;
}
.site-nav a:hover { color: #fff; background: var(--bg-3); }
.site-nav a.is-active { color: #fff; background: var(--accent-soft); border-color: rgba(93, 95, 239, .45); }

/* ---------- Hero ---------- */
.hero {
  position: relative; padding: clamp(40px, 7vw, 88px) 0 clamp(32px, 5vw, 64px);
  background:
    radial-gradient(900px 400px at 15% -10%, rgba(93, 95, 239, .22), transparent 60%),
    radial-gradient(700px 360px at 90% 10%, rgba(58, 183, 212, .12), transparent 60%),
    var(--bg);
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; letter-spacing: .14em;
  color: var(--choice); text-transform: uppercase; margin-bottom: 14px;
}
.kicker::before { content: ""; width: 22px; height: 1px; background: var(--choice); }
.hero h1 { margin-bottom: 14px; }
.hero-question { font-size: clamp(1.15rem, 2.1vw, 1.5rem); font-weight: 600; line-height: 1.5; color: #cdeff6; margin: 0 0 16px; }
.hero-lead { color: var(--text-2); font-size: 1.02rem; max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hero-figure { position: relative; }
.hero-figure img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

.page-hero { padding: clamp(32px, 5vw, 60px) 0 clamp(24px, 4vw, 40px); background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-bottom: 1px solid var(--line); }
.page-hero .hero-inner { align-items: start; }
.page-hero .hero-lead { max-width: 70ch; }
.breadcrumb { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px; font-size: .82rem; color: var(--muted); }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--line-2); }
.breadcrumb a { color: var(--text-2); }

/* ---------- Buttons / Tags ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: .95rem; border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: var(--accent-2); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { background: var(--bg-3); color: #fff; }
.btn--choice { background: var(--choice-soft); border-color: rgba(58, 183, 212, .5); color: #d8f4fa; }
.btn--choice:hover { background: rgba(58, 183, 212, .3); color: #fff; }
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; letter-spacing: .04em;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text-2);
}
.tag--accent { background: var(--accent-soft); border-color: rgba(93, 95, 239, .45); color: #d5d6ff; }
.tag--choice { background: var(--choice-soft); border-color: rgba(58, 183, 212, .45); color: #cdeff6; }
.tag--warn { background: var(--warn-soft); border-color: rgba(230, 145, 61, .45); color: #ffd9b3; }
.tag--char { background: var(--char-soft); border-color: rgba(196, 107, 184, .45); color: #f3d3ee; }

/* ---------- Sections ---------- */
.section { padding: clamp(40px, 6vw, 80px) 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 78ch; margin-bottom: clamp(20px, 3vw, 36px); }
.section-head p { color: var(--text-2); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .kicker { justify-content: center; }
.lead { color: var(--text-2); font-size: 1.02rem; }
.prose { max-width: 78ch; }
.prose p { color: var(--text-2); }
.prose strong { color: var(--text); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { margin-bottom: .5em; }
.card p { color: var(--text-2); margin-bottom: .6em; }
.card p:last-child { margin-bottom: 0; }
.card--accent { border-color: rgba(93, 95, 239, .45); background: linear-gradient(180deg, rgba(93, 95, 239, .1), var(--panel)); }
.card--choice { border-color: rgba(58, 183, 212, .4); }
.card--warn { border-color: rgba(230, 145, 61, .4); }
.card--char { border-color: rgba(196, 107, 184, .4); }

.notice {
  border-left: 3px solid var(--warn); background: var(--warn-soft); color: var(--text-2);
  padding: 12px 16px; border-radius: 0 var(--radius-s) var(--radius-s) 0; font-size: .9rem; margin: 18px 0;
}
.notice--info { border-left-color: var(--choice); background: var(--choice-soft); }
.notice--accent { border-left-color: var(--accent); background: var(--accent-soft); }
.notice p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius-s); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: .8rem; letter-spacing: .05em; background: var(--bg-3); }
tr:last-child td { border-bottom: 0; }

/* ---------- Pipeline / Flow ---------- */
.pipeline { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.pipeline li {
  position: relative; margin: 0; flex: 1 1 130px; min-width: 120px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  font-size: .9rem; color: var(--text-2);
}
.pipeline li strong { display: block; color: var(--text); font-size: .95rem; margin-bottom: 2px; }
.pipeline li::after {
  content: "→"; position: absolute; right: -13px; top: 50%; transform: translateY(-50%);
  color: var(--accent-2); font-size: 1rem; z-index: 1;
}
.pipeline li:last-child::after { content: none; }
.pipeline li.is-choice { border-color: rgba(58, 183, 212, .55); background: var(--choice-soft); }
.pipeline li.is-state { border-color: rgba(93, 95, 239, .55); background: var(--accent-soft); }
.pipeline li.is-warn { border-color: rgba(230, 145, 61, .55); background: var(--warn-soft); }
.pipeline li.is-char { border-color: rgba(196, 107, 184, .55); background: var(--char-soft); }
.pipeline--vertical { flex-direction: column; }
.pipeline--vertical li::after { content: "↓"; right: auto; left: 22px; top: auto; bottom: -19px; transform: none; }

.flow-compare { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; align-items: start; }
.flow-compare .card h3 { display: flex; align-items: center; gap: 8px; }

/* chain (consequence chain) */
.chain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: chain; }
.chain li {
  position: relative; margin: 0; padding: 10px 14px 10px 46px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; font-size: .92rem; color: var(--text-2);
}
.chain li::before {
  counter-increment: chain; content: counter(chain);
  position: absolute; left: 12px; top: 10px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: #d5d6ff; font-size: .78rem; display: grid; place-items: center; border: 1px solid rgba(93, 95, 239, .45);
}
.chain li strong { color: var(--text); }
.chain li.is-choice::before { background: var(--choice-soft); color: #cdeff6; border-color: rgba(58, 183, 212, .5); }
.chain li.is-warn::before { background: var(--warn-soft); color: #ffd9b3; border-color: rgba(230, 145, 61, .5); }
.chain li.is-end { border-color: rgba(230, 145, 61, .5); }

/* ---------- State system ---------- */
.state-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.state-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.state-card h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.state-card h3 .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }
.state-card--char h3 .dot { background: var(--char); }
.state-card--world h3 .dot { background: var(--choice); }
.state-card--rel h3 .dot { background: var(--warn); }
.state-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .9rem; }
.state-card dt { color: var(--muted); }
.state-card dd { color: var(--text-2); margin: 0; }
.state-card ul { margin: 0; padding-left: 1.1em; font-size: .9rem; color: var(--text-2); }
.state-card ul li { margin-bottom: .2em; }
.state-list { columns: 2; column-gap: 24px; font-size: .92rem; color: var(--text-2); padding-left: 1.1em; }
.state-list li { break-inside: avoid; }

/* Interactive demo (功能示意) */
.state-demo { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.demo-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--bg-3); font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.demo-body { display: grid; grid-template-columns: 1.2fr .8fr; }
.demo-stage { padding: 20px; border-right: 1px solid var(--line); }
.demo-scene { font-size: .8rem; color: var(--choice); letter-spacing: .1em; margin-bottom: 8px; }
.demo-text { color: var(--text-2); min-height: 5.5em; }
.demo-choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.demo-choices button { flex: 1 1 180px; text-align: left; padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(58, 183, 212, .5); background: var(--choice-soft); color: #d8f4fa; cursor: pointer; font-size: .92rem; transition: background .15s; }
.demo-choices button:hover { background: rgba(58, 183, 212, .3); }
.demo-choices button:disabled { opacity: .45; cursor: default; }
.demo-free { display: flex; gap: 8px; margin-top: 12px; }
.demo-free input { flex: 1; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); border-radius: 8px; padding: 9px 12px; font-family: inherit; font-size: .92rem; min-width: 0; }
.demo-free button { padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-3); color: var(--text); cursor: pointer; font-size: .9rem; }
.demo-state { padding: 18px 20px; font-size: .88rem; }
.demo-state h4 { color: var(--muted); font-size: .78rem; letter-spacing: .1em; margin-bottom: 10px; }
.demo-state dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; }
.demo-state dt { color: var(--muted); }
.demo-state dd { margin: 0; color: var(--text-2); }
.demo-state dd.is-changed { color: #fff; background: var(--accent-soft); border-radius: 4px; padding: 0 6px; }
.demo-log { margin: 14px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); padding-top: 10px; max-height: 190px; overflow: auto; }
.demo-log li { margin: 0 0 6px; padding-left: 12px; border-left: 2px solid var(--accent); color: var(--text-2); font-size: .84rem; }
.demo-log li.is-warn { border-left-color: var(--warn); }
.demo-log li.is-choice { border-left-color: var(--choice); }
.demo-foot { padding: 10px 18px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.demo-foot button { background: transparent; border: 1px solid var(--line-2); color: var(--text-2); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: .8rem; }

/* ---------- Articles ---------- */
.article-list { display: grid; gap: clamp(28px, 4vw, 48px); }
.article {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(20px, 3vw, 36px); scroll-margin-top: 80px;
}
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: 12px; }
.article-meta time { font-family: var(--mono); font-size: .8rem; }
.article h2, .article > h3.article-title { font-size: clamp(1.2rem, 2vw, 1.5rem); line-height: 1.5; margin-bottom: 16px; }
.article-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 26px; align-items: start; }
.article-body p { color: var(--text-2); }
.article-body p:first-of-type { color: var(--text); }
.article-body h3 { margin-top: 1.3em; font-size: 1.05rem; color: #fff; }
.article-body h4 { margin-top: 1.1em; color: var(--text); }
.article-figure { margin: 0 0 16px; }
.article-figure img { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); }
.article-figure figcaption { font-size: .8rem; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.article-aside { position: sticky; top: 84px; display: grid; gap: 16px; }
.article-structure { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.article-structure h4 { font-size: .8rem; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; margin-bottom: 10px; }
.article-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 600; }
.article-link::after { content: "→"; }
.article-quote { border-left: 3px solid var(--accent); padding: 10px 16px; margin: 18px 0; background: var(--accent-soft); border-radius: 0 8px 8px 0; color: #fff; font-size: 1rem; }
.article-quote p { margin: 0; }

/* structures used by the 8 core articles */
.firewall { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; font-size: .86rem; }
.firewall .fw-box { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--text-2); }
.firewall .fw-box strong { display: block; color: var(--text); margin-bottom: 4px; }
.firewall .fw-wall { width: 14px; border-radius: 6px; background: repeating-linear-gradient(45deg, var(--warn), var(--warn) 6px, transparent 6px, transparent 12px); opacity: .8; }
.firewall .fw-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.firewall .fw-list li { margin: 0; padding: 6px 10px; border-radius: 6px; background: var(--bg-3); border: 1px solid var(--line); }
.firewall .fw-list li.is-secret { border-color: rgba(230, 145, 61, .5); }

.packet { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .86rem; }
.packet dt { color: var(--muted); padding-top: 2px; }
.packet dd { margin: 0; color: var(--text-2); padding: 2px 8px; background: var(--bg-3); border-radius: 4px; border: 1px solid var(--line); }
.packet dd.is-warn { border-color: rgba(230, 145, 61, .5); color: #ffd9b3; }

.stack { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.stack li { margin: 0; padding: 8px 12px; border-radius: 6px; border: 1px solid var(--line); font-size: .86rem; color: var(--text-2); display: flex; justify-content: space-between; gap: 10px; }
.stack li span:last-child { color: var(--muted); font-size: .78rem; }
.stack li:nth-child(1) { background: rgba(196, 107, 184, .22); }
.stack li:nth-child(2) { background: rgba(196, 107, 184, .18); }
.stack li:nth-child(3) { background: rgba(196, 107, 184, .14); }
.stack li:nth-child(4) { background: rgba(93, 95, 239, .18); }
.stack li:nth-child(5) { background: rgba(93, 95, 239, .14); }
.stack li:nth-child(6) { background: rgba(58, 183, 212, .14); }
.stack li:nth-child(7) { background: rgba(58, 183, 212, .1); }
.stack li:nth-child(8) { background: rgba(230, 145, 61, .14); }

.layers { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.layers li { margin: 0; padding: 8px 12px; border-radius: 6px; background: var(--bg-3); border: 1px solid var(--line); font-size: .86rem; color: var(--text-2); }
.layers li strong { color: var(--text); margin-right: 8px; }
.layers li:nth-child(odd) { margin-left: 0; }
.layers li:nth-child(2) { margin-left: 8px; }
.layers li:nth-child(3) { margin-left: 16px; }
.layers li:nth-child(4) { margin-left: 24px; }
.layers li:nth-child(5) { margin-left: 32px; }
.layers li:nth-child(6) { margin-left: 40px; }
.layers li:nth-child(7) { margin-left: 48px; border-color: rgba(58, 183, 212, .5); }

.boundary { display: grid; gap: 0; }
.boundary div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: .86rem; color: var(--text-2); }
.boundary div div { margin-top: 8px; }
.boundary > div { background: rgba(93, 95, 239, .1); }
.boundary > div > div { background: rgba(93, 95, 239, .08); }
.boundary > div > div > div { background: rgba(58, 183, 212, .08); }
.boundary > div > div > div > div { background: rgba(58, 183, 212, .12); border-color: rgba(58, 183, 212, .45); }
.boundary strong { color: var(--text); }

.agency-map { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; font-size: .84rem; }
.agency-map .viewer { background: var(--choice-soft); border: 1px solid rgba(58, 183, 212, .45); border-radius: 8px; padding: 8px 10px; color: var(--text-2); }
.agency-map .viewer strong { color: #fff; display: block; }
.agency-map .wide { grid-column: 1 / -1; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; color: var(--text-2); position: relative; }
.agency-map .wide::before { content: "↓"; position: absolute; left: 50%; top: -18px; transform: translateX(-50%); color: var(--accent-2); }
.agency-map .wide.is-warn { border-color: rgba(230, 145, 61, .5); }
.agency-map .wide.is-end { border-color: rgba(93, 95, 239, .5); }

/* ---------- Observations ---------- */
.observe-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.observe { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; border-top: 3px solid var(--char); display: flex; flex-direction: column; }
.observe h3 { font-size: 1.05rem; line-height: 1.55; }
.observe p { color: var(--text-2); font-size: .93rem; }
.observe p:last-child { margin-bottom: 0; }

/* ---------- Trends ---------- */
.trend-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: trend; }
.trend { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; }
.trend::before { counter-increment: trend; content: "0" counter(trend); font-family: var(--mono); color: var(--accent-2); font-size: .8rem; letter-spacing: .1em; }
.trend h3 { font-size: 1rem; margin: 8px 0 10px; }
.trend p { color: var(--text-2); font-size: .9rem; margin: 0; }

/* ---------- Capability map ---------- */
.cap-map { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cap-col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.cap-col h3 { display: flex; align-items: center; gap: 8px; }
.cap-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .9rem; color: var(--text-2); }
.cap-col li { margin: 0; padding: 6px 10px; background: var(--bg-3); border-radius: 6px; border: 1px solid var(--line); }
.cap-col li strong { color: var(--text); }

/* ---------- Latest lists (回流首页) ---------- */
.latest-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.latest-list--4 { grid-template-columns: repeat(2, 1fr); }
.latest-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; }
.latest-item h3 { font-size: 1rem; line-height: 1.55; }
.latest-item h3 a { color: var(--text); }
.latest-item h3 a:hover { color: var(--choice); }
.latest-item .article-meta { margin-bottom: 8px; }
.latest-item p { color: var(--text-2); font-size: .92rem; flex: 1; }
.section-link { margin-top: 18px; }

/* ---------- Q&A ---------- */
.qa-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.qa { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.qa h3 { font-size: 1rem; color: #fff; margin-bottom: 6px; }
.qa p { color: var(--text-2); font-size: .92rem; margin: 0; }
.qa--warn { border-left: 3px solid var(--warn); }
.qa--choice { border-left: 3px solid var(--choice); }
.qa--char { border-left: 3px solid var(--char); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0 18px; }
.faq details[open] { border-color: rgba(93, 95, 239, .5); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent-2); font-size: 1.2rem; flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq .faq-body { padding: 0 0 16px; color: var(--text-2); font-size: .93rem; }
.faq .faq-body p:last-child { margin: 0; }

/* ---------- Timeline / Film strip ---------- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; display: grid; gap: 0; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--line-2); }
.timeline li { position: relative; margin: 0; padding: 6px 0 16px 36px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.timeline li.is-choice::before { border-color: var(--choice); }
.timeline li.is-warn::before { border-color: var(--warn); }
.timeline li.is-char::before { border-color: var(--char); }
.timeline .t-time { font-family: var(--mono); font-size: .78rem; color: var(--muted); letter-spacing: .05em; }
.timeline .t-title { display: block; color: var(--text); font-weight: 600; }
.timeline p { color: var(--text-2); font-size: .9rem; margin: 2px 0 0; }
.timeline li.is-active .t-title { color: var(--choice); }

.filmstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; position: relative; }
.filmstrip::before, .filmstrip::after { content: ""; position: absolute; left: 0; right: 0; height: 6px; background: repeating-linear-gradient(90deg, var(--line-2) 0 10px, transparent 10px 20px); opacity: .6; }
.filmstrip::before { top: 3px; }
.filmstrip::after { bottom: 3px; }
.frame { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px; font-size: .82rem; color: var(--text-2); min-height: 92px; }
.frame strong { display: block; color: var(--text); font-size: .85rem; }
.frame.is-generated { border-style: dashed; border-color: rgba(58, 183, 212, .6); }
.frame.is-anchor { border-color: rgba(93, 95, 239, .6); }
.frame .frame-tag { font-size: .7rem; color: var(--muted); letter-spacing: .08em; }

/* ---------- Character sheet / Memory log / Scene packet / Relationship graph ---------- */
.char-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; background: var(--panel); border: 1px solid rgba(196, 107, 184, .4); border-radius: var(--radius); padding: 22px; }
.char-sheet header { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.char-sheet .avatar { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, var(--char), #4a2a47); flex: none; }
.char-sheet dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .9rem; }
.char-sheet dd { margin: 0; color: var(--text-2); }
.char-sheet .is-secret { color: #ffd9b3; }

.memory-log { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; font-family: var(--mono); font-size: .82rem; overflow: hidden; }
.memory-log header { padding: 8px 14px; background: var(--bg-3); border-bottom: 1px solid var(--line); color: var(--muted); font-family: var(--font); font-size: .8rem; letter-spacing: .08em; }
.memory-log ul { list-style: none; margin: 0; padding: 10px 14px; display: grid; gap: 6px; }
.memory-log li { margin: 0; display: grid; grid-template-columns: 64px 110px 1fr; gap: 10px; color: var(--text-2); }
.memory-log .m-time { color: var(--muted); }
.memory-log .m-type { color: var(--choice); }
.memory-log .m-type.is-state { color: var(--accent-2); }
.memory-log .m-type.is-rel { color: var(--char); }
.memory-log .m-type.is-warn { color: var(--warn); }

.scene-packet { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.scene-packet header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 12px; font-family: var(--mono); font-size: .82rem; color: var(--muted); }
.scene-packet dl { display: grid; grid-template-columns: repeat(2, auto 1fr); gap: 6px 12px; font-size: .9rem; }
.scene-packet dd { margin: 0; color: var(--text-2); }

.rel-graph { display: grid; gap: 8px; }
.rel-row { display: grid; grid-template-columns: 120px 1fr 90px; gap: 10px; align-items: center; font-size: .88rem; }
.rel-row .rel-name { color: var(--text); }
.rel-bar { height: 8px; background: var(--bg-3); border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.rel-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--char), var(--accent)); }
.rel-row .rel-note { color: var(--muted); font-size: .8rem; text-align: right; }

/* ---------- App features / download ---------- */
.feature-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: feature; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.feature::before { counter-increment: feature; content: counter(feature, decimal-leading-zero); font-family: var(--mono); color: var(--choice); font-size: .8rem; letter-spacing: .1em; }
.feature h3 { font-size: 1rem; margin: 6px 0 8px; }
.feature p { color: var(--text-2); font-size: .9rem; margin: 0; }
.download-box { background: linear-gradient(135deg, rgba(93, 95, 239, .18), rgba(58, 183, 212, .1)); border: 1px solid rgba(93, 95, 239, .45); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; align-items: center; }
.download-box ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.download-box li { margin: 0; padding: 10px 14px; background: rgba(10, 13, 22, .6); border: 1px solid var(--line); border-radius: 8px; font-size: .92rem; color: var(--text-2); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.download-box li strong { color: var(--text); }
.download-box li span { color: var(--muted); font-size: .82rem; }

/* ---------- About / Footer ---------- */
.about-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 28px; align-items: start; }
.about-grid .prose p { color: var(--text-2); }
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 40px 0 24px; font-size: .88rem; color: var(--text-2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.footer-grid h4 { color: var(--text); font-size: .9rem; margin-bottom: 10px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { color: var(--text-2); }
.footer-grid a:hover { color: var(--choice); }
.footer-note { font-size: .8rem; color: var(--muted); line-height: 1.7; }
.footer-meta { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .8rem; color: var(--muted); }
.footer-meta span { white-space: nowrap; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .site-nav a { padding: 8px 8px; font-size: .86rem; }
  .trend-grid, .feature-list, .agency-map { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .hero-inner, .page-hero .hero-inner { grid-template-columns: 1fr; }
  .article-grid { grid-template-columns: 1fr; }
  .article-aside { position: static; }
  .state-grid, .observe-list, .latest-list, .cap-map, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .flow-compare, .about-grid, .download-box { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 10px var(--gutter) 16px; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 4px; }
  .site-nav a { white-space: normal; padding: 10px 12px; }
}
@media (max-width: 768px) {
  body { font-size: 15.5px; }
  .state-grid, .observe-list, .latest-list, .latest-list--4, .cap-map, .grid-2, .grid-3, .grid-4, .qa-grid, .trend-grid, .feature-list { grid-template-columns: 1fr; }
  .demo-body { grid-template-columns: 1fr; }
  .demo-stage { border-right: 0; border-bottom: 1px solid var(--line); }
  .pipeline { flex-direction: column; }
  .pipeline li { min-width: 0; }
  .pipeline li::after { content: "↓"; right: auto; left: 22px; top: auto; bottom: -19px; transform: none; }
  .pipeline li:last-child::after { content: none; }
  .state-list { columns: 1; }
  .firewall { grid-template-columns: 1fr; }
  .firewall .fw-wall { width: auto; height: 10px; }
  .agency-map { grid-template-columns: 1fr 1fr; }
  .char-sheet { grid-template-columns: 1fr; }
  .scene-packet dl { grid-template-columns: auto 1fr; }
  .rel-row { grid-template-columns: 90px 1fr 70px; }
  .memory-log li { grid-template-columns: 52px 90px 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .layers li { margin-left: 0 !important; }
  .article { padding: 18px; }
}
@media (max-width: 480px) {
  .hero-actions .btn { width: 100%; justify-content: center; }
  .agency-map { grid-template-columns: 1fr; }
  .brand small { display: none; }
  .memory-log li { grid-template-columns: 1fr; gap: 2px; }
  .rel-row { grid-template-columns: 1fr; gap: 4px; }
  .rel-row .rel-note { text-align: left; }
  .demo-free { flex-direction: column; }
}
