:root {
  color-scheme: light;
  --bg: #f1f3f5;
  --ink: #172432;
  --muted: #4a5b6b;
  --line: #dce2e7;
  --surface: #fff;
  --accent: #244e86;
  --wash: #e7eef9;
  --error: #9c2a22;
  font: 16px/1.5 Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  scroll-padding: 32px;
}
[data-product="uistyle"] { --accent: #176346; --wash: #e4f2e9; }
[data-product="uiclick"] { --accent: #244e86; --wash: #e6eefb; }
[data-product="uiflow"] { --accent: #8a422f; --wash: #f9ebe4; }
[data-product="uistate"] { --accent: #176375; --wash: #e1f1f4; }
[data-product="uia11y"] { --accent: #593981; --wash: #f0e9fa; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; }
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
button, select, input, textarea { font: inherit; }
button, select, summary, .broken-invite { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; z-index: 3; left: 16px; top: 8px; padding: 8px 16px; background: white; transform: translateY(-160%); }
.skip:focus { transform: none; }
.frame { width: min(1280px, calc(100% - 96px)); margin-inline: auto; }
.topbar { background: white; border-bottom: 1px solid var(--line); }
.topbar .frame { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: white; font: 750 16px/1 ui-monospace, monospace; }
.brand small { display: block; color: var(--muted); font-size: 13px; }
.modes { display: flex; gap: 4px; background: var(--bg); border-radius: 12px; padding: 4px; }
.modes button { border: 0; border-radius: 8px; padding: 8px 14px; color: var(--muted); background: transparent; min-height: 44px; }
.modes button[aria-pressed="true"] { background: white; color: var(--accent); font-weight: 750; box-shadow: 0 1px 5px #1724321a; }
.modes button:hover { color: var(--ink); background: white; }
.hero { background: var(--wash); border-bottom: 1px solid var(--line); }
.hero .frame { padding-block: 49px 46px; }
.hero span { color: var(--accent); font-size: 15px; font-weight: 750; }
.hero h1 { font-size: clamp(36px, 5vw, 64px); letter-spacing: -.055em; margin: 12px 0 12px; }
.hero p { color: var(--muted); max-width: 700px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 300px); gap: 24px; padding-block: 28px 48px; align-items: start; }
.layout > * { min-width: 0; }
.panel { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: 0 4px 16px #17243206; }
.panel + .panel { margin-top: 16px; }
.panel-head, .row { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.panel-head { margin-bottom: 20px; }
.panel h2 { font-size: 24px; }
.panel h3 { font-size: 18px; }
.subtle { color: var(--muted); }
.panel-head p, .guide p { margin-top: 8px; }
.guide h2 { font-size: 20px; }
.guide h3 { margin-top: 20px; font-size: 16px; }
.guide ol { margin: 12px 0 0; padding-left: 22px; color: var(--muted); }
.guide li + li { margin-top: 10px; }
.guide .fix { padding-top: 16px; border-top: 1px solid var(--line); }
.guide .fix p { color: var(--muted); }
.pill { display: inline-block; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 99px; color: var(--accent); background: var(--wash); }
.btn, .broken-invite { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 1px solid #aebbc9; padding: 9px 14px; border-radius: 9px; background: white; color: var(--ink); font-weight: 680; transition: background-color .15s, color .15s; }
.btn:hover { background: var(--wash); }
.primary, .broken-invite { background: var(--accent); color: white; border-color: var(--accent); }
.primary:hover, .broken-invite:hover { background: color-mix(in srgb, var(--accent), black 16%); }
.btn:disabled { background: #e9edf0; color: #536273; border-color: var(--line); }
select, input, textarea { color: var(--ink); background: white; border: 1px solid #aebbc9; border-radius: 8px; min-height: 44px; padding: 9px 12px; max-width: 100%; }
select:hover, input:hover, textarea:hover { border-color: var(--accent); }
textarea { min-height: 96px; resize: vertical; }
.field { display: grid; gap: 6px; font-weight: 680; min-width: 0; }
.field :is(input, select, textarea) { width: 100%; font-weight: 400; }
.form-grid { display: grid; gap: 16px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.error { color: var(--error); font-weight: 650; }
.status { color: var(--accent); overflow-wrap: anywhere; }
.status:empty { margin: 0; }
dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 24px; color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 70px #1724324d; overscroll-behavior: contain; }
dialog::backdrop { background: #17243270; }
.dialog-title { margin-bottom: 20px; }
.stories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.story { min-width: 0; background: #fbfcfb; border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 11px; align-items: flex-start; }
.story h3 { overflow-wrap: anywhere; }
.story .btn { margin-top: auto; }
[data-mode="broken"] .story:nth-child(1) { border-radius: 30px 4px; background: #f3edfe; padding: 24px; }
[data-mode="broken"] .story:nth-child(1) h3 { font-family: Georgia, "Songti SC", serif; font-size: 23px; }
[data-mode="broken"] .story:nth-child(1) .pill { background: #ded1fc; color: #4e2576; }
[data-mode="broken"] .story:nth-child(2) { border-radius: 0; background: #fff8df; padding: 10px; }
[data-mode="broken"] .story:nth-child(2) .btn { border-radius: 0; background: #ffe08a; }
[data-mode="broken"] .story:nth-child(3) { border-style: dashed; padding: 14px 20px; transform: translateY(9px); }
[data-mode="broken"] .story:nth-child(3) .pill { background: #fee7e5; color: #842923; }
.popover-anchor { position: relative; }
.popover { position: absolute; z-index: 1; inset: calc(100% + 6px) 0 auto auto; width: max-content; min-width: 146px; padding: 4px; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 20px #17243224; }
.popover button { display: block; width: 100%; text-align: left; border-color: transparent; }
.ticket-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.steps { list-style: none; padding: 0; margin: 0 0 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.steps li { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.steps [aria-current="step"] { background: var(--wash); color: var(--accent); font-weight: 700; }
.preview { background: var(--wash); padding: 24px; border-radius: 12px; overflow-wrap: anywhere; }
.preview > * + * { margin-top: 12px; }
.placeholder { border: 2px dashed #c79481; padding: 24px; border-radius: 12px; background: #fff9f5; color: #723d2b; }
.file-scroll { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; overscroll-behavior: contain; }
.files { width: 100%; table-layout: fixed; border-spacing: 0; }
.files th, .files td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.files th { position: sticky; top: 0; background: var(--wash); color: var(--accent); }
.files th:first-child { width: 62%; }
.files td:nth-child(2) { font-variant-numeric: tabular-nums; }
.files tr:last-child td { border-bottom: 0; }
[data-mode="broken"] .files { table-layout: auto; }
[data-mode="broken"] .files :is(td, th) { white-space: nowrap; }
[data-mode="broken"] .files th { position: static; transform: translateX(10px); }
.file-scroll + .status { margin-top: 12px; }
.file-scroll + .status:empty { margin-top: 0; }
.body-state { border: 1px solid var(--line); background: var(--wash); border-radius: 10px; padding: 20px; margin-bottom: 14px; }
.body-state .btn { margin-top: 10px; }
.member-list { padding: 0; margin: 0; list-style: none; }
.member { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; border-top: 1px solid var(--line); padding-block: 14px; }
.member small { color: var(--muted); display: block; overflow-wrap: anywhere; }
.initial { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--accent); background: var(--wash); font-weight: 750; }
[data-mode="broken"] #invite-dialog :focus-visible { outline: none; }
[data-mode="broken"] #invite-dialog[open] { position: fixed; inset: 20vh 0 auto; z-index: 2; }
.footer { border-top: 1px solid var(--line); }
.footer p { padding-block: 18px; color: var(--muted); font-size: 14px; }
@media (max-width: 1000px) {
  .frame { width: calc(100% - 48px); }
  .layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; }
  .stories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .frame { width: calc(100% - 32px); }
  .layout, .stories { grid-template-columns: minmax(0, 1fr); }
  .hero .frame { padding-block: 32px; }
  .panel { padding: 16px; }
  .files th, .files td { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
