:root {
  color-scheme: light;
  --ink: #202422;
  --muted: #747d78;
  --line: #dce2de;
  --paper: #ffffff;
  --canvas: #f3f5f2;
  --accent: #dc543f;
  --accent-dark: #ae382b;
  --green: #2f7763;
  --green-pale: #e6f1ec;
  --gold: #a46d13;
  --gold-pale: #fff3da;
  --radius: 5px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #e7a091; outline-offset: 2px; }
.app-header { min-height: 62px; display: flex; align-items: center; padding: 0 30px; gap: 42px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 720; white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; border-radius: 5px; background: var(--accent); display: inline-grid; place-items: center; color: white; font-size: 16px; font-weight: 800; }
.brand-divider { width: 1px; height: 19px; background: var(--line); margin: 0 2px 0 6px; }
.brand-subtitle { font-weight: 500; color: #5f6862; font-size: 13px; }
.top-tabs { align-self: stretch; display: flex; align-items: stretch; gap: 22px; flex: 1; }
.tab-button { position: relative; border: 0; border-radius: 0; background: transparent; color: var(--muted); padding: 0 2px; }
.tab-button.is-active { color: var(--ink); font-weight: 650; }
.tab-button.is-active::after { content: ""; height: 2px; background: var(--accent); position: absolute; bottom: -1px; left: 0; right: 0; }
.header-user { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.user-name { color: #606963; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.page-shell { width: min(1440px, 100%); margin: 0 auto; padding: 28px 30px 60px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 23px; }
.source-tabs { display: flex; gap: 20px; padding: 0 2px; border-bottom: 1px solid var(--line); background: var(--paper); }
.source-tab { position: relative; min-height: 42px; padding: 0 2px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.source-tab.is-active { color: var(--ink); font-weight: 680; }
.source-tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.eyebrow, .micro-label { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1px; margin: 0 0 5px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 25px; line-height: 1.2; margin: 0; font-weight: 690; }
h2 { font-size: 16px; margin: 0; font-weight: 670; }
h3 { font-size: 14px; margin: 0; }
.heading-note { color: var(--muted); margin: 0 0 3px; font-size: 12px; }
.workspace-layout { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr); align-items: start; border-top: 1px solid var(--line); background: var(--paper); }
.source-column { min-width: 0; border-right: 1px solid var(--line); }
.creator-column { min-width: 0; border-left: 1px solid var(--line); margin-left: -1px; background: #fafbf9; }
.control-section, .manual-section { padding: 20px 20px 22px; border-bottom: 1px solid var(--line); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.section-title .micro-label { margin: 0; }
.category-options { display: grid; gap: 3px; margin: 0 0 17px; }
.category-option { display: flex; align-items: flex-start; gap: 9px; padding: 6px 2px; cursor: pointer; color: #4f5852; font-size: 12px; line-height: 1.4; }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; margin: 1px 0 0; flex: 0 0 auto; }
.button { min-height: 36px; border-radius: var(--radius); padding: 7px 12px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 620; font-size: 12px; transition: background-color .12s ease, border-color .12s ease; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button-primary { background: var(--accent); color: white; }
.button-primary:hover:not(:disabled) { background: var(--accent-dark); }
.button-dark { background: var(--ink); color: white; }
.button-dark:hover:not(:disabled) { background: #080a09; }
.button-outline { background: white; border-color: #bfc9c2; color: var(--ink); }
.button-outline:hover:not(:disabled), .button-quiet:hover:not(:disabled) { background: #f0f3f0; }
.button-quiet { min-height: 32px; padding: 5px 9px; background: transparent; color: #59625d; border-color: transparent; }
.button-wide { width: 100%; }
.button-symbol { font-size: 15px; line-height: 1; }
.control-footnote { font-size: 10px; color: var(--muted); margin: 8px 0 0; }
.field-label { display: block; font-size: 11px; color: #59625d; margin: 12px 0 5px; }
select, input[type="text"], input[type="url"], input[type="search"], input[type="password"], textarea { background: #fff; border: 1px solid #cbd3ce; border-radius: var(--radius); min-height: 36px; padding: 7px 9px; width: 100%; font-size: 12px; }
select { padding-right: 28px; }
textarea { resize: vertical; line-height: 1.55; }
.control-section > select { margin-bottom: 1px; }
.field-pair { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.length-control { min-width: 0; }
.length-control .field-label { display: flex; justify-content: space-between; align-items: baseline; gap: 5px; }
.length-control output { color: var(--ink); font-weight: 680; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 36px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.creator-settings { padding: 21px 22px 22px; border-bottom: 1px solid var(--line); }
.creator-settings .section-title { align-items: start; margin-bottom: 18px; }
.creator-settings .section-title .eyebrow { margin-bottom: 3px; }
.creator-settings .section-title .micro-label { margin-top: 3px; }
.creator-settings .field-pair { grid-template-columns: 1fr 1.1fr; margin-top: 2px; }
.creator-note { margin: 12px 0 14px; color: #59625d; font-size: 11px; }
.selection-copy { min-height: 17px; margin: 12px 0 6px; color: var(--muted); font-size: 10px; }
.creator-settings > .button { min-height: 42px; justify-content: space-between; padding: 9px 13px; font-size: 13px; }
.image-settings { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); }
.image-settings .section-title { margin-bottom: 9px; }
.image-settings .section-title h3 { font-size: 12px; }
.image-settings .micro-label { margin: 0; font-size: 9px; letter-spacing: 0; text-align: right; }
.image-options-pair { grid-template-columns: 1fr 1.4fr !important; align-items: end; }
.toggle-row { display: flex; align-items: center; gap: 8px; min-height: 36px; padding-bottom: 9px; color: #59625d; font-size: 10px; cursor: pointer; }
.toggle-row input { accent-color: var(--accent); width: 15px; height: 15px; flex: 0 0 auto; }
.manual-section h2 { margin-bottom: 13px; }
.manual-section form { display: grid; }
.manual-section form .field-label { margin-top: 10px; }
.manual-section .button { margin-top: 14px; }
.optional-label { color: #89918c; font-size: 10px; }
.candidate-section { padding: 20px 22px 0; }
.section-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.section-heading-row .eyebrow { margin-bottom: 4px; }
.section-heading-row h2 { font-size: 18px; }
.count-mark { display: inline-block; vertical-align: 2px; font-size: 11px; font-weight: 600; color: var(--green); background: var(--green-pale); border-radius: 99px; padding: 1px 7px; margin-left: 4px; }
.candidate-tools { display: flex; align-items: center; gap: 7px; }
.candidate-tools select { min-width: 140px; width: auto; }
.status-line { border-top: 1px solid var(--line); margin-top: 16px; padding: 11px 0; color: var(--muted); font-size: 11px; }
.status-line.is-error { color: var(--accent-dark); }
.status-line.is-loading { color: var(--green); }
.source-failures { padding: 9px 11px; margin: 0 0 10px; border-left: 3px solid #d59b37; background: var(--gold-pale); color: #715218; font-size: 11px; }
.source-failures p { margin: 0 0 3px; }
.source-failures p:last-child { margin-bottom: 0; }
.topic-list { min-height: 180px; max-height: min(57vh, 720px); overflow: auto; overscroll-behavior: contain; }
.topic-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 15px 0; border-top: 1px solid #e7ebe8; }
.topic-check { margin-top: 3px !important; }
.topic-main { min-width: 0; }
.topic-title { font-size: 13px; line-height: 1.5; font-weight: 650; margin: 0 0 5px; overflow-wrap: anywhere; }
.topic-title-button { display: block; border: 0; border-radius: 0; background: transparent; padding: 0; margin: 0 0 5px; color: var(--ink); font-size: 13px; font-weight: 680; line-height: 1.5; text-align: left; overflow-wrap: anywhere; }
.topic-title-button:hover { color: var(--green); }
.topic-title-button::after { content: "+"; display: inline-block; margin-left: 7px; color: #89918c; font-size: 11px; font-weight: 500; }
.topic-title-button.is-open::after { content: "−"; }
.topic-summary { margin: 0 0 7px; font-size: 11px; color: #66706a; line-height: 1.55; overflow-wrap: anywhere; }
.topic-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; font-size: 10px; color: #858e88; align-items: center; }
.topic-meta a { color: var(--green); text-decoration: none; }
.topic-meta a:hover { text-decoration: underline; }
.topic-badge { color: #59625d; background: #eff2ef; padding: 1px 6px; border-radius: 3px; }
.topic-generated { color: var(--green); }
.age-label { color: var(--gold); font-weight: 600; }
.topic-source { white-space: nowrap; font-size: 10px; color: #727b75; }
.topic-detail { grid-column: 2 / -1; min-width: 0; padding: 12px 0 3px; border-top: 1px solid #e7ebe8; }
.topic-detail-summary { margin: 0 0 8px; color: #505a54; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.topic-detail-meta { margin: 0 0 12px; }
.detail-subtitle { font-size: 11px; margin: 12px 0 7px; }
.saved-post-links { display: grid; gap: 3px; margin: 0 0 8px; }
.saved-post-links .empty-state { padding: 10px; }
.saved-post-link { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
.saved-post-link a { color: var(--green); font-size: 11px; overflow-wrap: anywhere; }
.detail-link-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.detail-link-form .button { white-space: nowrap; }
.related-post-status { margin: 9px 0 5px; }
.related-post-row { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-top: 1px solid #e7ebe8; }
.related-post-body { min-width: 0; }
.related-post-body p { margin: 0 0 6px; color: #3d4641; font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.related-post-body a { color: var(--green); font-size: 10px; }
.empty-state { padding: 42px 16px; display: grid; justify-items: center; text-align: center; color: var(--muted); }
.empty-index { color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: 1px; }
.empty-state p { margin: 7px 0 2px; color: var(--ink); font-size: 13px; font-weight: 620; }
.empty-state span:last-child { font-size: 11px; }
.generate-bar { position: sticky; bottom: 0; margin: 0 -22px; padding: 12px 22px; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; z-index: 2; }
.generate-bar p { margin: 0; font-size: 11px; color: #59625d; }
.generate-bar p strong { color: var(--ink); font-size: 14px; }
.selection-hint { color: #929a95; font-size: 10px; }
.generated-section { margin: 0; padding: 20px 22px 28px; }
.generated-section .section-heading-row { margin-bottom: 14px; }
.generated-section .micro-label { margin: 0; }
.post-list { display: grid; gap: 12px; }
.post-item { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.post-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 13px; }
.post-title-wrap { min-width: 0; flex: 1; }
.post-title { min-height: 44px; padding: 4px 2px; border: 0; background: transparent; font-size: 15px; font-weight: 680; line-height: 1.4; resize: vertical; overflow-wrap: anywhere; }
.post-category-select { width: auto; max-width: 100%; min-height: 27px; padding: 3px 23px 3px 5px; border: 0; background: transparent; color: var(--green); font-size: 10px; }
.post-category { margin: 0 0 4px; color: var(--green); font-size: 10px; }
.post-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.post-toolbar .button { min-height: 30px; padding: 4px 7px; font-size: 10px; }
.post-field-label { display: block; margin: 12px 0 5px; color: #59625d; font-size: 10px; font-weight: 650; }
.post-content { min-height: 100px; font-size: 13px; line-height: 1.65; }
.post-translation { min-height: 66px; }
.post-context-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.post-context-grid textarea { min-height: 65px; }
.post-image-section { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.post-image-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.post-image-heading h4 { margin: 0; font-size: 11px; }
.image-state { color: var(--muted); font-size: 10px; }
.image-state.is-error { color: var(--accent-dark); }
.image-stage { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #f2f4f1; }
.image-stage img { width: 100%; height: 100%; object-fit: cover; }
.image-stage.is-empty { padding: 20px; color: var(--muted); text-align: center; font-size: 11px; }
.image-stage.is-loading::after { content: "正在生成图片…"; position: absolute; inset: auto 0 0; padding: 9px 12px; background: rgba(32,36,34,.82); color: #fff; font-size: 11px; }
.image-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.image-actions .button { min-height: 31px; font-size: 10px; }
.image-attribution { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.image-attribution a { color: var(--green); }
.image-error { margin: 7px 0 0; color: var(--accent-dark); font-size: 10px; overflow-wrap: anywhere; }
.image-candidates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.image-candidate { min-width: 0; padding: 7px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.image-candidate img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--canvas); }
.image-candidate p { margin: 6px 0; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.image-candidate .button { width: 100%; min-height: 29px; padding: 4px; font-size: 10px; }
.post-image-prompt { margin-top: 9px; font-size: 10px; }
.post-image-prompt summary { color: #59625d; cursor: pointer; }
.post-image-prompt textarea { min-height: 70px; margin-top: 7px; font-size: 10px; }
.post-char-count { margin: 5px 0 0; text-align: right; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.post-char-count.is-over-limit { color: var(--accent-dark); font-weight: 650; }
.post-note { margin: 10px 0 0; padding: 8px 10px; background: var(--gold-pale); border-left: 3px solid #d59b37; color: #6c521f; font-size: 11px; }
.post-sources { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 10px; }
.post-sources a { color: var(--green); }
.post-meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 7px 13px; align-items: center; color: var(--muted); font-size: 10px; }
.post-meta select { width: auto; min-width: 105px; min-height: 30px; padding: 4px 24px 4px 7px; font-size: 10px; }
.post-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; padding-top: 11px; border-top: 1px solid #edf0ed; }
.post-bottom .post-meta { margin: 0; }
.post-bottom .post-toolbar { justify-content: flex-start; }
.history-filters { display: flex; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; }
.history-filters label:not(.history-search) { min-width: 130px; }
.history-search { flex: 1; min-width: 150px; }
.history-list { margin-top: 0; }
.history-list .post-item { padding-left: 16px; padding-right: 16px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 18px 0; color: var(--muted); font-size: 11px; }
.view-panel { display: none; }
.view-panel.is-visible { display: block; }
.toast { position: fixed; z-index: 10; bottom: 22px; left: 50%; transform: translate(-50%, 15px); opacity: 0; pointer-events: none; max-width: calc(100vw - 28px); padding: 9px 14px; background: var(--ink); color: #fff; border-radius: 4px; font-size: 12px; transition: opacity .15s ease, transform .15s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.muted { color: var(--muted); font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f3f5f2; }
.login-shell { width: min(390px, 100%); padding: 34px 32px 30px; border-top: 3px solid var(--accent); background: var(--paper); box-shadow: 0 10px 30px rgba(26,39,31,.06); }
.login-shell .brand-mark { width: 38px; height: 38px; font-size: 20px; margin-bottom: 18px; }
.login-shell .eyebrow { margin-bottom: 7px; }
.login-shell h1 { font-size: 23px; margin-bottom: 22px; }
.login-form { display: grid; }
.login-form label { font-size: 11px; color: #59625d; margin: 13px 0 6px; }
.login-form input { min-height: 40px; }
.login-form .button { margin-top: 19px; min-height: 40px; }
.form-message { min-height: 18px; margin: 11px 0 0; color: var(--accent-dark); font-size: 11px; }
@media (max-width: 1000px) {
  .app-header { padding: 0 18px; gap: 25px; }
  .page-shell { padding: 24px 18px 48px; }
  .workspace-layout { grid-template-columns: minmax(0, 1fr) minmax(340px, .9fr); }
  .control-section, .manual-section { padding-left: 16px; padding-right: 16px; }
  .candidate-section { padding-left: 17px; padding-right: 17px; }
  .creator-settings { padding-left: 17px; padding-right: 17px; }
  .generate-bar { margin-left: -17px; margin-right: -17px; padding-left: 17px; padding-right: 17px; }
  .generated-section { padding-left: 17px; padding-right: 17px; }
}
@media (max-width: 720px) {
  .app-header { min-height: 56px; padding: 0 12px; gap: 12px; flex-wrap: wrap; }
  .brand { gap: 7px; font-size: 13px; }
  .brand-mark { width: 25px; height: 25px; font-size: 14px; }
  .brand-divider, .brand-subtitle { display: none; }
  .top-tabs { order: 3; flex-basis: 100%; height: 40px; gap: 20px; }
  .tab-button { font-size: 11px; }
  .header-user { margin-left: auto; gap: 5px; }
  .user-name { font-size: 10px; max-width: 82px; }
  .header-user .button { min-height: 29px; font-size: 10px; }
  .page-shell { padding: 20px 12px 35px; }
  .page-heading { align-items: start; margin-bottom: 17px; }
  .source-tabs { gap: 17px; }
  h1 { font-size: 21px; }
  .heading-note { max-width: 120px; text-align: right; font-size: 10px; }
  .workspace-layout { display: block; }
  .source-column { border-right: 0; border-bottom: 1px solid var(--line); }
  .creator-column { border-left: 0; margin-left: 0; }
  .control-section, .manual-section { padding: 15px 14px; }
  .control-section:first-child .category-options { grid-template-columns: 1fr 1fr; gap: 1px 10px; }
  .field-pair { grid-template-columns: 1fr 1fr; }
  .candidate-section { padding: 16px 14px 0; }
  .creator-settings { padding: 16px 14px 18px; }
  .creator-settings .field-pair { grid-template-columns: 1fr 1.1fr; }
  .section-heading-row { align-items: center; }
  .section-heading-row h2 { font-size: 16px; }
  .candidate-tools { gap: 2px; }
  .candidate-tools select { min-width: 105px; width: 105px; max-width: 34vw; font-size: 10px; }
  .candidate-tools .button { padding-left: 6px; padding-right: 6px; }
  .topic-row { grid-template-columns: 17px minmax(0, 1fr); gap: 8px; padding: 13px 0; }
  .topic-source { grid-column: 2; white-space: normal; }
  .topic-title { font-size: 12px; }
  .topic-summary { font-size: 10px; }
  .generate-bar { margin: 0 -14px; padding: 10px 14px; }
  .generate-bar p { font-size: 10px; }
  .generated-section { padding: 20px 14px 24px; }
  .topic-list { max-height: 55vh; }
  .post-item { padding: 12px; }
  .post-head { display: block; }
  .post-toolbar { justify-content: flex-start; margin-top: 9px; }
  .post-context-grid { grid-template-columns: 1fr; gap: 0; }
  .post-bottom { display: grid; }
  .image-options-pair { grid-template-columns: 1fr 1.2fr !important; }
  .history-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
  .history-search { grid-column: 1 / -1; }
  .history-filters label:not(.history-search) { min-width: 0; }
  .history-filters > .button { grid-column: 1 / -1; }
  .login-shell { padding: 27px 22px 23px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; } }
