:root {
  --bg: #f4f7fb;
  --surface: #fff;
  --border: #d9e3ef;
  --text: #13223a;
  --muted: #71829a;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #059669;
  --danger: #ef4444;
  --orange: #f59e0b;
  --sidebar: #07111f;
  --sidebar-soft: rgba(37,99,235,.22);
  --sidebar-glow: #38bdf8;
  --radius: 8px;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; letter-spacing: 0; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--text); outline: none; }
input, select { height: 36px; padding: 0 10px; }
textarea { min-height: 110px; padding: 10px; resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
a { color: inherit; text-decoration: none; }
.btn { min-height: 36px; padding: 0 16px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: #e8eef6; color: var(--text); white-space: nowrap; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.success { background: var(--success); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.orange { background: var(--orange); color: #fff; }
.btn.ghost { background: #e7f0ff; color: var(--primary); }
.btn.purple { background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; }
.btn.danger-light { background: #ffe8e8; color: #c53030; }
.btn.small { min-height: 30px; padding: 0 10px; }
.full { width: 100%; }
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(180deg, #edf4ff 0%, #f7f9fd 100%); }
.auth-card { width: min(430px, 100%); padding: 30px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 18px 50px rgba(24,40,61,.12); }
.brand-row { display: flex; align-items: center; gap: 14px; }
.brand-block { display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 12px; row-gap: 3px; align-items: center; }
.brand-block > div { display: contents; }
.brand-row { margin-bottom: 22px; }
.brand-mark { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%); color: #fff; font-weight: 800; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 10px 26px rgba(37,99,235,.35); }
.brand-row h1 { margin: 0; font-size: 24px; }
.brand-row p { margin: 4px 0 0; color: var(--muted); }
.auth-actions { display: grid; gap: 12px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 20px; border-radius: 8px; background: #eef4fb; }
.tabs a { height: 40px; border-radius: 6px; display: grid; place-items: center; }
.tabs a.active { background: #fff; color: var(--primary); font-weight: 700; }
.field { display: grid; gap: 8px; margin-bottom: 14px; }
.field span { color: var(--text); font-weight: 600; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-head > span { min-width: 0; }
.secret-field { position: relative; }
.secret-field input { padding-right: 46px; }
.secret-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 28px; border-radius: 6px; background: #edf4ff; color: var(--primary); display: grid; place-items: center; }
.secret-toggle:hover { background: #dbeafe; }
.stack-inputs { display: grid; gap: 8px; }
.paste-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.paste-input-row input { min-width: 0; }
.paste-btn { min-width: 82px; height: 36px; padding: 0 10px; white-space: nowrap; }
.field-head .paste-btn { flex: 0 0 auto; }
.dialog-close { width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; background: #eef4fb; color: var(--text); font-size: 20px; line-height: 1; }
.dialog-close:hover { background: #dbeafe; color: var(--primary); }
.check { display: flex; align-items: center; gap: 8px; min-height: 36px; margin-bottom: 12px; color: var(--text); }
.check input { width: 16px; height: 16px; }
.captcha-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 10px; align-items: center; }
.captcha-img { width: 120px; height: 40px; border: 1px solid var(--border); border-radius: 6px; background: #eef4fb; cursor: pointer; object-fit: cover; }
.notice { padding: 12px 14px; border-radius: 6px; margin-bottom: 16px; }
.notice.warn { background: #fff7ed; border: 1px solid #fdba74; color: #9a5b00; }
.notice.ok { background: #ecfdf5; border: 1px solid #86efac; color: #047857; }
.auth-tip { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px; background: #f8fbff; color: #41516a; line-height: 1.7; }
.auth-tip strong { display: block; margin-bottom: 6px; color: var(--text); }
.auth-tip p { margin: 0 0 6px; }
.auth-tip p:last-child { margin-bottom: 0; }
.status-bar { min-height: 46px; margin-bottom: 14px; padding: 0 14px; border: 1px solid #9bc5ff; border-radius: 7px; display: flex; align-items: center; gap: 10px; background: linear-gradient(90deg, #f0f7ff 0%, #ffffff 55%, #f8fbff 100%); color: #244060; box-shadow: inset 0 0 0 1px rgba(37,99,235,.05), 0 8px 24px rgba(37,99,235,.08); }
.status-bar.is-warn { border-color: #fdba74; background: linear-gradient(90deg, #fff7ed 0%, #fff 60%, #fffaf4 100%); color: #9a5b00; }
.status-bar.is-ok { border-color: #86efac; background: linear-gradient(90deg, #ecfdf5 0%, #fff 60%, #f0fff7 100%); color: #047857; }
.status-bar.is-busy { border-color: #60a5fa; background: linear-gradient(90deg, #eff6ff 0%, #fff 50%, #eef6ff 100%); color: #1d4ed8; }
.status-label { font-weight: 800; color: var(--primary); }
.status-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.12); animation: statusPulse 1.4s infinite; }
.status-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes statusPulse {
  0% { box-shadow: 0 0 0 0 rgba(37,99,235,.25); }
  70% { box-shadow: 0 0 0 8px rgba(37,99,235,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
}
.app-shell { width: min(1200px, calc(100vw - 28px)); margin: 22px auto 0; display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 18px; align-items: start; }
.sidebar { min-height: calc(100vh - 72px); background: linear-gradient(155deg, #07111f 0%, #0b1f3a 54%, #111827 100%); color: #d8e4f7; border: 1px solid rgba(56,189,248,.18); border-radius: 8px; padding: 22px 10px; position: sticky; top: 16px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 18px 44px rgba(3,7,18,.22), inset 0 1px 0 rgba(255,255,255,.06); }
.sidebar::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(56,189,248,.16), transparent 36%), repeating-linear-gradient(90deg, rgba(56,189,248,.06) 0 1px, transparent 1px 42px); opacity: .8; }
.sidebar > * { position: relative; z-index: 1; }
.brand-block { padding: 8px 6px 28px; }
.brand-block .brand-mark { grid-column: 1; grid-row: 2 / span 2; margin-top: 2px; align-self: center; }
.brand-block strong { grid-column: 1 / -1; grid-row: 1; display: block; color: #fff; font-size: 20px; line-height: 1.25; text-align: center; overflow-wrap: normal; word-break: keep-all; }
.brand-block small { display: block; margin-top: 0; color: #9fb5d2; line-height: 1.35; }
.brand-block small:first-of-type { grid-column: 2; grid-row: 2; align-self: end; }
.brand-block small:nth-of-type(2) { grid-column: 2; grid-row: 3; align-self: start; }
.side-nav { display: flex; flex-direction: column; gap: 8px; }
.side-nav button, .side-nav a, .logout { width: 100%; min-height: 46px; padding: 0 14px; border-radius: 6px; display: flex; align-items: center; gap: 10px; background: transparent; color: #b8c8e2; text-align: left; border: 1px solid transparent; position: relative; overflow: hidden; }
.workbench-body .side-nav button, .workbench-body .side-nav a, .workbench-body .logout { justify-content: center; text-align: center; }
.side-nav button::before, .side-nav a::before, .logout::before { content: ""; position: absolute; left: 1px; top: 8px; bottom: 8px; width: 3px; border-radius: 999px; background: transparent; transition: background .18s ease, box-shadow .18s ease; }
.side-nav button.active, .side-nav button:hover, .side-nav a.active, .side-nav a:hover, .logout:hover { background: linear-gradient(135deg, rgba(20,83,180,.72), rgba(8,145,178,.48)); border-color: rgba(56,189,248,.48); color: #fff; box-shadow: 0 0 0 1px rgba(56,189,248,.14), 0 12px 28px rgba(14,165,233,.16), inset 0 0 18px rgba(56,189,248,.14); }
.side-nav button.active::before, .side-nav button:hover::before, .side-nav a.active::before, .side-nav a:hover::before, .logout:hover::before { background: linear-gradient(180deg, #67e8f9, #2563eb); box-shadow: 0 0 12px rgba(103,232,249,.65); }
.sidebar-actions { margin-top: auto; display: grid; gap: 8px; padding-top: 28px; }
.logout { margin-top: 0; }
.logout.compact { min-height: 38px; color: #8fa2bf; }
.main-panel { min-width: 0; }
.panel { display: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: 0 10px 30px rgba(24,40,61,.06); }
.panel.active { display: block; }
.panel h2 { margin: 0 0 8px; color: var(--primary); font-size: 20px; }
.panel-desc { margin: 0 0 18px; color: var(--muted); }
.home-panel { background: linear-gradient(180deg, #fff 0%, #f8fbff 100%); }
.home-hero { min-height: 280px; padding: 34px 36px; border: 1px solid #cfe0f5; border-radius: 8px; background: linear-gradient(135deg, #fff 0%, #f7fbff 58%, #eef7ff 100%); box-shadow: 0 16px 42px rgba(24,40,61,.08); }
.home-kicker { width: max-content; max-width: 100%; padding: 6px 10px; border-radius: 999px; background: #e8f0ff; color: var(--primary); font-weight: 700; }
.home-hero h1 { margin: 18px 0 12px; color: #0f1f37; font-size: 38px; line-height: 1.2; letter-spacing: 0; }
.home-lead { max-width: none; margin: 0; color: #3a4c66; font-size: 16px; line-height: 30px; white-space: nowrap; }
.home-benefit { display: inline-flex; max-width: 100%; margin: 14px 0 0; padding: 8px 12px; border-radius: 8px; background: #edf4ff; color: #1f5ee8; font-weight: 700; line-height: 1.7; }
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.home-feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.home-feature { min-height: 170px; padding: 18px; border: 1px solid #d7e4f4; border-radius: 8px; background: #fff; box-shadow: 0 10px 26px rgba(24,40,61,.05); }
.home-feature span { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 26px; padding: 0 8px; border-radius: 999px; background: #edf4ff; color: var(--primary); font-weight: 800; font-size: 12px; }
.home-feature h3 { margin: 14px 0 8px; color: #0f1f37; font-size: 17px; }
.home-feature p { margin: 0; color: #51627a; line-height: 1.75; }
.home-flow { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.5fr); gap: 16px; align-items: start; margin-top: 16px; padding: 22px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.home-flow h2 { margin: 0 0 8px; color: var(--primary); }
.home-flow p { margin: 0; color: var(--muted); line-height: 1.75; }
.home-flow ol { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; list-style: none; }
.home-flow li { padding: 14px; border-radius: 8px; background: #f6f9fe; border: 1px solid #e4edf8; }
.home-flow li strong { display: block; margin-bottom: 6px; color: #0f1f37; }
.home-flow li span { color: #5e7089; line-height: 1.65; }
.home-note { margin-top: 16px; padding: 14px 16px; border-left: 4px solid var(--primary); border-radius: 6px; background: #eef6ff; color: #244060; }
.home-note strong { display: block; margin-bottom: 4px; color: var(--primary); }
.home-note p { margin: 0; line-height: 1.7; }
.model-grid, .split { display: grid; grid-template-columns: 560px minmax(0, 1fr); gap: 18px; align-items: start; }
.model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.model-grid.image-only { grid-template-columns: minmax(0, 560px) minmax(0, 1fr); }
.model-grid.image-only .card { grid-column: 1; }
.card, .tool-card, .preview-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card h3, .tool-card h3 { margin: 0 0 16px; color: var(--primary); }
.tool-card.narrow { max-width: 640px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
#screen-article .tool-card > .form-grid.two { grid-template-columns: repeat(3, minmax(0,1fr)); }
#screen-layout .tool-card > .form-grid.two { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
#screen-layout .tool-card > .form-grid.two .field { flex: 0 0 70px; min-width: 70px; }
#screen-layout .tool-card > .form-grid.two .field:first-child { flex-basis: 100px; }
#screen-layout .tool-card > .form-grid.two .field:nth-child(2) { flex-basis: 82px; }
#screen-layout .tool-card > .form-grid.two .field,
#screen-layout .tool-card > .form-grid.two .check { margin-bottom: 10px; }
#screen-layout .tool-card > .form-grid.two .check { flex: 0 0 auto; min-height: 36px; white-space: nowrap; }
.toolbar-select { width: auto; min-width: 104px; height: 36px; }
.toolbar-select.mini { min-width: 62px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.result-list { margin: 16px 0; display: grid; gap: 8px; }
.title-row { min-height: 40px; display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; background: #f8fbff; }
.title-row input { width: 16px; height: 16px; }
.rewrite-title-options { margin-top: 16px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #f8fbff; }
.rewrite-title-options[hidden] { display: none; }
.rewrite-title-options-head { margin-bottom: 10px; color: var(--primary); font-weight: 800; }
.rewrite-title-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.rewrite-title-option:first-of-type { border-top: 0; }
.rewrite-title-option span { min-width: 0; color: var(--text); font-weight: 700; line-height: 1.6; }
#articleTitleInputs { display: grid; gap: 8px; margin-bottom: 14px; }
.preview-card { min-height: 650px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: 0; overflow: hidden; }
.preview-toolbar, .preview-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.preview-footer { border-top: 1px solid var(--border); border-bottom: 0; }
.preview-body { padding: 26px; overflow: auto; line-height: 30px; background: #fff; }
.preview-body h1 { margin: 0 0 18px; font-size: 22px; line-height: 1.45; }
.preview-body p { margin: 0 0 18px; }
.article-divider { color: var(--muted); margin-bottom: 14px; font-family: Consolas, monospace; }
.tall { min-height: 260px; }
.layout-textarea { min-height: 450px; }
.layout-preview { min-height: 620px; max-height: 720px; overflow: auto; padding: 26px; background: #fff; line-height: 30px; }
.article-output { max-width: 720px; margin: 0 auto; color: #253047; font-size: var(--layout-font); line-height: var(--layout-line); }
.article-output h1 { margin: 0 0 24px; color: var(--layout-accent); font-size: 1.6em; line-height: 1.45; }
.article-output h2 { margin: 28px 0 12px; padding-left: 12px; border-left: 4px solid var(--layout-accent); color: var(--layout-accent); font-size: 1.12em; }
.article-output p { margin: 0 0 18px; }
.article-output [contenteditable="true"] { outline: 1px solid transparent; border-radius: 5px; transition: outline-color .15s ease, background-color .15s ease; }
.article-output [contenteditable="true"]:hover { outline-color: #d7e2f2; }
.article-output [contenteditable="true"]:focus { outline-color: #7aa7ff; background: #f8fbff; }
.article-output figure { margin: 18px 0 22px; position: relative; text-align: center; }
.article-output .layout-image-frame { position: relative; display: inline-block; overflow: hidden; max-width: 100%; border-radius: 12px; margin: 0 auto; background: #eef2f7; }
.article-output .layout-image-frame[style*="aspect-ratio"] { display: block; }
.article-output img { max-width: 100%; border-radius: 12px; display: block; margin: 0 auto; transform-origin: center; }
.article-output .layout-image-frame[style*="aspect-ratio"] img { width: 100%; height: 100%; object-fit: cover; }
.layout-image-click { cursor: zoom-in; }
.layout-image-actions { position: absolute; top: 10px; right: 10px; z-index: 2; display: flex; gap: 6px; opacity: 0; transition: opacity .18s ease; }
.layout-image-figure:hover .layout-image-actions { opacity: 1; }
.layout-image-actions button { border: 0; border-radius: 7px; padding: 6px 9px; background: rgba(15, 23, 42, .78); color: #fff; font-size: 12px; cursor: pointer; }
.layout-image-actions button:hover { background: rgba(15, 23, 42, .95); }
.article-output figcaption { text-align: center; color: #8a96a8; font-size: 13px; margin-top: 8px; }
.article-output strong { color: var(--layout-accent); background: var(--layout-soft); padding: 1px 4px; border-radius: 4px; }
.layout-decor-icon { user-select: none; white-space: nowrap; }
.image-crop-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(15, 23, 42, .42); }
.image-crop-modal[hidden] { display: none; }
.image-crop-dialog { width: min(760px, 96vw); max-height: 92vh; overflow: auto; border-radius: 10px; background: #fff; box-shadow: 0 24px 70px rgba(15, 23, 42, .28); }
.image-crop-head, .image-crop-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.image-crop-actions { justify-content: flex-end; border-top: 1px solid var(--border); border-bottom: 0; }
.image-crop-stage { padding: 18px; background: #f6f8fb; }
.image-crop-stage .image-crop-frame { width: min(560px, 100%); margin: 0 auto; overflow: hidden; border-radius: 10px; background: #dbe3ef; }
.image-crop-stage img { width: 100%; height: 100%; display: block; object-fit: cover; transform-origin: center; }
.image-crop-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px; }
.image-crop-controls input[type="range"] { height: 34px; padding: 0; }
.image-picker-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(15, 23, 42, .42); }
.image-picker-modal[hidden] { display: none; }
.image-picker-dialog { width: min(980px, 96vw); max-height: 92vh; overflow: auto; border-radius: 10px; background: #fff; box-shadow: 0 24px 70px rgba(15, 23, 42, .28); }
.image-picker-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: #f8fbff; }
.image-picker-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px; }
.image-picker-option { border: 1px solid var(--border); border-radius: 8px; padding: 0; overflow: hidden; background: #f8fafc; cursor: pointer; aspect-ratio: 16 / 9; }
.image-picker-option:hover { border-color: #2f6df6; box-shadow: 0 8px 22px rgba(47, 109, 246, .16); }
.image-picker-option img { width: 100%; height: 100%; display: block; object-fit: cover; }
.wechat-copy-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(15, 23, 42, .42); }
.wechat-copy-modal[hidden] { display: none; }
.wechat-copy-dialog { width: min(480px, 96vw); overflow: hidden; border-radius: 10px; background: #fff; box-shadow: 0 24px 70px rgba(15, 23, 42, .28); }
.wechat-copy-head, .wechat-copy-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.wechat-copy-actions { justify-content: flex-end; border-top: 1px solid var(--border); border-bottom: 0; }
.wechat-copy-body { padding: 16px; color: var(--text); line-height: 1.7; }
.wechat-copy-body p { margin: 0 0 10px; }
.wechat-copy-progress { min-height: 24px; padding: 10px 12px; border-radius: 6px; background: #f4f8fd; color: var(--muted); }
.tutorial-list { margin: 10px 0 0; padding-left: 22px; line-height: 2; }
.tutorial-content { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; line-height: 2; color: #34445d; white-space: normal; }
.tutorial-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tutorial-step { padding: 16px; border: 1px solid #dce8f6; border-radius: 8px; background: linear-gradient(180deg, #fff 0%, #f8fbff 100%); line-height: 1.75; }
.tutorial-step span { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 26px; margin-bottom: 10px; border-radius: 999px; background: #e8f0ff; color: var(--primary); font-size: 12px; font-weight: 800; }
.tutorial-step h3 { margin: 0 0 6px; color: #0f1f37; font-size: 16px; }
.tutorial-step p { margin: 0; color: #52657f; }
.tutorial-extra { margin-top: 12px; padding: 14px 16px; border-left: 4px solid var(--primary); border-radius: 6px; background: #eef6ff; color: #244060; line-height: 1.7; }
.tutorial-extra strong { display: block; margin-bottom: 4px; color: var(--primary); }
.tutorial-extra p { margin: 0; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.profile-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: 0 8px 22px rgba(24,40,61,.04); }
.profile-card h3 { margin: 0 0 10px; color: var(--text); font-size: 18px; }
.profile-card p { margin: 0 0 14px; color: var(--muted); line-height: 1.7; }
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.profile-head h3 { margin: 0; }
.profile-head p { margin: 4px 0 0; }
.profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.profile-stats div { padding: 12px; border: 1px solid var(--border); border-radius: 6px; background: #f8fbff; }
.profile-stats span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.profile-stats strong { font-size: 16px; color: var(--primary); }
.muted-line { color: var(--muted); }
.redeem-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 14px; }
.record-card, .notice-card { margin-top: 16px; }
.notice-list { margin: 0; padding-left: 22px; color: #34445d; line-height: 30px; }
.notice-list li { margin-bottom: 8px; }
.site-footer { width: min(1200px, calc(100vw - 28px)); margin: 18px auto 28px; color: var(--muted); text-align: center; font-size: 13px; }
.workbench-body { height: 100vh; overflow: hidden; }
.workbench-body .app-shell { width: calc(100vw - 40px); max-width: none; height: calc(100vh - 24px); margin: 12px auto; align-items: stretch; }
.workbench-body .sidebar { min-height: 0; height: 100%; position: relative; top: auto; }
.workbench-body .main-panel { min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: 0 10px 30px rgba(24,40,61,.06); }
.workbench-body .panel { border: 0; box-shadow: none; padding: 0; border-radius: 0; }
.workbench-body .panel.active { flex: 1 1 auto; min-height: 0; overflow: auto; }
.workbench-body #screen-home.panel.active { overflow: hidden; display: grid; grid-template-rows: auto auto auto auto; gap: 10px; align-content: start; }
.workbench-body .home-hero { min-height: 0; padding: 18px 26px; }
.workbench-body .home-kicker { padding: 5px 9px; font-size: 13px; }
.workbench-body .home-hero h1 { margin: 10px 0 6px; font-size: 34px; line-height: 1.12; }
.workbench-body .home-lead { line-height: 1.6; }
.workbench-body .home-benefit { margin-top: 8px; padding: 6px 10px; line-height: 1.45; }
.workbench-body .home-actions { margin-top: 14px; gap: 10px; }
.workbench-body .home-feature-grid { margin-top: 0; gap: 10px; }
.workbench-body .home-feature { min-height: 0; padding: 14px; }
.workbench-body .home-feature span { height: 24px; min-width: 32px; }
.workbench-body .home-feature h3 { margin: 9px 0 5px; font-size: 16px; }
.workbench-body .home-feature p { line-height: 1.55; }
.workbench-body .home-flow { margin-top: 10px; padding: 14px 16px; gap: 12px; }
.workbench-body .home-flow h2 { margin-bottom: 5px; font-size: 18px; }
.workbench-body .home-flow p { line-height: 1.55; }
.workbench-body .home-flow ol { gap: 8px; }
.workbench-body .home-flow li { padding: 10px 12px; }
.workbench-body .home-flow li strong { margin-bottom: 3px; }
.workbench-body .home-flow li span { line-height: 1.45; }
.workbench-body .home-note { margin-top: 10px; padding: 10px 12px; }
.workbench-body .home-note p { line-height: 1.55; }
.workbench-body #screen-article.panel.active,
.workbench-body #screen-rewrite.panel.active,
.workbench-body #screen-layout.panel.active { overflow: hidden; }
.workbench-body #screen-article .split,
.workbench-body #screen-rewrite .split,
.workbench-body #screen-layout .split { height: calc(100% - 34px); min-height: 0; }
.workbench-body .tool-card { min-height: 0; overflow: auto; }
.workbench-body .preview-card { min-height: 0; height: 100%; }
.workbench-body .preview-body { min-height: 0; overflow: auto; }
.workbench-body #screen-title.panel.active { overflow: hidden; }
.workbench-body #screen-title .title-split { height: calc(100% - 34px); min-height: 0; }
.title-result-card { min-height: 520px; }
.title-result-body { padding: 18px; }
.title-result-list { margin: 0; min-height: 0; gap: 8px; align-content: start; grid-auto-rows: min-content; }
.empty-result { min-height: 100%; display: grid; place-items: center; color: var(--muted); }
.workbench-body .layout-preview { min-height: 0; max-height: none; height: 100%; overflow: auto; }
.workbench-body .site-footer { display: none; }
.admin-layout { width: min(1280px, calc(100vw - 28px)); margin: 22px auto; display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 18px; align-items: start; }
.admin-content { width: 100%; display: grid; gap: 16px; min-width: 0; }
.admin-topbar, .admin-card { width: 100%; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.admin-topbar { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--muted); line-height: 1.6; }
.admin-topbar h1 { margin: 0; font-size: 22px; }
.admin-topbar p { margin: 6px 0 0; color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-card span { color: var(--muted); }
.stat-card strong { display: block; margin-top: 8px; font-size: 24px; }
.upload-cache-card { display: grid; gap: 14px; }
.upload-cache-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.upload-cache-head h2 { margin: 0 0 6px; }
.upload-cache-head p { margin: 0; color: var(--muted); line-height: 1.6; }
.upload-cache-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.upload-cache-grid div { padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #f8fbff; }
.upload-cache-grid span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.upload-cache-grid strong { color: var(--text); font-size: 15px; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { background: #f4f8fd; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form input, .inline-form select { width: auto; min-width: 120px; }
.member-form { width: 100%; display: grid; grid-template-columns: minmax(150px,1.4fr) minmax(110px,.8fr) minmax(110px,.8fr) minmax(120px,.7fr) minmax(150px,1fr) auto; gap: 8px; align-items: center; }
.member-edit-form { grid-template-columns: minmax(116px,.85fr) minmax(96px,.55fr) minmax(118px,.8fr) auto auto auto; gap: 10px; }
.member-edit-form input, .member-edit-form select { min-width: 0; border-radius: 6px; }
.member-edit-form .btn { min-height: 36px; padding: 0 14px; }
.permission-summary { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 999px; background: #eef6ff; color: var(--primary); font-size: 12px; white-space: nowrap; }
.member-admin-card { overflow: hidden; }
.member-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.member-list-head h2 { margin: 0; }
.member-list-count { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 999px; background: #eef4fb; color: var(--muted); font-size: 12px; white-space: nowrap; }
.member-table-wrap { width: 100%; overflow-x: auto; }
.members-table { min-width: 820px; border: 0; border-collapse: separate; border-spacing: 0 8px; background: transparent; }
.members-table th { padding: 0 12px 4px; border-bottom: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; }
.members-table th:nth-child(1) { width: 22%; }
.members-table th:nth-child(2) { width: 14%; }
.members-table th:nth-child(3) { width: 14%; }
.members-table th:nth-child(4) { width: 50%; }
.members-table td { padding: 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #fff; vertical-align: middle; }
.members-table tbody tr { box-shadow: 0 8px 22px rgba(24,40,61,.05); }
.members-table tbody td:first-child { border-left: 1px solid var(--border); border-radius: 8px 0 0 8px; }
.members-table tbody td:last-child { border-right: 1px solid var(--border); border-radius: 0 8px 8px 0; }
.member-account { display: grid; gap: 6px; align-content: center; }
.member-account strong { font-size: 15px; color: #0f1f37; }
.role-badge { width: max-content; }
.member-level-badge { min-width: 78px; justify-content: center; font-weight: 700; color: #42607c; }
.member-level-badge.green { color: #047857; }
.member-expiry { display: inline-block; color: #263852; line-height: 1.5; }
.members-table .permission-summary { justify-content: center; min-width: 106px; background: #eef6ff; }
.password-popover { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgba(19,34,58,.45); }
.password-popover[hidden] { display: none; }
.password-dialog { width: min(420px, 100%); max-height: min(80vh, 560px); overflow: auto; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: 0 22px 70px rgba(19,34,58,.24); }
.password-form { display: grid; gap: 12px; padding-top: 10px; }
.password-form .field { margin-bottom: 0; }
.password-target { margin: 0; padding: 10px 12px; border-radius: 6px; background: #f4f8fd; color: var(--muted); }
.password-target strong { color: var(--text); }
.password-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 2px; }
.modal-open { overflow: hidden; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 0 0; color: var(--muted); }
.pagination .disabled { opacity: .52; cursor: not-allowed; }
.admin-card.compact { padding: 14px; }
.admin-card.compact h2 { margin: 0 0 12px; }
.table.compact th, .table.compact td { padding: 8px; }
.badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: #edf2f7; color: var(--muted); font-size: 12px; }
.badge.green { background: #dcfce7; color: #047857; }
.badge.red { background: #fee2e2; color: #b91c1c; }
.compact-check { min-height: 32px; margin: 0; }
.agent-board { display: grid; gap: 16px; }
.agent-module { padding: 0; overflow: hidden; }
.agent-module-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; background: linear-gradient(180deg, #f8fbff, #fff); border-bottom: 1px solid var(--border); }
.agent-module-head h2 { margin: 0; color: var(--primary); font-size: 18px; }
.agent-module-head p { margin: 6px 0 0; color: var(--text); line-height: 1.6; }
.agent-module-head small { display: block; margin-top: 3px; color: var(--muted); line-height: 1.5; }
.agent-count { min-width: 58px; height: 32px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: #e8f0ff; color: var(--primary); font-weight: 700; }
.empty-state { margin: 14px 18px 18px; padding: 14px; border: 1px dashed var(--border); border-radius: 6px; color: var(--muted); background: #fbfdff; }
.agent-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; padding: 14px; }
.agent-card { min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 14px; background: #fff; box-shadow: 0 8px 22px rgba(24,40,61,.04); }
.agent-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.agent-head-actions { display: inline-flex; align-items: center; gap: 10px; }
.agent-name-toggle, .agent-sort-toggle { border: 0; background: transparent; padding: 0; cursor: pointer; color: var(--text); text-align: left; }
.agent-name-toggle { min-width: 0; font-size: 15px; font-weight: 700; }
.agent-sort-toggle { color: var(--muted); font-size: 12px; white-space: nowrap; }
.agent-name-toggle:hover, .agent-sort-toggle:hover { color: var(--primary); text-decoration: underline; }
.agent-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.agent-meta span { padding: 3px 8px; border-radius: 999px; background: #f1f5fb; }
.agent-fields { display: grid; grid-template-columns: 1fr 86px 94px 70px; gap: 8px; margin-bottom: 8px; }
.agent-inline-edit { display: grid; grid-template-columns: minmax(0,1fr) 96px; gap: 8px; margin: 0 0 8px; padding: 10px; border: 1px dashed var(--border); border-radius: 6px; background: #f8fbff; }
.agent-inline-edit[hidden] { display: none; }
.agent-inline-edit .field { margin: 0; }
.agent-inline-edit .field span { margin-bottom: 5px; font-size: 12px; color: var(--muted); }
.agent-card textarea { min-height: 130px; margin-bottom: 10px; font-size: 13px; }
.agent-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-admin-grid { width: 100%; display: grid; grid-template-columns: minmax(0,1fr) minmax(140px,.5fr) auto; gap: 10px; align-items: end; }
.generated-codes { width: 100%; min-height: 130px; font-family: Consolas, monospace; }
.code-text, .code-copy { font-family: Consolas, monospace; font-weight: 700; color: var(--primary); }
.code-copy { border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left; }
.code-copy:hover { text-decoration: underline; }
.code-copy.copied { color: var(--success); }
@media (max-width: 900px) {
  .app-shell, .admin-layout, .model-grid, .split { grid-template-columns: 1fr; }
  .workbench-body { height: auto; overflow: auto; }
  .workbench-body .app-shell { width: min(100%, calc(100vw - 14px)); height: auto; margin: 8px auto; gap: 10px; }
  .workbench-body .main-panel, .workbench-body .sidebar { height: auto; }
  .workbench-body .main-panel { padding: 10px; }
  .status-bar { align-items: flex-start; min-height: 0; padding: 10px 12px; }
  .status-text { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.6; }
  .workbench-body .panel.active { overflow: visible; }
  .workbench-body #screen-home.panel.active { display: block; overflow: visible; }
  .workbench-body #screen-title .title-split, .workbench-body #screen-article .split, .workbench-body #screen-rewrite .split, .workbench-body #screen-layout .split { height: auto; }
  .workbench-body .preview-card { height: auto; min-height: 520px; }
  .workbench-body .site-footer { display: block; position: static; transform: none; margin: 18px auto 28px; width: min(1200px, calc(100vw - 28px)); }
  .sidebar { min-height: auto; position: static; padding: 8px; }
  .brand-block { grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto auto; padding: 2px 4px 8px; column-gap: 9px; }
  .brand-block .brand-mark { grid-column: 1; grid-row: 1 / span 2; width: 34px; height: 34px; margin-top: 0; }
  .brand-block strong { grid-column: 2; grid-row: 1; text-align: left; font-size: 17px; }
  .brand-block small:first-of-type { grid-column: 2; grid-row: 2; align-self: start; }
  .brand-block small:nth-of-type(2) { display: none; }
  .sidebar-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 6px; padding-top: 6px; gap: 5px; }
  .side-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .side-nav button, .side-nav a, .logout { min-height: 30px; padding: 0 4px; font-size: 11px; justify-content: center; text-align: center; line-height: 1.2; }
  .home-hero { min-height: 0; padding: 20px; }
  .home-hero h1 { font-size: 30px; }
  .home-lead { white-space: normal; }
  .home-feature-grid, .home-flow, .home-flow ol, .tutorial-steps { grid-template-columns: 1fr; }
  .form-grid.two, .form-grid.three, #screen-article .tool-card > .form-grid.two, #screen-layout .tool-card > .form-grid.two, .stat-grid, .upload-cache-grid, .member-form, .member-edit-form, .agent-card-grid, .agent-fields, .profile-grid, .profile-stats, .redeem-form, .card-admin-grid { grid-template-columns: 1fr; }
  #screen-layout .tool-card > .form-grid.two { display: grid; }
  #screen-layout .tool-card > .form-grid.two .check { margin-bottom: 12px; }
  .preview-toolbar, .preview-footer, .admin-topbar { align-items: stretch; flex-direction: column; }
}

@media (max-width: 420px) {
  .side-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-actions .btn { width: 100%; }
  .panel { padding: 16px; }
}
/* 单独降AI：左右大编辑器样式 */
.workbench-body #screen-polish.panel.active {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.workbench-body #screen-polish > h2 {
  flex: 0 0 auto;
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}
.workbench-body #screen-polish .polish-solo {
  flex: 1 1 auto;
  min-height: 0;
  height: calc(100% - 44px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}
.workbench-body #screen-polish .code-card {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d9e3f2;
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(15, 35, 75, .08);
}
.workbench-body #screen-polish .code-toolbar {
  flex: 0 0 auto;
  min-height: 76px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #e7edf7;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.workbench-body #screen-polish .code-toolbar > span {
  color: #536681;
  font-weight: 700;
}
.workbench-body #screen-polish .code-toolbar strong {
  color: #2563eb;
  font-size: 18px;
}
.workbench-body #screen-polish .toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}
.workbench-body #screen-polish .toolbar-actions .btn {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .08);
}
.workbench-body #screen-polish #runPolishSolo {
  min-width: 118px;
  color: #fff;
  background: linear-gradient(135deg, #6d5dfc 0%, #a855f7 100%);
  box-shadow: 0 12px 24px rgba(124, 58, 237, .24);
}
.workbench-body #screen-polish .code-editor-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  background: #fff;
}
.workbench-body #screen-polish .line-gutter {
  padding-top: 30px;
  text-align: center;
  color: #9aabc2;
  font-weight: 800;
  border-right: 1px solid #e8eef7;
  background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
  user-select: none;
}
.workbench-body #screen-polish .line-gutter div { display: block; height: 30px; line-height: 30px; color: #8aa0bd; }
.workbench-body #screen-polish .code-editor {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 28px 24px;
  border: 0;
  outline: 0;
  resize: none;
  overflow: auto;
  background: #fff;
  color: #10213c;
  font-size: 16px;
  line-height: 30px;
  font-family: inherit;
  white-space: pre-wrap;
}
.workbench-body #screen-polish textarea.code-editor::placeholder,
.workbench-body #screen-polish .code-output {
  color: #8ca0ba;
}
.workbench-body #screen-polish .code-output {
  user-select: text;
}
@media (max-width: 900px) {
  .workbench-body #screen-polish.panel.active { overflow: auto; }
  .workbench-body #screen-polish .polish-solo {
    height: auto;
    min-height: 900px;
    grid-template-columns: 1fr;
  }
}

#polishSourceGutter,
#polishResultGutter {
  overflow: hidden;
}
.workbench-body #screen-polish .code-output,
.workbench-body #screen-polish textarea.code-editor {
  line-height: 30px !important;
}