:root {
  --ink: #171814;
  --ink-2: #282a25;
  --paper: #f3efe5;
  --paper-2: #e7e0d2;
  --white: #fffdf7;
  --red: #d6432d;
  --red-dark: #a72c1c;
  --green: #557565;
  --amber: #b8781d;
  --blue: #406f87;
  --muted: #77766e;
  --line: rgba(23, 24, 20, 0.16);
  --display: "Songti SC", "STSong", Georgia, serif;
  --body: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); font-family: var(--body); }
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 20; opacity: .25;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 8px; color: var(--red); letter-spacing: .15em; font-size: 11px; font-weight: 700; }

.login-shell {
  min-height: 100vh; display: grid; grid-template-columns: 58% 42%; grid-template-rows: auto minmax(460px,1fr) auto;
  background: var(--ink); color: var(--paper); overflow: auto; position: relative;
}
.login-shell::after {
  content: "山"; position: absolute; left: -4vw; bottom: -22vh; font: 54vw/.8 var(--display);
  color: rgba(255,255,255,.025); transform: rotate(-7deg); pointer-events: none;
}
.login-mark { grid-column: 1 / -1; display: flex; align-items: center; gap: 15px; padding: 36px 5vw; font-size: 10px; letter-spacing: .2em; }
.mountain { display: grid; place-items: center; width: 38px; height: 38px; background: var(--red); font: 22px var(--display); color: white; }
.login-copy { align-self: center; padding: 4vw 5vw 9vw; position: relative; z-index: 1; }
.login-copy h1 { font: 500 clamp(64px, 8vw, 126px)/.9 var(--display); margin: 0 0 36px; letter-spacing: -.06em; }
.login-copy h1 em { color: var(--red); font-style: normal; }
.login-copy > p:last-child { color: #aaa99e; max-width: 460px; font-size: 16px; line-height: 1.8; }
.login-card {
  align-self: center; width: min(420px, 80%); padding: 44px; background: var(--paper); color: var(--ink);
  box-shadow: 24px 24px 0 var(--red); position: relative; z-index: 2;
}
.login-card small { letter-spacing: .18em; color: var(--red); font-weight: 700; }
.login-card h2 { font: 34px var(--display); margin: 8px 0 34px; }
label { display: grid; gap: 8px; margin: 16px 0; color: var(--muted); font-size: 12px; font-weight: 700; }
input, textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 0; padding: 12px 13px; background: var(--white);
  color: var(--ink); outline: none; transition: border .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--red); box-shadow: 3px 3px 0 rgba(214,67,45,.16); }
textarea { min-height: 140px; resize: vertical; }
.btn { border: 1px solid var(--ink); padding: 11px 16px; background: transparent; color: var(--ink); font-weight: 700; transition: .2s; }
.btn:hover { transform: translate(-2px,-2px); box-shadow: 3px 3px 0 var(--ink); }
.btn.primary { background: var(--red); border-color: var(--red); color: white; }
.btn.primary:hover { box-shadow: 3px 3px 0 var(--red-dark); }
.btn.ghost { border-color: var(--line); }
.btn.danger { color: var(--red-dark); border-color: var(--red); }
.btn.small { padding: 6px 9px; font-size: 11px; }
.login-card .btn { margin-top: 18px; width: 100%; display: flex; justify-content: space-between; }
.form-error { min-height: 18px; color: var(--red-dark); font-size: 12px; }
.login-deployments {
  grid-column: 1 / -1;
  position: relative;
  z-index: 2;
  padding: 28px 5vw 42px;
  border-top: 1px solid rgba(255,255,255,.12);
  background: rgba(23,24,20,.93);
}
.login-deployments > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.login-deployments > header small { color: var(--red); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.login-deployments > header h2 { margin: 5px 0 0; font: 28px/1 var(--display); }
.login-deployments > header span { color: #8d8e85; font-size: 10px; }
.login-deployment-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.14); }
.login-deployment-grid article { min-height: 206px; padding: 22px; display: grid; align-content: start; gap: 10px; background: var(--ink-2); }
.login-deployment-grid article.featured { background: var(--paper); color: var(--ink); }
.login-deployment-grid small { color: var(--red); font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.login-deployment-grid b { font: 23px/1.2 var(--display); }
.login-deployment-grid p { min-height: 48px; margin: 0; color: #9b9b92; font-size: 10px; line-height: 1.65; }
.login-deployment-grid article.featured p { color: var(--muted); }
.login-deployment-grid .btn { align-self: end; justify-self: start; margin-top: 7px; }
.login-deployment-grid article:not(.featured) .btn { color: var(--paper); border-color: rgba(255,255,255,.24); }
.login-demo-note { margin: 12px 0 0; color: #73746e; font-size: 9px; }
.demo-mode nav button:not([data-page="dashboard"]):not([data-page="accounts"]):not([data-page="articles"]):not([data-page="analytics"]):not([data-page="settings"]):not([data-page="deployment"]) { display: none; }
.demo-banner { margin-bottom: 18px; padding: 13px 16px; border: 1px solid var(--amber); background: rgba(184,120,29,.08); color: var(--amber); font-size: 10px; line-height: 1.6; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 226px 1fr; }
.rail { position: fixed; inset: 0 auto 0 0; width: 226px; background: var(--ink); color: var(--paper); padding: 28px 18px 22px; display: flex; flex-direction: column; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand b { display: grid; place-items: center; width: 38px; height: 38px; background: var(--red); font: 22px var(--display); }
.brand span { font-weight: 700; font-size: 13px; line-height: 1.15; }
.brand small { color: #8d8e85; font-size: 9px; letter-spacing: .16em; }
nav { padding-top: 28px; display: grid; gap: 6px; }
nav button { display: grid; grid-template-columns: 34px 1fr; align-items: center; width: 100%; padding: 13px 12px; border: 0; background: transparent; color: #aaa99f; text-align: left; transition: .2s; }
nav button i { font: normal 9px var(--body); color: #60615b; }
nav button span { font-size: 13px; font-weight: 600; }
nav button:hover { color: white; transform: translateX(3px); }
nav button.active { background: var(--paper); color: var(--ink); }
nav button.active i { color: var(--red); }
.rail-foot { margin-top: auto; display: flex; align-items: center; gap: 11px; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.12); }
.rail-foot div { display: grid; gap: 2px; }
.rail-foot b { font-size: 11px; }
.rail-foot small { color: #72736c; font-size: 9px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #6da37f; box-shadow: 0 0 0 5px rgba(109,163,127,.12); }

main { grid-column: 2; min-width: 0; }
.topbar { min-height: 132px; padding: 30px 4vw 26px; display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid var(--line); }
.topbar h1 { font: 42px/1 var(--display); letter-spacing: -.04em; margin: 0; }
.top-actions { display: flex; align-items: center; gap: 26px; }
.date { font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.user-chip { display: grid; grid-template-columns: 32px auto; column-gap: 9px; align-items: center; border: 0; background: transparent; text-align: left; color: var(--ink); }
.user-chip > span { grid-row: 1/3; display: grid; place-items: center; width: 32px; height: 32px; background: var(--ink); color: var(--paper); }
.user-chip b { font-size: 11px; }
.user-chip small { color: var(--muted); font-size: 9px; }
.content { padding: 32px 4vw 60px; }

.hero-strip { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); animation: rise .5s both; }
.metric { background: var(--white); padding: 25px; min-height: 142px; display: flex; flex-direction: column; justify-content: space-between; }
.metric.featured { background: var(--red); color: white; }
.metric small { font-size: 10px; letter-spacing: .12em; color: var(--muted); }
.metric.featured small { color: rgba(255,255,255,.65); }
.metric strong { font: 48px/1 var(--display); font-weight: 500; }
.metric p { margin: 0; color: var(--muted); font-size: 11px; }
.metric.featured p { color: rgba(255,255,255,.7); }
.panel-grid { display: grid; grid-template-columns: 1.45fr .75fr; gap: 22px; margin-top: 22px; }
.panel { background: rgba(255,253,247,.82); border: 1px solid var(--line); padding: 22px; animation: rise .5s .08s both; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.panel-head h2 { margin: 0; font: 23px var(--display); }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.queue-bars { display: grid; gap: 14px; }
.queue-row { display: grid; grid-template-columns: 86px 1fr 28px; align-items: center; gap: 12px; font-size: 11px; }
.queue-row b { text-align: right; }
.bar { height: 8px; background: var(--paper-2); overflow: hidden; }
.bar i { display: block; height: 100%; min-width: 3px; background: var(--ink); transform-origin: left; animation: bar .7s .2s both; }
.queue-row[data-tone="red"] .bar i { background: var(--red); }
.queue-row[data-tone="green"] .bar i { background: var(--green); }
.queue-row[data-tone="amber"] .bar i { background: var(--amber); }
.attention { border-left: 5px solid var(--red); }
.attention-count { font: 68px/.9 var(--display); color: var(--red); margin: 22px 0; }
.attention-link { border: 0; background: none; padding: 0; color: var(--ink); border-bottom: 1px solid; font-size: 12px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.toolbar-copy h2 { font: 24px var(--display); margin: 0; }
.toolbar-copy p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.toolbar-actions { display: flex; gap: 8px; }
.creation-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.creation-lane {
  min-height: 154px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
  border: 1px solid var(--line);
  background: rgba(255,253,247,.82);
  color: var(--ink);
  text-align: left;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.creation-lane:hover {
  transform: translate(-3px,-3px);
  border-color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}
.creation-lane:nth-child(2):hover { box-shadow: 6px 6px 0 var(--amber); }
.creation-lane:nth-child(3):hover { box-shadow: 6px 6px 0 var(--red); }
.creation-lane small { color: var(--red); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.creation-lane b { font: 28px/1.05 var(--display); font-weight: 500; }
.creation-lane span { max-width: 34em; color: var(--muted); font-size: 11px; line-height: 1.6; }
.writing-flow-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin: 0 0 22px;
  border: 1px solid var(--line);
  background: var(--line);
  gap: 1px;
}
.writing-flow-strip span {
  min-width: 0;
  padding: 11px 8px;
  display: grid;
  gap: 4px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}
.writing-flow-strip i { color: var(--red); font: normal 13px/1 var(--display); }
.quality-pill {
  display: inline-flex;
  margin-left: 5px;
  padding: 4px 7px;
  border: 1px solid var(--amber);
  color: var(--amber);
  font-size: 9px;
}
.quality-pill.ready { border-color: var(--green); color: var(--green); }
.writing-pipeline {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin-top: 10px;
  border: 1px solid var(--line);
  background: var(--line);
  gap: 1px;
}
.writing-pipeline span {
  display: grid;
  place-items: center;
  gap: 5px;
  padding: 10px 4px;
  background: var(--paper-2);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}
.writing-pipeline i {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  font: normal 9px/1 var(--body);
}
.pairing-steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin: 18px 0; border: 1px solid var(--line); background: var(--line); }
.pairing-steps span { padding: 11px 8px; background: var(--paper-2); color: var(--ink); font-size: 9px; font-weight: 800; text-align: center; }
.pairing-steps i { display: inline-grid; place-items: center; width: 19px; height: 19px; margin-right: 5px; border-radius: 50%; background: var(--red); color: white; font: normal 9px/1 var(--body); }
.account-owner-groups { display: grid; gap: 22px; }
.account-owner-group { border: 1px solid var(--line); background: rgba(255,253,247,.76); }
.account-owner-group > header {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 20px; border-left: 5px solid var(--red); background: var(--paper-2);
}
.account-owner-group > header small { color: var(--muted); font-size: 8px; letter-spacing: .14em; }
.account-owner-group > header h3 { margin: 3px 0 0; font: 24px/1.1 var(--display); }
.account-owner-group > header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.account-owner-group > header strong { font: 35px/1 var(--display); }
.account-owner-group > header strong span { display: block; margin-top: 3px; color: var(--muted); font: 9px/1 sans-serif; text-align: right; }
.account-owner-group .data-table { border-width: 1px 0 0; }
.owner-tag {
  display: inline-flex; margin: 2px 4px 2px 0; padding: 4px 8px;
  background: var(--ink); color: var(--paper); font-size: 9px; font-weight: 800; letter-spacing: .04em;
}
.owner-tag.muted { background: var(--paper-2); color: var(--muted); border: 1px dashed var(--muted); }
.account-labels { max-width: 260px; }
.account-picker { margin: 14px 0 0; padding: 14px; border: 1px solid var(--line); }
.account-picker legend { padding: 0 7px; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.account-picker label { display: flex; flex-direction: row; align-items: center; gap: 10px; margin: 0; padding: 10px; border-bottom: 1px solid var(--line); }
.account-picker label:last-child { border-bottom: 0; }
.account-picker input { width: auto; }
.account-picker span b,.account-picker span small { display: block; }
.account-picker span small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.assigned-account-list { margin: 20px 0; border-top: 3px solid var(--ink); }
.assigned-account-list h3 { margin: 14px 0 6px; font: 18px var(--display); }
.assigned-account-list article { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.assigned-account-list article span b,.assigned-account-list article span small { display: block; }
.assigned-account-list article span small { color: var(--muted); font-size: 9px; }
.factory-steps { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; margin-bottom: 22px; border: 1px solid var(--line); background: var(--line); }
.factory-steps article { display: grid; grid-template-columns: 38px 1fr; padding: 15px; background: var(--white); }
.factory-steps b { grid-row: 1/3; color: var(--red); font: 24px/1 var(--display); }
.factory-steps span { font-size: 11px; font-weight: 800; }
.factory-steps small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.import-columns { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 18px 0; padding: 14px; background: var(--paper-2); }
.import-columns > b { margin-right: 8px; font-size: 10px; }
.import-errors { margin: 18px 0 26px; border-top: 3px solid var(--red); }
.import-errors h3 { margin: 12px 0; font: 18px var(--display); }
.import-errors article { display: grid; grid-template-columns: 80px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.import-errors article b { color: var(--red); }
.import-success { margin: 18px 0 26px; padding: 12px; border: 1px solid var(--green); color: var(--green); font-size: 11px; font-weight: 800; }
.data-table { width: 100%; border-collapse: collapse; background: rgba(255,253,247,.76); border: 1px solid var(--line); animation: rise .4s both; }
.data-table th { padding: 12px 14px; background: var(--ink); color: #b9b8ae; font-size: 9px; letter-spacing: .1em; text-align: left; }
.data-table td { padding: 14px; border-bottom: 1px solid var(--line); font-size: 12px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--white); }
.title-cell { max-width: 310px; }
.title-cell b { display: block; font: 16px/1.35 var(--display); }
.title-cell small { display: block; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid currentColor; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag.active,.tag.approved,.tag.succeeded,.tag.ready,.tag.online { color: var(--green); }
.tag.generated,.tag.imported { color: var(--green); }
.tag.review,.tag.claimed,.tag.running,.tag.busy { color: var(--blue); }
.tag.queued,.tag.draft,.tag.paused,.tag.pending,.tag.partial { color: var(--amber); }
.tag.failed,.tag.waiting_takeover,.tag.login_expired,.tag.cancelled { color: var(--red); }
.empty { text-align: center; padding: 65px 20px !important; color: var(--muted); }
.empty b { display: block; font: 26px var(--display); color: var(--ink); margin-bottom: 8px; }

.modal-backdrop, .drawer-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(8,9,7,.68); backdrop-filter: blur(4px); display: grid; place-items: center; }
.modal { width: min(640px, calc(100vw - 32px)); max-height: 88vh; overflow: auto; background: var(--paper); padding: 34px; box-shadow: 14px 14px 0 var(--red); position: relative; animation: pop .22s both; }
.modal.wide { width: min(860px, calc(100vw - 32px)); }
.modal-close { position: absolute; top: 12px; right: 14px; border: 0; background: none; font: 28px/1 var(--display); color: var(--muted); z-index: 2; }
.modal h2, .drawer h2 { margin: 4px 0 6px; font: 30px var(--display); }
.modal .sub, .drawer .sub { margin: 0 0 24px; font-size: 11px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.span-2 { grid-column: 1/-1; }
.form-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.drawer-backdrop { place-items: stretch end; }
.drawer { width: min(620px, 92vw); height: 100vh; overflow: auto; padding: 40px 32px; background: var(--paper); position: relative; animation: slide .25s both; }
.drawer.preview-wide { width: min(1120px, 97vw); padding: 30px; }
.article-preview { min-height: calc(100vh - 60px); }
.preview-head {
  position: sticky; top: -30px; z-index: 3; margin: -30px -30px 24px; padding: 28px 68px 20px 30px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  background: rgba(243,239,229,.94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.preview-head h2 { max-width: 680px; font-size: 27px; }
.preview-head .sub { margin-bottom: 0; }
.preview-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.preview-switch { display: flex; border: 1px solid var(--ink); background: var(--white); }
.preview-switch button { border: 0; padding: 7px 12px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; }
.preview-switch button.active { background: var(--ink); color: var(--white); }
.preview-grid { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 24px; align-items: start; }
.preview-inspector { position: sticky; top: 122px; display: grid; gap: 16px; }
.preview-cover {
  aspect-ratio: 900/383; display: grid; place-items: center; overflow: hidden;
  border: 1px solid var(--line); background: var(--paper-2); color: var(--muted); font-size: 11px;
}
.preview-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-cover.is-empty { border-style: dashed; }
.preview-facts { margin: 0; border-top: 3px solid var(--ink); }
.preview-facts div { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.preview-facts dt { color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.preview-facts dd { margin: 0; font-size: 11px; font-weight: 700; }
.preview-summary { padding: 15px; background: var(--ink); color: var(--paper); }
.preview-summary small { color: #8f9088; font-size: 9px; letter-spacing: .12em; }
.preview-summary p { margin: 8px 0 0; font-size: 11px; line-height: 1.65; }
.quality-review ul { margin: 9px 0 0; padding-left: 18px; font-size: 10px; line-height: 1.65; }
.sticker-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(760px, 100%);
  margin: 0 auto;
}
.sticker-preview-card {
  aspect-ratio: 3/4;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(23,24,20,.22);
  background: var(--paper-2);
  color: var(--muted);
  font-size: 10px;
}
.sticker-preview-card img { width: 100%; height: 100%; display: block; object-fit: cover; }
.sticker-plan-card {
  aspect-ratio: 3/4;
  min-height: 0;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(23,24,20,.22);
  background: linear-gradient(145deg,var(--white),var(--paper-2));
  color: var(--ink);
}
.sticker-plan-card small { color: var(--red); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.sticker-plan-card h3 { margin: 22px 0 13px; font: 26px/1.28 var(--display); }
.sticker-plan-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.sticker-plan-card footer { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.preview-stage {
  min-height: calc(100vh - 160px); padding: 28px; overflow: auto;
  background-color: #d9d4c8;
  background-image: linear-gradient(rgba(23,24,20,.055) 1px,transparent 1px),linear-gradient(90deg,rgba(23,24,20,.055) 1px,transparent 1px);
  background-size: 24px 24px;
}
.preview-device { width: 100%; max-width: 760px; min-height: 720px; margin: 0 auto; background: white; box-shadow: 0 14px 40px rgba(23,24,20,.18); transition: max-width .28s ease; }
.preview-device.is-mobile { max-width: 430px; }
.wechat-proof { padding: 46px 38px 70px; color: #222; font-family: "PingFang SC","Microsoft YaHei",sans-serif; }
.wechat-proof h1 { margin: 0 0 12px; font: 700 27px/1.35 "PingFang SC","Microsoft YaHei",sans-serif; letter-spacing: 0; }
.wechat-proof-meta { display: flex; gap: 10px; margin: 0 0 34px; color: #888; font-size: 13px; }
.wechat-proof-meta span:first-child { color: #576b95; }
.wechat-proof-body { font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
.wechat-proof-body h1,.wechat-proof-body h2,.wechat-proof-body h3 { margin: 34px 0 14px; color: #202020; font-weight: 700; line-height: 1.5; }
.wechat-proof-body h2 { font-size: 20px; }
.wechat-proof-body h3 { font-size: 18px; }
.wechat-proof-body p { margin: 0 0 22px; }
.wechat-proof-body ul,.wechat-proof-body ol { margin: 0 0 22px; padding-left: 1.5em; }
.wechat-proof-body li { margin: 8px 0; }
.wechat-proof-body img { display: block; width: auto; max-width: 100%; height: auto; margin: 24px auto; }
.wechat-proof-body blockquote { margin: 24px 0; padding: 14px 18px; border-left: 4px solid var(--red); background: #f7f7f7; color: #666; }
.wechat-proof-body a { color: #576b95; text-decoration: none; }
.inbox-metrics { margin-bottom: 20px; }
.metric-word { font-size: 32px !important; }
.inbox-connector-note { display: grid; grid-template-columns: 100px 1fr; gap: 18px; margin-bottom: 18px; padding: 16px 18px; border: 1px solid var(--blue); background: rgba(52,83,119,.06); }
.inbox-connector-note b { color: var(--blue); font-size: 11px; }
.inbox-connector-note p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.inbox-unread { background: rgba(214,67,45,.06); }
.inbox-preview { max-width: 360px; line-height: 1.55; }
.unread-pill { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 20px; background: var(--red); color: white; font: 700 10px sans-serif; }
.conversation-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.message-stream { display: flex; flex-direction: column; gap: 12px; min-height: 55vh; padding: 24px 4px; }
.message-bubble { width: min(72%,600px); padding: 14px 16px; border: 1px solid var(--line); background: var(--white); }
.message-bubble.outbound { align-self: flex-end; border-color: var(--ink); background: var(--ink); color: var(--paper); }
.message-bubble small { color: var(--muted); font-size: 9px; }
.message-bubble p { margin: 7px 0 10px; white-space: pre-wrap; line-height: 1.65; font-size: 13px; }
.message-bubble footer { color: var(--muted); font-family: "SFMono-Regular",Consolas,monospace; font-size: 8px; }
.reply-placeholder { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.reply-placeholder textarea { margin: 0; min-height: 72px; }
.analytics-note { margin-top: 20px; }
.dashboard-performance { margin: 22px 0; }
.performance-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.performance-card { min-height: 118px; padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.performance-card.featured { background: var(--red); color: white; }
.performance-card small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.performance-card.featured small, .performance-card.featured span { color: rgba(255,255,255,.78); }
.performance-card strong { display: block; margin: 12px 0 7px; font: 34px/1 var(--display); }
.performance-card span { color: var(--muted); font-size: 10px; }
.dashboard-performance-note { margin-top: 16px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.analytics-kpis { grid-template-columns: repeat(4, 1fr); }
.analytics-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 22px; margin: 22px 0; }
.analytics-bars { display: grid; gap: 12px; margin-top: 20px; }
.analytics-bar-row { display: grid; grid-template-columns: 45px 1fr 68px 72px; gap: 10px; align-items: center; font-size: 11px; }
.analytics-bar-row .bar { height: 12px; background: var(--paper-2); }
.analytics-bar-row .bar i { display: block; height: 100%; min-width: 3px; background: var(--red); }
.analytics-bar-row b { text-align: right; font-family: var(--display); }
.analytics-bar-row em { color: var(--muted); font-size: 10px; font-style: normal; }
.data-table.compact { margin: 0; }
.metric-cell { font: 24px/1 var(--display); }
.metric-growth { color: var(--green); font-weight: 800; }
.metric-trend { display: grid; gap: 18px; margin-top: 26px; }
.metric-trend article { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; align-items: center; }
.metric-trend article div b,.metric-trend article div small { display: block; }
.metric-trend article div b { font: 27px/1 var(--display); }
.metric-trend article div small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.metric-trend article > span { height: 12px; background: var(--paper-2); }
.metric-trend article > span i { display: block; height: 100%; background: var(--red); }
.metric-trend article p { grid-column: 2; margin: 0; color: var(--muted); font-size: 10px; }
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 7px; bottom: 7px; width: 1px; background: var(--line); }
.log { position: relative; padding: 0 0 22px; }
.log::before { content: ""; position: absolute; left: -23px; top: 5px; width: 9px; height: 9px; background: var(--paper); border: 2px solid var(--ink); border-radius: 50%; }
.log.error::before { border-color: var(--red); background: var(--red); }
.log.warn::before { border-color: var(--amber); }
.log small { color: var(--muted); font-size: 9px; }
.log b { display: block; font-size: 11px; margin: 4px 0; }
.log p { margin: 0; font-size: 12px; line-height: 1.6; }
.toast-stack { position: fixed; right: 24px; bottom: 24px; z-index: 50; display: grid; gap: 8px; }
.toast { min-width: 270px; max-width: 430px; padding: 13px 16px; color: white; background: var(--ink); border-left: 5px solid var(--green); box-shadow: 7px 7px 0 rgba(0,0,0,.15); font-size: 12px; animation: toast .25s both; }
.toast.error { border-color: var(--red); }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; }
.score { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); font: 24px/1 var(--display); }
.score.high { background: var(--red); border-color: var(--red); color: white; }
.help { color: var(--muted); font-size: 11px; line-height: 1.6; }
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; }
.pairing-code {
  margin: 28px 0 18px;
  padding: 24px;
  border: 2px solid var(--ink);
  background: var(--paper-2);
  font: 42px/1 var(--display);
  letter-spacing: .12em;
  text-align: center;
}
.security-note { margin: 18px 0; padding: 16px; border-left: 4px solid var(--green); background: #eef4ee; }
.security-note b { font-size: 11px; }
.security-note p { margin: 8px 0 0; line-height: 1.65; overflow-wrap: anywhere; }
.deployment-model {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 22px;
}
.deployment-model > article {
  display: grid;
  gap: 8px;
  align-content: center;
  min-height: 148px;
  padding: 21px;
  border: 1px solid var(--line);
  background: var(--white);
}
.deployment-model > article.featured { background: var(--ink); color: var(--paper); }
.deployment-model > i { align-self: center; font: normal 28px/1 var(--display); color: var(--red); }
.deployment-model small,.installer-grid small { color: var(--red); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.deployment-model b,.installer-grid b { font: 22px/1.15 var(--display); }
.deployment-model p,.installer-grid p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.installer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.installer-grid article { min-height: 166px; display: grid; align-content: start; gap: 10px; padding: 20px; border: 1px solid var(--line); background: var(--white); }
.installer-grid .tag { justify-self: start; }
.deployment-choice-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 22px; }
.deployment-choice-card { min-height: 360px; padding: 24px; display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--white); }
.deployment-choice-card.recommended { border-top: 6px solid var(--red); }
.deployment-choice-card > small { color: var(--red); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.deployment-choice-card h2 { margin: 18px 0 10px; font: 28px/1.15 var(--display); }
.deployment-choice-card > p { min-height: 52px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.deployment-choice-card dl { margin: 22px 0; border-top: 1px solid var(--line); }
.deployment-choice-card dl div { display: contents; }
.deployment-choice-card dt { padding-top: 11px; color: var(--muted); font-size: 9px; }
.deployment-choice-card dd { margin: 4px 0 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; }
.deployment-choice-card .tag { align-self: flex-start; margin-bottom: 12px; }
.deployment-choice-card .btn { margin-top: auto; }
.install-steps { margin: 22px 0; padding: 0; display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--line); list-style: none; }
.install-steps li { min-height: 110px; display: grid; align-content: center; gap: 7px; padding: 15px; border-right: 1px solid var(--line); counter-increment: install; }
.install-steps li:last-child { border-right: 0; }
.install-steps b { font-size: 11px; }
.install-steps span { color: var(--muted); font-size: 9px; line-height: 1.55; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } }
@keyframes slide { from { transform: translateX(100%); } }
@keyframes toast { from { opacity: 0; transform: translateX(15px); } }
@keyframes bar { from { transform: scaleX(0); } }

@media (max-width: 960px) {
  .shell { grid-template-columns: 76px 1fr; }
  .rail { width: 76px; padding-inline: 10px; }
  .brand span, nav span, .rail-foot div { display: none; }
  .brand { padding-inline: 8px; }
  nav button { grid-template-columns: 1fr; text-align: center; }
  main { grid-column: 2; }
  .hero-strip { grid-template-columns: 1fr 1fr; }
  .panel-grid { grid-template-columns: 1fr; }
  .deployment-model { grid-template-columns: 1fr; }
  .deployment-model > i { display: none; }
  .install-steps { grid-template-columns: 1fr 1fr; }
  .install-steps li { border-bottom: 1px solid var(--line); }
  .creation-lanes { grid-template-columns: 1fr; }
  .deployment-choice-grid { grid-template-columns: 1fr; }
  .creation-lane { min-height: 120px; }
  .writing-flow-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .writing-pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .login-shell { grid-template-columns: 1fr; }
  .login-copy { padding-bottom: 20px; }
  .login-card { margin: 0 auto 70px; }
  .login-deployment-grid { grid-template-columns: 1fr; }
  .login-deployment-grid article { min-height: 170px; }
}
@media (max-width: 680px) {
  .topbar { align-items: flex-start; min-height: 118px; }
  .top-actions .date { display: none; }
  .topbar h1 { font-size: 32px; }
  .content { padding-inline: 18px; }
  .hero-strip { grid-template-columns: 1fr; }
  .metric { min-height: 112px; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { flex-wrap: wrap; }
  .factory-steps { grid-template-columns: 1fr 1fr; }
  .data-table { display: block; overflow-x: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .login-copy h1 { font-size: 58px; }
  .login-card { padding: 30px; }
  .login-deployments > header { align-items: flex-start; flex-direction: column; }
  .drawer.preview-wide { width: 100vw; padding: 22px 14px; }
  .preview-head { position: static; margin: -22px -14px 18px; padding: 22px 52px 16px 14px; align-items: flex-start; flex-direction: column; }
  .preview-grid { grid-template-columns: 1fr; }
  .preview-inspector { position: static; grid-template-columns: 1fr 1fr; }
  .preview-summary,.preview-facts { grid-column: 1/-1; }
  .preview-stage { padding: 10px; }
  .wechat-proof { padding: 34px 24px 52px; }
  .message-bubble { width: 90%; }
  .inbox-connector-note { grid-template-columns: 1fr; gap: 5px; }
  .analytics-grid { grid-template-columns: 1fr; }
  .analytics-kpis { grid-template-columns: 1fr 1fr; }
  .performance-grid { grid-template-columns: 1fr 1fr; }
  .writing-flow-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .writing-pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sticker-preview-grid { grid-template-columns: 1fr; }
  .installer-grid,.install-steps { grid-template-columns: 1fr; }
  .install-steps li { border-right: 0; }
}
