:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  color: #263a47;
  background: #f3f6f8;
  font-synthesis: weight;
  --accent: #3978ed;
  --border: #e0e7eb;
  --muted: #7a8b94;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #75c7b2; outline-offset: 3px; }
button { transition: background-color .15s, border-color .15s; }
[hidden] { display: none !important; }
.sidebar { width: 204px; position: fixed; inset: 0 auto 0 0; padding: 27px 15px; background: #18313f; color: #d4e1e6; }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 7px 37px; font-size: 17px; font-weight: 700; }
.brand > span { display: grid; place-items: center; width: 36px; height: 39px; border-radius: 10px; background: #d1ede2; color: #23654f; font-size: 21px; }
.brand small { display: block; margin-top: 5px; font-size: 13px; color: #8ea7b4; font-weight: 500; }
.nav { display: flex; align-items: center; width: 100%; padding: 13px 12px; margin: 7px 0; gap: 11px; color: #b4c7d0; background: transparent; border: 0; border-radius: 7px; font-size: 14px; text-align: left; }
.nav.active { background: #2d4c58; color: #effbf6; }
.nav:hover { background: #294553; }
.nav-icon { font-size: 19px; width: 22px; text-align: center; color: #a4cfc0; }
.nav small { margin-left: auto; font-size: 13px; color: #8da4ad; }
.sidebar-note { position: absolute; bottom: 27px; left: 22px; font-size: 13px; color: #abc4cd; }
.sidebar-note i { width: 6px; height: 6px; display: inline-block; background: #7bc8ad; border-radius: 50%; margin-right: 5px; }
.sidebar-note small { display: block; font-size: 13px; margin-top: 8px; color: #7996a3; }
main { margin-left: 204px; padding: 0 30px 12px; max-width: 1680px; }
.topbar { height: 61px; border-bottom: 1px solid #dfe7eb; display: flex; justify-content: space-between; align-items: center; color: #82929a; font-size: 13px; }
.topbar b { color: #577181; font-weight: 500; }
.topbar > span:last-child { display: flex; align-items: center; gap: 8px; }
.heading { padding: 23px 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
h1 { font-size: 25px; line-height: 1.4; margin: 0; color: #203d4d; letter-spacing: -.6px; }
h2 { font-size: 20px; margin: 0; color: #264554; }
h3 { font-size: 15px; margin: 0; }
p { font-size: 13px; color: #7a8e98; line-height: 1.75; }
.heading p { margin: 5px 0 0; }
.heading-actions, .row-actions, .post-actions, .inline-actions, .form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.primary, .secondary { border: 1px solid #d8e2e7; border-radius: 6px; padding: 9px 13px; font-size: 13px; font-weight: 600; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: 35px; }
.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.primary:hover { background: #116750; border-color: #116750; }
.secondary { color: #466475; background: #fff; }
.secondary:hover { border-color: #aac5bf; background: #f5fbf8; }
.icon-button { background: none; border: 0; color: #738e99; padding: 4px 7px; font-size: 20px; line-height: 1; }
.text-button { color: var(--accent); background: none; border: 0; padding: 0; font-size: 13px; text-align: left; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stats > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff; border: 1px solid var(--border); padding: 15px 19px; border-radius: 8px; }
.stats span { font-size: 13px; color: #79909a; }
.stats strong { font-size: 25px; font-weight: 600; color: #2b6758; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid #dce5ea; margin: 19px 0 18px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 0 0 12px; color: #7b8e98; font-size: 13px; white-space: nowrap; }
.tabs .selected { border-bottom: 2px solid var(--accent); color: var(--accent); font-weight: 700; }
.card { min-width: 0; border: 1px solid var(--border); background: #fff; border-radius: 9px; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #edf1f3; }
.card-head small, .dialog-head small { display: block; font-size: 13px; line-height: 1.6; color: #8a9aa1; margin-top: 5px; }
.spaced { margin-top: 17px; }
.tag { display: inline-block; font-size: 13px; font-weight: 500; border-radius: 4px; color: #4b7968; background: #eaf5ef; padding: 3px 7px; white-space: nowrap; }
.tag.muted { color: #8b969d; background: #f1f4f5; }
.tag.status { color: #927020; background: #fff5dc; }
.tag.history { color: #8a6a3e; background: #f8f0e4; }
.workspace { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 17px; }
.mobile-selection-bar { display: none; }
.categories { align-self: start; }
.categories .card-head { padding: 14px 14px; }
.category-search { padding: 0 11px 11px; }
.category-search input { padding: 8px 9px; font-size: 13px; background: #f9fbfc; }
.category-search input::placeholder { font-size: 13px; }
#category-list .empty { padding: 25px 10px; }
#category-list .empty strong { font-size: 13px; }
#category-list { max-height: 68vh; overflow-y: auto; }
.site-parent { border: 0; border-top: 1px solid #edf2f4; width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 13px 13px; background: #f7fafb; color: #385765; font-size: 13px; font-weight: 700; text-align: left; }
.site-parent.chosen { background: #e8f4ee; color: #247b5e; }
.site-parent small { color: #92a6ae; font-size: 13px; }
.category-line { display: flex; align-items: center; padding-right: 10px; background: #fff; border-left: 3px solid transparent; }
.category-line.selected { border-left-color: var(--accent); background: #eaf6f0; }
.category { display: flex; justify-content: space-between; align-items: center; flex: 1; min-width: 0; width: 100%; gap: 6px; border: 0; background: transparent; color: #62808b; padding: 10px 10px 10px 22px; text-align: left; font-size: 13px; }
.category small { color: #99abb1; font-size: 13px; }
.category-line.selected .category { color: #267d5e; font-weight: 700; }
.category-call { border: 1px solid #dbe9e3; border-radius: 4px; color: #42816d; font-size: 13px; background: #fff; padding: 4px 6px; }
.category-call:hover { border-color: #62ac91; background: #eff8f2; }
.all-category { padding: 13px 15px; }
.all-category.selected { background: #eaf6f0; color: var(--accent); font-weight: 700; }
.add-subcategory { margin: 11px; width: calc(100% - 22px); }
.listing-head { align-items: flex-start; flex-wrap: wrap; }
.row-actions { gap: 6px; }
.row-actions button { font-size: 13px; padding: 7px 10px; min-height: 32px; }
.post-row { padding: 17px 18px; border-bottom: 1px solid #edf1f3; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.post-row:last-child { border: 0; }
.post-row:hover { background: #fafcfd; }
.post-info { min-width: 0; }
.post-title { color: #294a58; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.post-title small { font-size: 13px; font-weight: 500; color: #9baab0; margin-left: 5px; white-space: nowrap; }
.post-meta { font-size: 13px; color: #879ba4; line-height: 1.8; margin-top: 5px; }
.post-actions { flex-shrink: 0; gap: 6px; }
.post-actions button { font-size: 13px; padding: 7px 9px; min-height: 31px; }
.empty { padding: 45px 15px; text-align: center; line-height: 1.8; font-size: 13px; color: #94a5ac; }
.empty strong { display: block; color: #6a838e; font-weight: 500; font-size: 14px; }
.empty span { display: block; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px 18px; padding: 20px; }
.wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: #56707e; min-width: 0; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid #d9e3e8; background: #fff; border-radius: 5px; color: #294d5e; padding: 10px; outline: 0; font-size: 13px; }
input:focus, select:focus, textarea:focus { border-color: #63a991; box-shadow: 0 0 0 3px #edf7f2; }
input::placeholder, textarea::placeholder { color: #a0adb4; font-size: 13px; }
textarea { resize: vertical; line-height: 1.7; }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; margin: 0; }
input[type=color] { height: 39px; padding: 5px; }
.check { flex-direction: row; align-items: center; gap: 8px; line-height: 1.6; }
.hint { font-size: 13px; line-height: 1.75; color: #8b9da5; overflow-wrap: anywhere; }
.code { font-family: Consolas, "Microsoft YaHei", monospace; font-size: 13px; line-height: 1.8; }
.scope-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 6px; background: #eff7f3; color: #33765e; font-size: 13px; }
.scope-summary .check { font-size: 13px; }
.post-choices, #preset-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; max-height: 330px; overflow: auto; }
.post-choices .empty { grid-column: 1 / -1; }
.choice { display: flex; flex-direction: row; align-items: center; gap: 9px; border: 1px solid #e0e8ec; border-radius: 6px; padding: 10px; cursor: pointer; background: #fbfdfd; min-width: 0; }
.choice > span { min-width: 0; overflow-wrap: anywhere; }
.choice small { display: block; color: #97a8af; font-size: 13px; margin-top: 4px; }
.choice:has(input:checked) { border-color: #78b79c; background: #edf8f1; color: #277658; }
.bulk-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.bulk-tools .inline-actions { justify-content: flex-end; }
.bulk-tools input { max-width: 170px; padding: 8px; }
.bulk-tools select { width: 128px; padding: 8px; font-size: 13px; }
.bulk-tools .secondary { min-height: 32px; padding: 7px 9px; font-size: 13px; }
.divider { height: 1px; background: #edf1f2; }
.rule-note { background: #f1f6f8; padding: 11px 13px; color: #6d8996; font-size: 13px; line-height: 1.8; border-radius: 5px; overflow-wrap: anywhere; }
.generation-note { background: #fbf7ef; padding: 13px 15px; border-radius: 6px; color: #92713f; font-size: 13px; }
.generation-note p { color: #9c8b72; margin: 7px 0; font-size: 13px; }
.generation-note .error-text { color: #ba4f45; }
.record-row { padding: 16px 19px; border-bottom: 1px solid #eaf0f3; font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
.record-row:last-child { border: 0; }
.record-row .tag { margin-left: 9px; }
.record-row b { color: #456473; }
.record-content { font-size: 16px; color: #2c5666; margin: 7px 0; }
.record-row p { margin: 3px 0; }
.record-row small { display: block; font-size: 13px; color: #94a5ad; }
.record-content small { display: inline; margin-left: 8px; }
.scroll-list { max-height: 610px; overflow-y: auto; }
.log-line { display: grid; grid-template-columns: 150px 130px minmax(0,1fr); gap: 13px; padding: 15px 18px; border-bottom: 1px solid #edf1f3; align-items: start; font-size: 13px; }
.log-line time { font-size: 13px; color: #9babb2; }
.log-line p { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
#managed-sites { padding: 17px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.managed-site { display: flex; align-items: center; gap: 11px; text-align: left; border: 1px solid #e0e8ec; border-radius: 7px; padding: 17px 12px; background: #fafdfe; color: #446577; min-width: 0; }
.managed-site > span { display: grid; place-items: center; width: 35px; height: 38px; border-radius: 7px; background: #e5f3ec; color: #3a8e71; font-size: 17px; flex-shrink: 0; }
.managed-site b { font-size: 13px; }
.managed-site small { display: block; font-size: 13px; color: #8eaaad; margin-top: 6px; }
.managed-site em { margin-left: auto; font-style: normal; font-size: 13px; color: #719b8c; white-space: nowrap; }
.source-list { padding: 16px 19px; display: grid; gap: 14px; }
.source-list a { text-decoration: none; font-size: 13px; color: #388c70; }
.source-list small { display: block; color: #99a8ae; font-size: 13px; overflow-wrap: anywhere; margin-top: 5px; }
.reference-details { padding: 0 19px 17px; }
summary { cursor: pointer; color: #5e7e90; font-size: 13px; padding: 5px 0; }
details > label { margin-top: 12px; }
#reference-list { max-height: 360px; overflow-y: auto; }
.reference-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid #edf1f4; font-size: 13px; }
.reference-row p { color: #53788a; margin: 5px 0; }
.reference-row small { color: #9eafb7; font-size: 13px; }
.reference-row button { flex-shrink: 0; }
.construction { max-width: 540px; margin: 90px auto; text-align: center; background: #fff; border: 1px dashed #c6d5dc; border-radius: 10px; padding: 45px 20px; }
.construction > span { display: inline-block; font-size: 13px; color: #9b874e; background: #fcf4de; padding: 5px 14px; border-radius: 20px; margin-bottom: 15px; }
.construction h1 { font-size: 23px; }
footer { color: #9dabb3; font-size: 13px; padding: 22px 0; }
dialog { width: 660px; max-width: 95vw; max-height: 92vh; overflow-y: auto; border: 1px solid #dae5e9; border-radius: 11px; padding: 22px; color: #315462; box-shadow: 0 20px 75px #102b3930; }
dialog::backdrop { background: #152e3d70; }
.dialog-wide { width: 850px; }
.dialog-design { width: 1160px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 17px; border-bottom: 1px solid #e8eef1; }
.dialog-head .icon-button { font-size: 26px; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 15px; }
.dialog-actions .hint { margin-right: auto; }
dialog .form-grid { padding: 19px 0; }
.preview-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.preview-tools b { font-size: 13px; margin-right: auto; }
.preview-stage { background: #eff3f5; padding: 12px; border: 1px solid #e5ecef; border-radius: 7px; overflow: auto; margin-top: 15px; }
iframe { display: block; width: 100%; max-width: 100%; height: 480px; border: 0; margin: 0 auto; background: #fff; }
.generated-preview { border: 1px solid #dce8e3; border-radius: 7px; overflow: hidden; }
.generated-preview iframe { height: 430px; }
.preview-banner { background: #f1f7f3; color: #729284; padding: 10px 12px; font-size: 13px; }
.design-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; }
.design-editor, .design-preview { min-width: 0; }
.form-grid.compact { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.template-tabs { gap: 17px; margin-top: 0; }
.template-tabs button { font-size: 13px; }
.design-preview .preview-stage { padding: 7px; margin-top: 0; }
.design-preview iframe { height: 570px; }
.design-preview .preview-tools button { font-size: 13px; padding: 7px 9px; }
.workspace-tools { display: flex; gap: 10px; flex-wrap: wrap; padding: 16px 18px; }
.tools-card .card-head { padding-top: 13px; padding-bottom: 13px; }
#variables-list { max-height: 58vh; overflow-y: auto; }
.variable-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; padding: 14px 1px; border-bottom: 1px solid #e8eef1; font-size: 13px; }
.variable-row > div { overflow-wrap: anywhere; line-height: 1.8; }
.variable-row code { color: #3267b5; font-family: Consolas,monospace; }
.variable-row .tag { align-self: start; }
.variable-row p { grid-column: 1 / -1; margin: 0; font-size: 13px; }
#toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); max-width: min(600px,90vw); padding: 13px 20px; background: #2a579d; color: #fff; font-size: 13px; line-height: 1.7; border-radius: 7px; box-shadow: 0 5px 24px #142b4533; z-index: 100; }
#toast.error { background: #9c4843; }
@media (max-width:1150px) {
  .sidebar { width: 180px; padding-left: 12px; padding-right: 12px; }
  .brand { margin-left: 3px; font-size: 16px; gap: 8px; }
  main { margin-left: 180px; padding-left: 22px; padding-right: 22px; }
  .workspace { grid-template-columns: 205px minmax(0,1fr); }
  .post-row { align-items: flex-start; flex-direction: column; }
  .post-choices, #preset-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #managed-sites { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .managed-site em { display: none; }
}
@media (max-width:800px) {
  .sidebar { width: 160px; }
  .nav { font-size: 13px; padding: 12px 8px; gap: 8px; }
  .nav small { font-size: 13px; }
  .brand { font-size: 14px; }
  .brand small { font-size: 13px; }
  .brand > span { width: 30px; height: 34px; }
  main { margin-left: 160px; padding-left: 16px; padding-right: 16px; }
  .heading { align-items: flex-start; }
  .heading-actions { justify-content: flex-end; max-width: 240px; }
  .heading-actions button { padding: 7px 10px; font-size: 13px; }
  .stats { gap: 8px; }
  .stats > div { padding: 12px; flex-direction: column; align-items: flex-start; }
  .stats span { font-size: 13px; }
  .workspace { grid-template-columns: 1fr; }
  #category-list { max-height: 260px; }
  .site-children { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .category { padding-left: 9px; }
  .category-line { padding-right: 5px; }
  .log-line { grid-template-columns: 125px 1fr; gap: 7px; }
  .log-line p { grid-column: 1 / -1; }
  .design-layout { grid-template-columns: 1fr; gap: 6px; }
  .design-preview iframe { height: 440px; }
}
@media (max-width:600px) {
  .sidebar { position: static; width: 100%; padding: 10px; display: flex; gap: 7px; align-items: center; overflow-x: auto; }
  .brand { margin: 0; flex-shrink: 0; }
  .brand > div { display: none; }
  .brand > span { width: 29px; height: 33px; border-radius: 7px; font-size: 18px; }
  .sidebar nav { display: flex; gap: 3px; }
  .nav { margin: 0; width: auto; flex-shrink: 0; padding: 9px 9px; font-size: 13px; white-space: nowrap; border-radius: 5px; gap: 4px; }
  .nav-icon, .nav small, .sidebar-note { display: none; }
  main { margin: 0; padding: 0 12px 10px; }
  .topbar { height: 48px; font-size: 13px; }
  .topbar > span:last-child { gap: 4px; }
  .heading { padding: 19px 0 14px; gap: 10px; flex-wrap: wrap; }
  h1 { font-size: 22px; }
  .heading p { font-size: 13px; }
  .heading-actions { max-width: none; width: 100%; justify-content: flex-start; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stats > div { flex-direction: row; align-items: center; padding: 12px 14px; }
  .stats strong { font-size: 23px; }
  .stats span { font-size: 13px; }
  .tabs { margin: 17px 0 14px; gap: 21px; }
  .tabs button { font-size: 13px; }
  .card-head { padding: 14px; flex-wrap: wrap; gap: 7px; }
  .card-head h3 { font-size: 14px; }
  .card-head small { font-size: 13px; }
  .form-grid { padding: 15px; gap: 14px 11px; }
  label { font-size: 13px; }
  input, select, textarea { padding: 9px; font-size: 13px; }
  input[type=datetime-local] { min-width: 0; max-width: 100%; }
  .scope-summary { flex-direction: column; align-items: flex-start; padding: 11px; gap: 9px; }
  .form-actions { gap: 7px; }
  .form-actions button { font-size: 13px; padding: 9px 10px; }
  .site-children { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .row-actions { gap: 5px; }
  .row-actions button { font-size: 13px; padding: 7px 8px; }
  .post-row { padding: 15px; gap: 11px; }
  .post-actions { width: 100%; }
  .post-title { font-size: 14px; }
  .post-meta { font-size: 13px; }
  .post-choices { grid-template-columns: 1fr; }
  #preset-list { gap: 7px; max-height: 310px; }
  .choice { padding: 9px; font-size: 13px; gap: 6px; }
  .choice small { font-size: 13px; }
  .bulk-tools { align-items: flex-start; flex-direction: column; }
  .bulk-tools .inline-actions { width: 100%; flex-wrap: nowrap; }
  #bulk-dialog .bulk-tools .inline-actions { flex-wrap: wrap; justify-content: flex-start; }
  #preset-group { width: 115px; flex-shrink: 0; }
  #preset-search { flex: 1; width: 110px; }
  .bulk-tools input { max-width: none; flex: 1; }
  .bulk-tools .secondary { flex-shrink: 0; }
  .record-row { padding: 14px; font-size: 13px; }
  .record-row .tag { margin-left: 4px; font-size: 13px; }
  .record-content { font-size: 15px; }
  #managed-sites { padding: 13px; grid-template-columns: 1fr; gap: 9px; }
  .managed-site { padding: 13px; }
  .managed-site em { display: inline; }
  .log-line { padding: 13px; font-size: 13px; }
  .source-list { padding: 14px; }
  .reference-details { padding-left: 14px; padding-right: 14px; }
  dialog { padding: 16px; max-width: calc(100vw - 18px); }
  h2 { font-size: 18px; }
  dialog .form-grid { gap: 14px 10px; }
  .dialog-actions { flex-wrap: wrap; gap: 8px; }
  .dialog-actions .hint { width: 100%; }
  .preview-tools { gap: 6px; }
  .preview-tools .primary, .preview-tools .secondary { font-size: 13px; padding: 7px 9px; }
  .preview-stage { padding: 4px; }
  .form-grid.compact { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .template-tabs { gap: 17px; }
  .template-tabs button { font-size: 13px; }
  .workspace-tools { gap: 8px; padding: 14px; }
  .workspace-tools button { font-size: 13px; padding: 8px 10px; }
  .variable-row { grid-template-columns: 1fr; gap: 6px; }
  .variable-row .tag { justify-self: start; }
  .construction { margin: 55px auto; }
  footer { font-size: 13px; line-height: 1.7; }
}
@media (max-width:360px) {
  .nav { padding: 9px 7px; font-size: 13px; }
  .form-grid { grid-template-columns: 1fr; }
  .wide { grid-column: 1; }
  .form-grid.compact { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .compact .wide { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion:reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* 手机使用独立的紧凑导航和分类选择条，电脑继续显示常驻分类栏。 */
@media (min-width:701px) and (max-width:800px) {
  .workspace { grid-template-columns: 185px minmax(0,1fr); }
  .site-children { display: block; }
  #category-list { max-height: 68vh; }
}
@media (max-width:700px) {
  .sidebar { position: static; inset: auto; width: 100%; padding: 8px; display: block; overflow: visible; }
  .brand, .sidebar-note { display: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); width: 100%; gap: 3px; }
  .nav { display: flex; width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 9px 3px; justify-content: center; font-size: 14px; white-space: nowrap; }
  .nav-icon, .nav small { display: none; }
  main { margin-left: 0; padding: 0 12px 12px; }
  .topbar { height: 51px; font-size: 13px; gap: 7px; }
  .topbar > span:last-child { gap: 3px; }
  .topbar .icon-button { min-width: 37px; }
  .heading { padding: 19px 0 14px; flex-wrap: wrap; }
  h1 { font-size: 23px; letter-spacing: 0; }
  h2 { font-size: 20px; }
  h3 { font-size: 16px; }
  .heading p { font-size: 13px; }
  .heading-actions { width: 100%; max-width: none; justify-content: flex-start; gap: 8px; }
  .primary, .secondary, .heading-actions button, .row-actions button, .post-actions button { min-height: 42px; padding: 9px 12px; font-size: 14px; }
  .icon-button { min-height: 40px; min-width: 40px; display: inline-flex; align-items: center; justify-content: center; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .stats > div { flex-direction: row; align-items: center; padding: 13px; }
  .stats span { font-size: 13px; }
  .stats strong { font-size: 25px; }
  .tabs { gap: 20px; margin-top: 17px; }
  .tabs button { min-height: 42px; padding: 0 0 10px; font-size: 14px; }
  .workspace { grid-template-columns: 1fr; gap: 12px; }
  .workspace:not(.mobile-picker-open) > .categories { display: none; }
  .mobile-selection-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; margin-bottom: 12px; border: 1px solid #dce7f8; border-radius: 8px; background: #f0f6ff; }
  .mobile-selection-bar > div { min-width: 0; }
  .mobile-selection-bar small { display: block; color: #7b99c3; font-size: 13px; margin-bottom: 4px; }
  .mobile-selection-bar strong { display: block; color: #366cb6; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
  .mobile-selection-bar button { flex-shrink: 0; padding: 9px 10px; }
  #category-list { max-height: 55vh; }
  .site-children { display: block; }
  .site-parent { min-height: 46px; padding: 10px 14px; font-size: 15px; }
  .site-parent small { font-size: 13px; }
  .category { min-height: 44px; font-size: 14px; padding: 10px 12px 10px 22px; }
  .category small { font-size: 13px; }
  .category-call { min-height: 40px; min-width: 40px; padding: 8px; font-size: 13px; }
  .category-line { padding-right: 9px; }
  .category-search input { min-height: 43px; font-size: 16px; }
  .category-search input::placeholder { font-size: 14px; }
  .add-subcategory { min-height: 42px; }
  .card-head { padding: 14px; flex-wrap: wrap; }
  .card-head h3 { font-size: 16px; }
  .card-head small { font-size: 13px; }
  .listing-head { gap: 12px; }
  .row-actions { gap: 7px; }
  .row-actions button { padding: 8px 10px; }
  .post-row { flex-direction: column; align-items: stretch; padding: 15px; gap: 12px; }
  .post-title { font-size: 16px; line-height: 1.5; }
  .post-title small { font-size: 13px; }
  .post-meta { font-size: 13px; line-height: 1.8; }
  .post-actions { gap: 8px; }
  .post-actions button { flex: 1; }
  .form-grid { grid-template-columns: 1fr; gap: 15px; padding: 15px; }
  .wide { grid-column: 1 / -1; }
  label { font-size: 14px; gap: 8px; }
  input, select, textarea { padding: 10px; font-size: 16px; min-height: 43px; }
  input[type=checkbox] { min-height: 0; width: 18px; height: 18px; }
  input[type=color] { height: 43px; }
  input::placeholder, textarea::placeholder { font-size: 14px; }
  .code { font-size: 16px; }
  .hint, .rule-note { font-size: 13px; line-height: 1.8; }
  p { font-size: 14px; }
  .scope-summary { align-items: flex-start; flex-direction: column; font-size: 14px; gap: 12px; padding: 13px; }
  .scope-summary .check { font-size: 13px; }
  .form-actions { gap: 8px; }
  .form-actions button { font-size: 14px; padding: 10px 12px; }
  .post-choices { grid-template-columns: 1fr; }
  .choice { min-height: 50px; padding: 11px; font-size: 14px; gap: 9px; }
  .choice small { font-size: 13px; line-height: 1.5; }
  #preset-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .bulk-tools { flex-direction: column; align-items: flex-start; gap: 12px; font-size: 14px; }
  .bulk-tools .inline-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .bulk-tools input, .bulk-tools select { font-size: 16px; min-height: 43px; padding: 9px; }
  .bulk-tools .secondary { min-height: 42px; padding: 9px 11px; font-size: 14px; }
  #preset-group { width: 130px; }
  #preset-search { min-width: 105px; flex: 1; }
  .generation-note { font-size: 14px; }
  .generation-note p { font-size: 13px; }
  .text-button { font-size: 14px; min-height: 40px; }
  .tag { font-size: 13px; }
  .record-row { font-size: 14px; }
  .record-content { font-size: 17px; }
  .record-row small { font-size: 13px; }
  .record-row .tag { font-size: 13px; margin-top: 5px; }
  .record-row p { font-size: 13px; }
  .log-line { font-size: 14px; grid-template-columns: 1fr; }
  .log-line time, .log-line p { font-size: 13px; }
  #managed-sites { grid-template-columns: 1fr; }
  .managed-site { min-height: 75px; }
  .managed-site b { font-size: 15px; }
  .managed-site small, .managed-site em { font-size: 13px; }
  .source-list a { font-size: 14px; }
  .source-list small { font-size: 13px; }
  summary { font-size: 14px; min-height: 40px; line-height: 1.7; }
  .reference-row { font-size: 13px; }
  .reference-row small { font-size: 13px; }
  .empty { font-size: 13px; }
  .empty strong { font-size: 15px; }
  .workspace-tools { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; padding: 14px; }
  .workspace-tools button { font-size: 14px; min-height: 44px; padding: 9px 8px; }
  dialog, .dialog-wide, .dialog-design { width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100dvh - 20px); padding: 15px; border-radius: 10px; }
  .dialog-head { padding-bottom: 12px; gap: 8px; }
  .dialog-head .icon-button { flex-shrink: 0; }
  .dialog-head small { font-size: 13px; }
  dialog .form-grid { grid-template-columns: 1fr; padding: 16px 0; }
  .form-grid.compact { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .compact .wide { grid-column: 1 / -1; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .hint { width: 100%; }
  .preview-tools { gap: 7px; }
  .preview-tools .primary, .preview-tools .secondary, .design-preview .preview-tools button { font-size: 13px; min-height: 40px; padding: 9px 10px; }
  .preview-tools b { font-size: 14px; }
  .preview-stage { padding: 4px; }
  .design-layout { grid-template-columns: 1fr; gap: 8px; }
  .template-tabs { gap: 20px; }
  .template-tabs button { font-size: 14px; }
  .design-preview iframe { height: 440px; }
  .variable-row { grid-template-columns: 1fr; font-size: 14px; }
  .variable-row .tag { justify-self: start; }
  .variable-row p { font-size: 13px; }
  footer { font-size: 13px; line-height: 1.8; }
  #toast { font-size: 14px; }
}
@media (max-width:350px) {
  main { padding-left: 9px; padding-right: 9px; }
  .sidebar { padding: 6px; }
  .nav { font-size: 13px; }
  .topbar { font-size: 13px; }
  .mobile-selection-bar { padding: 10px; gap: 8px; }
  .mobile-selection-bar strong { font-size: 14px; }
  .mobile-selection-bar button { padding: 9px 8px; font-size: 13px; }
  .row-actions button { padding: 8px; font-size: 13px; }
  #preset-list { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; align-items: stretch; }
}

/* 模板工作台：编辑、预览、保存状态各自独立。 */
.template-dialog { background: #f8fafb; width: 1180px; padding-bottom: 0; }
.template-dialog > form { min-width: 0; }
.template-dialog .dialog-head { background: #f8fafb; padding-bottom: 15px; }
.template-scope { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0 17px; font-size: 13px; color: #6e8793; }
.template-scope > label { flex-direction: row; align-items: center; gap: 12px; font-size: 13px; }
.template-scope select { width: 160px; padding: 8px 10px; background: white; }
.save-state { font-size: 13px; color: #6085b9; background: #edf4ff; padding: 5px 9px; border-radius: 5px; line-height: 1.5; }
.save-state[data-state="dirty"] { background: #fff4d9; color: #9c7a30; }
.save-state[data-state="error"] { background: #fff0ed; color: #ad5b4d; }
.template-workspace .design-layout { grid-template-columns: minmax(0,.98fr) minmax(0,1.02fr); gap: 18px; align-items: start; }
.template-panel { padding: 16px; border: 1px solid #dfe8ed; border-radius: 9px; background: white; }
.template-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; margin-bottom: 13px; }
.template-panel-heading h3 { font-size: 14px; }
.template-panel-heading small { color: #9aabb3; font-size: 13px; }
.template-panel .template-tabs { margin: 9px 0 15px; gap: 22px; }
.template-panel .template-tabs button { padding-bottom: 11px; font-size: 13px; }
.template-panel .form-grid.compact { padding: 15px 0 18px; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.template-panel label { font-size: 13px; }
.template-panel input, .template-panel select { padding: 8px; }
.template-panel textarea { background: #fbfcfd; border-color: #dfe7ec; font-size: 13px; line-height: 1.85; padding: 12px; }
.layout-presets > span { font-size: 13px; color: #7d939d; display: block; margin-bottom: 8px; }
.layout-presets > div { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.layout-presets button { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #657f8a; background: #fafcfd; border: 1px solid #e0e8ed; border-radius: 6px; padding: 9px; font-size: 13px; min-width: 0; }
.layout-presets button:hover, .layout-presets button[aria-pressed="true"] { border-color: #8eb3ee; background: #f1f6ff; color: #346cc4; }
.layout-swatch { width: 54px; height: 32px; display: flex; flex-direction: column; border: 1px solid #bfcee5; border-radius: 2px; background: white; overflow: hidden; padding: 4px; gap: 3px; }
.layout-swatch i { display: block; width: 100%; height: 4px; background: #dbe7f8; border-radius: 1px; }
.layout-swatch.simple i:first-child { height: 7px; background: #9cbce9; }
.layout-swatch.stripe { padding: 0 4px 4px; }
.layout-swatch.stripe i:first-child { margin: 0 -4px; width: calc(100% + 8px); height: 9px; background: #477fd2; }
.layout-swatch.panel { border: 0; background: #edf2fa; padding: 3px; gap: 3px; }
.layout-swatch.panel i { background: white; flex: 1; border-left: 2px solid #7fa7df; }
.variable-hint { padding: 9px 11px; background: #f6f9fa; border-radius: 5px; font-size: 13px; }
.variable-hint code { color: #3c70ba; background: #eaf2ff; padding: 2px 4px; border-radius: 3px; }
.template-color-note { margin: -6px 0 14px; padding: 0; font-size: 13px; color: #9aa8af; }
.viewport-buttons { display: inline-flex; gap: 0; padding: 3px; background: #edf2f4; border-radius: 6px; flex-shrink: 0; }
.viewport-buttons .secondary { min-height: 29px; border: 0; border-radius: 4px; padding: 5px 10px; background: transparent; color: #8c9da5; font-size: 13px; }
.viewport-buttons .secondary[aria-pressed="true"] { color: #3b6db7; background: #fff; box-shadow: 0 1px 4px #17375b12; }
.preview-action-line { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 0 0 12px; }
.preview-action-line > span { color: #94a6ae; font-size: 13px; }
.preview-action-line .primary { min-height: 32px; padding: 7px 11px; font-size: 13px; }
.template-preview-stage { position: relative; min-height: 540px; background: repeating-linear-gradient(0deg,#f1f5f6,#f1f5f6 15px,#eef3f4 15px,#eef3f4 16px); padding: 12px !important; margin: 0 !important; border-radius: 7px; }
.template-preview-stage iframe { height: 540px; background: white; box-shadow: 0 1px 7px #284d6010; }
.preview-state { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 17px; padding: 28px; text-align: center; font-size: 13px; line-height: 1.9; color: #869ba7; background: #f7fafbed; overflow-wrap: anywhere; }
.preview-state::before { content: ''; display: block; width: 30px; height: 37px; border: 2px solid #c9d8df; border-radius: 4px; background: linear-gradient(#d8e3e8,#d8e3e8) center 9px / 17px 2px no-repeat,linear-gradient(#d8e3e8,#d8e3e8) center 16px / 17px 2px no-repeat; }
.preview-state[data-state="loading"] { color: #7394c2; background: #f5f9fff5; }
.preview-state[data-state="loading"]::before { width: 27px; height: 27px; border: 3px solid #dfeafa; border-top-color: #5087d7; border-radius: 50%; background: none; animation: template-loading 1s linear infinite; }
.preview-state[data-state="error"] { color: #a36155; background: #fff8f6f5; }
.preview-state[data-state="error"]::before { content: '!'; display: grid; place-items: center; width: 32px; height: 32px; border-color: #d7a99f; border-radius: 50%; background: none; font-size: 20px; font-weight: 700; }
.preview-status-line { min-height: 20px; margin: 10px 0 0; font-size: 13px; }
.template-savebar { position: sticky; bottom: 0; z-index: 3; background: #f8fafb; margin-top: 17px; padding: 15px 0; border-top: 1px solid #dfe7eb; }
.template-savebar .hint { font-size: 13px; }
.template-pane-tabs { display: none; }
@keyframes template-loading { to { transform: rotate(360deg); } }
@media (max-width:900px) and (min-width:701px) {
  .template-workspace .design-layout { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
  .template-panel { padding: 12px; }
  .template-panel .form-grid.compact { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .template-panel-heading small { display: none; }
  .preview-action-line > span { font-size: 13px; }
}
@media (max-width:700px) {
  .template-dialog { padding: 14px 14px 0; }
  .template-dialog .dialog-head { padding-bottom: 10px; }
  .template-scope { gap: 8px; padding: 10px 0 13px; flex-wrap: wrap; font-size: 13px; }
  .template-scope > label { width: 100%; font-size: 14px; justify-content: space-between; }
  .template-scope select { font-size: 16px; width: min(200px,65%); }
  .save-state { font-size: 13px; padding: 5px 8px; }
  .template-pane-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; background: #eaf0f3; border-radius: 7px; margin-bottom: 12px; }
  .template-pane-tabs button { min-height: 42px; border: 0; background: transparent; border-radius: 5px; color: #8c9fa9; font-size: 15px; }
  .template-pane-tabs button[aria-selected="true"] { color: #28765a; background: white; box-shadow: 0 1px 5px #183c4010; font-weight: 700; }
  .template-workspace .design-layout { display: block; }
  .template-workspace[data-active-pane="edit"] .design-preview { display: none; }
  .template-workspace[data-active-pane="preview"] .design-editor { display: none; }
  .template-panel { padding: 13px; border-radius: 7px; }
  .template-panel-heading { min-height: 37px; gap: 8px; margin-bottom: 12px; }
  .template-panel-heading h3 { font-size: 15px; }
  .template-panel-heading small { font-size: 13px; }
  .template-panel .template-tabs { gap: 21px; margin: 6px 0 14px; }
  .template-panel .template-tabs button { font-size: 14px; }
  .layout-presets > span { font-size: 13px; }
  .layout-presets > div { gap: 6px; }
  .layout-presets button { font-size: 13px; padding: 8px 4px; min-height: 72px; }
  .layout-swatch { width: 47px; height: 30px; }
  .template-panel .form-grid.compact { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding-top: 16px; }
  .template-panel label { font-size: 14px; }
  .template-panel input, .template-panel select, .template-panel textarea { font-size: 16px; padding: 9px; }
  .template-panel .variable-hint { font-size: 13px; padding: 9px; }
  .template-panel .template-color-note { font-size: 13px; }
  .viewport-buttons { padding: 3px; }
  .viewport-buttons .secondary { min-height: 38px; min-width: 49px; font-size: 13px; padding: 7px; }
  .preview-action-line { align-items: flex-start; padding-bottom: 12px; }
  .preview-action-line > span { font-size: 13px; line-height: 1.7; max-width: 45%; }
  .preview-action-line .primary { min-height: 42px; padding: 9px 11px; font-size: 14px; }
  .template-preview-stage { padding: 4px !important; min-height: 430px; }
  .template-preview-stage iframe { height: 430px; }
  .preview-state { font-size: 14px; padding: 20px; }
  .preview-status-line { font-size: 13px; }
  .template-savebar { margin-top: 12px; padding: 12px 0; gap: 8px; }
  .template-savebar .hint { width: 100%; font-size: 13px; }
  .template-savebar button { flex: 1; min-height: 44px; padding-left: 8px; padding-right: 8px; font-size: 14px; }
}
@media (max-width:350px) {
  .template-dialog { padding-left: 11px; padding-right: 11px; }
  .template-panel { padding: 10px; }
  .template-panel-heading small { display: none; }
  .layout-presets button { font-size: 13px; }
  .template-savebar button { font-size: 13px; }
}
@media (prefers-reduced-motion:reduce) { .preview-state[data-state="loading"]::before { animation: none; } }

.site-editor-tabs { margin-bottom: 12px !important; }
.brand { height: 72px; padding: 9px 0; }
.brand img { display:block; width:180px; height:auto; max-width:100%; }
.load-status { margin-bottom:12px; border:1px solid #d3e4dd; border-radius:6px; padding:11px 14px; background:#f2faf6; color:#376451; font-size:14px; }
.advance-plan { padding:15px; border:1px solid #d8e8df; border-radius:7px; background:#f7fbf8; }
.advance-plan > p { font-size:13px; line-height:1.7; margin:6px 0 12px; }
.advance-warning { margin:8px 0; padding:9px 11px; border:1px solid #eddbad; border-radius:5px; background:#fffbef; color:#8b642e; font-size:13px; line-height:1.7; overflow-wrap:anywhere; }
.advance-change { padding:10px 0; border-top:1px solid #dfebe4; }
.advance-change > b { font-size:13px; color:#759486; }
.advance-change > div { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:12px; align-items:center; margin-top:5px; }
.advance-change span { min-width:0; overflow-wrap:anywhere; font-size:14px; font-weight:600; }
.advance-change small { display:block; margin-top:4px; color:#7c95b8; font-size:13px; font-weight:500; }
.advance-change em { font-style:normal; color:#709e88; }
.advance-savebar { position:sticky; bottom:-22px; z-index:1; border-top:1px solid #e5ece8; background:#fffffff5; padding:14px 0; }
.advance-savebar .hint { flex:1; min-width:0; }
.list-filter { padding:12px 16px; border-bottom:1px solid #edf1f3; }
.list-filter input { max-width:360px; }
.list-pager { padding:12px 16px; display:flex; align-items:center; justify-content:space-between; gap:12px; border-top:1px solid #edf1f3; color:#72858e; font-size:13px; }
.list-pager > div { display:flex; gap:7px; }
.list-pager button { min-height:34px; padding:6px 10px; }
.task-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 0; border-top:1px solid #e7eef0; }
.task-row > div:first-child { min-width:0; }
.task-row p { margin:7px 0; font-size:13px; line-height:1.6; color:#526a75; overflow-wrap:anywhere; }
.task-row small { font-size:13px; color:#79919c; }
.task-row .task-reason { color:#a3543e; background:#fff8f3; border-radius:4px; padding:7px 9px; }
#control-tasks .inline-actions { flex-wrap:wrap; }
#publish-task-filter { width:auto; min-width:100px; }
[aria-busy="true"] { opacity:.65; }
@media(max-width:700px) {
  .sidebar .brand { display:block; height:44px; padding:3px 13px; margin:0; background:#183d34; }
  .sidebar .brand img { width:148px; height:38px; }
  .list-filter { padding:10px 12px; }
  .list-filter input { max-width:100%; }
  .list-pager { padding:12px 0; font-size:13px; flex-wrap:wrap; }
  .list-pager button { min-height:40px; padding:8px 12px; }
  .task-row { flex-direction:column; align-items:stretch; gap:10px; padding:14px 0; }
  .task-row p { font-size:14px; }
  .task-row small { font-size:13px; }
  .task-row .post-actions { justify-content:flex-end; }
  .advance-plan { padding:11px; }
  .advance-plan > p,.advance-warning { font-size:14px; }
  .advance-change > div { gap:7px; }
  .advance-savebar { bottom:-15px; flex-wrap:wrap; }
  .advance-savebar .hint { flex-basis:100%; }
  .advance-savebar button { width:100%; white-space:normal; }
  #control-tasks .card-head { flex-wrap:wrap; }
  #control-tasks .inline-actions { width:100%; }
  #publish-task-filter { flex:1; }
}
.analytics-enable { margin: 0 0 17px; font-size: 13px; }
.analytics-status { margin: 13px 0; padding: 12px; border: 1px solid #dce6eb; border-radius: 7px; background: #f5f8fa; color: #607d8a; }
.analytics-status > div { display: grid; gap: 7px; min-width: 0; }
.analytics-status strong { font-size: 13px; color: #426372; }
.analytics-status span, .analytics-status p { font-size: 13px; line-height: 1.7; }
.analytics-status p { margin: 8px 0 0; }
.analytics-status code { font-family: Consolas, monospace; overflow-wrap: anywhere; }
.analytics-status[data-state="ready"] { background: #f2f7ff; border-color: #d7e5fa; }
.analytics-status[data-state="ready"] strong { color: #3a70bd; }
.analytics-status[data-state="error"] { background: #fff7f5; border-color: #eed5ce; }
.analytics-status[data-state="error"] strong { color: #a94c3f; }
.site-modules-description { font-size: 13px; color: #78939e; line-height: 1.8; margin: 0 0 15px; }
.site-modules-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 13px; color: #486c7b; }
.site-modules-toolbar button { min-height: 33px; padding: 7px 10px; font-size: 13px; }
#site-page-modules { display: grid; gap: 9px; max-height: 480px; overflow-y: auto; }
.page-module-row { border: 1px solid #dfe8ed; border-radius: 7px; background: #fbfdfd; padding: 12px; }
.page-module-row.disabled { background: #f5f7f8; }
.page-module-row .module-info { display: flex; justify-content: space-between; align-items: center; gap: 9px; flex-wrap: wrap; }
.page-module-row .module-info b, .page-module-row .module-name { font-size: 13px; color: #426372; font-weight: 700; overflow-wrap: anywhere; }
.page-module-row small { color: #9baeb7; font-size: 13px; }
.page-module-row .module-position { font-size: 13px; color: #6e9586; background: #edf5f1; border-radius: 4px; padding: 3px 6px; }
.page-module-row .module-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding-top: 10px; }
.page-module-row .module-actions button { min-height: 30px; padding: 5px 8px; font-size: 13px; }
.page-module-row .module-actions .check { font-size: 13px; margin-right: auto; }
.module-content-marker { margin: 14px 0 10px; padding: 13px; border: 1px dashed #bbd2c7; border-radius: 6px; background: #f4faf7; color: #6a9881; text-align: center; }
.module-content-marker span { display: block; font-size: 13px; font-weight: 600; }
.module-content-marker small { display: block; font-size: 13px; margin-top: 5px; color: #9bb1a5; }
.module-preview-box { border: 1px solid #e1eaee; background: #f3f7f9; border-radius: 7px; padding: 12px; }
.module-preview-box p { margin-top: 0; }
.module-preview-box iframe { height: 260px; }
.module-savebar { position: sticky; bottom: -22px; background: #fffffff5; padding: 13px 0; margin-top: 0; border-top: 1px solid #e5ecef; }
@media (max-width:700px) {
  .site-editor-tabs { gap: 15px; }
  .site-editor-tabs button { font-size: 14px; }
  .analytics-enable { font-size: 14px; min-height: 40px; }
  .analytics-status strong { font-size: 15px; }
  .analytics-status span, .analytics-status p { font-size: 14px; }
  .site-modules-description { font-size: 14px; }
  .site-modules-toolbar { font-size: 14px; }
  .site-modules-toolbar button { min-height: 42px; padding: 9px 10px; font-size: 13px; }
  #site-page-modules { max-height: none; }
  .page-module-row { padding: 12px; }
  .page-module-row .module-info b, .page-module-row .module-name { font-size: 15px; }
  .page-module-row small { font-size: 13px; }
  .page-module-row .module-position { font-size: 13px; }
  .page-module-row .module-actions { gap: 7px; padding-top: 12px; }
  .page-module-row .module-actions button { min-height: 40px; padding: 8px; font-size: 13px; }
  .page-module-row .module-actions .check { font-size: 13px; }
  .module-content-marker span { font-size: 14px; }
  .module-content-marker small { font-size: 13px; }
  .module-preview-box { padding: 7px; }
  .module-savebar { bottom: -15px; }
  .module-savebar button { flex: 1; }
}

/* 绮小诺：蓝白工作台与登录，全部保持在本后台作用域。 */
:root { --accent:#3978ed; --border:#e1e8f2; --muted:#788ba5; background:#f4f7fc; color:#293e5b; }
.sidebar { background:#fff; border-right:1px solid #e1e9f5; color:#405d87; }
.brand { height:auto; display:flex; align-items:center; padding:0; gap:10px; margin:0 4px 28px; }
.brand .brand-mascot { width:42px; height:42px; object-fit:contain; flex-shrink:0; border-radius:12px; background:#f0f6ff; }
.brand > div { min-width:0; }
.brand strong { color:#25539a; font-size:21px; letter-spacing:1px; white-space:nowrap; }
.brand small { color:#7796c0; font-size:13px; letter-spacing:1px; margin-top:3px; }
.nav { color:#607c9d; border-radius:8px; }
.nav.active { color:#2865d5; background:#eaf2ff; }
.nav:hover { color:#2865d5; background:#f1f6ff; }
.nav-icon { color:#82a4d9; }
.sidebar-note { color:#728caa; }
.sidebar-note i { background:#6b9bee; }
.sidebar-note small { color:#9aaec4; }
.primary:hover { background:#2767de; border-color:#2767de; }
.secondary { color:#4b6b95; border-color:#d9e3f1; }
.secondary:hover { background:#f4f8ff; border-color:#abc4eb; }
button:focus-visible,a:focus-visible,summary:focus-visible { outline-color:#9abdf9; }
input:focus,select:focus,textarea:focus { border-color:#7fa8ee; box-shadow:0 0 0 3px #edf3ff; }
.card { border-radius:10px; box-shadow:0 2px 8px #36517b03; }
.card-head { border-bottom-color:#edf2f9; }
.stats strong { color:#316bd0; }
.tag:not(.muted):not(.status):not(.history) { color:#4477bb; background:#edf4ff; }
.site-parent.chosen { background:#eef4ff; color:#3268bc; }
.category-line.selected,.all-category.selected { background:#f0f6ff; }
.category-line.selected .category { color:#316bc4; }
.category-call { color:#4278c5; border-color:#d7e4f7; }
.category-call:hover { border-color:#8bb3f0; background:#f2f7ff; }
.scope-summary { color:#406fae; background:#f0f5ff; }
.choice:has(input:checked) { background:#f0f6ff; border-color:#8ab0ef; color:#326cc5; }
.managed-site > span { background:#edf4ff; color:#4a80cd; }
.managed-site > div { min-width:0; flex:1; }
.managed-site b,.managed-site small { overflow-wrap:anywhere; }
.managed-site em { color:#7399c9; flex-shrink:0; }
.source-list a { color:#477ec7; }
.preview-banner,.load-status { background:#f0f6ff; color:#5b7eaf; border-color:#dbe7f8; }
.template-pane-tabs button[aria-selected="true"] { color:#326ac5; }
.advance-plan { background:#f8fbff; border-color:#dbe6f7; }
.advance-change { border-color:#e2eaf7; }
.advance-change > b,.advance-change em { color:#7294c3; }
.module-content-marker { color:#6386b5; background:#f3f7fe; border-color:#c5d7f0; }
.module-content-marker small { color:#8ca6c7; }
.page-module-row .module-position { color:#6388bd; background:#edf4ff; }
.topbar { gap:14px; }
.topbar-tools { display:flex; align-items:center; gap:9px; min-width:0; }
.topbar-time { white-space:nowrap; }
.account-chip { border-left:1px solid #dbe5f2; padding-left:13px; display:flex; align-items:center; gap:7px; min-width:0; }
.account-chip b { font-size:13px; color:#3e6192; max-width:130px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-chip small { font-size:13px; color:#7194c5; white-space:nowrap; background:#eaf2ff; border-radius:4px; padding:3px 5px; }
#logout { padding:8px 3px; white-space:nowrap; }
.readonly-note { padding:10px 13px; margin-top:14px; color:#5779aa; background:#edf4ff; border:1px solid #d7e5fb; border-radius:7px; font-size:13px; line-height:1.7; }
.user-row { display:flex; align-items:center; gap:12px; padding:16px 18px; border-top:1px solid #ecf1f8; }
.user-avatar { width:37px; height:37px; display:grid; place-items:center; flex-shrink:0; color:#6291d3; background:#eff5ff; border-radius:11px; font-size:16px; }
.user-info { flex:1; min-width:0; }
.user-info b { font-size:14px; color:#385a87; overflow-wrap:anywhere; }
.user-info p { margin:4px 0; font-size:13px; color:#8097b4; overflow-wrap:anywhere; }
.user-info small { color:#8aa0ba; font-size:13px; }
.user-actions { display:flex; gap:7px; flex-shrink:0; }
#users-status { margin:12px 18px; }
.auth-pending > .sidebar,.auth-pending > main,.auth-locked > .sidebar,.auth-locked > main { display:none !important; }
#login-screen { min-height:100vh; min-height:100dvh; display:grid; place-items:center; padding:28px 18px; background:linear-gradient(155deg,#f0f6ff,#fff 58%,#f4f8ff); }
.login-card { width:100%; max-width:390px; padding:29px; border:1px solid #e2eaf7; border-radius:16px; background:#fff; box-shadow:0 12px 40px #4776b70c; }
.login-brand { display:flex; align-items:center; gap:12px; margin-bottom:28px; }
.login-brand img { width:48px; height:48px; object-fit:contain; border-radius:13px; background:#f1f6ff; }
.login-brand strong { color:#2e60a9; font-size:23px; letter-spacing:1px; }
.login-brand span { display:block; color:#90a6c5; font-size:13px; margin-top:4px; }
.login-card h1 { font-size:24px; color:#284d7d; letter-spacing:0; }
.login-intro { color:#8b9fb9; font-size:13px; margin:7px 0 24px; }
#login-form { display:grid; gap:18px; }
#login-form label { color:#5c789d; font-size:13px; }
#login-form input { height:45px; font-size:16px; border-radius:7px; }
#login-submit { width:100%; min-height:45px; font-size:15px; border-radius:7px; }
.login-status { min-height:19px; color:#839abc; font-size:13px; line-height:1.6; margin:-4px 0 -7px; overflow-wrap:anywhere; }
.error-text { color:#b85345 !important; }
.role-viewer #new-post,.role-viewer #bulk-posts,.role-viewer #new-site,.role-viewer #control-add-site,.role-viewer #new-category,.role-viewer #category-generate,.role-viewer #category-advance,.role-viewer #authors-open,.role-viewer #ai-words-open,.role-viewer #edit-sources,.role-viewer #draw-form,.role-viewer [data-edit],.role-viewer [data-task-cancel],.role-viewer [data-task-reschedule],.role-viewer [data-fill-reference],.role-viewer #design-reset,.role-viewer #site-design-reset,.role-viewer .layout-presets,.role-viewer #site-module-add,.role-viewer [data-module-edit],.role-viewer [data-module-remove],.role-viewer [data-module-move],.role-viewer #design-form button[type="submit"],.role-viewer #site-design-form button[type="submit"],.role-viewer #site-module-form button[type="submit"],.role-viewer .generation-form button[type="submit"] { display:none !important; }
.role-viewer .template-panel input:disabled,.role-viewer .template-panel textarea:disabled,.role-viewer .template-panel select:disabled { color:#657f9c; opacity:1; background:#f8faff; }
@media(max-width:700px) {
  .sidebar { padding:6px 10px 8px; border-right:0; border-bottom:1px solid #e3ebf6; }
  .sidebar .brand { display:flex; height:43px; padding:1px 3px; gap:8px; background:none; margin:0 0 5px; }
  .sidebar .brand > div { display:block; }
  .sidebar .brand .brand-mascot { width:35px; height:35px; border-radius:9px; }
  .brand strong { font-size:18px; }
  .brand small { font-size:13px; margin-top:1px; }
  .nav { min-height:42px; font-size:14px; }
  .topbar { height:auto; min-height:53px; padding:9px 0; flex-wrap:wrap; gap:5px 10px; }
  .topbar-tools { gap:7px; flex-wrap:wrap; }
  .topbar-time { font-size:13px; }
  .account-chip { padding-left:8px; gap:5px; }
  .account-chip b { max-width:86px; font-size:13px; }
  .account-chip small { font-size:13px; }
  #logout { min-height:40px; padding:8px 3px; font-size:13px; }
  .heading { padding-top:18px; }
  .row-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; gap:7px; }
  .row-actions button { width:100%; min-height:41px; font-size:13px; padding:8px 6px; }
  .dialog-head { align-items:flex-start; }
  .dialog-head .close { flex-shrink:0; }
  .dialog-actions { flex-wrap:wrap; }
  .user-row { padding:14px 12px; gap:9px; flex-wrap:wrap; }
  .user-info b { font-size:15px; }
  .user-info p,.user-info small { font-size:13px; }
  .user-actions { margin-left:auto; }
  #control-users .card-head { flex-wrap:wrap; }
  #control-users .inline-actions { width:100%; justify-content:flex-end; }
  .readonly-note { font-size:13px; }
  .login-card { max-width:390px; padding:25px 22px; border-radius:13px; }
}
@media(max-width:380px) {
  main { padding-right:10px; padding-left:10px; }
  .stats > div { flex-direction:column; align-items:flex-start; padding:12px; gap:5px; }
  .stats strong { font-size:24px; }
  .stats span { font-size:13px; }
  .topbar-tools { width:100%; justify-content:flex-end; }
  .topbar-time { margin-right:auto; }
  .account-chip { border-left:0; padding-left:0; }
  .managed-site { padding:12px 10px; gap:8px; }
  .managed-site > span { width:30px; height:33px; }
  .login-card { padding:23px 18px; }
  #login-screen { padding:16px 12px; }
}

/* 主题只作用于工作台；资料在独立 iframe 内保持自身配色。 */
.theme-toggle { width:42px; height:42px; padding:0; border:1px solid #e1ebfa; border-radius:12px; background:#f1f6ff; display:grid; place-items:center; flex-shrink:0; overflow:hidden; cursor:pointer; }
.theme-toggle:hover { border-color:#a4c2f1; }
.theme-toggle:focus-visible { outline:3px solid #9abdf9; outline-offset:3px; }
.theme-toggle:disabled { cursor:wait; opacity:1; }
.theme-toggle img { display:block; object-fit:contain; border-radius:inherit; }
.login-brand .theme-toggle { width:48px; height:48px; border-radius:13px; }
.brand .theme-toggle .brand-mascot,.login-brand .theme-toggle img { width:100%; height:100%; background:none; }
iframe { color-scheme:light; }
html[data-theme="dark"] { color-scheme:dark; --accent:#8ab6ff; --border:#293e5d; --muted:#9db0cd; color:#d1dff3; background:#0d192b; scrollbar-color:#385579 #15243b; }
html[data-theme="dark"] body { background:#0d192b; color:#d1dff3; }
html[data-theme="dark"] [data-theme-avatar] { content:url('/mascot-dark.png'); }
html[data-theme-transition] [data-theme-avatar] { content:normal !important; }
html[data-theme-transition] body,
html[data-theme-transition] :is(.sidebar,.topbar,.card,.stats > div,.nav,.brand strong,.brand small,.theme-toggle,.login-card,.login-brand strong,.login-brand span,.login-intro,.login-status,.account-chip,.account-chip small,.post-row,.record-row,.site-parent,.category-line,.category-call,.mobile-selection-bar,.template-panel,.template-savebar,.module-savebar,.advance-savebar,.preview-stage,.template-preview-stage,.tabs button,.secondary,.primary,dialog,input,select,textarea,label,h1,h2,h3,p),
html[data-theme-transition] #login-screen {
  transition:background-color 250ms ease,border-color 250ms ease,color 250ms ease,box-shadow 250ms ease;
}
@media(prefers-reduced-motion:reduce) {
  html[data-theme-transition] body,html[data-theme-transition] body * { transition:none !important; }
}
html[data-theme="dark"] .sidebar { background:#12213a; border-color:#283c5a; color:#c5d8f4; }
html[data-theme="dark"] .brand strong,html[data-theme="dark"] .login-brand strong { color:#c4dbff; }
html[data-theme="dark"] .brand small,html[data-theme="dark"] .login-brand span { color:#8eafd9; }
html[data-theme="dark"] .theme-toggle { background:#1c2e4b; border-color:#354d71; }
html[data-theme="dark"] .theme-toggle:hover { border-color:#759fd6; }
html[data-theme="dark"] .nav { color:#a8bddb; }
html[data-theme="dark"] .nav.active { color:#d3e5ff; background:#24436e; }
html[data-theme="dark"] .nav:hover { color:#d3e5ff; background:#1b3458; }
html[data-theme="dark"] .nav-icon { color:#9cbff2; }
html[data-theme="dark"] .sidebar-note,html[data-theme="dark"] .sidebar-note small { color:#8fa8c8; }
html[data-theme="dark"] .topbar { border-color:#293d5a; color:#9eb3d0; }
html[data-theme="dark"] .topbar b,html[data-theme="dark"] .account-chip b { color:#cfdef5; }
html[data-theme="dark"] .account-chip { border-color:#354966; }
html[data-theme="dark"] .account-chip small { color:#b8d6ff; background:#203c60; }
html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3 { color:#e0ebfc; }
html[data-theme="dark"] p,html[data-theme="dark"] label,html[data-theme="dark"] summary { color:#adbfda; }
html[data-theme="dark"] .card,html[data-theme="dark"] .stats > div { background:#16263f; border-color:#2a3e5b; box-shadow:0 2px 9px #07122418; }
html[data-theme="dark"] .card-head,html[data-theme="dark"] .dialog-head { border-color:#2a3d59; }
html[data-theme="dark"] .card-head small,html[data-theme="dark"] .dialog-head small,html[data-theme="dark"] .hint { color:#a2b6d1; }
html[data-theme="dark"] .primary { color:#fff; background:#356ed0; border-color:#457fdc; }
html[data-theme="dark"] .primary:hover { background:#3975da; border-color:#6b9cf0; }
html[data-theme="dark"] .secondary { color:#bfd6f6; background:#1b3050; border-color:#385170; }
html[data-theme="dark"] .secondary:hover { color:#d5e6ff; background:#25416a; border-color:#6285b8; }
html[data-theme="dark"] .icon-button { color:#aac3e4; }
html[data-theme="dark"] .stats span { color:#a3bad6; }
html[data-theme="dark"] .stats strong { color:#a9ccff; }
html[data-theme="dark"] .tabs { border-color:#304560; }
html[data-theme="dark"] .tabs button { color:#9fb6d4; }
html[data-theme="dark"] .tabs .selected { color:#b1d2ff; border-bottom-color:#84b3ff; }
html[data-theme="dark"] .tag:not(.muted):not(.status):not(.history) { color:#b5d3ff; background:#234163; }
html[data-theme="dark"] .tag.muted { color:#a6b8d0; background:#263951; }
html[data-theme="dark"] .tag.status { color:#f1d298; background:#403727; }
html[data-theme="dark"] .tag.history { color:#e5c59e; background:#3b332b; }
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea { color:#d8e5f7; background:#11213a; border-color:#3b506e; }
html[data-theme="dark"] input:focus,html[data-theme="dark"] select:focus,html[data-theme="dark"] textarea:focus { border-color:#7ba8ed; box-shadow:0 0 0 3px #2c4b743d; }
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder { color:#8b9fbb; }
html[data-theme="dark"] .category-search input { background:#11213a; }
html[data-theme="dark"] .site-parent { color:#b3c9e5; background:#192d48; border-color:#2b3e58; }
html[data-theme="dark"] .site-parent.chosen { color:#c4ddff; background:#23416b; }
html[data-theme="dark"] .site-parent small,html[data-theme="dark"] .category small { color:#9ab2d2; }
html[data-theme="dark"] .category-line { background:#16263f; }
html[data-theme="dark"] .category-line.selected,html[data-theme="dark"] .all-category.selected { background:#203c61; }
html[data-theme="dark"] .category { color:#b0c6e2; }
html[data-theme="dark"] .category-line.selected .category { color:#c2ddff; }
html[data-theme="dark"] .category-call { color:#afceff; background:#1e3555; border-color:#3b587c; }
html[data-theme="dark"] .category-call:hover { background:#28466e; border-color:#6b93c4; }
html[data-theme="dark"] .mobile-selection-bar { color:#c2d7f5; background:#193254; border-color:#35557d; }
html[data-theme="dark"] .mobile-selection-bar small { color:#9bb8df; }
html[data-theme="dark"] .mobile-selection-bar strong { color:#c7dfff; }
html[data-theme="dark"] .post-row,html[data-theme="dark"] .record-row,html[data-theme="dark"] .log-line,html[data-theme="dark"] .list-filter,html[data-theme="dark"] .list-pager,html[data-theme="dark"] .task-row,html[data-theme="dark"] .user-row { border-color:#2b3e58; }
html[data-theme="dark"] .post-row:hover { background:#1b2f4a; }
html[data-theme="dark"] .post-title,html[data-theme="dark"] .record-row b,html[data-theme="dark"] .record-content,html[data-theme="dark"] .user-info b { color:#d0e1f9; }
html[data-theme="dark"] .post-title small,html[data-theme="dark"] .post-meta,html[data-theme="dark"] .record-row small,html[data-theme="dark"] .log-line time,html[data-theme="dark"] .log-line p,html[data-theme="dark"] .list-pager,html[data-theme="dark"] .task-row p,html[data-theme="dark"] .task-row small,html[data-theme="dark"] .user-info p,html[data-theme="dark"] .user-info small { color:#9eb5d1; }
html[data-theme="dark"] .empty,html[data-theme="dark"] .empty strong,html[data-theme="dark"] footer { color:#96acc9; }
html[data-theme="dark"] .scope-summary,html[data-theme="dark"] .readonly-note,html[data-theme="dark"] .load-status { color:#b6d2f7; background:#1e3758; border-color:#365477; }
html[data-theme="dark"] .choice { color:#c3d4ec; background:#182d48; border-color:#344b69; }
html[data-theme="dark"] .choice small { color:#a0b5d1; }
html[data-theme="dark"] .choice:has(input:checked) { color:#d4e6ff; background:#24466f; border-color:#709bda; }
html[data-theme="dark"] .divider { background:#30445f; }
html[data-theme="dark"] .rule-note { color:#b0c9e9; background:#1c324f; }
html[data-theme="dark"] .generation-note { background:#39342e; color:#e8cd9e; }
html[data-theme="dark"] .generation-note p { color:#cdb897; }
html[data-theme="dark"] .managed-site { color:#bed4f3; background:#192d48; border-color:#344b68; }
html[data-theme="dark"] .managed-site > span,html[data-theme="dark"] .user-avatar { color:#bedaff; background:#264367; }
html[data-theme="dark"] .managed-site small,html[data-theme="dark"] .managed-site em { color:#99b6d9; }
html[data-theme="dark"] .source-list a,html[data-theme="dark"] .variable-row code { color:#a7ccff; }
html[data-theme="dark"] .source-list small,html[data-theme="dark"] .reference-row small,html[data-theme="dark"] .reference-row p { color:#9fb6d2; }
html[data-theme="dark"] .reference-row,html[data-theme="dark"] .variable-row { border-color:#2d415d; }
html[data-theme="dark"] dialog { color:#ccdcf2; background:#15253d; border-color:#39516f; box-shadow:0 20px 70px #0711227a; }
html[data-theme="dark"] dialog::backdrop { background:#06101dc2; }
html[data-theme="dark"] .template-dialog,html[data-theme="dark"] .template-dialog .dialog-head,html[data-theme="dark"] .template-savebar,html[data-theme="dark"] .module-savebar,html[data-theme="dark"] .advance-savebar { background:#14233a; border-color:#2e4260; }
html[data-theme="dark"] .template-panel { color:#c5d7f0; background:#192a44; border-color:#354b69; }
html[data-theme="dark"] .template-panel textarea { color:#d8e5f7; background:#102039; border-color:#3d5576; }
html[data-theme="dark"] .template-scope,html[data-theme="dark"] .template-panel-heading small,html[data-theme="dark"] .template-color-note { color:#a3b7d2; }
html[data-theme="dark"] .save-state { color:#bad6fa; background:#244363; }
html[data-theme="dark"] .save-state[data-state="dirty"] { color:#efd398; background:#44392a; }
html[data-theme="dark"] .save-state[data-state="error"] { color:#f3b5ad; background:#472f31; }
html[data-theme="dark"] .layout-presets > span { color:#a4bad7; }
html[data-theme="dark"] .layout-presets button { color:#b9d1f1; background:#1c304b; border-color:#3d5675; }
html[data-theme="dark"] .layout-presets button:hover,html[data-theme="dark"] .layout-presets button[aria-pressed="true"] { color:#d0e3ff; background:#294970; border-color:#6d97cb; }
html[data-theme="dark"] .layout-swatch { background:#1b304f; border-color:#6381a9; }
html[data-theme="dark"] .layout-swatch i { background:#50749f; }
html[data-theme="dark"] .layout-swatch.simple i:first-child,html[data-theme="dark"] .layout-swatch.stripe i:first-child { background:#86aee8; }
html[data-theme="dark"] .layout-swatch.panel { background:#213a5a; }
html[data-theme="dark"] .layout-swatch.panel i { background:#3f5e86; border-color:#90b7ed; }
html[data-theme="dark"] .variable-hint { color:#afc7e5; background:#1e3451; }
html[data-theme="dark"] .variable-hint code { color:#bfd9ff; background:#2a476c; }
html[data-theme="dark"] .viewport-buttons,html[data-theme="dark"] .template-pane-tabs { background:#102039; }
html[data-theme="dark"] .viewport-buttons .secondary,html[data-theme="dark"] .template-pane-tabs button { color:#9fb8d9; background:transparent; }
html[data-theme="dark"] .viewport-buttons .secondary[aria-pressed="true"],html[data-theme="dark"] .template-pane-tabs button[aria-selected="true"] { color:#d4e6ff; background:#2c4b72; }
html[data-theme="dark"] .preview-stage,html[data-theme="dark"] .template-preview-stage { background:#102039; border-color:#314967; }
html[data-theme="dark"] .preview-action-line > span { color:#9eb5d2; }
html[data-theme="dark"] .preview-state { color:#afc5e2; background:#16283ff5; }
html[data-theme="dark"] .preview-state::before { border-color:#6a89b1; background:none; }
html[data-theme="dark"] .preview-state[data-state="loading"] { color:#bad3f4; background:#172b46f5; }
html[data-theme="dark"] .preview-state[data-state="loading"]::before { border-color:#385779; border-top-color:#9cc4ff; }
html[data-theme="dark"] .preview-state[data-state="error"] { color:#f2b5ad; background:#342732f5; }
html[data-theme="dark"] .generated-preview { border-color:#36506e; }
html[data-theme="dark"] .preview-banner { color:#b1cbed; background:#203b5c; }
html[data-theme="dark"] .site-modules-description,html[data-theme="dark"] .site-modules-toolbar { color:#afc4e2; }
html[data-theme="dark"] .page-module-row { background:#1a2e49; border-color:#354c6c; }
html[data-theme="dark"] .page-module-row.disabled { background:#1b293e; }
html[data-theme="dark"] .page-module-row .module-info b,html[data-theme="dark"] .page-module-row .module-name { color:#c9dcf6; }
html[data-theme="dark"] .page-module-row small { color:#9bb3d0; }
html[data-theme="dark"] .page-module-row .module-position { color:#b6d3fa; background:#264465; }
html[data-theme="dark"] .module-content-marker { color:#b7d3f4; background:#203954; border-color:#557397; }
html[data-theme="dark"] .module-content-marker small { color:#9eb8d6; }
html[data-theme="dark"] .module-preview-box { background:#172a43; border-color:#38506e; }
html[data-theme="dark"] .analytics-status { color:#abc1df; background:#1b304b; border-color:#354e6e; }
html[data-theme="dark"] .analytics-status strong { color:#c5daf5; }
html[data-theme="dark"] .analytics-status[data-state="ready"] { background:#1f3c5b; border-color:#426589; }
html[data-theme="dark"] .analytics-status[data-state="ready"] strong { color:#c4ddff; }
html[data-theme="dark"] .analytics-status[data-state="error"],html[data-theme="dark"] .task-row .task-reason { background:#3c2c34; border-color:#63434a; color:#efb8ac; }
html[data-theme="dark"] .analytics-status[data-state="error"] strong { color:#f3c0b5; }
html[data-theme="dark"] .advance-plan { color:#c5d8f1; background:#1b304c; border-color:#3a5475; }
html[data-theme="dark"] .advance-warning { color:#ecd19e; background:#3e352b; border-color:#655439; }
html[data-theme="dark"] .advance-change { border-color:#3a4f6b; }
html[data-theme="dark"] .advance-change > b,html[data-theme="dark"] .advance-change em,html[data-theme="dark"] .advance-change small { color:#a5bfdf; }
html[data-theme="dark"] .role-viewer .template-panel input:disabled,html[data-theme="dark"] .role-viewer .template-panel textarea:disabled,html[data-theme="dark"] .role-viewer .template-panel select:disabled { color:#b2c9e7; background:#14253d; }
html[data-theme="dark"] #login-screen { background:linear-gradient(155deg,#142844,#0d1a2d 58%,#12243e); }
html[data-theme="dark"] .login-card { background:#172943; border-color:#334e72; box-shadow:0 12px 40px #06112540; }
html[data-theme="dark"] .login-card h1 { color:#d9e8ff; }
html[data-theme="dark"] .login-intro,html[data-theme="dark"] .login-status { color:#a9c0e0; }
html[data-theme="dark"] #login-form label { color:#bfd3ef; }
html[data-theme="dark"] .error-text { color:#f0aca1 !important; }
html[data-theme="dark"] #toast { color:#eef5ff; background:#315b96; border:1px solid #6387b8; }
html[data-theme="dark"] #toast.error { background:#743f49; border-color:#b7777f; }
@media(max-width:700px) {
  .sidebar .brand .theme-toggle { width:35px; height:35px; border-radius:9px; }
  .sidebar .brand .theme-toggle .brand-mascot { width:100%; height:100%; }
}

/* 后台文字清晰度：只调整工作台，预览 iframe 内的资料样式不受影响。 */
:root { font-size:15px; font-weight:500; --muted:#61748d; }
body { font-size:15px; font-weight:600; }
body :is(h1,h2,h3,strong,b) { font-weight:700; }
body :is(p,label,summary,.post-title,.record-row,.log-line,.choice,.source-list a,.variable-row,.scope-summary,.bulk-tools,.generation-note,.site-modules-description,.site-modules-toolbar,.module-content-marker span,.reference-row,.load-status,.readonly-note,.advance-plan > p,.advance-warning,.advance-change span,.analytics-enable,.analytics-status strong,.task-row p,.user-info b) { font-size:15px; }
body :is(label,summary,.site-parent,.category,.choice,.source-list a,.module-content-marker span) { font-weight:600; }
body :is(button,a.primary,a.secondary):not(.icon-button):not(.theme-toggle) { font-size:15px; font-weight:600; line-height:1.45; }
body :is(input,select,textarea):not([type="checkbox"]):not([type="color"]) { font-size:15px; font-weight:600; line-height:1.55; }
body .code,body .template-panel textarea { font-size:15px; font-weight:500; line-height:1.75; }
body :is(input,textarea)::placeholder { font-size:14px; font-weight:500; opacity:1; }
body :is(small,.hint,.rule-note,.post-meta,.tag,.list-pager,.save-state,.variable-hint,.template-color-note,.preview-status-line,.preview-banner,.template-scope,.analytics-status span,.analytics-status p,.user-info p,.user-info small,.login-intro,.login-status,footer) { font-size:13px; font-weight:500; line-height:1.65; }
body :is(.card-head,.dialog-head,.template-panel-heading) h3 { font-size:16px; }
body .stats strong { font-weight:700; }
body .post-title { line-height:1.6; }
body .record-content { font-size:17px; font-weight:600; }
body .account-chip b { font-size:14px; font-weight:600; }
body .analytics-status strong,body .managed-site b,body .page-module-row .module-name,body .page-module-row .module-info b { font-size:15px; font-weight:600; }
body .layout-presets > span,body .preview-action-line > span { font-size:13px; font-weight:500; }
body #toast { font-size:15px; }
body #login-form label { font-size:15px; font-weight:600; }
body #login-form input { font-size:16px; }

/* 细字加深；日夜主题分别使用合适对比度，不覆盖错误/警告状态色。 */
html[data-theme="light"] :is(.hint,.post-meta,.post-title small,.card-head small,.dialog-head small,.choice small,.record-row small,.log-line time,.log-line p,.managed-site small,.source-list small,.reference-row small,.template-panel-heading small,.template-color-note,.preview-action-line > span,.user-info p,.user-info small,.login-intro,.login-status,.site-modules-description,.page-module-row small,footer) { color:#62758d; }
html[data-theme="light"] :is(.brand small,.login-brand span,.sidebar-note,.sidebar-note small,.site-parent small,.category small,.mobile-selection-bar small,.stats span,.layout-presets > span) { color:#5d789c; }
html[data-theme="light"] :is(input,textarea)::placeholder { color:#718097; }
html[data-theme="dark"] :is(.hint,.post-meta,.post-title small,.card-head small,.dialog-head small,.choice small,.record-row small,.log-line time,.log-line p,.managed-site small,.source-list small,.reference-row small,.template-panel-heading small,.template-color-note,.preview-action-line > span,.user-info p,.user-info small,.login-intro,.login-status,.site-modules-description,.page-module-row small,footer) { color:#adbed8; }

/* 大字仍可在窄屏自然断行，保持分类、按钮与预览控件可操作。 */
.site-parent > span,.category > span { min-width:0; overflow-wrap:anywhere; }
.site-parent small,.category small,.category-call { flex-shrink:0; }
.site-parent,.category { gap:8px; }
.card-head > div,.dialog-head > div { min-width:0; }
.template-panel-heading,.site-modules-toolbar,.scope-summary { flex-wrap:wrap; }
.template-panel-heading small,.site-modules-toolbar > span { overflow-wrap:anywhere; }
.preview-action-line { flex-wrap:wrap; }
.reference-row > div { min-width:0; overflow-wrap:anywhere; }
.stats > div { flex-wrap:wrap; }
@media(max-width:700px) {
  body :is(input,select,textarea):not([type="checkbox"]):not([type="color"]),body .code,body .template-panel textarea { font-size:16px; }
  body :is(button,a.primary,a.secondary):not(.icon-button):not(.theme-toggle) { min-height:40px; }
  body :is(.row-actions,.workspace-tools,.form-actions,.dialog-actions,.template-savebar,.module-savebar) button { min-width:0; white-space:normal; overflow-wrap:anywhere; }
  body .layout-presets button { font-size:13px; }
  body .nav { font-size:15px; padding-left:2px; padding-right:2px; white-space:nowrap; }
  body .category-call { font-size:13px; }
  .list-pager,.topbar-tools { flex-wrap:wrap; }
  .brand small { line-height:1.3; }
  .reference-row { flex-wrap:wrap; }
}

/* 同类玩法收在一组，手机也不再一次铺满全部预设。 */
#preset-list { display:block; max-height:min(52vh,480px); overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; padding:1px 3px 1px 0; }
#preset-list .preset-section { margin:0 0 7px; border:1px solid #dbe4ef; border-radius:8px; background:#fff; overflow:hidden; }
#preset-list .preset-section > summary { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:44px; padding:9px 12px; cursor:pointer; color:#27476d; list-style:none; }
#preset-list .preset-section > summary::-webkit-details-marker { display:none; }
#preset-list .preset-section > summary::before { content:'›'; font-size:22px; line-height:1; width:12px; transition:transform .15s; }
#preset-list .preset-section[open] > summary::before { transform:rotate(90deg); }
#preset-list .preset-section > summary > span { flex:1; }
#preset-list .preset-section-count { font-size:13px; font-weight:600; color:#62758d; }
#preset-list .preset-section.has-selection > summary { color:#1857b2; background:#edf5ff; }
.preset-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; padding:0 10px 10px; }
.preset-group-tools { padding:0 10px 5px; text-align:right; }
#preset-list .choice { padding:8px; min-height:48px; }
#preset-list .choice[hidden],#preset-list .preset-section[hidden] { display:none; }
#preset-selection-note { margin:0; font-size:13px; }
#play-config { margin:0; padding:10px; border:1px solid #dbe4ef; border-radius:7px; background:#f5f9ff; }
#play-config[hidden] { display:none; }
html[data-theme="dark"] #preset-list .preset-section { background:#13253f; border-color:#344b69; }
html[data-theme="dark"] #preset-list .preset-section > summary { color:#d7e6fb; }
html[data-theme="dark"] #preset-list .preset-section.has-selection > summary { background:#24466f; color:#fff; }
html[data-theme="dark"] #preset-list .preset-section-count { color:#b1c6e2; }
html[data-theme="dark"] #play-config { background:#172e4c; border-color:#344b69; }
@media(max-width:700px) {
  .preset-options { grid-template-columns:repeat(2,minmax(0,1fr)); padding:0 8px 8px; }
  #preset-list { max-height:46vh; }
  #preset-list .choice { font-size:14px; }
  #preset-list .choice small { font-size:12px; }
}
@media(max-width:350px) { .preset-options { grid-template-columns:1fr; } }
.bulk-selection { border-top:1px solid #dce5f0; padding-top:14px; min-width:0; }
#bulk-items { display:grid; gap:12px; margin-top:10px; }
.bulk-item { padding:14px; border:1px solid #cedff2; border-radius:10px; background:#f6faff; min-width:0; }
.bulk-item-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.bulk-item .form-grid { padding:0; }
.bulk-item p:empty { display:none; }
.pool-picker { margin-top:8px; border:1px solid #dce5f0; border-radius:7px; background:#fff; padding:8px; min-width:0; }
.pool-picker summary { cursor:pointer; color:#356bb0; line-height:1.7; }
.pool-picker summary small { margin-left:8px; font-weight:400; }
.pool-picker-tools { display:flex; flex-wrap:wrap; gap:10px; margin:8px 0; }
.pool-picker-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(43px,1fr)); gap:5px; }
.pool-picker-options label { display:flex; align-items:center; justify-content:center; gap:4px; border:1px solid #e2eaf5; border-radius:4px; padding:6px 2px; cursor:pointer; font-size:14px; }
.pool-picker-options label:has(input:checked) { color:#165cc3; background:#e5f0ff; border-color:#79a7e7; }
.pool-picker-options input { width:13px; height:13px; margin:0; }
.template-default-action { padding:10px; margin:10px 0; border:1px solid #cbdff6; border-radius:7px; background:#f5faff; }
.template-default-action .hint { margin:8px 0 0; }
html[data-theme="dark"] :is(.bulk-item,.pool-picker,.template-default-action) { background:#192d48; border-color:#344b69; }
html[data-theme="dark"] .pool-picker summary { color:#b2d0fc; }
html[data-theme="dark"] .pool-picker-options label { border-color:#405a7c; }
html[data-theme="dark"] .pool-picker-options label:has(input:checked) { color:#d4e6ff; background:#24466f; border-color:#709bda; }
@media(max-width:600px) { .bulk-item { padding:10px; } .bulk-item .form-grid { grid-template-columns:minmax(0,1fr); } .bulk-selection .bulk-tools { align-items:flex-start; } }
@media(prefers-reduced-motion:reduce) { #preset-list .preset-section > summary::before { transition:none; } }

.template-adapter-tools { display:flex; flex-wrap:wrap; gap:7px; margin:10px 0; }
.template-adapter-tools button { font-size:13px; padding:8px 10px; }
.material-layout-controls { margin-top:10px; }
.material-layout-controls label[hidden] { display:none; }
.template-library-save-row { display:flex; align-items:flex-end; gap:10px; margin:16px 0; }
.template-library-save-row label { flex:1; min-width:0; }
.template-library-row,.sync-candidate { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:12px 0; border-top:1px solid #dbe4ef; }
.template-library-row > div,.sync-candidate > div { flex:1; min-width:0; overflow-wrap:anywhere; }
.template-library-row p,.sync-candidate p { margin:5px 0; line-height:1.5; }
.template-library-row p,.sync-candidate small { color:#62758d; font-size:13px; }
.template-library-row button,.sync-candidate button { flex:0 0 auto; }
#template-adapt-notes { padding-left:22px; line-height:1.7; }
#draw-sync-status { padding:10px 12px; background:#edf5ff; border-radius:7px; color:#27476d; }
.draw-sync-card details { margin-top:12px; }
.sync-source-row { display:grid; grid-template-columns:90px minmax(0,1fr) minmax(0,1fr); gap:10px; padding:12px 0; border-top:1px solid #dbe4ef; }
.sync-source-row .wide { grid-column:1 / -1; }
.sync-source-row .check { align-self:center; }
.sync-source-remove { grid-column:1 / -1; justify-self:end; }
.sync-source-message { display:block; margin:3px 0; overflow-wrap:anywhere; }
#draw-candidate-detail { overflow-wrap:anywhere; }
.role-viewer :is(#draw-sync-settings,#draw-sync-run,#design-adapt-open,#design-library-save,.template-library-save-row,[data-use-template]) { display:none!important; }
html[data-theme="dark"] :is(.template-library-row,.sync-candidate,.sync-source-row) { border-color:#344b69; }
html[data-theme="dark"] :is(.template-library-row p,.sync-candidate small) { color:#adbed8; }
html[data-theme="dark"] #draw-sync-status { background:#24466f; color:#d7e6fb; }
@media(max-width:700px) {
  .template-library-save-row,.template-library-row,.sync-candidate { flex-wrap:wrap; }
  .template-library-save-row label { flex-basis:100%; }
  .sync-source-row { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .sync-source-row > .check { grid-column:1/-1; }
  .sync-candidate .tag { display:inline-block; margin-top:4px; }
}
.post-statline { display:flex; flex-wrap:wrap; gap:5px 12px; margin:7px 0 0; color:#526a88; font-size:14px; line-height:1.65; }
.post-statline .consecutive-warning { color:#b52d3d; font-weight:700; }
.post-summary-note { color:#677b94; font-size:12px; margin:3px 0 0; line-height:1.6; }
.post-miss-details { margin-top:6px; }
.post-miss-details > summary { font-size:13px; color:#416c9d; cursor:pointer; }
.post-miss-periods { display:flex; flex-wrap:wrap; gap:5px; padding-top:6px; }
.post-miss-periods span { font-size:12px; padding:3px 7px; border-radius:4px; background:#f1f5fa; color:#4f6480; }
html[data-theme="dark"] .post-statline,html[data-theme="dark"] .post-summary-note { color:#adbed8; }
html[data-theme="dark"] .post-statline .consecutive-warning { color:#ffa6ae; }
html[data-theme="dark"] .post-miss-details > summary { color:#9bc5ff; }
html[data-theme="dark"] .post-miss-periods span { background:#223e60; color:#d2e2f7; }

/* 采集与模板预览单独隔离，来源页面不会进入后台页面布局。 */
.capture-source-card { padding:16px 18px; }
.capture-url-form { display:flex; gap:10px; align-items:flex-end; }
.capture-url-form label { flex:1; min-width:0; }
.capture-url-form button { flex:0 0 auto; }
#capture-status { margin:10px 0 0; overflow-wrap:anywhere; }
.capture-warnings { margin:10px 0 0; padding:10px 12px 10px 30px; border-radius:6px; background:#fff7e3; color:#86601d; font-size:13px; line-height:1.65; }
.capture-workspace { display:grid; grid-template-columns:230px minmax(0,1fr); gap:16px; align-items:start; }
.capture-workspace > *, .capture-detail-card { min-width:0; }
.capture-block-list { display:grid; gap:6px; padding:8px; max-height:540px; overflow:auto; overscroll-behavior:contain; }
.capture-block-list button { display:flex; flex-direction:column; gap:5px; width:100%; padding:12px; border:1px solid transparent; border-radius:6px; background:transparent; text-align:left; color:#344f70; overflow-wrap:anywhere; }
.capture-block-list button strong { font-size:14px; line-height:1.5; font-weight:700; }
.capture-block-list button small { color:#71839b; font-size:12px; }
.capture-block-list button:hover { background:#f4f8ff; }
.capture-block-list button.selected { border-color:#aac9fa; background:#edf5ff; color:#235eb6; }
.capture-block-list button:focus-visible { outline:2px solid #3a70f4; outline-offset:-2px; }
.capture-export-all { padding:10px; border-top:1px solid #e2eaf4; }
.capture-export-all button { width:100%; }
.capture-preview-tools { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:0 16px; border-bottom:1px solid #e2eaf4; flex-wrap:wrap; }
.capture-preview-tools .tabs { margin:0; border:0; }
.capture-preview-tools .viewport-buttons { padding:8px 0; }
.capture-preview-wrap { padding:14px; background:#edf2f8; }
.capture-preview-stage { position:relative; width:100%; height:500px; overflow:hidden; border:1px solid #d8e1ed; border-radius:6px; background:#fff; }
.capture-preview-stage iframe { position:absolute; top:0; left:50%; margin:0; border:0; background:#fff; transform-origin:top center; translate:-50% 0; }
.capture-code-wrap { display:block; padding:14px; }
.capture-code-wrap textarea { display:block; width:100%; min-height:500px; font-size:13px; line-height:1.6; resize:vertical; }
.capture-source-title { padding:10px 14px; margin:0; border-top:1px solid #e2eaf4; font-size:12px; line-height:1.6; color:#6c809b; overflow-wrap:anywhere; }
.capture-detail-card > .card-head { flex-wrap:wrap; gap:10px; }
.capture-detail-card h3 { overflow-wrap:anywhere; }
html[data-theme="dark"] .capture-warnings { background:#3c3525; color:#e9cc91; }
html[data-theme="dark"] .capture-block-list button { color:#c6d9f0; }
html[data-theme="dark"] .capture-block-list button small,html[data-theme="dark"] .capture-source-title { color:#adbed8; }
html[data-theme="dark"] .capture-block-list button:hover { background:#1c3656; }
html[data-theme="dark"] .capture-block-list button.selected { background:#24466f; color:#fff; border-color:#537caa; }
html[data-theme="dark"] :is(.capture-export-all,.capture-preview-tools,.capture-source-title,.capture-preview-stage) { border-color:#344b69; }
html[data-theme="dark"] .capture-preview-wrap { background:#0b1728; }
.automation-input-tabs { margin:0 0 14px; }
.automation-target-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; padding:16px 18px 4px; }
.automation-target-fields label { min-width:0; }
.automation-match-action { display:flex; align-items:flex-end; }
.automation-match-action button { width:100%; }
#automation-status,#automation-preview-status { margin:0; padding:10px 18px; overflow-wrap:anywhere; }
.automation-match-summary { padding:12px 18px; border-top:1px solid #e2eaf4; }
.automation-match-summary strong { font-size:15px; color:#294c7a; }
#automation-fields { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
#automation-fields span { padding:4px 7px; font-size:12px; line-height:1.5; color:#416b9b; background:#edf5ff; border-radius:4px; overflow-wrap:anywhere; }
#automation-warnings { margin:0 18px 12px; }
.automation-apply-bar { display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; padding:12px 18px; border-top:1px solid #e2eaf4; }
.automation-published { margin:0 18px 16px; padding:14px; border:1px solid #b8ddcd; border-radius:7px; background:#f0faf5; }
.automation-published > strong { display:block; font-size:15px; color:#266347; margin-bottom:12px; overflow-wrap:anywhere; }
.automation-published textarea { width:100%; margin-bottom:10px; }
.automation-history-stage { height:450px; border:1px solid #d8e1ed; background:#fff; }
.automation-history-stage iframe { width:100%; height:100%; border:0; background:#fff; }
.generation-basis-hint { margin:0; align-self:center; line-height:1.6; }
.generation-basis { margin:0; padding:10px 12px; border:1px solid #bbd6ff; border-radius:6px; color:#2a568e; background:#eff6ff; font-size:14px; font-weight:600; line-height:1.65; overflow-wrap:anywhere; }
html[data-theme="dark"] .generation-basis { background:#203d61; border-color:#42658d; color:#c6dfff; }

/* 总账号配置入口；子账号只处理帖子、生成发布和内容预览。 */
body:not(.role-owner) [data-owner-only],body:not(.role-owner) :is(#control-add-site,#new-site,#new-category,#category-design,#category-advance,#site-design-open,#authors-open,#ai-words-open,#edit-sources,#bulk-open-draw,#post-form details,[data-control-tab="draw"],[data-control-tab="sites"],[data-control-tab="users"],[data-control-tab="logs"]) { display:none!important; }
body:not(.perm-create) :is(#new-post,#bulk-posts),body:not(.perm-generate) :is(#category-generate,.generation-form button[type="submit"]),body:not(.perm-update) [data-edit],body:not(.perm-delete) [data-delete-post],body:not(.perm-publish) :is([data-task-reschedule],[data-task-cancel]) { display:none!important; }
.danger-text { color:#af3246; }
.user-permissions { border:1px solid #dbe5f2; border-radius:7px; padding:12px; }
.user-permissions > strong { display:block; margin-bottom:10px; font-size:14px; }
.user-permissions > div { display:flex; flex-wrap:wrap; gap:10px 18px; }
.user-permissions .hint { margin:10px 0 0; }
.readonly-permissions { opacity:.65; }
.inspection-limit-label { width:min(300px,100%); padding:12px 18px; }
.ranking-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; margin:14px 0; }
.ranking-toolbar .hint { margin:0; }
.ranking-entries { list-style:none; padding:0; max-height:260px; overflow:auto; border:1px solid #e2eaf4; border-radius:6px; }
.ranking-entries li { display:flex; align-items:center; gap:10px; padding:9px 12px; border-bottom:1px solid #e2eaf4; font-size:14px; }
.ranking-entries li:last-child { border-bottom:0; }
.ranking-entries li > b { width:25px; color:#3571bd; }
.ranking-entries li > span { flex:1; min-width:0; overflow-wrap:anywhere; }
.ranking-entries li > small { color:#71839b; }
.ranking-link-row { display:flex; align-items:center; justify-content:space-between; gap:12px; border-top:1px solid #e2eaf4; padding:12px 0; }
.ranking-link-row > div:first-child { min-width:0; overflow-wrap:anywhere; }
.ranking-link-row b { font-size:14px; }
.ranking-link-row small { display:block; margin-top:4px; color:#71839b; font-size:12px; }
.ranking-save-link { display:flex; align-items:flex-end; }
#ranking-link-form { margin-top:14px; padding-top:14px; border-top:1px solid #e2eaf4; }
html[data-theme="dark"] :is(.user-permissions,.ranking-entries,.ranking-entries li,.ranking-link-row,#ranking-link-form) { border-color:#344b69; }
html[data-theme="dark"] .danger-text { color:#f2a2ac; }
html[data-theme="dark"] .ranking-entries li > b { color:#a7caff; }
@media(max-width:700px) { .ranking-link-row { flex-wrap:wrap; } .inspection-limit-label { padding:12px; } }
.region-parent { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; padding:9px 10px 9px 16px; margin:0; border:0; background:#f6f9fd; color:#58718e; font-size:13px; font-weight:700; text-align:left; }
.region-parent.chosen { color:#245da8; background:#eaf3ff; }
.region-parent small { font-size:12px; font-weight:500; }
.region-children { padding-left:8px; }
.region-empty { padding:8px 12px; margin:0; font-size:12px; color:#71839b; }
.region-unavailable { margin:0; padding:9px 12px; border-radius:6px; color:#805d20; background:#fff6df; font-size:13px; line-height:1.6; }
html[data-theme="dark"] .region-parent { background:#172d49; color:#adbed8; }
html[data-theme="dark"] .region-parent.chosen { background:#24466f; color:#d7e6fb; }
html[data-theme="dark"] .region-unavailable { background:#3c3525; color:#e9cc91; }
@media(max-width:700px) { .region-parent { min-height:40px; padding-top:8px; padding-bottom:8px; } .region-children { padding-left:4px; } }
.inspection-settings-card { padding-bottom:0; }
.inspection-target-row { display:grid; grid-template-columns:65px minmax(120px,170px) minmax(0,1fr) 46px; align-items:end; gap:10px; padding:12px 18px; border-top:1px solid #e2eaf4; }
.inspection-target-row > label,.inspection-rule-row > label { min-width:0; }
.inspection-target-row > .check,.inspection-rule-row > .check { align-self:center; }
.inspection-target-row input,.inspection-rule-row input,.inspection-rule-row select { width:100%; }
.inspection-target-row input[type="checkbox"],.inspection-rule-row input[type="checkbox"] { width:auto; }
.inspection-rules-details { border-top:1px solid #e2eaf4; }
.inspection-rules-details > summary { padding:15px 18px; font-size:15px; font-weight:700; color:#2b527e; cursor:pointer; }
.inspection-rules-details > summary span { font-size:13px; font-weight:500; color:#71839b; }
.inspection-rule-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:0 18px 10px; }
.inspection-rule-toolbar .hint { margin:0; }
.inspection-rule-toolbar button { flex-shrink:0; }
.inspection-rule-row { display:grid; grid-template-columns:65px minmax(100px,1fr) minmax(130px,1fr) minmax(0,1.4fr) 46px; align-items:end; gap:10px; padding:12px 18px; border-top:1px solid #e2eaf4; }
.inspection-settings-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 18px; border-top:1px solid #e2eaf4; }
.inspection-settings-actions .hint { margin:0; min-width:0; overflow-wrap:anywhere; }
.inspection-settings-actions button { flex-shrink:0; }
.inspection-progress-card > p { margin:12px 18px; line-height:1.65; overflow-wrap:anywhere; }
#inspection-progress-bar { display:block; width:calc(100% - 36px); height:9px; margin:0 18px 16px; accent-color:#3974db; }
.inspection-summary { display:flex; flex-wrap:wrap; gap:8px; padding:12px 18px; }
.inspection-summary span { padding:7px 10px; border-radius:5px; background:#f0f5fc; color:#476685; font-size:13px; }
.inspection-summary b { color:#244e81; margin-left:5px; }
#inspection-warnings { margin:0 18px 12px; }
.inspection-findings-wrap { overflow-x:auto; }
.inspection-findings { width:100%; border-collapse:collapse; table-layout:fixed; font-size:14px; }
.inspection-findings th,.inspection-findings td { padding:11px 14px; border-bottom:1px solid #e2eaf4; text-align:left; vertical-align:top; line-height:1.65; overflow-wrap:anywhere; }
.inspection-findings th { color:#476685; background:#f7faff; font-weight:700; }
.inspection-findings th:first-child { width:100px; }
.inspection-findings th:nth-child(2) { width:22%; }
.inspection-findings th:last-child { width:24%; }
.inspection-findings td small { display:block; color:#71839b; font-size:12px; }
.inspection-findings td a { color:#2866bd; }
.inspection-level { display:inline-block; padding:2px 6px; border-radius:4px; font-size:12px; color:#785d22; background:#fff5d9; white-space:nowrap; }
.inspection-level-error { color:#aa3446; background:#ffedf0; }
.inspection-level-blocked { color:#77529c; background:#f3edfc; }
.inspection-level-maintenance { color:#a15c22; background:#fff0df; }
#inspection-findings-empty { padding:12px 18px; margin:0; }
.inspection-coverage { padding:12px 18px; }
.inspection-coverage details { border-top:1px solid #e2eaf4; padding:12px 0; }
.inspection-coverage summary { color:#31577e; font-size:14px; font-weight:700; cursor:pointer; }
.inspection-coverage p,.inspection-coverage ul { margin:8px 0; font-size:13px; line-height:1.65; color:#647b96; overflow-wrap:anywhere; }
.inspection-coverage ul { padding-left:20px; }
.inspection-coverage strong { font-size:13px; color:#815d25; }
html[data-theme="dark"] :is(.inspection-target-row,.inspection-rule-row,.inspection-rules-details,.inspection-settings-actions,.inspection-findings td,.inspection-findings th,.inspection-coverage details) { border-color:#344b69; }
html[data-theme="dark"] :is(.inspection-rules-details > summary,.inspection-coverage summary,.inspection-summary b) { color:#c6d9f0; }
html[data-theme="dark"] :is(.inspection-coverage p,.inspection-coverage ul,.inspection-findings td small) { color:#adbed8; }
html[data-theme="dark"] .inspection-findings th { background:#172d49; color:#bdd1eb; }
html[data-theme="dark"] .inspection-summary span { background:#1e3858; color:#b3cbe5; }
html[data-theme="dark"] .inspection-findings td a { color:#a7caff; }
html[data-theme="dark"] .inspection-coverage strong { color:#e6c58c; }
@media(max-width:1050px) {
  .inspection-rule-row { grid-template-columns:60px minmax(0,1fr) minmax(0,1fr) 46px; }
  .inspection-rule-text { grid-column:2 / 4; }
  .inspection-rule-row > button { grid-column:4; grid-row:1 / 3; align-self:center; }
}
@media(max-width:700px) {
  .inspection-target-row { grid-template-columns:55px minmax(0,1fr) 42px; gap:8px; padding:12px; }
  .inspection-target-url { grid-column:1 / 3; }
  .inspection-target-row > button { grid-column:3; grid-row:1 / 3; }
  .inspection-rule-row { grid-template-columns:55px minmax(0,1fr) 42px; gap:8px; padding:12px; }
  .inspection-rule-row > label:nth-child(3) { grid-column:1 / 3; }
  .inspection-rule-text { grid-column:1 / 3; }
  .inspection-rule-row > button { grid-column:3; grid-row:1 / 4; }
  .inspection-rule-toolbar,.inspection-settings-actions { padding:10px 12px; flex-wrap:wrap; }
  .inspection-findings,.inspection-findings tbody { display:block; width:100%; }
  .inspection-findings thead { display:none; }
  .inspection-findings tr { display:grid; grid-template-columns:100px minmax(0,1fr); gap:10px; padding:12px; border-bottom:1px solid #e2eaf4; }
  .inspection-findings td { display:block; min-width:0; border:0; padding:0; }
  .inspection-findings td:nth-child(3),.inspection-findings td:nth-child(4) { grid-column:1 / -1; }
  .inspection-findings td::before { content:attr(data-label); display:block; margin-bottom:3px; color:#71839b; font-size:12px; }
  html[data-theme="dark"] .inspection-findings tr { border-color:#344b69; }
  .inspection-summary,.inspection-coverage { padding:12px; }
  .inspection-rules-details > summary { padding:12px; }
  #inspection-result > .card-head { flex-wrap:wrap; gap:10px; }
  #inspection-warnings { margin-right:12px; margin-left:12px; }
}
.automation-target-card > .card-head { flex-wrap:wrap; gap:10px; }
.role-viewer :is(#automation-apply,#automation-history-restore) { display:none!important; }
html[data-theme="dark"] :is(.automation-match-summary,.automation-apply-bar,.automation-history-stage) { border-color:#344b69; }
html[data-theme="dark"] .automation-match-summary strong { color:#c6d9f0; }
html[data-theme="dark"] #automation-fields span { background:#24466f; color:#d7e6fb; }
html[data-theme="dark"] .automation-published { background:#143e34; border-color:#386455; }
html[data-theme="dark"] .automation-published > strong { color:#b9ecd8; }
@media(max-width:900px) { .capture-workspace { grid-template-columns:190px minmax(0,1fr); gap:10px; } }
@media(max-width:700px) {
  .sidebar nav { display:flex; gap:3px; overflow-x:auto; scrollbar-width:thin; }
  body .sidebar .nav { width:auto; flex:1 0 auto; padding:9px 10px; font-size:14px; }
  .capture-source-card { padding:12px; }
  .capture-url-form { flex-wrap:wrap; gap:8px; }
  .capture-url-form label { flex-basis:100%; }
  .capture-url-form .primary { flex:1; }
  .capture-workspace { grid-template-columns:minmax(0,1fr); }
  .capture-block-list { grid-template-columns:repeat(2,minmax(0,1fr)); max-height:210px; }
  .capture-block-list button { padding:9px; }
  .capture-export-all { padding:8px 10px; }
  .capture-preview-wrap { padding:8px; }
  .capture-preview-tools { padding:0 10px; }
  .capture-preview-tools .tabs button { padding-left:10px; padding-right:10px; }
  .capture-detail-card > .card-head { padding:12px; }
  .capture-code-wrap { padding:8px; }
  .automation-target-fields { grid-template-columns:repeat(2,minmax(0,1fr)); padding:12px; gap:10px; }
  .automation-target-card > .card-head { padding:12px; }
  #automation-status,#automation-preview-status { padding:8px 12px; }
  .automation-match-summary { padding:12px; }
  #automation-warnings { margin:0 12px 12px; }
  .automation-apply-bar { padding:12px; gap:8px; }
  .automation-apply-bar button { flex:1 1 130px; }
  .automation-published { margin:0 12px 12px; padding:12px; }
}
.homepage-layout-rows{display:grid;gap:7px;margin:12px 0;max-height:380px;overflow:auto}
.experts-template-tools{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;padding:14px 16px;margin:0 0 16px;border:1px solid var(--line,#dce5ef);border-radius:10px;background:var(--surface,#fff)}
.experts-template-tools>div:first-child{flex:1;min-width:200px}.experts-template-tools .hint{margin:5px 0 0;line-height:1.6}.experts-template-tools>.inline-actions{flex-shrink:0}
.site-page-shortcuts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0 0 18px}.site-page-shortcuts button{white-space:normal;min-height:42px}
.bulk-history-shortcuts{display:flex;gap:8px;flex-wrap:wrap}.bulk-history-shortcuts [aria-pressed="true"]{border-color:#477bda;background:#e7efff;color:#184a91}
.automation-kind-correction{padding:0 16px 14px}
.template-error-example{margin:12px 0;padding:14px;border:1px solid #dcbd73;border-radius:8px;background:#fffaf0;min-width:0}.template-error-example>strong{display:block;line-height:1.6}.template-error-example>.code{display:block;width:100%;margin:10px 0;min-width:0;max-height:280px}.template-error-example .hint{line-height:1.7;margin:7px 0}.template-error-example ul{padding-left:20px}.template-error-example .inline-actions{margin-top:10px}#template-error-automation{margin:0 16px 14px}
html[data-theme="dark"] .template-error-example{background:#302d25;border-color:#877044;color:#f2e5c6}
html[data-theme="dark"] .experts-template-tools{background:#15263e;border-color:#3c516f}html[data-theme="dark"] .bulk-history-shortcuts [aria-pressed="true"]{background:#294a74;border-color:#81acf1;color:#fff}
@media(max-width:600px){.experts-template-tools{padding:12px;gap:10px}.experts-template-tools>.inline-actions{width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.experts-template-tools button{white-space:normal;padding:9px 6px;font-size:13px}.site-page-shortcuts{gap:7px}.bulk-history-shortcuts button{flex:1 1 65px;padding:9px 6px}}
.homepage-layout-row{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:9px 10px;border:1px solid var(--line,#dce5ef);border-radius:8px}
.homepage-layout-row .check{flex:1;min-width:0;margin:0}.homepage-layout-row .check span{min-width:0;overflow-wrap:anywhere}.homepage-layout-row small{display:block;margin-top:3px;color:var(--muted,#6c7c92)}
.homepage-layout-row .inline-actions{flex-shrink:0}.homepage-layout-actions{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.homepage-layout-call{margin-top:16px;padding-top:12px;border-top:1px solid var(--line,#dce5ef)}
#homepage-layout-frame{display:block;left:0;translate:none;border:0;background:#fff}#homepage-layout-preview-box{margin-top:16px}#homepage-layout-stage{margin:0 auto;overflow:hidden}
@media(max-width:600px){.homepage-layout-row{gap:7px;padding:8px}.homepage-layout-row .inline-actions{gap:4px}.homepage-layout-row button{padding:7px 8px;font-size:12px}.homepage-layout-actions button{flex:1}}
.post-bulk-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:9px 0;border-bottom:1px solid var(--line,#dce5ef);font-size:13px}.post-bulk-toolbar .check{margin:0}.post-bulk-toolbar>button{margin-left:auto}.post-select{margin:3px 0 0;align-self:flex-start;flex:0 0 22px}.post-select input{width:18px;height:18px}.post-row:has(.post-select){column-gap:9px}#posts-delete-list{line-height:1.9;padding-left:24px}.draw-region-picker{display:flex;align-items:center;gap:16px;margin:0 0 14px}.draw-region-picker>label{width:160px;flex-shrink:0}.draw-region-picker p{margin:0}
@media(max-width:600px){.post-bulk-toolbar{gap:8px}.post-bulk-toolbar>span{font-size:12px}.draw-region-picker{align-items:flex-end;gap:10px}.draw-region-picker>label{width:104px}.draw-region-picker p{font-size:12px}.post-row .post-select{grid-column:1;grid-row:1/3}.post-row:has(.post-select){display:grid;grid-template-columns:22px minmax(0,1fr)}.post-row:has(.post-select) .post-info,.post-row:has(.post-select) .post-actions{grid-column:2}}
.basis-chooser{padding:11px;border:1px solid var(--line,#dce5ef);border-radius:8px}.basis-chooser-toolbar{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;margin-bottom:10px}.basis-chooser-toolbar>label{width:140px}.basis-chooser-toolbar>span{padding-bottom:9px;font-size:13px;font-weight:700}.basis-chooser-toolbar>button{margin-left:auto}.basis-zodiacs{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:6px}.basis-zodiacs label{position:relative;display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer}.basis-zodiacs input{position:absolute;opacity:0;width:100%;height:100%;margin:0;cursor:pointer}.basis-zodiacs span{display:flex;width:100%;min-height:37px;align-items:center;justify-content:center;border:1px solid var(--line,#dce5ef);border-radius:6px;font-weight:800;background:var(--surface,#fff)}.basis-zodiacs input:checked+span{background:#ddebff;border-color:#527ecc;color:#184a91}.basis-zodiacs input:focus-visible+span{outline:2px solid #477bda;outline-offset:2px}.basis-zodiacs input:disabled:not(:checked)+span{opacity:.5}.basis-chooser .hint{margin:9px 0 0}html[data-theme="dark"] .basis-zodiacs span{background:#15263e;color:#dceaff;border-color:#3c516f}html[data-theme="dark"] .basis-zodiacs input:checked+span{background:#294a74;border-color:#81acf1;color:#fff}
@media(max-width:600px){.basis-zodiacs{grid-template-columns:repeat(6,minmax(0,1fr))}.basis-chooser-toolbar{gap:8px}.basis-chooser-toolbar>label{width:118px}.basis-chooser-toolbar>button{font-size:13px;padding:9px}.basis-chooser{padding:9px}}

/* 检查设置独立适配，站点、彩种、年份与规则范围保持可见。 */
.inspection-target-row{grid-template-columns:55px minmax(110px,150px) minmax(0,1fr) 85px 85px 46px}
.inspection-target-row select{width:100%;min-width:0}
.inspection-rule-scope{grid-column:1 / -1;min-width:0;padding-top:6px;border-top:1px dashed var(--line,#e2eaf4)}
.inspection-rule-scope>strong{display:block;font-size:13px;margin-bottom:8px}
.inspection-rule-targets{display:flex;flex-wrap:wrap;gap:8px 18px;margin-top:8px}
.inspection-rule-targets .check{max-width:100%;min-width:0;align-items:flex-start}
.inspection-rule-targets span{overflow-wrap:anywhere}
.inspection-capabilities{margin-bottom:14px;padding:14px 18px;line-height:1.7}
.inspection-capabilities summary{cursor:pointer;font-weight:700}
.inspection-capabilities strong{display:block;margin-top:10px;font-size:14px}
.inspection-capabilities ul{margin:6px 0;padding-left:20px;font-size:13px;overflow-wrap:anywhere}
.inspection-builtins{margin-top:18px;padding-top:14px;border-top:1px solid var(--line,#e2eaf4)}
#inspection-builtin-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:12px 0}
.inspection-check-group{min-width:0;border:1px solid var(--line,#e2eaf4);border-radius:8px;padding:10px 12px}
.inspection-check-group summary{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:14px;font-weight:700;cursor:pointer}
.inspection-check-group summary>span:before{content:'▸';display:inline-block;margin-right:7px;color:var(--muted,#627591)}
.inspection-check-group[open] summary>span:before{content:'▾'}
.inspection-check-group summary .check{margin:0;font-size:13px;font-weight:400}
.inspection-check-group ul{margin:10px 0 0;padding-left:18px;font-size:13px;line-height:1.8;overflow-wrap:anywhere}
.inspection-advertising{border-top:1px solid var(--line,#e2eaf4);margin-top:14px;padding-top:14px;min-width:0}
.inspection-advertising>summary{font-weight:700;cursor:pointer}
.inspection-ad-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0}
.inspection-ad-fields>.wide{grid-column:1 / -1}.inspection-ad-fields>label{min-width:0}.inspection-ad-fields input{min-width:0;width:100%}.inspection-ad-fields .check input{width:auto}
.inspection-ad-targets>strong{font-size:13px}.inspection-ad-targets>div{display:flex;flex-wrap:wrap;gap:8px 18px;margin-top:8px}.inspection-ad-targets .check{min-width:0;overflow-wrap:anywhere}
#inspection-ad-snapshot-status,#inspection-ad-file-error{overflow-wrap:anywhere}
@media(max-width:600px){#inspection-builtin-groups,.inspection-ad-fields{grid-template-columns:minmax(0,1fr)}.inspection-check-group{padding:10px}.inspection-ad-fields>.wide{grid-column:auto}}
@media(max-width:1050px){.inspection-target-row{grid-template-columns:55px minmax(0,1fr) 85px 85px 46px}.inspection-target-url{grid-column:1 / -1;grid-row:2}.inspection-target-row>button{grid-column:5;grid-row:1}.inspection-target-row>label:nth-child(4){grid-column:3;grid-row:1}.inspection-target-row>label:nth-child(5){grid-column:4;grid-row:1}}
@media(max-width:700px){.inspection-target-row{grid-template-columns:repeat(2,minmax(0,1fr))}.inspection-target-row>label:nth-child(4){grid-column:1;grid-row:3}.inspection-target-row>label:nth-child(5){grid-column:2;grid-row:3}.inspection-target-row>button{grid-column:1 / -1;grid-row:4;justify-self:end}.inspection-capabilities{padding:12px}.inspection-rule-targets{gap:8px 12px}}

/* 分类标题在玩法滚动区内吸顶，保留原生点击收起与键盘操作。 */
#preset-list .preset-section { overflow:visible; }
#preset-list .preset-section > summary { position:sticky; top:0; z-index:3; background:#fff; border-radius:7px; }
#preset-list .preset-section[open] > summary { box-shadow:0 2px 5px #00000012; }
html[data-theme="dark"] #preset-list .preset-section > summary { background:#13253f; }
html[data-theme="dark"] #preset-list .preset-section.has-selection > summary { background:#24466f; }
#draw-sync-details > summary { cursor:pointer; padding:12px 4px; font-weight:700; }
#draw-sync-details > #draw-sync-candidates { max-height:420px; overflow:auto; overscroll-behavior:contain; }
