/* 稿成 · 工作台视觉
   米白纸感、墨绿主色、克制橙色重点。无远程字体与图片。 */

:root {
  --bg: #f4f2ec;
  --bg-deep: #ece8df;
  --surface: #fffdf8;
  --surface-2: #faf7f0;
  --surface-3: #f3efe5;
  --ink: #16241f;
  --ink-soft: #40544b;
  --muted: #6d7d75;
  --faint: #9a9f96;
  --line: #e2ddd2;
  --line-strong: #d3ccbe;
  --green: #1f5a48;
  --green-deep: #143d31;
  --green-soft: #e7efe9;
  --orange: #c2642c;
  --orange-soft: #f7e9de;
  --red: #a8452f;
  --red-soft: #f8e7e1;
  --blue-soft: #e8eef4;
  --blue: #2c567a;
  --amber: #9a641d;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(22, 36, 31, 0.04);
  --shadow: 0 24px 60px -30px rgba(22, 36, 31, 0.45);
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia, serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  background:
    radial-gradient(1100px 520px at 88% -8%, rgba(233, 224, 204, 0.55), transparent 62%),
    radial-gradient(900px 620px at -8% 108%, rgba(231, 239, 233, 0.85), transparent 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

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

button { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: rgba(194, 100, 44, 0.2); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--green-deep);
  color: #fbf8f0;
  font-size: 13px;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}
.skip-link:focus { transform: translateY(0); }

/* ------------------------------------------------------------------ */
/* Shell                                                               */
/* ------------------------------------------------------------------ */

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 30px;
  height: 100vh;
  padding: 28px 20px 22px;
  background: rgba(255, 253, 248, 0.72);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px;
  border-radius: 12px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: linear-gradient(145deg, #2b715c, #153f32);
  color: #f7f3e9;
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1;
  box-shadow: 0 10px 22px -12px rgba(20, 61, 49, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.brand-name {
  display: block;
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 0.14em;
  line-height: 1.15;
}
.brand-sub {
  display: block;
  margin-top: 3px;
  font-size: 8.5px;
  letter-spacing: 0.3em;
  color: var(--muted);
}

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

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link svg { width: 18px; height: 18px; opacity: 0.82; flex: 0 0 auto; }
.nav-link:hover { background: rgba(31, 90, 72, 0.06); color: var(--ink); }
.nav-link[aria-current="page"] {
  background: var(--green-soft);
  color: var(--green-deep);
  font-weight: 600;
}
.nav-link[aria-current="page"] svg { opacity: 1; }

.sidebar-foot { margin-top: auto; }

.credit-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(160deg, #fffdf8, #f7f2e7);
  box-shadow: var(--shadow-sm);
}
.credit-label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.credit-row { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.credit-number {
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1;
  color: var(--green-deep);
}
.credit-unit { font-size: 12px; color: var(--muted); }
.credit-hint { margin: 8px 0 0; font-size: 11px; line-height: 1.5; color: var(--muted); }

.account { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 6px 4px; }
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(31, 90, 72, 0.16);
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 600;
}
.account-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.account-email {
  overflow: hidden;
  font-size: 12.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.account-sub { font-size: 10.5px; color: var(--muted); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--red); }

.content { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 40px;
  border-bottom: 1px solid rgba(226, 221, 210, 0.75);
  background: rgba(244, 242, 236, 0.82);
  backdrop-filter: blur(16px);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--muted);
}
.topbar-eyebrow { font-weight: 600; letter-spacing: 0.02em; color: var(--ink-soft); }
.topbar-dot { width: 3px; height: 3px; flex: 0 0 auto; border-radius: 50%; background: var(--line-strong); }
.topbar-note { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.bridge-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.pill-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--line-strong); }
.bridge-pill.is-ready { border-color: #d5e4da; background: var(--green-soft); color: var(--green-deep); }
.bridge-pill.is-ready .pill-dot { background: #2c7a5d; }
.bridge-pill.is-offline { border-color: #ecd9c9; background: #fbf3ea; color: var(--amber); }
.bridge-pill.is-offline .pill-dot { background: var(--orange); }

.view {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 38px 40px 72px;
  flex: 1;
}

.site-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 40px 28px;
  color: var(--muted);
  font-size: 11.5px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary {
  background: linear-gradient(160deg, #256451, #173f33);
  color: #fbf8f0;
  box-shadow: 0 12px 26px -14px rgba(20, 61, 49, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn-primary:hover { box-shadow: 0 16px 30px -16px rgba(20, 61, 49, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.12); }

.btn-ghost { border-color: var(--line-strong); background: var(--surface); color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--green); color: var(--green-deep); background: #fff; }

.btn-quiet { color: var(--muted); background: transparent; }
.btn-quiet:hover { color: var(--green-deep); background: var(--green-soft); }

.btn-danger { border-color: rgba(168, 69, 47, 0.2); background: var(--red-soft); color: var(--red); }

.btn-sm { padding: 8px 14px; border-radius: 9px; font-size: 13px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-block { width: 100%; }

.btn.is-loading { color: transparent !important; position: relative; }
.btn.is-loading svg { opacity: 0; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn-ghost.is-loading::after { border-color: rgba(31, 90, 72, 0.25); border-top-color: var(--green); }
.btn-ghost.is-loading, .btn-quiet.is-loading { color: transparent !important; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ------------------------------------------------------------------ */
/* Page and cards                                                      */
/* ------------------------------------------------------------------ */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.page-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: 0.02em;
}
.page-sub { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.panel-pad { padding: 26px 28px; }
.panel-title { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: 0.01em; }
.panel-sub { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 30px; }
.stat-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(255, 253, 248, 0.96), rgba(250, 247, 240, 0.72));
  box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 11px; letter-spacing: 0.12em; color: var(--muted); }
.stat-value { margin-top: 6px; font-family: var(--font-serif); font-size: 32px; line-height: 1.1; color: var(--ink); }
.stat-value small { margin-left: 4px; font-family: var(--font-sans); font-size: 12px; color: var(--muted); }
.stat-foot { margin-top: 6px; font-size: 11.5px; color: var(--muted); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 14px; }
.section-title { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: 0.01em; }
.section-note { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Job list and status                                                 */
/* ------------------------------------------------------------------ */

.job-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}
.job-row:last-child { border-bottom: 0; }
.job-row:hover { background: #fbf8f1; }
.job-topic {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.job-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 5px; color: var(--muted); font-size: 12px; }
.job-meta span { display: inline-flex; align-items: center; gap: 5px; }
.job-meta svg { width: 13px; height: 13px; opacity: 0.7; }
.job-arrow { color: var(--line-strong); transition: transform 0.15s ease, color 0.15s ease; }
.job-arrow svg { width: 18px; height: 18px; }
.job-row:hover .job-arrow { color: var(--green); transform: translateX(3px); }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.status-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.tone-neutral { border-color: #e6e0d4; background: #f0ece3; color: #6b675c; }
.tone-progress { border-color: #d9e4ee; background: var(--blue-soft); color: var(--blue); }
.tone-progress .status-dot { animation: pulse 1.6s ease-in-out infinite; }
.tone-attention { border-color: #f0d8c4; background: var(--orange-soft); color: #9a4d1e; }
.tone-success { border-color: #d5e3da; background: var(--green-soft); color: var(--green-deep); }
.tone-danger { border-color: #efd4cb; background: var(--red-soft); color: var(--red); }

/* ------------------------------------------------------------------ */
/* Empty and skeleton                                                  */
/* ------------------------------------------------------------------ */

.empty-state {
  padding: 46px 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.72), rgba(250, 247, 240, 0.36));
  text-align: center;
}
.empty-art { width: 118px; height: 88px; margin: 0 auto 18px; color: var(--green); opacity: 0.9; }
.empty-state h3 { margin: 0; font-family: var(--font-serif); font-size: 21px; font-weight: 600; }
.empty-state p { max-width: 420px; margin: 8px auto 20px; color: var(--muted); font-size: 13px; }
.empty-state > svg { margin: 0 auto 16px; color: var(--orange); }

.skeleton { border-radius: 8px; background: linear-gradient(90deg, #eee9df 25%, #f7f3ea 37%, #eee9df 63%); background-size: 400% 100%; animation: shimmer 1.5s ease infinite; }
.skeleton-title { width: 42%; height: 34px; margin-bottom: 10px; }
.skeleton-sub { width: 62%; height: 13px; margin-bottom: 28px; }
.skeleton-block { height: 96px; margin-bottom: 14px; border-radius: 16px; }

/* ------------------------------------------------------------------ */
/* Forms                                                               */
/* ------------------------------------------------------------------ */

.compose-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.form-panel { padding: 28px 30px 26px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field > label, .field-label {
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.field-hint { color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.input, .textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fffefb;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder, .textarea::placeholder { color: #a7a294; }
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 90, 72, 0.12);
}
.input:disabled, .textarea:disabled { background: #f3efe6; color: var(--muted); cursor: not-allowed; }
.textarea { min-height: 104px; resize: vertical; }
.code-input {
  padding: 14px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 28px;
  letter-spacing: 0.48em;
  text-align: center;
  text-indent: 0.48em;
}

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fffefb;
  color: var(--ink-soft);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.chip:hover { border-color: var(--green); color: var(--green-deep); }
.chip[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: #fbf8f0; font-weight: 600; }
.chip:disabled { opacity: 0.5; cursor: not-allowed; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.form-actions .btn-primary { min-width: 170px; }
.form-actions-note { flex: 1 1 200px; color: var(--muted); font-size: 11.5px; line-height: 1.55; }

.form-alert { margin-bottom: 18px; }

/* ------------------------------------------------------------------ */
/* Upload                                                              */
/* ------------------------------------------------------------------ */

.upload-zone {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.upload-zone:hover, .upload-zone.is-drag { border-color: var(--green); background: var(--green-soft); }
.upload-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--surface);
  color: var(--green);
  border: 1px solid var(--line);
}
.upload-icon svg { width: 18px; height: 18px; }
.upload-title { display: block; font-size: 13px; font-weight: 600; }
.upload-note { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.upload-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.upload-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffefb;
  font-size: 12.5px;
}
.upload-item svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--green); }
.upload-item-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.upload-item-size { color: var(--muted); font-size: 11.5px; }
.upload-item button { border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 2px; border-radius: 6px; }
.upload-item button:hover { color: var(--red); }

/* ------------------------------------------------------------------ */
/* Aside                                                               */
/* ------------------------------------------------------------------ */

.aside-stack { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 14px; }
.aside-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(170deg, #fffdf8, #f8f3e8);
}
.aside-title { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.aside-text { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.72; }
.aside-list { margin: 10px 0 0; padding-left: 16px; color: var(--ink-soft); font-size: 12.5px; line-height: 1.8; }
.aside-list li::marker { color: var(--orange); }

/* ------------------------------------------------------------------ */
/* Callouts                                                            */
/* ------------------------------------------------------------------ */

.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.65;
}
.callout svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.callout > div { min-width: 0; }
.callout strong { color: var(--ink); }
.callout-info { border-color: #dbe5ef; background: #eef3f8; }
.callout-warn { border-color: #efd6c1; background: var(--orange-soft); }
.callout-danger { border-color: #efd3c9; background: var(--red-soft); }
.callout-success { border-color: #d5e4da; background: var(--green-soft); }

/* ------------------------------------------------------------------ */
/* Guest / login                                                       */
/* ------------------------------------------------------------------ */

.guest-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 44px;
  align-items: center;
  padding: 24px 0 10px;
}
.guest-intro { min-width: 0; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--orange);
  font-size: 11px;
  letter-spacing: 0.18em;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.guest-title {
  margin: 16px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(34px, 4.1vw, 50px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: 0.01em;
}
.guest-title em {
  font-style: normal;
  color: var(--green);
  background: linear-gradient(transparent 64%, rgba(194, 100, 44, 0.18) 64%);
}
.lede { max-width: 520px; margin: 18px 0 0; color: var(--ink-soft); font-size: 14.5px; line-height: 1.85; }
.feature-list { display: flex; flex-direction: column; gap: 12px; max-width: 500px; margin: 26px 0 0; padding: 0; list-style: none; }
.feature-item { display: flex; align-items: flex-start; gap: 12px; color: var(--ink-soft); font-size: 13px; }
.feature-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
}
.feature-icon svg { width: 14px; height: 14px; }

.guest-preview {
  max-width: 520px;
  margin-top: 32px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.72);
}
.preview-topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.traffic { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.preview-topbar-label { margin-left: 8px; color: var(--muted); font-size: 10.5px; letter-spacing: 0.08em; }
.preview-body { padding: 16px; }
.preview-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 12px;
}
.preview-empty svg { width: 30px; height: 30px; flex: 0 0 auto; color: var(--green); opacity: 0.8; }
.preview-empty strong { display: block; margin-bottom: 2px; color: var(--ink-soft); font-size: 12.5px; }

.login-panel {
  padding: 30px 30px 26px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.login-head h2 { margin: 0; font-family: var(--font-serif); font-size: 26px; font-weight: 600; }
.login-sub { margin: 8px 0 24px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-note {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.72;
}
.login-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11.5px; }
.login-back { align-self: flex-start; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.login-back:hover { color: var(--green); }
.login-expiry { color: var(--muted); font-size: 11.5px; }
.login-expiry.is-warning { color: var(--orange); }

.noscript-note {
  margin: 24px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ */
/* Detail                                                              */
/* ------------------------------------------------------------------ */

.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; color: var(--muted); font-size: 12.5px; }
.back-link:hover { color: var(--green-deep); }
.back-link svg { width: 15px; height: 15px; }

.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.detail-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.22;
  overflow-wrap: anywhere;
}
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.detail-meta .status-chip { margin-right: 2px; }
.detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; flex: 0 0 auto; }

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 26px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  list-style: none;
}
.step { display: flex; align-items: center; gap: 10px; padding: 13px 16px; color: var(--muted); font-size: 12px; }
.step + .step { border-left: 1px solid var(--line); }
.step-dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fffefb;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.step.is-done .step-dot { border-color: var(--green); background: var(--green); color: #fff; }
.step.is-current { color: var(--ink); font-weight: 600; }
.step.is-current .step-dot { border-color: var(--orange); background: var(--orange-soft); color: var(--orange); box-shadow: 0 0 0 3px rgba(194, 100, 44, 0.12); }
.step.is-failed .step-dot { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.step.is-failed { color: var(--red); font-weight: 600; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail-side { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 14px; }

.summary-list { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 9px 14px; margin: 0; font-size: 12.5px; }
.summary-list dt { color: var(--muted); font-size: 11.5px; }
.summary-list dd { margin: 0; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }

.side-card { padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.side-card h3 { margin: 0 0 10px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em; }
.side-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.side-card p + p { margin-top: 8px; }
.side-card p strong { color: var(--green-deep); font-size: 13px; }
.side-card ul { margin: 0; padding-left: 16px; color: var(--ink-soft); font-size: 12px; line-height: 1.8; }

/* ------------------------------------------------------------------ */
/* Outline                                                             */
/* ------------------------------------------------------------------ */

.outline-list { display: flex; flex-direction: column; gap: 12px; }
.slide-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefb;
}
.slide-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
}
.slide-body { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.slide-title-input { font-size: 14.5px; font-weight: 600; }
.point-row { display: flex; align-items: center; gap: 8px; }
.point-bullet { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--orange); }
.point-input { flex: 1; padding: 8px 11px; font-size: 13px; }
.point-remove { padding: 2px; border: 0; border-radius: 6px; background: transparent; color: var(--faint); cursor: pointer; }
.point-remove:hover { color: var(--red); background: var(--red-soft); }
.point-remove svg { width: 14px; height: 14px; }
.add-point {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--green);
  font-size: 12px;
  cursor: pointer;
}
.add-point:hover { color: var(--green-deep); }
.add-point:disabled { color: var(--faint); cursor: not-allowed; }
.add-point svg { width: 13px; height: 13px; }

.readonly-outline { display: flex; flex-direction: column; gap: 10px; }
.readonly-slide { padding: 12px 0; border-bottom: 1px solid var(--line); }
.readonly-slide:last-child { border-bottom: 0; padding-bottom: 0; }
.readonly-title { font-size: 13.5px; font-weight: 600; }
.readonly-points { margin: 6px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: 12.5px; line-height: 1.8; }

/* ------------------------------------------------------------------ */
/* Render state, preview, download                                     */
/* ------------------------------------------------------------------ */

.render-panel { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 46px 24px; text-align: center; }
.spinner {
  width: 38px;
  height: 38px;
  border: 2px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.render-title { margin: 0; font-family: var(--font-serif); font-size: 22px; font-weight: 600; }
.render-text { max-width: 460px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.render-elapsed { color: var(--faint); font-size: 11.5px; }
.render-panel .callout { width: 100%; max-width: 540px; text-align: left; }

.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 14px; }
.preview-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.preview-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.preview-card img { width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--surface-3); object-fit: contain; }
.preview-card figcaption { display: flex; justify-content: space-between; gap: 8px; padding: 8px 11px; color: var(--muted); font-size: 11.5px; }
.preview-card figcaption a { color: var(--green); }
.preview-open { display: block; }

.download-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(31, 90, 72, 0.2);
  border-radius: 14px;
  background: linear-gradient(150deg, #f4f9f5, #e9f1eb);
}
.download-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--green);
  color: #fbf8f0;
}
.download-icon svg { width: 20px; height: 20px; }
.download-main { flex: 1; min-width: 0; }
.download-name { font-size: 13px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.download-meta { margin-top: 2px; color: var(--muted); font-size: 11.5px; }

details.outline-details { padding: 0; }
details.outline-details > summary {
  padding: 16px 22px;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  list-style: none;
}
details.outline-details > summary::-webkit-details-marker { display: none; }
details.outline-details > summary::after { content: "＋"; float: right; color: var(--muted); font-weight: 400; }
details.outline-details[open] > summary::after { content: "－"; }
details.outline-details > .outline-body { padding: 0 22px 20px; }

.error-panel { display: flex; flex-direction: column; gap: 14px; padding: 26px 28px; }

/* ------------------------------------------------------------------ */
/* Toasts and dialog                                                   */
/* ------------------------------------------------------------------ */

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #16241f;
  color: #f8f4ea;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
  animation: toast-in 0.25s ease both;
}
.toast.is-error { background: #5c2a20; }
.toast.is-success { background: #1d4a3c; }
.toast svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }

dialog.modal {
  width: calc(100vw - 40px);
  max-width: 440px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 40px 80px -30px rgba(10, 20, 16, 0.55);
}
dialog.modal::backdrop { background: rgba(20, 30, 26, 0.42); backdrop-filter: blur(3px); }
.modal-body { padding: 26px 26px 18px; }
.modal-title { margin: 0 0 10px; font-family: var(--font-serif); font-size: 22px; font-weight: 600; }
.modal-text { margin: 0; color: var(--ink-soft); font-size: 13.5px; line-height: 1.8; }
.modal-text strong { color: var(--green-deep); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 26px 22px; }

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

@media (max-width: 1080px) {
  .view { padding: 32px 28px 64px; }
  .topbar { padding: 14px 28px; }
  .site-foot { padding: 0 28px 24px; }
  .compose-layout { grid-template-columns: 1fr; }
  .aside-stack { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { position: static; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand { padding: 0; gap: 9px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; font-size: 17px; }
  .brand-name { font-size: 18px; }
  .brand-sub { display: none; }
  .nav { flex-direction: row; gap: 2px; margin-left: 6px; }
  .nav-link { gap: 6px; padding: 8px 10px; font-size: 13px; }
  .nav-link svg { width: 16px; height: 16px; }
  .sidebar-foot { display: flex; align-items: center; gap: 8px; margin: 0 0 0 auto; }
  .credit-card {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 10px;
    border-radius: 999px;
    box-shadow: none;
  }
  .credit-label, .credit-hint { display: none; }
  .credit-row { margin: 0; gap: 3px; }
  .credit-number { font-family: var(--font-sans); font-size: 15px; font-weight: 700; line-height: 1; }
  .credit-unit { font-size: 10px; }
  .account { margin: 0; padding: 0; gap: 6px; }
  .account-info { display: none; }
  .avatar { width: 30px; height: 30px; }
  .topbar { padding: 10px 16px; gap: 10px; justify-content: flex-end; }
  .topbar-note { display: none; }
  .topbar-eyebrow { display: none; }
  .topbar-left { display: none; }
  .view { padding: 24px 16px 56px; }
  .site-foot { flex-direction: column; gap: 4px; padding: 0 16px 22px; }
  .guest-layout { gap: 28px; padding-top: 8px; }
  .side-card { padding: 16px 18px; }
}

@media (max-width: 760px) {
  .guest-layout { grid-template-columns: 1fr; align-items: start; }
  .guest-title { font-size: 36px; }
  .guest-preview { display: none; }
  .detail-head { flex-direction: column; gap: 16px; }
  .detail-actions { justify-content: flex-start; }
  .detail-title { font-size: 27px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .step:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .step:nth-child(4) { border-top: 1px solid var(--line); }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stat-card:nth-child(3) { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-side, .aside-stack { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .page-title { font-size: 28px; }
  .job-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 16px 18px; }
  .job-arrow { display: none; }
  .job-meta { gap: 7px 10px; }
  .summary-list { grid-template-columns: 74px minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .brand-name { display: none; }
  .brand-mark { width: 30px; height: 30px; font-size: 16px; }
  .nav { margin-left: 2px; }
  .nav-link { padding: 8px; }
  .nav-link span { display: none; }
  .credit-card { padding: 5px 8px; }
  .topbar { padding: 8px 12px; }
  .topbar-right { gap: 6px; }
  .bridge-pill { padding: 5px 9px; font-size: 10.5px; }
  #topbar-new span { display: none; }
  #topbar-new { padding: 7px 9px; }
  .view { padding: 20px 14px 48px; }
  .page-title { font-size: 26px; }
  .panel-pad, .form-panel { padding: 20px 18px; }
  .render-panel { padding: 38px 16px; }
  .detail-title { font-size: 24px; }
  .login-panel { padding: 24px 20px 22px; }
  .login-head h2 { font-size: 23px; }
  .guest-title { font-size: 31px; }
  .lede { font-size: 13.5px; }
  .code-input { font-size: 24px; letter-spacing: 0.36em; }
  .toast-region { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
}

/* ------------------------------------------------------------------ */
/* Motion                                                              */
/* ------------------------------------------------------------------ */

.view > * { animation: fade-up 0.28s ease both; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
