/* 城发后台业务层：基础令牌与组件由 public/ui-system/ 统一提供。 */
:root {
  --blue: var(--zc-blue);
  --red: var(--zc-danger);
  --ink: var(--zc-ink);
  --muted: var(--zc-muted);
  --line: var(--zc-line);
  --bg: var(--zc-canvas);
  --white: var(--zc-surface);
  --success: var(--zc-teal);
  --danger: var(--zc-danger);
}

html { background: var(--zc-canvas); }
body { min-width: 1120px; }
a { color: var(--zc-blue); text-decoration: none; }
a:hover { color: var(--zc-blue-strong); }

/* Application shell */
.admin-shell { min-height: 100vh; grid-template-columns: var(--zc-sidebar-width) minmax(0, 1fr); }
.sidebar { z-index: 20; overflow-y: auto; }
.brand { min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 6px 19px; color: var(--zc-ink); }
.brand:hover { color: var(--zc-ink); }
.brand-mark { width: 34px; height: 34px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #2d8cff, var(--zc-blue)); box-shadow: 0 8px 16px rgba(22,119,255,.2); font-size: 15px; font-weight: 800; }
.brand-copy { min-width: 0; color: var(--zc-ink); font-size: 16px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.brand-copy small { display: block; margin-top: 3px; color: var(--zc-muted-2); font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.sidebar nav { display: grid; min-width: 0; gap: 2px; }
.nav-label { margin: 18px 0 7px; padding: 8px 10px; color: #45627f; font-size: 12px; font-weight: 800; letter-spacing: .08em; line-height: 1; background: linear-gradient(90deg, #edf4fc 0%, #f7faff 100%); border-left: 3px solid #8db5e4; border-radius: 6px; }
.nav-label:first-child { margin-top: 7px; }
.sidebar a:not(.brand) { min-width: 0; min-height: 38px; display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: var(--zc-radius-control); color: #52647b; font-size: var(--zc-text-md); font-weight: 700; transition: color .18s ease, background .18s ease, transform .18s ease; }
.sidebar a:not(.brand)::before { width: 18px; height: 18px; display: grid; flex: 0 0 auto; place-items: center; content: attr(data-icon); color: #8292a7; font-size: 10px; font-weight: 800; }
.sidebar a:not(.brand):hover { color: var(--zc-blue); background: var(--zc-blue-soft); transform: translateX(2px); }
.sidebar a:not(.brand):hover::before, .sidebar a:not(.brand).active::before { color: var(--zc-blue); }
.sidebar a:not(.brand).active { color: #fff; background: linear-gradient(100deg, var(--zc-blue), #3c92ff); box-shadow: 0 7px 16px rgba(22,119,255,.18); }
.sidebar a:not(.brand).active::before { color: #fff; }

.admin-main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; min-height: 64px; padding: 0 28px; background: rgba(255,255,255,.93); backdrop-filter: blur(14px); }
.topbar form { margin: 0; }
.topbar-location { min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--zc-muted); font-size: var(--zc-text-sm); }
.topbar-location strong { color: var(--zc-ink); font-weight: 800; }
.topbar-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--zc-blue); box-shadow: 0 0 0 4px var(--zc-blue-soft); }
.topbar-separator { color: var(--zc-line-strong); }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.topbar .actions { gap: 11px; }
.topbar-preview { color: #52708e; font-size: var(--zc-text-sm); font-weight: 800; }
.topbar-updates { position: relative; flex: 0 0 auto; }
.changelog-toggle { position: relative; gap: 6px; white-space: nowrap; }
.changelog-icon { width: 16px; height: 16px; display: inline-grid; place-items: center; border: 1.5px solid currentColor; border-radius: 50%; font-family: Georgia, serif; font-size: 11px; font-weight: 800; line-height: 1; }
.changelog-new { position: absolute; top: -8px; right: -7px; min-width: 19px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid #fff; border-radius: 99px; color: #fff; background: var(--zc-danger); font-size: 9px; font-style: normal; font-weight: 800; line-height: 1; }
.changelog-panel { position: absolute; top: calc(100% + 12px); right: 0; z-index: 40; width: min(380px, calc(100vw - 40px)); overflow: hidden; border: 1px solid var(--zc-line); border-radius: var(--zc-radius-card); background: #fff; box-shadow: var(--zc-shadow-float); }
.changelog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 18px 13px; border-bottom: 1px solid var(--zc-line); background: linear-gradient(135deg, #f8fbff, #fff); }
.changelog-head strong, .changelog-head small { display: block; }
.changelog-head strong { color: var(--zc-ink); font-size: 16px; font-weight: 800; }
.changelog-head small { margin-top: 3px; color: var(--zc-muted-2); font-size: 10px; }
.changelog-close { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: var(--zc-muted); background: transparent; cursor: pointer; font-size: 21px; line-height: 1; }
.changelog-close:hover { color: var(--zc-ink); background: var(--zc-blue-soft); }
.changelog-list { display: grid; gap: 0; max-height: 420px; margin: 0; padding: 2px 18px 8px; overflow-y: auto; list-style: none; }
.changelog-item { position: relative; padding: 14px 0 14px 18px; border-bottom: 1px solid var(--zc-line); }
.changelog-item:last-child { border-bottom: 0; }
.changelog-item::before { position: absolute; top: 21px; left: 0; width: 7px; height: 7px; content: ""; border-radius: 50%; background: var(--zc-line-strong); }
.changelog-item--current::before { background: var(--zc-blue); box-shadow: 0 0 0 4px var(--zc-blue-soft); }
.changelog-item time, .changelog-item strong, .changelog-item p { display: block; }
.changelog-item time { margin-bottom: 4px; color: var(--zc-blue); font-size: 10px; font-weight: 800; }
.changelog-item strong { color: #30455d; font-size: var(--zc-text-sm); font-weight: 800; }
.changelog-item p { margin: 5px 0 0; color: var(--zc-muted); font-size: 11px; line-height: 1.55; }
.user-avatar { width: 32px; height: 32px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--zc-violet); background: var(--zc-violet-soft); font-size: 12px; font-weight: 800; }
.topbar-user { display: grid; min-width: 75px; line-height: 1.17; }
.topbar-user strong { color: #31465e; font-size: var(--zc-text-sm); font-weight: 800; }
.topbar-user small { margin-top: 3px; color: var(--zc-muted-2); font-size: 10px; }
.topbar .btn-ghost { min-height: 30px; }

.content-wrap { width: min(100%, 1740px); padding: 22px 26px 48px; }
.page-head { min-width: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.page-head h1 { margin: 3px 0 5px; color: var(--zc-ink); font-size: var(--zc-text-display); font-weight: 800; letter-spacing: -.035em; line-height: 1.2; }
.page-head p { max-width: 900px; margin: 0; color: var(--zc-muted); font-size: var(--zc-text-md); }
.page-pretitle { display: block; color: var(--zc-muted-2); font-size: 10px; font-weight: 800; letter-spacing: .1em; }

/* Controls and panels */
.btn { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--zc-blue); border-radius: var(--zc-radius-control); color: #fff; background: var(--zc-blue); box-shadow: 0 6px 14px rgba(22,119,255,.16); cursor: pointer; font: inherit; font-size: var(--zc-text-sm); font-weight: 800; line-height: 1; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease; }
.btn:hover { border-color: var(--zc-blue-strong); color: #fff; background: var(--zc-blue-strong); transform: translateY(-1px); box-shadow: var(--zc-shadow-float); }
.btn:active { transform: translateY(1px); box-shadow: 0 2px 6px rgba(22,91,183,.16); }
.btn-red { border-color: var(--zc-danger); background: var(--zc-danger); box-shadow: 0 6px 14px rgba(239,79,99,.16); }
.btn-red:hover { border-color: #db334c; background: #db334c; }
.btn-secondary, .btn-ghost { border-color: var(--zc-line-strong); color: #55728f; background: #fff; box-shadow: none; }
.btn-secondary:hover, .btn-ghost:hover { border-color: #b9d6f2; color: var(--zc-blue); background: var(--zc-blue-soft); }
.btn-danger { border-color: #ffc4cd; color: var(--zc-danger); background: #fff; box-shadow: none; }
.btn-danger:hover { border-color: var(--zc-danger); color: var(--zc-danger); background: #fff0f2; }
.btn-sm { min-height: 28px; padding: 0 9px; font-size: 11px; }

.card { min-width: 0; margin-bottom: 16px; padding: 16px; overflow: hidden; border: 1px solid var(--zc-line); border-radius: var(--zc-radius-card); background: var(--zc-surface); box-shadow: var(--zc-shadow-card); }
.flash, .errors { margin-bottom: 16px; padding: 12px 14px; border-radius: var(--zc-radius-control); font-size: var(--zc-text-sm); }
.flash { border: 1px solid #bfeee6; color: #0c8c7c; background: var(--zc-teal-soft); }
.errors { border: 1px solid #ffc7d0; color: #cf334b; background: #fff2f4; }
.errors ul { margin: 6px 0 0; padding-left: 19px; }
.muted { color: var(--zc-muted); }

/* Tables */
.table-wrap { min-width: 0; overflow: auto; }
.table { width: 100%; min-width: 730px; border-collapse: collapse; border-spacing: 0; }
.table th, .table td { padding: 12px 12px; border-bottom: 1px solid var(--zc-line); vertical-align: middle; text-align: left; }
.table th { color: var(--zc-muted); background: #f8fbff; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.table td { color: #53657b; font-size: var(--zc-text-sm); }
.table td strong { color: #243850; font-weight: 800; }
.table tbody tr { transition: background .18s ease; }
.table tbody tr:hover { background: var(--zc-surface-blue); }
.table code { color: var(--zc-muted-2); font-size: 11px; overflow-wrap: anywhere; white-space: normal; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 0; border-radius: 99px; color: var(--zc-violet); background: var(--zc-violet-soft); font-size: 10px; font-weight: 800; line-height: 1.25; }
.badge { white-space: nowrap; }
.badge::before { width: 5px; height: 5px; content: ""; border-radius: 50%; background: currentColor; }
.badge.green { color: #0d9b88; background: var(--zc-teal-soft); }
.badge.red { color: #d83d51; background: #fff0f2; }

/* Forms */
.form-grid { display: grid; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.form-grid > * { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 7px; color: #30455d; font-size: var(--zc-text-sm); font-weight: 800; }
.field .hint { margin-top: 5px; color: var(--zc-muted-2); font-size: 11px; }
.input, .select, .textarea { display: block; width: 100%; padding: 8px 10px; border: 1px solid var(--zc-line-strong); border-radius: var(--zc-radius-control); color: var(--zc-ink); background: #fff; font: inherit; font-size: var(--zc-text-sm); line-height: 1.42; outline: none; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.input:hover, .select:hover, .textarea:hover { border-color: #a9c8e6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--zc-blue); background: #fff; box-shadow: 0 0 0 3px rgba(22,119,255,.13); }
.textarea { min-height: 130px; resize: vertical; }
.textarea.tall { min-height: 340px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.7; }
.checkbox { display: flex; align-items: center; gap: 8px; padding-top: 29px; color: #53657b; font-size: var(--zc-text-sm); }
.checkbox input { width: 16px; height: 16px; accent-color: var(--zc-blue); }
.filter { display: grid; min-width: 0; grid-template-columns: 2fr minmax(150px, 1fr) minmax(150px, 1fr) auto; gap: 9px; margin-bottom: 15px; padding: 11px; border: 1px solid var(--zc-line); border-radius: var(--zc-radius-control); background: var(--zc-surface-blue); }
.filter > * { min-width: 0; }

/* Media and pagination */
.media-grid { display: grid; min-width: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.media-grid > * { min-width: 0; }
.media-card { min-width: 0; padding: 10px; overflow: hidden; border: 1px solid var(--zc-line); border-radius: var(--zc-radius-card); background: #fff; box-shadow: var(--zc-shadow-card); transition: transform .18s ease, box-shadow .18s ease; }
.media-card:hover { transform: translateY(-2px); box-shadow: var(--zc-shadow-float); }
.media-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--zc-radius-control); background: var(--zc-surface-blue); }
.media-file-preview, .media-pdf-preview { position: relative; display: grid; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; place-items: center; border-radius: var(--zc-radius-control); background: #eef1f8; }
.media-pdf-preview { background: #fff; }
.media-pdf-preview iframe { width: 100%; height: 100%; border: 0; pointer-events: none; }
.media-pdf-preview span { position: absolute; top: 8px; left: 8px; padding: 3px 6px; border-radius: 4px; color: #fff; background: rgba(199, 35, 45, .92); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.media-card > strong { display: block; margin-top: 9px; overflow: hidden; color: #30455d; font-size: var(--zc-text-sm); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.media-card code { display: block; margin: 7px 0; overflow-wrap: anywhere; color: var(--zc-muted-2); font-size: 10px; }
.pagination-nav { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; }
.pagination { min-width: 0; display: flex; flex: 1 1 auto; align-items: center; flex-wrap: nowrap; gap: 4px; margin: 0; padding: 0; overflow-x: auto; list-style: none; }
.pagination li { display: flex; flex: 0 0 auto; align-items: center; }
.pagination li > * { min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border: 1px solid var(--zc-line-strong); border-radius: var(--zc-radius-control); color: #55728f; background: #fff; font-size: 11px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.pagination .active > *, .pagination [aria-current="page"] { border-color: var(--zc-blue); color: #fff; background: var(--zc-blue); box-shadow: 0 5px 12px rgba(22,119,255,.16); }
.pagination .disabled > * { cursor: default; color: #a8b4c2; background: #f5f7fb; }
.pagination-summary { flex: 0 0 auto; margin: 0; color: var(--zc-muted-2); font-size: 12px; white-space: nowrap; }
.bulk-bar { display: flex; gap: 8px; align-items: center; margin: 14px 0; }
.bulk-bar .select { width: auto; min-width: 160px; }
.publish-reminder { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 14px; padding: 12px 16px; color: #6d4b00; border: 1px solid #f1d58a; border-radius: var(--zc-radius-control); background: #fff9df; }
.publish-reminder a { color: var(--zc-blue); font-weight: 800; }
.autosave-status { margin-left: 10px; color: var(--zc-muted-2); font-size: 12px; }
.settings-group h2 { margin: 0 0 18px; padding-bottom: 13px; border-bottom: 1px solid var(--zc-line); color: #30455d; font-size: var(--zc-text-lg); font-weight: 800; }

/* Dashboard */
.dashboard-heading { margin-bottom: 17px; }
.dashboard-welcome { position: relative; min-height: 126px; display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 14px; overflow: hidden; border-color: #d8e9fb; background: linear-gradient(110deg, #fff 0%, #fff 59%, #eff7ff 100%); }
.dashboard-welcome::after { position: absolute; right: -46px; bottom: -115px; width: 270px; height: 270px; content: ""; opacity: .09; background: url("/zc-assets/workbench/compute-transparent.png") center / contain no-repeat; pointer-events: none; }
.dashboard-welcome > * { position: relative; z-index: 1; min-width: 0; }
.dashboard-welcome h2 { margin: 4px 0 5px; color: var(--zc-ink); font-size: 21px; font-weight: 800; letter-spacing: -.025em; }
.dashboard-welcome p { margin: 0; color: var(--zc-muted); }
.welcome-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.welcome-actions > a:not(.btn) { padding: 0 6px; color: var(--zc-blue); font-size: var(--zc-text-sm); font-weight: 800; white-space: nowrap; }
.welcome-actions b { font-size: 15px; }
.grid-stats { display: grid; min-width: 0; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.grid-stats > * { min-width: 0; }
.stat { min-width: 0; min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; overflow: hidden; border: 1px solid var(--zc-line); border-radius: var(--zc-radius-card); background: #fff; box-shadow: var(--zc-shadow-card); transition: transform .18s ease, box-shadow .18s ease; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--zc-shadow-float); }
.stat-link { color: inherit; text-decoration: none; cursor: pointer; }
.stat-link:hover { border-color: #b9d8fb; }
.stat-link:focus-visible { outline: 3px solid rgba(22,119,255,.2); outline-offset: 2px; }
.stat > div { min-width: 0; flex: 1; }
.stat-label, .stat small { display: block; overflow: hidden; color: var(--zc-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.stat strong { display: block; margin: 4px 0; color: var(--zc-ink); font-size: 28px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.stat-icon { width: 48px; height: 48px; display: grid; flex: 0 0 auto; place-items: center; overflow: visible; border-radius: 0; background: transparent; }
.stat-icon img { width: 44px; height: 44px; object-fit: contain; }
.dashboard-grid { display: grid; min-width: 0; grid-template-columns: minmax(0, 1.45fr) minmax(340px, .55fr); gap: 14px; align-items: start; }
.dashboard-grid > * { min-width: 0; }
.dashboard-card { margin: 0; padding: 0; }
.card-head { min-height: 61px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--zc-line); }
.card-head h2 { margin: 0 0 3px; color: #30455d; font-size: var(--zc-text-md); font-weight: 800; }
.card-head span { color: var(--zc-muted-2); font-size: 11px; }
.card-head > a { font-size: 11px; font-weight: 800; }
.dashboard-card .table-wrap { padding: 0 9px 9px; }
.dashboard-card .table { min-width: 0; table-layout: fixed; }
.dashboard-card .table th { border-top: 0; }
.dashboard-card:first-child .table th,
.dashboard-card:first-child .table td { white-space: nowrap; }
.dashboard-card:first-child .table td { overflow: hidden; text-overflow: ellipsis; }
.dashboard-card:first-child .table th:nth-child(1),
.dashboard-card:first-child .table td:nth-child(1) { width: 47%; }
.dashboard-card:first-child .table th:nth-child(2),
.dashboard-card:first-child .table td:nth-child(2) { width: 14%; }
.dashboard-card:first-child .table th:nth-child(3),
.dashboard-card:first-child .table td:nth-child(3) { width: 12%; }
.dashboard-card:first-child .table th:nth-child(4),
.dashboard-card:first-child .table td:nth-child(4) { width: 18%; }
.dashboard-card:first-child .table th:nth-child(5),
.dashboard-card:first-child .table td:nth-child(5) { width: 9%; }
.dashboard-card:first-child .table td:first-child strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Desktop workbench: keep controls and record cells on one line at 1440px. */
@media (min-width: 1121px) {
  .topbar,
  .topbar-location,
  .topbar .actions,
  .page-head,
  .page-head .actions,
  .welcome-actions,
  .actions { flex-wrap: nowrap; }

  .topbar-location,
  .topbar-location > *,
  .topbar .actions > *,
  .page-head > *,
  .page-head h1,
  .page-head p,
  .page-head .btn,
  .card-head,
  .card-head > *,
  .card-head h2,
  .card-head span,
  .card-head > a,
  .field label,
  .settings-group h2 { white-space: nowrap; }

  .page-head > div,
  .card-head > div { min-width: 0; }
  .page-head p,
  .card-head span { overflow: hidden; text-overflow: ellipsis; }

  .filter { grid-template-columns: minmax(220px, 2fr) minmax(160px, 1fr) minmax(160px, 1fr) max-content; }
  .filter .btn { white-space: nowrap; }

  .table { table-layout: auto; }
  .table th,
  .table td,
  .table td strong { white-space: nowrap; }
  .table td { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
  .table td .actions { min-width: max-content; }
  .table td code { max-width: 340px; display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
  .pagination-nav { max-width: 100%; }
  .pagination { max-width: 100%; padding-bottom: 2px; }
}

/* Publish and loading feedback */
.publish-status { min-width: 190px; }
.publish-status .badge { color: var(--zc-blue); background: var(--zc-blue-soft); }
.publish-status .badge::before { animation: zc-breathe 1.35s ease-in-out infinite; }
.is-loading, [aria-busy="true"] { position: relative; pointer-events: none; }
.is-loading::after, [aria-busy="true"]::after { width: 14px; height: 14px; display: inline-block; margin-left: 7px; border: 2px solid #cfe2fb; border-top-color: var(--zc-blue); border-radius: 50%; content: ""; animation: zc-spin .7s linear infinite; vertical-align: -2px; }
@keyframes zc-breathe { 50% { opacity: .4; transform: scale(.7); } }
@keyframes zc-spin { to { transform: rotate(360deg); } }

/* Theme management */
.theme-active-summary { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid var(--zc-line); border-radius: var(--zc-radius-control); background: #fff; color: var(--zc-muted); font-size: 12px; }
.theme-active-summary strong { min-width: 0; overflow: hidden; color: var(--zc-ink); text-overflow: ellipsis; white-space: nowrap; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.theme-grid > * { min-width: 0; }
.theme-card { display: flex; min-width: 0; min-height: 250px; flex-direction: column; margin: 0; padding: 20px; }
.theme-card-head { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 12px; }
.theme-card-head > div { min-width: 0; }
.theme-card h2, .theme-guide h2 { margin: 4px 0 0; color: var(--zc-ink); font-size: 19px; font-weight: 800; }
.theme-description { min-height: 38px; margin: 16px 0; color: var(--zc-muted); font-size: 13px; line-height: 1.6; }
.theme-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.theme-meta div { min-width: 0; padding: 9px 10px; border-radius: var(--zc-radius-control); background: var(--zc-canvas); }
.theme-meta dt { color: var(--zc-muted-2); font-size: 11px; }
.theme-meta dd { margin: 3px 0 0; overflow: hidden; color: var(--zc-ink); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.theme-actions { display: flex; min-width: 0; align-items: center; gap: 8px; margin-top: auto; padding-top: 17px; }
.theme-actions form { margin: 0; }
.theme-actions .btn { white-space: nowrap; }
.theme-hint { overflow: hidden; color: var(--zc-muted-2); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.theme-guide { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: 32px; margin-top: 16px; padding: 22px; }
.theme-guide > * { min-width: 0; }
.theme-guide p { margin: 10px 0 0; color: var(--zc-muted); font-size: 13px; line-height: 1.7; }
.theme-guide ol { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: theme-steps; }
.theme-guide li { position: relative; min-width: 0; padding: 11px 12px 11px 42px; border: 1px solid var(--zc-line); border-radius: var(--zc-radius-control); color: var(--zc-muted); font-size: 12px; line-height: 1.6; }
.theme-guide li::before { position: absolute; top: 10px; left: 11px; display: grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: var(--zc-blue-soft); color: var(--zc-blue); content: counter(theme-steps); counter-increment: theme-steps; font-size: 11px; font-weight: 800; }
.theme-guide code { font-size: 11px; }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 82% 5%, #e5f2ff 0, transparent 28%), var(--zc-canvas); }
.login-card { width: min(410px, 100%); padding: 30px; border: 1px solid var(--zc-line); border-radius: var(--zc-radius-card); background: #fff; box-shadow: var(--zc-shadow-float); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 27px; }
.login-brand > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #2d8cff, var(--zc-blue)); font-size: 15px; font-weight: 800; }
.login-brand strong { display: block; color: var(--zc-ink); font-size: 16px; font-weight: 800; }
.login-brand small { display: block; margin-top: 2px; color: var(--zc-muted-2); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.login-card h1 { margin: 0 0 5px; color: var(--zc-ink); font-size: var(--zc-text-xl); font-weight: 800; }
.login-card .field { margin: 18px 0; }
.login-card .btn { width: 100%; margin-top: 20px; }

@media (max-width: 1450px) {
  .content-wrap { padding-inline: 20px; }
  .topbar { padding-inline: 20px; }
  .grid-stats { gap: 10px; }
  .stat { padding: 10px; }
  .stat-icon { width: 42px; height: 42px; }
  .stat-icon img { width: 38px; height: 38px; }
}

@media (max-width: 1120px) {
  body { min-width: 0; }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; padding: 14px; border-right: 0; border-bottom: 1px solid var(--zc-line); }
  .brand { padding-bottom: 12px; }
  .sidebar nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nav-label { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-guide { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { position: relative; min-height: 54px; padding: 10px 16px; gap: 10px; }
  .topbar-user, .topbar-preview, .topbar-separator { display: none; }
  .content-wrap { padding: 20px 16px 42px; }
  .page-head, .dashboard-welcome { display: block; }
  .page-head .actions, .welcome-actions { margin-top: 14px; }
  .form-grid, .filter, .grid-stats { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .media-grid { grid-template-columns: 1fr; }
  .login-card { padding: 24px; }
}

/* Channel hierarchy: make the numbering rule visible at a glance. */
.channel-tree-table .channel-parent-row td { background: #f3f8ff; border-top: 2px solid #c9ddf7; }
.channel-tree-table .channel-parent-row td:nth-child(2) strong { color: #193f78; font-size: 14px; }
.channel-tree-table .channel-child-row td:nth-child(2) { padding-left: 24px; }
.channel-tree-table .channel-order { display: inline-flex; min-width: 52px; justify-content: center; padding: 4px 8px; border-radius: 999px; color: #2365b4; background: #eaf3ff; font-size: 12px; font-variant-numeric: tabular-nums; }
.channel-tree-table .channel-parent-row .channel-order { color: #fff; background: #2365b4; }

/* Image picker (shared component) — reuses existing field/input/btn tokens */
.picker-row { display: flex; align-items: stretch; gap: 8px; }
.picker-row .input { flex: 1 1 auto; }
.picker-row .btn { flex: 0 0 auto; }
.picker-actions { display: flex; gap: 8px; margin-top: 8px; }
.picker-preview { display: grid; gap: 7px; width: min(100%, 520px); margin-top: 10px; }
.picker-preview img { display: block; width: 100%; height: 240px; cursor: zoom-in; border: 1px solid var(--zc-line); border-radius: var(--zc-radius-control); background: var(--zc-surface-blue); object-fit: contain; }
.picker-preview-status { color: var(--zc-muted-2); font-size: 12px; }
.picker-preview.has-error .picker-preview-status { color: var(--zc-red); }
.picker-lightbox { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 48px; cursor: zoom-out; background: rgba(7, 18, 38, .82); }
.picker-lightbox img { max-width: min(1200px, 92vw); max-height: 88vh; border-radius: var(--zc-radius-control); box-shadow: var(--zc-shadow-float); object-fit: contain; }
.picker-lightbox button { position: fixed; top: 20px; right: 24px; width: 42px; height: 42px; cursor: pointer; color: #fff; font-size: 32px; line-height: 1; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; background: rgba(0,0,0,.25); }

/* Media library modal */
.picker-modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(20, 40, 66, .42); }
.picker-modal { width: min(880px, 100%); max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--zc-line-strong); border-radius: var(--zc-radius-card); background: #fff; box-shadow: var(--zc-shadow-float); }
.picker-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--zc-line); }
.picker-modal-head h3 { margin: 0; color: #30455d; font-size: var(--zc-text-md); font-weight: 800; }
.picker-modal-close { background: none; border: 0; cursor: pointer; color: var(--zc-muted); font-size: 22px; line-height: 1; }
.picker-modal-close:hover { color: var(--zc-ink); }
.picker-modal-body { padding: 14px 16px; overflow: auto; }
.picker-modal-body .media-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.picker-modal-body .media-card { cursor: pointer; }
.picker-modal-body .media-card.is-selected { border-color: var(--zc-blue); box-shadow: 0 0 0 3px rgba(22, 119, 255, .15); }
.picker-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--zc-line); }
.picker-modal-search { display: flex; gap: 8px; margin-bottom: 12px; }
.picker-loading { padding: 30px; text-align: center; color: var(--zc-muted-2); font-size: 13px; }

/* Visual article editor */
.rich-editor { overflow: hidden; border: 1px solid var(--zc-line-strong); border-radius: var(--zc-radius-control); background: #fff; }
.rich-toolbar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; padding: 9px; border-bottom: 1px solid var(--zc-line); background: #f8fbff; }
.rich-toolbar button, .rich-toolbar select { min-height: 34px; padding: 6px 10px; cursor: pointer; color: #34465f; font-size: 12px; border: 1px solid var(--zc-line); border-radius: 7px; background: #fff; }
.rich-toolbar button:hover { color: var(--zc-blue); border-color: #9ec7fa; background: var(--zc-blue-soft); }
.rich-surface, .rich-source { min-height: 520px; padding: 28px 34px; outline: 0; color: #273650; font-size: 16px; line-height: 1.85; }
.rich-surface:focus { box-shadow: inset 0 0 0 2px rgba(22,119,255,.12); }
.rich-surface img { max-width: 100%; height: auto; }
.rich-surface .rich-image-center { display: block; margin: 18px auto; }
.rich-surface .rich-image-left { float: left; margin: 8px 20px 14px 0; }
.rich-surface .rich-image-right { float: right; margin: 8px 0 14px 20px; }

.channel-tree-indent {
  display: inline-block;
  width: calc(var(--tree-depth, 0) * 22px);
  min-width: calc(var(--tree-depth, 0) * 22px);
  color: #8aa0be;
}

.channel-level-1 .channel-tree-indent { color: #7493b8; }
.channel-level-2 { background: linear-gradient(90deg, rgba(115, 91, 173, .055), transparent 42%); }
.channel-level-2 .channel-tree-indent { color: #7657ad; font-size: 15px; font-weight: 900; }
.channel-level-2 .channel-name { color: #5f4d8a; }
.channel-level-2 .channel-order { color: #674ea0; background: #f0ebfb; border-color: #d7caef; }
.channel-level-2 .channel-english { color: #8a79ad; }

.editor-media-status {
  margin: 10px 0;
  padding: 10px 12px;
  color: #a5282c;
  font-size: 13px;
  background: #fff2f2;
  border: 1px solid #ffd7d8;
  border-radius: 8px;
}

.editor-date-picker {
  position: relative;
}

.editor-date-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
}

.editor-date-control button {
  border: 1px solid #d7e0ed;
  border-left: 0;
  color: #255da9;
  background: #fff;
  cursor: pointer;
}

.editor-date-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, 90vw);
  padding: 16px;
  background: #fff;
  border: 1px solid #d7e0ed;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(21, 47, 81, .18);
}

.editor-date-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.editor-date-fields label {
  display: grid;
  gap: 6px;
  color: #566984;
  font-size: 12px;
}

.editor-date-shortcuts,
.editor-date-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.editor-date-shortcuts button {
  padding: 0;
  border: 0;
  color: #2670d7;
  background: transparent;
  cursor: pointer;
}

.editor-date-actions {
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid #edf1f7;
}
.rich-surface table { width: 100%; border-collapse: collapse; }
.rich-surface th, .rich-surface td { padding: 9px; border: 1px solid var(--zc-line-strong); }
.rich-editor.is-fullscreen { position: fixed; inset: 0; z-index: 1500; display: flex; flex-direction: column; border-radius: 0; }
.rich-editor.is-fullscreen .rich-surface, .rich-editor.is-fullscreen .rich-source { flex: 1; overflow: auto; }

/* Content editor — clean, visual and publishing-focused. */
.editor-page-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.editor-page-head h1 { display: inline; margin: 0 12px 0 0; color: var(--zc-ink); font-size: 24px; }
.editor-back { display: block; margin-bottom: 7px; color: var(--zc-muted); font-size: 12px; font-weight: 700; }
.editor-save-state { color: var(--zc-muted-2); font-size: 12px; }
.editor-head-actions { display: flex; align-items: center; gap: 8px; }
.editor-workspace { display: grid; grid-template-columns: minmax(620px, 1fr) 310px; gap: 16px; align-items: start; }
.editor-document { min-width: 0; margin: 0; padding: 0; overflow: visible; }
.editor-title-input { width: 100%; padding: 30px 38px 15px; border: 0; color: #17223b; background: #fff; outline: 0; font-size: 30px; font-weight: 800; line-height: 1.35; }
.editor-title-input::placeholder { color: #a7b3c4; }
.editor-title-meta { display: flex; gap: 12px; padding: 0 38px 21px; color: var(--zc-muted-2); font-size: 12px; }
.editor-title-meta span:first-child { color: var(--zc-blue); font-weight: 800; }
.wechat-editor { position: relative; border-top: 1px solid var(--zc-line); background: #f4f7fb; }
.wechat-toolbar { position: sticky; top: 60px; z-index: 8; display: flex; align-items: center; flex-wrap: wrap; gap: 0; padding: 8px 12px; border-bottom: 1px solid var(--zc-line); background: rgba(255,255,255,.97); box-shadow: 0 4px 14px rgba(38,73,113,.05); backdrop-filter: blur(10px); }
.toolbar-group { display: flex; align-items: center; gap: 3px; padding: 0 7px; border-right: 1px solid var(--zc-line); }
.toolbar-group:first-child { padding-left: 0; }
.toolbar-group:last-child { margin-left: auto; padding-right: 0; border: 0; }
.wechat-toolbar button, .wechat-toolbar select { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 8px; border: 0; border-radius: 6px; color: #4f6279; background: transparent; cursor: pointer; font: inherit; font-size: 13px; }
.wechat-toolbar select { width: 96px; border: 1px solid transparent; }
.wechat-toolbar button:hover, .wechat-toolbar button.is-active, .wechat-toolbar select:hover { color: var(--zc-blue); background: var(--zc-blue-soft); }
.wechat-toolbar button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.table-tools[hidden] { display: none; }
.table-tools button { min-width: auto; padding-inline: 7px; font-size: 11px; }
.editor-mount { padding: 22px 34px 38px; }
.article-canvas { min-height: 720px; padding: 42px 58px 80px; border: 1px solid #e2e8f1; background: #fff; box-shadow: 0 6px 24px rgba(37,68,108,.06); color: #26374e; outline: 0; font-size: 16px; line-height: 1.95; }
.article-canvas > *:first-child { margin-top: 0; }
.article-canvas p.is-editor-empty:first-child::before { float: left; height: 0; color: #a7b3c4; content: attr(data-placeholder); pointer-events: none; }
.article-canvas h2 { margin: 1.6em 0 .7em; color: #17223b; font-size: 24px; }
.article-canvas h3 { margin: 1.5em 0 .6em; color: #26374e; font-size: 20px; }
.article-canvas blockquote { margin: 1.4em 0; padding: 14px 20px; border-left: 4px solid #e22c3b; color: #53657b; background: #f7f9fc; }
.article-canvas ul, .article-canvas ol { padding-left: 1.7em; }
.article-canvas a { color: var(--zc-blue); text-decoration: underline; }
.article-canvas img { max-width: 100%; height: auto; cursor: pointer; border-radius: 2px; }
.article-canvas img.ProseMirror-selectednode { outline: 3px solid rgba(22,119,255,.32); }
.article-canvas video { display: block; width: min(100%, 880px); max-height: 68vh; margin: 24px auto; background: #0b153f; object-fit: contain; }
.article-canvas video.ProseMirror-selectednode { outline: 3px solid rgba(22,119,255,.32); }
.article-canvas .rich-image-center { display: block; margin: 22px auto; }
.article-canvas .rich-image-left { display: block; margin: 22px auto 22px 0; }
.article-canvas .rich-image-right { display: block; margin: 22px 0 22px auto; }
.article-canvas table { width: 100%; margin: 22px 0; border-collapse: collapse; table-layout: fixed; }
.article-canvas th, .article-canvas td { min-width: 1em; padding: 10px 12px; border: 1px solid #ced8e6; vertical-align: top; }
.article-canvas th { background: #f3f7fc; }
.article-canvas .selectedCell::after { position: absolute; inset: 0; content: ''; background: rgba(22,119,255,.1); pointer-events: none; }
.image-context-panel { position: sticky; top: 111px; z-index: 7; display: flex; align-items: center; gap: 7px; padding: 8px 16px; border-bottom: 1px solid #bad6fa; background: #edf6ff; color: #405775; font-size: 12px; }
.image-context-panel[hidden] { display: none; }
.image-context-panel button { padding: 5px 9px; border: 1px solid #bad6fa; border-radius: 5px; color: #365678; background: #fff; cursor: pointer; }
.image-context-panel label { display: flex; align-items: center; gap: 6px; }
.image-context-panel input { width: 180px; padding: 5px 8px; border: 1px solid #bad6fa; border-radius: 5px; }
.image-context-panel .danger { margin-left: auto; color: #cf3043; }
.editor-settings { position: sticky; top: 76px; display: grid; gap: 12px; }
.editor-setting-card { margin: 0; padding: 17px; }
.editor-setting-card h2 { margin: 0 0 15px; color: #30455d; font-size: 15px; }
.editor-setting-card .field { margin-top: 13px; }
.editor-setting-card .field:first-of-type { margin-top: 0; }
.editor-top-check { padding-top: 14px; }
.editor-cover-card .image-picker > label, .editor-cover-card .picker-row .input { display: none; }
.editor-cover-card .picker-row { justify-content: flex-start; }
.editor-cover-card .picker-preview { width: 100%; margin-top: 12px; }
.editor-cover-card .picker-preview img { height: 145px; object-fit: cover; }
.setting-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.setting-card-head h2 { margin: 0; }
.setting-card-head button { border: 0; color: var(--zc-blue); background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; }
.editor-summary { min-height: 104px; margin-top: 13px; }
.advanced-settings > summary, .revision-drawer > summary { cursor: pointer; color: #30455d; font-size: 14px; font-weight: 800; }
.advanced-settings > summary::marker, .revision-drawer > summary::marker { color: var(--zc-blue); }
.advanced-body { display: grid; gap: 13px; margin-top: 17px; }
.type-extra { padding: 24px 38px; border-top: 1px solid var(--zc-line); }
.type-extra[hidden] { display: none; }
.type-extra h2 { margin: 0 0 5px; color: #30455d; font-size: 18px; }
.type-extra > p { margin: 0 0 15px; color: var(--zc-muted); font-size: 12px; }
.type-extra .image-picker > label, .type-extra .textarea { display: none; }
.revision-drawer { margin-top: 16px; }
.revision-drawer summary span { margin-left: 8px; color: var(--zc-muted-2); font-size: 12px; font-weight: 500; }
.revision-drawer .table-wrap { margin-top: 16px; }
.wechat-editor.is-fullscreen { position: fixed; inset: 0; z-index: 1500; display: flex; flex-direction: column; overflow: hidden; }
.wechat-editor.is-fullscreen .wechat-toolbar { top: 0; }
.wechat-editor.is-fullscreen .editor-mount { flex: 1; overflow: auto; }
.wechat-editor.is-fullscreen .article-canvas { width: min(920px, calc(100% - 40px)); min-height: calc(100vh - 110px); margin: 0 auto; }
.editor-fullscreen-open { overflow: hidden; }
.editor-dialog-backdrop { position: fixed; inset: 0; z-index: 1700; display: grid; place-items: center; padding: 24px; background: rgba(13,31,55,.48); }
.editor-dialog { width: min(880px, 96vw); max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 22px 70px rgba(8,26,52,.28); }
.editor-dialog header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--zc-line); }
.editor-dialog h3 { margin: 0; color: #26374e; font-size: 17px; }
.editor-dialog header button { border: 0; color: var(--zc-muted); background: transparent; cursor: pointer; font-size: 25px; }
.editor-dialog-body { padding: 18px 20px; overflow: auto; }
.editor-dialog-body > label { display: grid; gap: 7px; color: #405775; font-size: 12px; font-weight: 800; }
.editor-dialog footer { display: flex; justify-content: flex-end; padding: 13px 20px; border-top: 1px solid var(--zc-line); }
.editor-media-actions { display: flex; gap: 10px; margin-bottom: 14px; }
.editor-media-actions .input { flex: 1; }
.editor-media-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.editor-media-grid .media-card { cursor: pointer; text-align: left; }
.editor-media-grid .media-card video, .media-card > video { width: 100%; aspect-ratio: 16 / 9; background: #101936; object-fit: contain; }
.editor-media-hint { margin: -4px 0 14px; color: var(--zc-muted-2); font-size: 12px; }
.media-detail-video { width: min(100%, 900px); margin-bottom: 18px; }
.media-detail-video video { display: block; width: 100%; max-height: 68vh; background: #101936; }
.media-detail-pdf { width: min(100%, 1100px); height: min(68vh, 860px); min-height: 540px; overflow: hidden; border: 1px solid var(--zc-line); border-radius: var(--zc-radius-control); background: #fff; }
.media-detail-pdf iframe { display: block; width: 100%; height: 100%; border: 0; }

@media (max-width: 1250px) {
  .editor-workspace { grid-template-columns: 1fr; }
  .editor-settings { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .advanced-settings { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .editor-page-head { display: block; }
  .editor-head-actions { margin-top: 14px; }
  .editor-settings { grid-template-columns: 1fr; }
  .editor-title-input { padding-inline: 22px; font-size: 24px; }
  .editor-title-meta { padding-inline: 22px; }
  .editor-mount { padding: 12px; }
  .article-canvas { min-height: 580px; padding: 26px 22px 50px; }
  .wechat-toolbar { top: 0; }
  .editor-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
