:root {
  --paper: #e9e8e2;
  --sheet: #fffefa;
  --ink: #191918;
  --muted: #77746c;
  --line: #d6d3ca;
  --soft-line: #e9e6df;
  --soft: #eae8e1;
  --dark: #181817;
  --danger: #9f2f2f;
  --success: #355b3d;
  --shadow: 0 16px 50px rgba(29, 28, 24, 0.08);
  --radius: 2px;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 10px 14px; transform: translateY(-160%); background: var(--dark); color: white; }
.skip-link:focus { transform: none; }
.auth-gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(440px, 1.2fr);
  align-items: stretch;
  background: var(--paper);
}
.auth-brand { display: flex; align-items: flex-start; gap: 13px; padding: clamp(28px, 5vw, 72px); border-right: 1px solid var(--ink); }
.auth-brand::after { align-self: end; margin: auto 0 0 auto; color: var(--muted); font-family: Georgia, "Songti SC", "SimSun", serif; font-size: clamp(44px, 7vw, 104px); line-height: .9; content: "文渡"; writing-mode: vertical-rl; opacity: .12; }
.auth-card { align-self: center; width: min(520px, calc(100% - 48px)); margin: 40px auto; padding: clamp(28px, 5vw, 56px); border: 1px solid var(--ink); background: var(--sheet); box-shadow: 18px 18px 0 var(--soft-line); }
.auth-card h1 { margin: 10px 0 12px; font-family: Georgia, "Songti SC", "SimSun", serif; font-size: clamp(30px, 4vw, 48px); font-weight: 500; letter-spacing: -.04em; }
.auth-lead { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.auth-google, .auth-submit { display: grid; width: 100%; min-height: 46px; place-items: center; text-align: center; text-decoration: none; }
.auth-google.is-disabled { cursor: not-allowed; opacity: .45; }
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--muted); font-size: 11px; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.email-code-step { display: grid; margin-top: 14px; gap: 10px; }
.email-code-step .text-button { justify-self: start; }
.auth-status, .auth-terms { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.auth-status.is-ready { color: var(--success); }
.auth-status.is-error { color: var(--danger); }
.site-header {
  position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 78px; padding: 14px clamp(18px, 4vw, 58px); border-bottom: 1px solid var(--line);
  background: rgba(244, 243, 239, 0.94); backdrop-filter: blur(18px);
}
.brand-lockup { display: flex; align-items: center; gap: 13px; }
.brand-seal { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--ink); font-family: Georgia, "Songti SC", "SimSun", serif; font-size: 23px; }
.brand-name, .brand-line, .eyebrow, .panel-kicker, .asset-title, .asset-summary, .dialog-copy { margin: 0; }
.brand-name { font-family: Georgia, "Songti SC", "SimSun", serif; font-size: 20px; letter-spacing: 0.12em; }
.brand-line { margin-top: 2px; color: var(--muted); font-size: 11px; letter-spacing: 0.14em; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.account-button { display: grid; max-width: 180px; padding: 5px 9px; border: 0; border-left: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.account-button span { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.account-button small { margin-top: 2px; color: var(--success); font-size: 9px; }
.button, .text-button, .editor-toolbar button, .tab, .dialog-close { border: 0; background: transparent; cursor: pointer; }
.button { min-height: 38px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sheet); transition: border-color 150ms ease, background 150ms ease, color 150ms ease; }
.button:hover { border-color: var(--ink); }
.button-dark { border-color: var(--dark); background: var(--dark); color: white; }
.button-dark:hover { background: #333; }
.button:disabled, .payment-method:disabled { cursor: not-allowed; opacity: .5; }
.button-ghost { color: var(--muted); }
.button-small { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.save-status { margin-right: 5px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.save-status.is-saving { color: var(--ink); }
.page-shell { width: min(1580px, 100%); margin: 0 auto; padding: 0 clamp(16px, 3vw, 44px) 56px; }
.intro-strip { display: flex; align-items: end; justify-content: space-between; gap: 40px; padding: 54px 2px 34px; border-bottom: 1px solid var(--ink); }
.eyebrow, .panel-kicker { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: 0.18em; text-transform: uppercase; }
.intro-strip h1 { max-width: 720px; margin: 10px 0 0; font-family: Georgia, "Songti SC", "SimSun", serif; font-size: clamp(32px, 4vw, 58px); font-weight: 500; letter-spacing: -0.035em; line-height: 1.13; }
.mini-steps { display: grid; min-width: 280px; margin: 0; padding: 0; gap: 9px; color: var(--muted); font-size: 12px; list-style: none; }
.mini-steps li { display: flex; gap: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--soft-line); }
.mini-steps span { color: var(--ink); font-variant-numeric: tabular-nums; }
.workspace { position: relative; display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); min-height: 760px; margin-top: 28px; overflow: clip; border: 1px solid var(--line); background: var(--sheet); box-shadow: var(--shadow); }
.editor-panel, .preview-panel { min-width: 0; padding: clamp(22px, 2.6vw, 38px); }
.editor-panel { border-right: 1px solid var(--line); background: #fbfbf9; }
.preview-panel { background: var(--sheet); }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.panel-heading h2 { margin: 7px 0 0; font-family: Georgia, "Songti SC", "SimSun", serif; font-size: 25px; font-weight: 500; }
.text-button { padding: 2px 0; border-bottom: 1px solid currentColor; color: var(--muted); font-size: 12px; }
.text-button:hover { color: var(--ink); }
.metadata-card { margin-bottom: 18px; border-block: 1px solid var(--line); }
.metadata-card summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 0; cursor: pointer; font-size: 13px; list-style: none; }
.metadata-card summary::-webkit-details-marker { display: none; }
.metadata-card summary::after { content: "＋"; margin-left: auto; font-size: 17px; }
.metadata-card[open] summary::after { content: "－"; }
.summary-hint { color: var(--muted); font-size: 11px; }
.metadata-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 2px 0 18px; }
.field { display: grid; gap: 7px; min-width: 0; color: var(--muted); font-size: 12px; }
.field-wide { grid-column: 1 / -1; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: white; color: var(--ink); }
.field input, .field select { height: 39px; padding: 0 11px; }
.field textarea { min-height: 68px; padding: 10px 11px; resize: vertical; }
.field-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 9px; }
.field-help { color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.45; }
.inline-field { display: flex; align-items: center; min-height: 39px; gap: 10px; }
.file-name { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.editor-toolbar { display: flex; align-items: center; min-height: 42px; padding: 5px; border: 1px solid var(--line); border-bottom: 0; background: var(--soft); }
.editor-toolbar button { display: grid; min-width: 32px; height: 30px; place-items: center; border-right: 1px solid var(--line); color: #484743; font-size: 12px; }
.editor-toolbar button:hover { background: white; color: var(--ink); }
.toolbar-spacer { flex: 1; }
.source-stats { padding: 0 7px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.editor-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.source-editor { width: 100%; min-height: 430px; padding: 20px; border: 1px solid var(--line); border-radius: 0; background: linear-gradient(to bottom, transparent 31px, rgba(0, 0, 0, 0.035) 32px) 0 0 / 100% 32px, #fff; color: #222; font-family: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 14px; line-height: 32px; resize: vertical; }
.source-editor::placeholder { color: #aaa8a1; }
.asset-strip { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.asset-title { font-size: 12px; }
.asset-summary { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.asset-list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.asset-chip { display: inline-flex; align-items: center; max-width: 180px; min-height: 27px; padding: 4px 8px; border: 1px solid var(--line); background: white; font-size: 11px; }
.asset-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-chip button { margin-left: 7px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.ai-card { display: grid; margin-top: 28px; padding: 22px; border: 1px solid var(--ink); background: white; gap: 18px; }
.ai-card h3 { margin: 6px 0 5px; font-family: Georgia, "Songti SC", "SimSun", serif; font-size: 20px; font-weight: 500; }
.ai-card p:not(.panel-kicker) { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.ai-settings-button { margin-top: 8px; }
.ai-access-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 9px; }
.ai-access-row label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.ai-access-row select { min-height: 30px; padding: 4px 25px 4px 8px; border: 1px solid var(--line); background: var(--sheet); color: var(--ink); font-size: 10px; }
.ai-quota-status { color: var(--success); font-size: 10px; }
.ai-quota-status.is-empty { color: var(--danger); }
.ai-template-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 13px; border: 1px solid var(--line); background: var(--soft); }
.ai-template-box .field { gap: 6px; }
.ai-template-box .field-help { grid-column: 1 / -1; }
.workflow-entry { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 14px; border-top: 1px solid var(--soft-line); }
.workflow-entry div { display: grid; gap: 4px; }
.workflow-entry span { font-size: 12px; }
.workflow-entry small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.candidate-notice, .stale-notice { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-left: 3px solid var(--ink); background: var(--soft); font-size: 12px; }
.preview-heading { margin-bottom: 14px; }
.readiness { margin: 0; padding: 5px 9px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.readiness.is-ready { border-color: var(--success); color: var(--success); }
.platform-note { margin-bottom: 18px; padding: 10px 12px; border-block: 1px solid var(--soft-line); color: var(--muted); font-size: 11px; line-height: 1.55; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--ink); }
.tab { position: relative; padding: 13px 8px; color: var(--muted); font-size: 13px; }
.tab::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: transparent; content: ""; }
.tab:hover, .tab.is-active { color: var(--ink); }
.tab.is-active::after { background: var(--ink); }
.tab-panel { min-width: 0; padding-top: 16px; }
.output-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 42px; margin-bottom: 13px; color: var(--muted); font-size: 11px; }
.output-actions > div { display: flex; gap: 6px; }
.output-format { align-items: center; flex-wrap: wrap; gap: 8px 12px !important; }
.output-buttons { align-items: center; flex-shrink: 0; }
.platform-template { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.platform-template select { min-width: 104px; height: 30px; padding: 0 24px 0 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sheet); color: var(--ink); font-size: 11px; }
.article-preview { min-height: 620px; padding: clamp(28px, 5vw, 62px); overflow-wrap: anywhere; border: 1px solid var(--soft-line); background: white; }
.x-preview { max-width: 760px; margin: 0 auto; }
.empty-preview { display: grid; min-height: 380px; place-items: center; align-content: center; color: #aaa8a1; text-align: center; }
.empty-preview span { display: grid; width: 58px; height: 58px; margin-bottom: 12px; place-items: center; border: 1px solid #bbb9b2; font-family: Georgia, "Songti SC", "SimSun", serif; font-size: 28px; }
.empty-preview p { margin: 0; font-size: 12px; }
.thread-actions { margin-bottom: 12px; }
.toggle { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.thread-list { display: grid; gap: 12px; }
.thread-card { padding: 14px; border: 1px solid var(--line); background: white; }
.thread-card.is-over { border-color: var(--danger); }
.thread-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; color: var(--muted); font-size: 11px; }
.thread-number { color: var(--ink); font-variant-numeric: tabular-nums; }
.thread-card textarea { width: 100%; min-height: 118px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; line-height: 1.65; resize: vertical; }
.thread-card-foot { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--soft-line); color: var(--muted); font-size: 11px; }
.thread-count.is-over { color: var(--danger); }
.thread-images { display: flex; flex-wrap: wrap; gap: 5px; }
.thread-image-chip { padding: 3px 6px; background: var(--soft); }
.drop-overlay { position: absolute; z-index: 15; inset: 0; display: grid; place-items: center; background: rgba(244, 243, 239, 0.94); border: 2px dashed var(--ink); }
.drop-overlay div { text-align: center; }
.drop-overlay span { display: grid; width: 66px; height: 66px; margin: 0 auto 12px; place-items: center; border: 1px solid var(--ink); font-family: Georgia, "Songti SC", "SimSun", serif; font-size: 30px; }
.drop-overlay p { margin: 0; font-size: 14px; }
.dialog { max-width: none; padding: 0; border: 0; background: transparent; }
.dialog::backdrop { background: rgba(10, 10, 9, 0.62); backdrop-filter: blur(5px); }
.dialog-card, .compare-card { width: min(560px, calc(100vw - 28px)); padding: 28px; border: 1px solid var(--ink); background: var(--paper); box-shadow: 0 28px 90px rgba(0, 0, 0, 0.25); }
.ai-dialog .dialog-card { width: min(660px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow: auto; }
.workflow-card { width: min(1000px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 28px; overflow: auto; border: 1px solid var(--ink); background: var(--paper); box-shadow: 0 28px 90px rgba(0, 0, 0, 0.25); }
.compare-card { width: min(1120px, calc(100vw - 28px)); }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.dialog-heading h2 { margin: 6px 0 0; font-family: Georgia, "Songti SC", "SimSun", serif; font-size: 25px; font-weight: 500; }
.dialog-close { width: 34px; height: 34px; font-size: 28px; line-height: 1; }
.dialog-copy { margin-bottom: 20px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.dialog-card .field + .field { margin-top: 13px; }
.custom-ai-fields { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.ai-settings-fields { display: grid; gap: 13px; }
.ai-settings-fields .field + .field { margin-top: 0; }
.skill-upload-row { display: flex; align-items: center; gap: 10px; }
.skill-summary { color: var(--muted); font-size: 11px; }
.skill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 8px; border: 1px solid var(--line); background: white; color: var(--ink); font-size: 11px; }
.skill-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-chip button { padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.skill-safety { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.image-option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.workflow-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 22px; padding: 0; border-block: 1px solid var(--line); list-style: none; }
.workflow-progress li { display: flex; align-items: center; min-height: 48px; gap: 9px; color: var(--muted); font-size: 11px; }
.workflow-progress li + li { padding-left: 14px; border-left: 1px solid var(--line); }
.workflow-progress li span { font-family: Georgia, "Songti SC", "SimSun", serif; font-size: 16px; }
.workflow-progress li.is-active { color: var(--ink); }
.workflow-progress li.is-complete { color: var(--success); }
.workflow-step { min-height: 330px; }
.workflow-step > .field + .field { margin-top: 13px; }
.workflow-model-row, .workflow-skill-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding: 10px 12px; border: 1px solid var(--soft-line); background: white; }
.workflow-model-row > div { display: flex; flex-wrap: wrap; gap: 7px; }
.workflow-model-row span { padding: 4px 7px; border: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.workflow-model-row span.is-ready { border-color: var(--success); color: var(--success); }
.workflow-skill-row > div { display: grid; gap: 3px; font-size: 11px; }
.workflow-skill-row small { color: var(--muted); font-size: 10px; }
.workflow-result-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(240px, .7fr); gap: 18px; }
.workflow-result-grid > div { min-width: 0; }
.workflow-result-grid .field + .field { margin-top: 13px; }
.workflow-image-card { display: grid; min-height: 260px; margin: 0; place-items: center; align-content: center; overflow: hidden; border: 1px solid var(--line); background: white; }
.workflow-image-card img { display: block; width: 100%; max-height: 430px; object-fit: contain; }
.workflow-image-card figcaption { padding: 16px; color: var(--muted); font-size: 11px; line-height: 1.6; text-align: center; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.billing-balance { display: flex; align-items: end; justify-content: space-between; margin-bottom: 18px; padding: 18px; border: 1px solid var(--ink); background: var(--sheet); }
.billing-balance span { color: var(--muted); font-size: 12px; }
.billing-balance strong { font-family: Georgia, "Songti SC", "SimSun", serif; font-size: 42px; font-weight: 500; line-height: 1; }
.payment-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.payment-method { display: grid; min-height: 76px; padding: 14px; border: 1px solid var(--line); background: var(--sheet); text-align: left; }
.payment-method span { font-size: 14px; }
.payment-method small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.billing-note { margin: 13px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.form-error { margin-top: 12px; padding: 9px 10px; border-left: 3px solid var(--danger); background: #f4e8e8; color: var(--danger); font-size: 12px; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compare-grid label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
.compare-grid textarea { width: 100%; min-height: min(62vh, 620px); padding: 16px; border: 1px solid var(--line); background: white; color: var(--ink); font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace; font-size: 13px; line-height: 1.7; resize: vertical; }
.toast { position: fixed; z-index: 100; right: 20px; bottom: 20px; max-width: min(420px, calc(100vw - 40px)); padding: 12px 16px; border: 1px solid var(--ink); background: var(--dark); color: white; box-shadow: var(--shadow); font-size: 12px; line-height: 1.55; }
[hidden] { display: none !important; }

/* 石墨编辑台：正式工作界面 */
.site-header {
  min-height: 66px;
  padding: 9px clamp(16px, 2.5vw, 42px);
  background: rgba(245, 244, 239, 0.94);
}
.brand-seal { width: 36px; height: 36px; background: var(--sheet); font-size: 19px; }
.brand-name { font-size: 17px; font-weight: 600; }
.brand-line { font-size: 9px; }
.header-actions { gap: 7px; }
.save-status::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(53, 91, 61, 0.1);
  content: "";
  vertical-align: 1px;
}
.button { min-height: 34px; padding: 7px 12px; font-size: 11px; }
.button:hover { transform: translateY(-1px); }
.page-shell {
  width: min(1760px, 100%);
  margin: 0 auto;
  padding: 16px 16px 24px;
}
.workspace {
  grid-template-columns: minmax(420px, 0.86fr) minmax(560px, 1.14fr);
  min-height: calc(100vh - 106px);
  margin-top: 0;
  overflow: hidden;
  border-color: #cfccc3;
  box-shadow: var(--shadow);
  animation: studio-in 420ms cubic-bezier(.22, .8, .26, 1) both;
}
.editor-panel, .preview-panel { padding: clamp(20px, 2.4vw, 38px); }
.editor-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  background: #f5f4ef;
}
.preview-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  background: #e5e3dc;
}
.panel-heading { min-height: 58px; margin-bottom: 0; }
.panel-heading h2 { margin-top: 6px; font-size: 25px; letter-spacing: -0.02em; }
.panel-kicker { font-size: 9px; letter-spacing: 0.18em; }
.metadata-card { margin: 0 0 11px; border-top: 0; }
.metadata-card summary { min-height: 38px; padding: 7px 0; font-size: 11px; }
.metadata-grid { padding-bottom: 14px; }
.document-tools { min-width: 0; }
.editor-toolbar {
  min-height: 42px;
  margin-top: 0;
  padding: 5px;
  background: var(--soft);
  scrollbar-width: none;
}
.editor-toolbar::-webkit-scrollbar { display: none; }
.editor-document {
  display: flex;
  min-height: 510px;
  flex: 1;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--sheet);
  box-shadow: 0 12px 35px rgba(30, 29, 25, 0.045);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.document-title-input {
  width: calc(100% - 42px);
  margin: 24px 21px 0;
  padding: 0 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: Georgia, "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(20px, 2vw, 29px);
  line-height: 1.35;
}
.document-title-input::placeholder { color: #aaa79f; }
.document-title-rule { height: 1px; margin: 0 21px; background: var(--soft-line); }
.source-editor {
  min-height: 420px;
  flex: 1;
  padding: 22px 21px 28px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #33322f;
  font-size: 13px;
  line-height: 1.95;
  resize: vertical;
}
.source-editor.is-asset-drop-target {
  background: #f4f2ea;
  box-shadow: inset 0 0 0 2px var(--ink);
}
.asset-strip {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 1.3fr);
  align-items: start;
  margin-top: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  background: transparent;
}
.asset-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 7px; }
.asset-chip {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  max-width: none;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  background: var(--sheet);
  cursor: grab;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.asset-chip:hover { border-color: var(--ink); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(28, 27, 24, .06); }
.asset-chip:active { cursor: grabbing; }
.asset-chip.is-dragging { opacity: .55; }
.asset-thumb { width: 40px; height: 40px; object-fit: cover; background: var(--soft); }
.asset-copy { display: grid; min-width: 0; gap: 2px; }
.asset-copy strong { overflow: hidden; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.asset-copy small { color: var(--muted); font-size: 8px; }
.asset-buttons { display: grid; align-self: stretch; }
.asset-buttons button {
  min-width: 38px;
  margin-left: 0;
  padding: 2px 5px;
  border: 0;
  border-left: 1px solid var(--soft-line);
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}
.asset-buttons button:hover { color: var(--ink); background: var(--soft); }
.ai-card {
  grid-template-columns: 1fr;
  margin-top: 8px;
  padding: 14px;
  border-color: var(--line);
  gap: 14px;
}
.ai-card h3 { margin: 4px 0; font-size: 16px; }
.ai-card p:not(.panel-kicker) { font-size: 10px; line-height: 1.5; }
.candidate-notice { grid-column: 1 / -1; }
.preview-heading { min-height: 58px; margin-bottom: 0; }
.readiness { border: 0; color: var(--success); }
.readiness::before { display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: currentColor; content: ""; vertical-align: 1px; }
.platform-note {
  order: 5;
  margin: 8px 0 0;
  padding: 8px 0 0;
  border: 0;
  color: var(--muted);
  font-size: 9px;
}
.tabs { min-height: 48px; margin-top: 11px; border-block: 1px solid #cac7be; border-bottom-color: #cac7be; }
.tab { font-size: 11px; }
.tab::after { right: 14px; left: 14px; height: 2px; }
.tab-panel {
  min-height: 680px;
  flex: 1;
  margin-top: 14px;
  padding: 16px;
  overflow: auto;
  border: 1px solid #d1cec5;
  background:
    linear-gradient(rgba(255, 255, 255, .34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .34) 1px, transparent 1px),
    #dcdad3;
  background-size: 24px 24px;
}
.tab-panel:not([hidden]) { display: block; animation: preview-in 260ms ease both; }
.output-actions {
  min-height: 38px;
  margin: -16px -16px 16px;
  padding: 7px 10px;
  border-bottom: 1px solid #cfccc3;
  background: rgba(245, 244, 239, .92);
}
.article-preview {
  width: min(680px, 100%);
  min-height: 720px;
  margin: 0 auto;
  padding: clamp(34px, 5vw, 62px);
  border-color: #d5d2c9;
  background: var(--sheet);
  box-shadow: 0 20px 55px rgba(31, 29, 25, .1);
}
.thread-list { width: min(620px, 100%); margin: 0 auto; }
.thread-card { background: var(--sheet); box-shadow: 0 10px 30px rgba(31, 29, 25, .06); }

@keyframes studio-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes preview-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 1080px) {
  .site-header { align-items: flex-start; }
  .header-actions { flex-wrap: wrap; }
  .save-status { width: 100%; text-align: right; }
  .workspace { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); }
  .editor-panel, .preview-panel { padding: 22px; }
  .editor-toolbar { overflow-x: auto; }
  .ai-card { grid-template-columns: 1fr; }
  .candidate-notice { grid-column: auto; }
}
@media (max-width: 760px) {
  .workspace { grid-template-columns: 1fr; }
  .editor-panel { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .auth-gate { display: block; padding: 18px; }
  .auth-brand { padding: 6px 0 18px; border: 0; border-bottom: 1px solid var(--ink); }
  .auth-brand::after { display: none; }
  .auth-card { width: 100%; margin: 28px 0; padding: 24px; box-shadow: 8px 8px 0 var(--soft-line); }
  .site-header { position: static; display: block; padding: 14px 16px; }
  .header-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; margin-top: 14px; }
  .header-actions .button { width: 100%; min-width: 0; }
  .account-button { grid-column: 1 / -1; max-width: none; border-left: 0; border-bottom: 1px solid var(--line); }
  .save-status { grid-column: 1 / -1; width: auto; margin: 0; text-align: left; }
  .intro-strip { display: block; padding-top: 36px; }
  .intro-strip h1 { max-width: 100%; font-size: clamp(30px, 9vw, 36px); overflow-wrap: anywhere; }
  .mini-steps { min-width: 0; width: 100%; margin-top: 26px; }
  .page-shell { padding-inline: 10px; }
  .workspace { margin-top: 0; }
  .editor-panel, .preview-panel { padding: 20px 14px; }
  .metadata-grid, .compare-grid, .image-option-grid, .workflow-result-grid, .payment-methods { grid-template-columns: 1fr; }
  .ai-template-box { grid-template-columns: 1fr; }
  .workflow-entry, .workflow-model-row, .workflow-skill-row { align-items: stretch; flex-direction: column; }
  .workflow-card { padding: 20px 14px; }
  .workflow-progress li { justify-content: center; }
  .workflow-progress li + li { padding-left: 0; }
  .field-wide { grid-column: auto; }
  .summary-hint, .output-note { display: none; }
  .source-stats[title] { display: none; }
  .editor-document { min-height: 470px; }
  .document-title-input { width: calc(100% - 30px); margin: 20px 15px 0; }
  .document-title-rule { margin-inline: 15px; }
  .source-editor { min-height: 360px; padding: 18px 15px; }
  .asset-strip { grid-template-columns: 1fr; }
  .output-actions { align-items: flex-start; flex-direction: column; }
  .output-format, .output-buttons { width: 100%; }
  .output-buttons { justify-content: flex-end; }
  .asset-list { justify-content: flex-start; }
  .tab-panel { min-height: 520px; padding: 8px; }
  .output-actions { margin: -8px -8px 8px; }
  .article-preview { min-height: 500px; padding: 25px 18px; }
  .compare-grid textarea { min-height: 36vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
