/* ==========================================================
   三叶映画 TRIFOLIA · Design System
   方向：暗房胶片 × 编辑排版。墨黑底、纸白字、嫩叶绿点缀、琥珀暖光。
   ========================================================== */
:root {
  --ink: #0b0d0a;
  --ink-2: #111410;
  --ink-3: #171b15;
  --line: rgba(236, 231, 218, .09);
  --line-2: rgba(236, 231, 218, .16);
  --paper: #ece7da;
  --paper-2: #b9b5a8;
  --mute: #7d7f74;
  --leaf: #c8f25a;
  --leaf-deep: #8fb52a;
  --leaf-ghost: rgba(200, 242, 90, .1);
  --amber: #f2b544;
  --rust: #ff7a59;
  --danger: #ff6b5b;

  --f-display: 'Fraunces', 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  --f-cn-display: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  --f-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

  --r-s: 8px; --r: 14px; --r-l: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);
  --topbar: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--ink); color: var(--paper);
  font: 15px/1.65 var(--f-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--leaf); color: var(--ink); }
:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; border-radius: 4px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2e26; border-radius: 10px; border: 3px solid var(--ink); }
::-webkit-scrollbar-track { background: transparent; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 999; background: var(--leaf); color: var(--ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* 胶片颗粒 */
.grain {
  position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%,100% { transform: translate(0,0) } 20% { transform: translate(-3%,2%) } 40% { transform: translate(2%,-4%) } 60% { transform: translate(-4%,-1%) } 80% { transform: translate(3%,3%) } }
@media (prefers-reduced-motion: reduce) { .grain { animation: none; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar);
  display: flex; align-items: center; gap: 28px; padding: 0 28px;
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-cn-display); font-weight: 900; font-size: 19px; letter-spacing: .04em; }
.brand img { width: 30px; height: 30px; }
.brand small { font: italic 400 13px var(--f-display); color: var(--mute); letter-spacing: .12em; margin-left: 2px; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 7px 14px; border-radius: 999px; color: var(--paper-2); font-size: 14px; transition: color .2s, background .2s; }
.nav a:hover { color: var(--paper); background: rgba(255,255,255,.04); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--paper); }
.topbar .spacer { flex: 1; }
.credit-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px;
  border: 1px solid var(--line-2); font: 600 13px var(--f-mono); color: var(--leaf);
}
.credit-chip .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--leaf-ghost); display: grid; place-items: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--leaf), var(--amber)); color: var(--ink); font-weight: 700; font-size: 14px; border: 0; }
.menu-btn { display: none; background: none; border: 0; padding: 6px; }

/* ---------- 按钮 / 表单 ---------- */
.btn {
  --bg: rgba(255,255,255,.05); --fg: var(--paper); --bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--bd);
  background: var(--bg); color: var(--fg); font-weight: 500; font-size: 14px; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { border-color: var(--paper-2); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.primary { --bg: var(--leaf); --fg: var(--ink); --bd: var(--leaf); font-weight: 700; }
.btn.primary:hover { box-shadow: 0 0 0 6px var(--leaf-ghost), 0 10px 30px -10px var(--leaf); }
.btn.ghost { --bg: transparent; --bd: transparent; }
.btn.ghost:hover { --bg: rgba(255,255,255,.05); }
.btn.danger { --fg: var(--danger); --bd: rgba(255,107,91,.35); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 52px; padding: 0 28px; font-size: 16px; }
.btn.block { width: 100%; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > label, .label { font-size: 12px; letter-spacing: .08em; color: var(--mute); text-transform: uppercase; font-family: var(--f-mono); }
.input, .select, .textarea {
  width: 100%; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--r-s);
  padding: 10px 12px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--leaf); box-shadow: 0 0 0 4px var(--leaf-ghost); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.hint { font-size: 12px; color: var(--mute); }

.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--paper-2); font-size: 13px;
  transition: all .18s;
}
.seg button:hover { color: var(--paper); border-color: var(--paper-2); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }

.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #2a2e26; transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--leaf); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--ink); }
.switch input:focus-visible + span { outline: 2px solid var(--leaf); outline-offset: 2px; }

.range { width: 100%; accent-color: var(--leaf); }

/* ---------- 通用 ---------- */
.wrap { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }
.eyebrow { font: 500 12px var(--f-mono); letter-spacing: .22em; text-transform: uppercase; color: var(--leaf); }
.h-display { font-family: var(--f-cn-display); font-weight: 900; letter-spacing: -.01em; line-height: 1.08; margin: 0; }
.h-display em { font-family: var(--f-display); font-style: italic; font-weight: 400; color: var(--leaf); letter-spacing: -.02em; }
.muted { color: var(--mute); }
.mono { font-family: var(--f-mono); }
.card { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; border: 1px solid var(--line-2); color: var(--paper-2); }
.tag.leaf { color: var(--leaf); border-color: rgba(200,242,90,.35); background: var(--leaf-ghost); }
.tag.amber { color: var(--amber); border-color: rgba(242,181,68,.35); }
.tag.danger { color: var(--danger); border-color: rgba(255,107,91,.35); }
.empty { padding: 60px 20px; text-align: center; color: var(--mute); }
.empty svg { width: 46px; height: 46px; margin: 0 auto 12px; opacity: .5; }
.page { padding: 40px 0 80px; animation: rise .5s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(30px, 4vw, 44px); }
.icon { width: 18px; height: 18px; flex: none; }

/* ---------- 首页 ---------- */
.hero { position: relative; min-height: calc(100vh - var(--topbar)); display: grid; align-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg video { width: 100%; height: 100%; object-fit: cover; opacity: .32; filter: saturate(.8) contrast(1.1); }
.hero-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 80% at 70% 30%, transparent, var(--ink) 75%), linear-gradient(to top, var(--ink), transparent 40%); }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.25fr 1fr; gap: 60px; align-items: center; padding: 60px 0; }
.hero h1 { font-size: clamp(46px, 7.4vw, 108px); }
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span { display: inline-block; animation: lineUp 1s var(--ease) both; }
.hero h1 .line:nth-child(2) > span { animation-delay: .12s; }
.hero h1 .line:nth-child(3) > span { animation-delay: .24s; }
@keyframes lineUp { from { transform: translateY(105%); } }
.hero .lead { font-size: 18px; color: var(--paper-2); max-width: 520px; margin: 28px 0 36px; animation: rise .8s .4s var(--ease) both; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; animation: rise .8s .5s var(--ease) both; }
.hero .meta { display: flex; gap: 36px; margin-top: 56px; animation: rise .8s .6s var(--ease) both; }
.hero .meta b { display: block; font: 400 34px var(--f-display); color: var(--paper); }
.hero .meta span { font-size: 12px; color: var(--mute); letter-spacing: .1em; }

.prompt-demo { position: relative; animation: rise 1s .5s var(--ease) both; }
.prompt-demo .frame { aspect-ratio: 4/5; border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line-2); box-shadow: var(--shadow); position: relative; background: var(--ink-3); }
.prompt-demo .frame video { width: 100%; height: 100%; object-fit: cover; }
.prompt-demo .frame::after { content: 'REC ● 00:00:05:12'; position: absolute; top: 14px; left: 16px; font: 11px var(--f-mono); color: var(--rust); letter-spacing: .1em; }
.prompt-demo .bubble {
  position: absolute; left: -40px; bottom: 36px; right: 40px; padding: 16px 18px; border-radius: var(--r);
  background: color-mix(in srgb, var(--ink) 80%, transparent); backdrop-filter: blur(16px); border: 1px solid var(--line-2);
  font-size: 14px;
}
.prompt-demo .bubble .label { margin-bottom: 6px; display: block; }
.typing::after { content: '▍'; color: var(--leaf); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.marquee { border-bottom: 1px solid var(--line); overflow: hidden; padding: 18px 0; white-space: nowrap; }
.marquee div { display: inline-flex; gap: 48px; animation: scroll 40s linear infinite; font: italic 300 28px var(--f-display); color: var(--paper-2); }
.marquee span::after { content: '✳'; margin-left: 48px; color: var(--leaf); font-style: normal; font-size: 18px; vertical-align: middle; }
@keyframes scroll { to { transform: translateX(-50%); } }

.section { padding: 110px 0; border-bottom: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 56px; align-items: end; }
.section-head h2 { font-size: clamp(34px, 4.6vw, 60px); }
.section-head p { color: var(--paper-2); max-width: 460px; justify-self: end; }

.leaves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.leaf-card { background: var(--ink); padding: 36px 32px 40px; position: relative; min-height: 340px; display: flex; flex-direction: column; transition: background .3s; }
.leaf-card:hover { background: var(--ink-2); }
.leaf-card .no { font: italic 300 72px/1 var(--f-display); color: var(--leaf); opacity: .9; }
.leaf-card h3 { font: 700 24px var(--f-cn-display); margin: 28px 0 10px; }
.leaf-card p { color: var(--paper-2); margin: 0 0 20px; }
.leaf-card ul { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 8px; }

.tools-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.tool-tile { grid-column: span 2; position: relative; border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line); background: var(--ink-2); min-height: 260px; padding: 26px; display: flex; flex-direction: column; justify-content: end; isolation: isolate; transition: transform .35s var(--ease), border-color .3s; }
.tool-tile:nth-child(1), .tool-tile:nth-child(2) { grid-column: span 3; min-height: 320px; }
.tool-tile:hover { transform: translateY(-4px); border-color: var(--line-2); }
.tool-tile .bg { position: absolute; inset: 0; z-index: -1; opacity: .55; transition: opacity .4s, transform .8s var(--ease); }
.tool-tile:hover .bg { opacity: .8; transform: scale(1.04); }
.tool-tile .bg video, .tool-tile .bg img { width: 100%; height: 100%; object-fit: cover; }
.tool-tile::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, var(--ink) 15%, transparent 80%); }
.tool-tile h3 { margin: 0 0 6px; font: 700 22px var(--f-cn-display); display: flex; align-items: center; gap: 10px; }
.tool-tile p { margin: 0; color: var(--paper-2); font-size: 14px; }
.tool-tile .arrow { position: absolute; top: 22px; right: 22px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; transition: background .3s, color .3s, transform .3s; }
.tool-tile:hover .arrow { background: var(--leaf); color: var(--ink); transform: rotate(-45deg); }

.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; counter-reset: s; }
.pipeline li { list-style: none; border-top: 1px solid var(--line-2); padding: 22px 20px 0 0; position: relative; }
.pipeline li::before { counter-increment: s; content: '0' counter(s); font: 12px var(--f-mono); color: var(--leaf); position: absolute; top: -9px; background: var(--ink); padding-right: 10px; }
.pipeline b { display: block; font: 700 18px var(--f-cn-display); margin-bottom: 6px; }
.pipeline span { color: var(--mute); font-size: 14px; }

.cta-band { padding: 120px 0; text-align: center; position: relative; overflow: hidden; }
.cta-band h2 { font-size: clamp(40px, 6vw, 84px); }
.cta-band::before { content: ''; position: absolute; width: 700px; height: 700px; left: 50%; top: 50%; transform: translate(-50%,-50%); background: radial-gradient(circle, rgba(200,242,90,.16), transparent 60%); z-index: -1; }

.footer { padding: 44px 0 50px; color: var(--mute); font-size: 13px; border-top: 1px solid var(--line); }
.footer[hidden] { display: none; }
.footer .wrap { display: grid; grid-template-columns: 1fr auto; gap: 18px 40px; }
.footer .f-brand { display: flex; flex-direction: column; gap: 6px; }
.footer .f-brand b { color: var(--paper); font: 700 16px var(--f-serif, inherit); }
.footer .f-links { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--paper-2); }
.footer a:hover { color: var(--leaf); }
.footer .f-legal { grid-column: 1 / -1; display: flex; gap: 8px 22px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; }
@media (max-width: 720px) { .footer .wrap { grid-template-columns: 1fr; } }
.legal { max-width: 780px; margin: 0 auto; line-height: 1.85; color: var(--paper-2); }
.legal h1 { font: 700 34px var(--f-serif, inherit); color: var(--paper); margin: 0 0 8px; }
.legal h2 { font-size: 19px; color: var(--paper); margin: 34px 0 10px; }
.legal ol, .legal ul { padding-left: 1.4em; }
.agree { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--paper-2); margin: 4px 0 16px; line-height: 1.5; }
.agree input { margin-top: 3px; accent-color: var(--leaf); }
.agree a { color: var(--leaf); }

/* ---------- 工作台 ---------- */
.studio { display: grid; grid-template-columns: 76px 380px 1fr; height: calc(100vh - var(--topbar)); }
.rail { border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 6px; background: var(--ink); }
.rail button {
  display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; border: 1px solid transparent; background: none; color: var(--mute); font-size: 11px;
  transition: color .2s, background .2s;
}
.rail button .icon { width: 22px; height: 22px; }
.rail button:hover { color: var(--paper); background: rgba(255,255,255,.03); }
.rail button[aria-pressed="true"] { color: var(--leaf); background: var(--leaf-ghost); border-color: rgba(200,242,90,.2); }
.rail hr { border: 0; border-top: 1px solid var(--line); width: 60%; margin: 6px auto; }

.panel { border-right: 1px solid var(--line); overflow-y: auto; background: var(--ink-2); display: flex; flex-direction: column; }
.panel-body { padding: 22px 22px 10px; flex: 1; }
.panel h2 { font: 700 22px var(--f-cn-display); margin: 0 0 4px; }
.panel .sub { color: var(--mute); font-size: 13px; margin: 0 0 22px; }
.panel-foot { position: sticky; bottom: 0; padding: 16px 22px 20px; background: linear-gradient(to top, var(--ink-2) 70%, transparent); border-top: 1px solid var(--line); }
.cost-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--mute); margin-bottom: 10px; }
.cost-line b { color: var(--leaf); font-family: var(--f-mono); }

.prompt-box { position: relative; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--ink); transition: border-color .2s, box-shadow .2s; }
.prompt-box:focus-within { border-color: var(--leaf); box-shadow: 0 0 0 4px var(--leaf-ghost); }
.prompt-box textarea { width: 100%; min-height: 130px; border: 0; background: transparent; padding: 14px 14px 4px; resize: vertical; outline: none; line-height: 1.7; }
.prompt-box .bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 8px 14px; }
.prompt-box .count { font: 11px var(--f-mono); color: var(--mute); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips button { font-size: 12px; padding: 4px 10px; border-radius: 99px; border: 1px dashed var(--line-2); background: none; color: var(--paper-2); transition: all .15s; }
.chips button:hover { border-style: solid; border-color: var(--leaf); color: var(--leaf); }

.dropzone {
  border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 22px; text-align: center; color: var(--mute); position: relative; cursor: pointer;
  transition: border-color .2s, background .2s; overflow: hidden; min-height: 150px; display: grid; place-items: center;
}
.dropzone:hover, .dropzone.over { border-color: var(--leaf); background: var(--leaf-ghost); color: var(--paper); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone img { max-height: 220px; border-radius: 8px; margin: 0 auto; }
.dropzone .clear { position: absolute; top: 8px; right: 8px; z-index: 2; }

.advanced summary { cursor: pointer; font-size: 13px; color: var(--paper-2); padding: 8px 0; list-style: none; display: flex; align-items: center; gap: 6px; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: '+'; font-family: var(--f-mono); color: var(--leaf); width: 14px; }
.advanced[open] summary::before { content: '−'; }

.canvas { overflow-y: auto; display: flex; flex-direction: column; background:
  radial-gradient(circle at 1px 1px, rgba(236,231,218,.06) 1px, transparent 0) 0 0 / 22px 22px, var(--ink); }
.stage { padding: 28px; flex: none; }
.stage-frame {
  border-radius: var(--r-l); border: 1px solid var(--line); background: var(--ink-2); min-height: 420px; display: grid; place-items: center; overflow: hidden; position: relative;
}
.stage-frame img, .stage-frame video { max-height: 62vh; width: auto; margin: 0 auto; }
.stage-multi { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; width: 100%; }
.stage-multi img { width: 100%; max-height: none; aspect-ratio: auto; }
.stage-empty { text-align: center; color: var(--mute); padding: 40px; }
.stage-empty .big { font: italic 300 56px var(--f-display); color: var(--paper-2); display: block; margin-bottom: 8px; }
.stage-actions { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.stage-actions .p { color: var(--paper-2); font-size: 13px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.progress-ring { display: grid; justify-items: center; gap: 18px; color: var(--paper-2); }
.progress-ring svg { width: 120px; height: 120px; transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 3; }
.progress-ring .t { stroke: var(--line-2); }
.progress-ring .v { stroke: var(--leaf); stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.progress-ring .pct { position: absolute; font: 400 30px var(--f-display); color: var(--paper); }
.progress-ring .ring { position: relative; display: grid; place-items: center; }
.scanline { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent, rgba(200,242,90,.08), transparent); height: 30%; animation: scan 2.4s ease-in-out infinite; }
@keyframes scan { from { transform: translateY(-100%); } to { transform: translateY(400%); } }

.history { padding: 0 28px 40px; }
.history-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.history-head h3 { margin: 0; font: 700 16px var(--f-cn-display); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--ink-3); cursor: pointer; padding: 0; transition: border-color .2s, transform .2s; }
.thumb:hover { border-color: var(--leaf); transform: translateY(-2px); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .badge { position: absolute; left: 6px; top: 6px; font: 10px var(--f-mono); padding: 2px 6px; border-radius: 6px; background: rgba(11,13,10,.75); color: var(--paper); backdrop-filter: blur(6px); }
.thumb .state { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--paper-2); background: rgba(11,13,10,.6); }
.thumb .state.fail { color: var(--danger); }

/* ---------- 作品广场 ---------- */
.masonry { columns: 4 260px; column-gap: 14px; }
.work { break-inside: avoid; margin-bottom: 14px; border-radius: var(--r); overflow: hidden; position: relative; border: 1px solid var(--line); background: var(--ink-2); cursor: zoom-in; }
.work img, .work video { width: 100%; }
.work .over { position: absolute; inset: auto 0 0; padding: 30px 14px 12px; background: linear-gradient(to top, rgba(11,13,10,.95), transparent); opacity: 0; transform: translateY(6px); transition: all .25s var(--ease); font-size: 13px; }
.work:hover .over, .work:focus-visible .over { opacity: 1; transform: none; }
.work .over p { margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.work .over .row { display: flex; justify-content: space-between; color: var(--mute); font-size: 12px; }
.work .feat { position: absolute; top: 10px; left: 10px; }

/* ---------- 定价 ---------- */
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.plan { padding: 30px 26px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--ink-2); display: flex; flex-direction: column; position: relative; transition: transform .3s var(--ease), border-color .3s; }
.plan:hover { transform: translateY(-4px); border-color: var(--line-2); }
.plan.hot { border-color: var(--leaf); background: linear-gradient(180deg, rgba(200,242,90,.08), var(--ink-2) 50%); }
.plan h3 { margin: 0 0 18px; font: 700 20px var(--f-cn-display); display: flex; justify-content: space-between; align-items: center; }
.plan .price { font: 400 52px/1 var(--f-display); margin-bottom: 4px; }
.plan .price small { font-size: 18px; color: var(--mute); margin-right: 4px; }
.plan .credits { color: var(--leaf); font-family: var(--f-mono); font-size: 14px; margin-bottom: 22px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 8px; font-size: 14px; color: var(--paper-2); }
.plan li::before { content: '✓'; color: var(--leaf); margin-right: 8px; }
.plan .btn { margin-top: auto; }
.price-table { width: 100%; border-collapse: collapse; margin-top: 40px; }
.price-table td, .price-table th { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
.price-table th { color: var(--mute); font-weight: 400; font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; }

/* ---------- 对话 ---------- */
.chat { display: grid; grid-template-columns: 280px 1fr; height: calc(100vh - var(--topbar)); }
.chat-side { border-right: 1px solid var(--line); background: var(--ink-2); display: flex; flex-direction: column; min-height: 0; }
.chat-side .top { padding: 16px; border-bottom: 1px solid var(--line); }
.conv-list { flex: 1; overflow-y: auto; padding: 8px; }
.conv { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; border: 0; background: none; color: var(--paper-2); font-size: 14px; }
.conv span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv:hover { background: rgba(255,255,255,.04); color: var(--paper); }
.conv[aria-current="true"] { background: var(--leaf-ghost); color: var(--leaf); }
.conv .del { opacity: 0; padding: 2px; background: none; border: 0; color: var(--mute); }
.conv:hover .del { opacity: 1; }
.chat-main { display: flex; flex-direction: column; min-height: 0; }
.msgs { flex: 1; overflow-y: auto; padding: 30px 0; }
.msgs .inner { width: min(780px, calc(100% - 40px)); margin: 0 auto; display: grid; gap: 26px; }
.msg { display: grid; grid-template-columns: 34px 1fr; gap: 14px; animation: rise .35s var(--ease) both; }
.msg .who { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.msg.user .who { background: var(--ink-3); border: 1px solid var(--line-2); }
.msg.assistant .who { background: var(--leaf); color: var(--ink); }
.msg .body { min-width: 0; padding-top: 4px; }
.msg.user .body { color: var(--paper); }
.md p { margin: 0 0 12px; } .md p:last-child { margin: 0; }
.md h1, .md h2, .md h3 { font-family: var(--f-cn-display); margin: 18px 0 8px; font-size: 18px; }
.md ul, .md ol { padding-left: 20px; margin: 0 0 12px; }
.md blockquote { margin: 0 0 12px; padding: 8px 14px; border-left: 2px solid var(--leaf); background: var(--leaf-ghost); border-radius: 0 8px 8px 0; color: var(--paper); }
.md code { font-family: var(--f-mono); font-size: 13px; background: var(--ink-3); padding: 1px 6px; border-radius: 4px; }
.md pre { background: var(--ink-3); border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow-x: auto; margin: 0 0 12px; position: relative; }
.md pre code { background: none; padding: 0; white-space: pre-wrap; }
.md pre.prompt { border-color: rgba(200,242,90,.35); }
.md pre .tools { display: flex; gap: 6px; margin-top: 10px; }
.md strong { color: var(--paper); }
.composer { padding: 12px 0 22px; }
.composer .box { width: min(780px, calc(100% - 40px)); margin: 0 auto; border: 1px solid var(--line-2); border-radius: var(--r-l); background: var(--ink-2); padding: 10px; transition: border-color .2s, box-shadow .2s; }
.composer .box:focus-within { border-color: var(--leaf); box-shadow: 0 0 0 4px var(--leaf-ghost); }
.composer textarea { width: 100%; border: 0; background: none; resize: none; outline: none; padding: 6px 8px; max-height: 200px; line-height: 1.6; }
.composer .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.welcome { text-align: center; padding: 60px 20px 20px; }
.welcome h2 { font-size: 42px; margin-bottom: 10px; }
.starter { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 30px; text-align: left; }
.starter button { padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--ink-2); color: var(--paper-2); font-size: 14px; transition: all .2s; }
.starter button:hover { border-color: var(--leaf); color: var(--paper); }
.starter b { display: block; color: var(--paper); margin-bottom: 2px; font-size: 14px; }

/* ---------- 个人中心 / 后台 ---------- */
.dash { display: grid; grid-template-columns: 220px 1fr; gap: 32px; }
.side-nav { display: grid; gap: 2px; align-content: start; position: sticky; top: calc(var(--topbar) + 30px); }
.side-nav a { padding: 10px 14px; border-radius: 10px; color: var(--paper-2); font-size: 14px; display: flex; align-items: center; gap: 10px; }
.side-nav a:hover { background: rgba(255,255,255,.04); color: var(--paper); }
.side-nav a[aria-current="page"] { background: var(--ink-3); color: var(--leaf); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat { padding: 20px; border-radius: var(--r); border: 1px solid var(--line); background: var(--ink-2); }
.stat .k { font: 12px var(--f-mono); color: var(--mute); letter-spacing: .1em; }
.stat .v { font: 400 36px/1.2 var(--f-display); margin-top: 6px; }
.stat .v.leaf { color: var(--leaf); }
.balance-card { padding: 30px; border-radius: var(--r-l); border: 1px solid var(--line); margin-bottom: 24px; background: radial-gradient(120% 140% at 100% 0%, rgba(200,242,90,.16), transparent 50%), var(--ink-2); display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; }
.balance-card .num { font: 300 72px/1 var(--f-display); color: var(--leaf); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--ink-2); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font: 500 11px var(--f-mono); letter-spacing: .1em; color: var(--mute); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; text-transform: uppercase; }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr:hover td { background: rgba(255,255,255,.015); }
table.t .ellipsis { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.t .mini { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--ink-3); }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar .input { max-width: 280px; }
.pager { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 14px; font-size: 13px; color: var(--mute); }
.chart { height: 220px; display: flex; align-items: end; gap: 6px; padding: 20px 20px 34px; position: relative; }
.chart .bar { flex: 1; background: linear-gradient(to top, var(--leaf-deep), var(--leaf)); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; transition: height .6s var(--ease); }
.chart .bar span { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font: 10px var(--f-mono); color: var(--mute); white-space: nowrap; }
.chart .bar:hover::after { content: attr(data-v); position: absolute; top: -24px; left: 50%; transform: translateX(-50%); font: 11px var(--f-mono); color: var(--paper); background: var(--ink-3); padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.settings-block { padding: 24px; margin-bottom: 18px; }
.settings-block h3 { margin: 0 0 4px; font: 700 18px var(--f-cn-display); display: flex; align-items: center; gap: 10px; }
.settings-block > p { margin: 0 0 20px; color: var(--mute); font-size: 13px; }
.task-row { display: grid; grid-template-columns: 110px 150px 1fr 90px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.code-list { font-family: var(--f-mono); font-size: 13px; background: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 14px; max-height: 240px; overflow: auto; white-space: pre; }

/* ---------- 弹窗 / 提示 ---------- */
.modal-back { position: fixed; inset: 0; z-index: 200; background: rgba(5,6,5,.72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(440px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--r-l); padding: 30px; box-shadow: var(--shadow); position: relative; animation: pop .3s var(--ease) both; }
.modal.wide { width: min(960px, 100%); padding: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal .x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--ink); display: grid; place-items: center; z-index: 2; }
.modal h2 { margin: 0 0 6px; font: 900 28px var(--f-cn-display); }
.tabs { display: flex; gap: 2px; padding: 4px; background: var(--ink); border-radius: 999px; margin: 18px 0 22px; border: 1px solid var(--line); }
.tabs button { flex: 1; padding: 8px; border-radius: 999px; border: 0; background: none; color: var(--mute); }
.tabs button[aria-selected="true"] { background: var(--paper); color: var(--ink); font-weight: 600; }
.lightbox { display: grid; grid-template-columns: 1fr 300px; }
.lightbox .media { background: #000; display: grid; place-items: center; min-height: 400px; }
.lightbox .media img, .lightbox .media video { max-height: 80vh; }
.lightbox .info { padding: 30px 24px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; font-size: 14px; }
.pay-qr { text-align: center; padding: 10px 0; }
.pay-qr .amount { font: 400 48px var(--f-display); margin: 10px 0; }

.toasts { position: fixed; top: calc(var(--topbar) + 14px); left: 50%; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; padding: 10px 18px; border-radius: 999px; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 500; box-shadow: var(--shadow); animation: pop .3s var(--ease) both; display: flex; gap: 8px; align-items: center; }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok::before { content: '✓'; color: var(--leaf-deep); font-weight: 700; }

.announce { background: var(--leaf); color: var(--ink); font-size: 13px; text-align: center; padding: 7px 40px; position: relative; font-weight: 500; }
.announce button { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--ink); font-size: 16px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .hero-inner { grid-template-columns: 1fr; }
  .prompt-demo { max-width: 420px; }
  .plans { grid-template-columns: repeat(2, 1fr); }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-tile, .tool-tile:nth-child(1), .tool-tile:nth-child(2) { grid-column: span 1; }
  .studio { grid-template-columns: 76px 340px 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .topbar { padding: 0 16px; gap: 12px; }
  .nav { display: none; position: absolute; top: var(--topbar); left: 0; right: 0; flex-direction: column; background: var(--ink-2); padding: 12px; border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .menu-btn { display: block; }
  .brand small { display: none; }
  .section-head, .grid-2 { grid-template-columns: 1fr; }
  .section-head p { justify-self: start; }
  .leaves, .pipeline { grid-template-columns: 1fr; }
  .pipeline li { padding-bottom: 20px; }
  .studio { grid-template-columns: 1fr; height: auto; }
  .rail { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail hr { display: none; }
  .panel { border-right: 0; }
  .chat { grid-template-columns: 1fr; }
  .chat-side { display: none; }
  .dash { grid-template-columns: 1fr; }
  .side-nav { position: static; display: flex; overflow-x: auto; }
  .side-nav a { white-space: nowrap; }
  .lightbox { grid-template-columns: 1fr; }
  .lightbox .info { border-left: 0; border-top: 1px solid var(--line); }
  .task-row { grid-template-columns: 1fr 1fr; }
  .starter { grid-template-columns: 1fr; }
  .prompt-demo .bubble { left: 12px; right: 12px; }
}
@media (max-width: 560px) {
  .plans, .stats, .tools-grid { grid-template-columns: 1fr; }
  .hero .meta { gap: 22px; }
}
