:root {
  color-scheme: light;
  --bg:#f7f7f5;
  --panel:#fff;
  --panel-soft:#fafafa;
  --text:#171717;
  --muted:#6b6b6b;
  --line:#dededb;
  --line-strong:#b9b9b4;
  --primary:#171717;
  --primary-soft:#efefec;
  --accent:#2f6f73;
  --accent-soft:#eef7f6;
  --accent-line:#b9d7d4;
  --danger:#b42318;
  --danger-soft:#fff1f0;
  --success:#116329;
  --success-soft:#eef8f0;
  --warning:#8a4b00;
  --warning-soft:#fff7df;
  --shadow:0 1px 2px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
body { margin:0; font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif; background:var(--bg); color:var(--text); font-size:15px; }
a { color: inherit; text-decoration: none; }
.sidebar { position:fixed; inset:0 auto 0 0; width:240px; background:#111; color:#fff; padding:20px; border-right:1px solid #242424; display:flex; flex-direction:column; }
.brand { display:flex; gap:10px; align-items:center; margin-bottom:24px; font-weight:800; }
.brand b { display:grid; place-items:center; width:34px; height:34px; background:#fff; color:#111; border-radius:8px; }
.sidebar nav { display:grid; gap:6px; }
.sidebar nav a { padding:10px 12px; border-radius:8px; color:#d8d8d4; font-weight:600; }
.sidebar nav a:hover { background:#252525; color:#fff; }
.sidebar nav a.active { background:#fff; color:#111; box-shadow:inset 3px 0 0 #fff; }
.sidebar nav a.active:hover { background:#fff; color:#111; }
.sidebar-version { margin-top:auto; padding:12px; color:#999; border-top:1px solid #2a2a2a; font-size:12px; font-weight:700; border-radius:8px; }
.sidebar-version:hover, .sidebar-version.active { color:#111; background:#fff; }
.main { margin-left:240px; padding:28px 30px; max-width:100vw; overflow-x:hidden; }
.auth-main { min-height:100vh; display:grid; place-items:center; padding:24px; }
.topbar, .page-head { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:20px; }
.page-head h1 { margin:0 0 6px; font-size:30px; line-height:1.18; }
.page-head p, .muted { color:var(--muted); margin:0; }
.page-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.panel, .card, .login-card { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:20px; box-shadow:var(--shadow); }
.compact-note { padding:12px 14px; margin-bottom:14px; color:var(--muted); }
.login-card { width:min(420px, 100%); }
.login-card h1 { margin:0 0 18px; font-size:28px; }
.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:16px; }
.help-grid { grid-template-columns:repeat(auto-fit, minmax(320px, 1fr)); }
.help-grid h2 { margin:0 0 12px; font-size:20px; }
.version-notes { display:grid; gap:12px; }
.version-notes article { border:1px solid var(--line); border-radius:8px; padding:12px 14px; background:#fafafa; }
.version-notes h3 { margin:0 0 6px; font-size:17px; }
.version-notes p { margin:0; color:#4f4f4b; line-height:1.65; }
.diagnostic-block pre { background:#fff; border-color:#d8d8d4; }
.stats-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(190px, 1fr)); gap:14px; margin-bottom:16px; }
.stat-card { display:grid; gap:6px; }
.stat-card span { color:var(--muted); font-weight:700; }
.stat-card strong { font-size:28px; line-height:1; }
.stat-card small { color:var(--muted); }
.monitor-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(180px, 1fr)); gap:10px; }
.monitor-tile { display:grid; gap:4px; border:1px solid var(--line); border-radius:8px; padding:12px; background:#fafafa; }
.monitor-tile strong { font-size:16px; }
.monitor-tile span { color:var(--muted); }
.warning-tile { border-color:#f5d08a; background:var(--warning-soft); }
.danger-tile { border-color:#f0b8b3; background:var(--danger-soft); }
.form-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:14px; align-items:start; }
.form-grid.compact { grid-template-columns:repeat(4, minmax(0, 1fr)); }
.wide { grid-column:1 / -1; }
label, .form-grid > * { min-width:0; }
label { display:grid; gap:6px; font-weight:600; align-self:start; }
label.inline { display:inline-flex; gap:6px; align-items:center; margin-right:14px; }
fieldset { border:0; padding:0; margin:0; min-width:0; }
legend { font-weight:700; margin-bottom:8px; }
input, textarea, select { width:100%; border:1px solid var(--line); border-radius:8px; padding:10px 11px; font:inherit; background:#fff; color:var(--text); }
input:focus, textarea:focus, select:focus { outline:2px solid #d8d8d4; outline-offset:1px; border-color:#a3a3a0; }
textarea { resize:vertical; }
.field-short input { min-height:42px; }
.field-medium textarea { min-height:92px; }
.field-long textarea { min-height:170px; }
.field-long textarea[name="配料"], .field-long textarea[name="请检查以下文案"], .field-long textarea[name="竞品五点"] { min-height:210px; }
.button { display:inline-flex; align-items:center; justify-content:center; border:1px solid var(--line-strong); border-radius:8px; padding:9px 14px; background:#fff; cursor:pointer; font-weight:700; color:var(--text); }
.button.primary { background:var(--primary); color:#fff; border-color:var(--primary); }
.button.primary:hover { background:#000; }
.button.ghost { background:transparent; border-color:var(--line); }
.button.subtle { background:#fafafa; color:#323230; }
.button.danger { color:var(--danger); border-color:#f0b8b3; background:#fff; }
.button.danger:hover { background:var(--danger-soft); }
.button.small { padding:6px 9px; font-size:13px; }
.button:disabled { opacity:.72; cursor:wait; }
.actions { display:flex; gap:10px; align-items:center; margin:14px 0; }
.stack { display:grid; gap:14px; }
.empty { color:var(--muted); border:1px dashed var(--line-strong); border-radius:10px; padding:24px; background:#fff; }
.flash-wrap { display:grid; gap:8px; margin-bottom:16px; }
.flash, .notice { padding:10px 12px; border-radius:8px; background:var(--primary-soft); border:1px solid var(--line); }
.flash.error, .notice.error { background:#fff1f0; border-color:#ffccc7; }
.status { display:inline-flex; align-items:center; padding:4px 9px; border-radius:999px; background:#efefec; color:#4a4a47; font-size:12px; font-weight:700; }
.status.success { background:var(--success-soft); color:var(--success); }
.status.failed { background:var(--danger-soft); color:var(--danger); }
.status.canceled { background:#efefec; color:#525252; }
.status.running, .status.pending { background:var(--warning-soft); color:var(--warning); animation:statusPulse 1.4s ease-in-out infinite; }
.steps { display:flex; flex-wrap:wrap; gap:6px; }
table { width:100%; border-collapse:collapse; background:#fff; }
th, td { border-bottom:1px solid var(--line); padding:12px 10px; text-align:left; vertical-align:top; }
th { color:#323230; background:#fafafa; font-weight:800; }
.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:10px; background:#fff; box-shadow:var(--shadow); }
pre { white-space:pre-wrap; word-break:break-word; background:#fafafa; border:1px solid var(--line); border-radius:8px; padding:12px; }
.result-shell { display:grid; gap:14px; margin-bottom:0; }
.result-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:18px; }
.result-head h2 { margin:0 0 4px; }
.result-head p { margin:0; color:var(--muted); }
.result-grid { display:grid; gap:14px; }
.listing-language-group { border:1px solid var(--line); border-radius:10px; background:#fff; box-shadow:var(--shadow); overflow:hidden; }
.listing-language-group > summary { cursor:pointer; padding:14px 18px; font-size:19px; font-weight:900; background:#fafafa; border-bottom:1px solid var(--line); }
.listing-language-group:not([open]) > summary { border-bottom:0; }
.listing-language-sections { display:grid; gap:14px; padding:14px; }
.result-section { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:18px; box-shadow:var(--shadow); }
.result-section h3 { margin:0 0 12px; font-size:20px; }
.result-section-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:12px; }
.result-section-head h3 { margin:0; }
.section-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.result-section p { margin:0 0 10px; line-height:1.7; }
.result-section p:last-child { margin-bottom:0; }
.result-selling-points, .result-keywords, .result-risk, .result-pricing, .result-image { border-left:4px solid var(--accent-line); }
.result-title { border-left:4px solid var(--accent); background:#fcfcfb; }
.result-muted-section { border-left:4px solid var(--line); background:#fafafa; }
.listing-quality { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:10px; margin-bottom:14px; }
.quality-pill { border:1px solid var(--line); border-radius:8px; padding:10px; background:#fafafa; }
.quality-pill strong { display:block; margin-bottom:2px; }
.quality-pill span { color:var(--muted); line-height:1.55; }
.quality-score { float:right; min-width:38px; height:38px; display:grid; place-items:center; border-radius:999px; font-weight:900; background:#f1f1ef; }
.quality-good .quality-score { background:var(--success-soft); color:var(--success); }
.quality-warn .quality-score { background:var(--warning-soft); color:var(--warning); }
.quality-bad .quality-score { background:var(--danger-soft); color:var(--danger); }
.model-row { display:flex; align-items:center; gap:8px; margin:0 0 14px; color:var(--muted); font-weight:700; }
.model-badge { display:inline-flex; align-items:center; border:1px solid var(--line-strong); border-radius:999px; padding:4px 10px; background:#f3f3f1; color:#171717; font-weight:800; }
.bilingual-list { display:grid; gap:14px; margin:0; padding:0; list-style:none; }
.bilingual-item { border:1px solid var(--line); border-radius:10px; padding:14px; background:#fff; position:relative; }
.listing-clean-list .bilingual-item { padding:14px 14px 12px; }
.bilingual-actions { display:flex; justify-content:flex-end; margin-bottom:8px; }
.listing-clean-list .bilingual-actions { float:right; margin:0 0 8px 12px; gap:8px; }
.bilingual-original { color:#111; line-height:1.65; font-weight:650; }
.bilingual-zh { color:#777; line-height:1.65; margin-top:12px; padding-top:10px; border-top:1px solid var(--line); }
.bilingual-label { display:block; color:#444; font-size:12px; font-weight:800; margin-bottom:4px; }
.bilingual-grouped { display:grid; gap:12px; }
.original-list, .translation-list { margin:0; padding:0; list-style:none; display:grid; gap:10px; }
.original-item, .translation-list li { display:grid; grid-template-columns:28px minmax(0, 1fr); gap:10px; align-items:start; line-height:1.7; }
.original-item { padding:10px 0; border-bottom:1px solid #eeeeeb; }
.original-item:last-child { border-bottom:0; }
.original-text { font-weight:650; color:#171717; }
.item-number { display:inline-grid; place-items:center; width:24px; height:24px; border-radius:999px; background:var(--accent-soft); color:var(--accent); font-size:12px; font-weight:900; }
.translation-fold { border:1px solid var(--line); border-radius:10px; background:#fbfbfa; padding:10px 12px; }
.translation-fold > summary { cursor:pointer; color:#62625f; font-weight:800; }
.translation-list { margin-top:10px; color:#6f6f6b; }
.selectable-listing-text::selection, .original-text::selection { background:#dcefed; color:#111; }
.clean-list { margin:0; padding-left:20px; display:grid; gap:8px; line-height:1.65; }
.clean-list li { min-width:0; }
.clean-list li .icon-action { margin-left:8px; vertical-align:middle; }
.listing-text-row { display:grid; grid-template-columns:minmax(0, 1fr) auto; gap:10px; align-items:start; }
.icon-action { display:inline-flex; align-items:center; justify-content:center; border:1px solid var(--line); border-radius:999px; padding:4px 9px; background:#fff; color:#444; font-size:12px; font-weight:800; cursor:pointer; }
.icon-action:hover { background:#111; color:#fff; border-color:#111; }
.selection-rewrite-popover { position:absolute; z-index:80; border:1px solid var(--accent); border-radius:999px; background:#111; color:#fff; padding:7px 12px; font-size:13px; font-weight:800; box-shadow:0 8px 24px rgba(0,0,0,.16); cursor:pointer; }
.selection-rewrite-popover[hidden] { display:none; }
.result-table-wrap { overflow:auto; border:1px solid var(--line); border-radius:8px; background:#fff; }
.result-table { min-width:720px; }
.result-table th { background:#fafafa; font-weight:700; white-space:nowrap; }
.result-table td, .result-table th { line-height:1.55; }
.visually-hidden { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); border:0; }
.file-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:12px; }
.file-card { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px; border:1px solid var(--line); border-radius:8px; background:#fff; min-width:0; }
.file-meta { display:grid; gap:4px; min-width:0; }
.file-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.download-form { display:grid; grid-template-columns:minmax(90px, 1fr) auto; gap:8px; align-items:center; min-width:180px; }
.download-form .filename-input { padding:7px 8px; font-size:13px; }
.file-group { display:grid; gap:10px; margin-top:14px; }
.file-group h3 { margin:0; font-size:16px; }
.muted-files { color:var(--muted); }
.muted-files summary { cursor:pointer; font-weight:700; margin-bottom:10px; }
figure { margin:0; border:1px solid var(--line); border-radius:6px; overflow:hidden; background:#fff; }
figure img { width:100%; display:block; }
figcaption { padding:8px; display:grid; gap:8px; }
.tag { font-size:12px; color:var(--muted); border:1px solid var(--line); border-radius:999px; padding:2px 7px; background:#fafafa; }
.segmented { display:flex; flex-wrap:wrap; gap:8px; }
.seg-option { display:inline-flex; width:auto; }
.seg-option input { position:absolute; opacity:0; pointer-events:none; }
.seg-option span { display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:8px 14px; border:1px solid var(--line); border-radius:999px; background:#fff; font-weight:700; color:#383836; cursor:pointer; }
.seg-option input:checked + span { background:#171717; border-color:#171717; color:#fff; box-shadow:0 0 0 2px rgba(0,0,0,.08); }
.form-band { border:1px solid var(--line); border-radius:10px; padding:14px; background:#fafafa; }
.compact-options { background:#fff; }
.check-option { display:inline-flex; flex-direction:row; align-items:center; gap:8px; width:auto; font-weight:800; }
.check-option input { width:auto; }
.form-section-title { font-size:18px; font-weight:800; padding-top:6px; }
.label-form { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px; }
.hint { color:var(--muted); margin:0 0 12px; line-height:1.6; }
.nutrition-panel { border:1px solid var(--line); border-radius:10px; padding:14px; background:#fff; }
.nutrition-tables { display:grid; gap:12px; margin-bottom:12px; }
.nutrition-table-card, .nutrition-edit-group { border:1px solid var(--line); border-radius:10px; padding:12px; background:#fafafa; }
.nutrition-table-head { display:grid; grid-template-columns:minmax(220px, 1fr) auto; gap:12px; align-items:end; margin-bottom:12px; }
.nutrition-grid { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:12px; }
.unit-field div { display:flex; align-items:center; border:1px solid var(--line); border-radius:6px; overflow:hidden; background:#fff; }
.unit-field input { border:0; border-radius:0; min-width:0; }
.unit-field em { flex:none; padding:0 10px; color:var(--muted); font-style:normal; font-weight:600; border-left:1px solid var(--line); background:#fafafa; align-self:stretch; display:flex; align-items:center; }
.ocr-panel { display:grid; gap:14px; margin-bottom:14px; }
.ocr-panel h2 { margin:0 0 4px; }
.ocr-form { display:grid; grid-template-columns:220px minmax(260px, 1fr) auto; gap:12px; align-items:end; }
.model-module-panel { border:1px solid var(--line); border-radius:10px; padding:14px; background:#fff; }
.model-module-grid { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:12px; }
.model-card { display:grid; gap:14px; }
.price-config { border:1px solid var(--line); border-radius:10px; padding:12px; background:#fafafa; }
.price-config legend { padding:0 4px; }
.price-config .hint { font-size:13px; margin-bottom:10px; }
.model-section { display:grid; gap:14px; margin-bottom:18px; }
.model-card h2 { margin:0 0 4px; font-size:20px; }
.model-card p { margin:0; color:var(--muted); }
.model-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.model-card select, .model-card input { min-width:0; }
.model-advice { border:1px solid var(--line); border-radius:10px; padding:10px 12px; background:#fafafa; }
.model-advice strong { display:block; margin-bottom:4px; }
.model-advice p { margin:0 0 4px; color:#343431; line-height:1.55; }
.model-advice small { color:var(--warning); line-height:1.5; }
.listing-rewrite-form { display:grid; gap:12px; margin-top:12px; padding:12px; border:1px solid var(--line); border-radius:10px; background:#fafafa; }
.rewrite-tools { display:grid; grid-template-columns:minmax(220px, 1fr) minmax(160px, 260px); gap:10px; align-items:end; }
.rewrite-actions { display:flex; gap:8px; flex-wrap:wrap; }
.rewrite-mode { border:1px solid var(--line); border-radius:10px; padding:10px 12px; background:#fff; }
.rewrite-mode .check-option { margin-right:14px; }
.rewrite-drawer-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.18); display:none; z-index:60; }
.rewrite-drawer-backdrop.show { display:block; }
.rewrite-drawer { position:fixed; top:0; right:0; width:min(520px, 100vw); height:100vh; background:#fff; border-left:1px solid var(--line); box-shadow:-20px 0 50px rgba(0,0,0,.18); z-index:70; transform:translateX(104%); transition:transform .18s ease; padding:20px; overflow:auto; }
.rewrite-drawer.open { transform:translateX(0); }
.rewrite-drawer-head { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; margin-bottom:16px; }
.rewrite-drawer-head h2 { margin:0 0 4px; }
.rewrite-drawer-head p { margin:0; color:var(--muted); }
.section-rewrite { margin-top:14px; border:1px solid var(--line); border-radius:10px; padding:10px 12px; background:#fcfcfb; }
.section-rewrite summary { cursor:pointer; font-weight:800; }
.section-rewrite[open] summary { margin-bottom:10px; }
.site-groups { display:grid; gap:10px; }
.site-group { border:1px solid var(--line); border-radius:10px; padding:10px; background:#fafafa; }
.site-group summary { cursor:pointer; font-weight:800; margin-bottom:8px; }
.site-group:not([open]) summary { margin-bottom:0; }
.spinner { width:16px; height:16px; border:2px solid rgba(255,255,255,.5); border-top-color:#fff; border-radius:50%; animation:spin .8s linear infinite; margin-right:8px; }
.generating-overlay { position:fixed; inset:0; display:none; place-items:center; background:rgba(0,0,0,.18); backdrop-filter:blur(2px); z-index:50; }
.generating-overlay.show { display:grid; }
.generating-card { display:grid; place-items:center; gap:8px; background:#fff; border:1px solid var(--line); border-radius:10px; padding:24px 30px; box-shadow:0 16px 40px rgba(0,0,0,.16); }
.generating-card span { color:var(--muted); }
.orbit { width:44px; height:44px; border-radius:50%; border:4px solid #e7e7e4; border-top-color:#171717; animation:spin 1s linear infinite; }
.section-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:14px; }
.section-head h2 { margin:0 0 4px; }
.section-head p { margin:0; color:var(--muted); }
.history-filters { display:grid; grid-template-columns:minmax(220px, 1.5fr) repeat(3, minmax(160px, 1fr)) auto; gap:12px; align-items:end; margin-bottom:14px; }
.inline-form { display:flex; gap:8px; align-items:center; margin:0; }
.inline-form select { min-width:96px; }
.reset-form input { width:140px; }
.row-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.running-panel { display:flex; align-items:center; gap:18px; background:#fff; border:1px solid #dededb; border-radius:10px; padding:18px; margin-bottom:14px; box-shadow:var(--shadow); }
.running-panel h2 { margin:0 0 6px; }
.running-panel p { margin:0; color:#475467; line-height:1.6; white-space:pre-line; }
.running-note { margin-top:6px !important; color:var(--warning) !important; }
.running-animation { position:relative; width:54px; height:54px; flex:none; border-radius:50%; background:#efefec; display:grid; place-items:center; }
.running-animation::before { content:""; position:absolute; inset:8px; border-radius:50%; border:4px solid #d8d8d4; border-top-color:#171717; animation:spin 1s linear infinite; }
.running-animation span { width:10px; height:10px; border-radius:50%; background:#171717; box-shadow:0 0 0 8px rgba(0,0,0,.08); }
.next-steps { margin-top:14px; border:1px solid var(--line); border-radius:10px; padding:12px 14px; background:#fafafa; }
.next-steps h3 { margin:0 0 8px; font-size:16px; }
.next-steps ul { margin:0; padding-left:20px; line-height:1.7; color:#3f3f3b; }
.label-preview-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(320px, 1fr)); gap:16px; }
.label-preview-card { background:#fff; border:1px solid var(--line); border-radius:8px; padding:20px; color:#050505; }
.label-preview-top { display:flex; justify-content:space-between; align-items:center; gap:12px; color:var(--muted); margin-bottom:10px; }
.label-preview-top span { font-weight:700; color:#344054; }
.label-preview-card h3 { margin:0 0 12px; font-size:24px; line-height:1.15; letter-spacing:0; font-weight:900; text-transform:uppercase; }
.label-preview-card p { margin:0 0 8px; line-height:1.45; }
.label-preview-rule { height:4px; background:#111; margin:10px 0 12px; }
.label-preview-rule.bottom { margin-top:20px; }
.label-preview-dates { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:10px; }
.label-preview-table { margin-top:16px; font-size:14px; }
.label-preview-table th, .label-preview-table td { border:1px solid #111; padding:6px 8px; color:#111; }
.label-preview-table th { font-weight:900; background:#fff; }
.label-preview-table th:last-child, .label-preview-table td:last-child { text-align:right; }
.label-net { margin-top:16px !important; }
@keyframes statusPulse { 50% { box-shadow:0 0 0 5px rgba(245,158,11,.15); } }
@keyframes spin { to { transform:rotate(360deg); } }
@media (max-width: 1000px) { .nutrition-grid, .model-module-grid, .ocr-form, .history-filters, .rewrite-tools { grid-template-columns:1fr 1fr; } }
@media (max-width: 800px) { .sidebar { position:static; width:auto; } .main { margin-left:0; padding:18px; } .form-grid, .label-preview-dates, .nutrition-grid, .nutrition-table-head, .model-module-grid, .ocr-form, .history-filters, .rewrite-tools { grid-template-columns:1fr; } .file-card, .inline-form, .row-actions { align-items:stretch; flex-direction:column; } .download-form { width:100%; } }
