:root {
  --canvas: #edf3f0;
  --accent: #ee3f4d;
  --ink: #2d3532;
  --light: rgba(255, 255, 255, 0.92);
  --shade: rgba(45, 53, 50, 0.18);
  --raised: -8px -8px 18px rgba(255, 255, 255, 0.92), 8px 8px 18px rgba(45, 53, 50, 0.18);
  --pressed: inset -4px -4px 9px rgba(255, 255, 255, 0.88), inset 4px 4px 9px rgba(45, 53, 50, 0.16);
  --radius: 18px;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: var(--canvas); color: var(--ink); }
body.dialog-open, body:has(dialog[open]) { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 12px 16px; background: var(--ink); color: var(--canvas); border-radius: 10px; }
.skip-link:focus { top: 16px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 1.6px; }
.brand-mark { display: block; width: 70px; height: 70px; border-radius: 22px; box-shadow: var(--raised); }
.brand-mark-small { width: 46px; height: 46px; border-radius: 15px; box-shadow: -5px -5px 12px var(--light), 5px 5px 12px var(--shade); }
.login-view { min-height: 100vh; display: grid; align-content: center; grid-template-columns: minmax(280px, 420px); justify-content: center; gap: 28px; padding: 48px 24px; }
.login-copy h1 { margin: 0; font-size: clamp(30px, 5vw, 50px); line-height: 1.12; letter-spacing: 0; }
.login-copy p:last-child { margin: 14px 0 0; opacity: .72; }
.login-form { padding: 30px; border-radius: 24px; box-shadow: var(--raised); }
.field { display: grid; gap: 9px; margin-bottom: 20px; }
.field label { font-size: 14px; font-weight: 700; }
.field input, .field select, .field textarea, .toolbar input, .toolbar select { width: 100%; border: 0; border-radius: 13px; background: var(--canvas); padding: 13px 15px; box-shadow: var(--pressed); }
.form-error { min-height: 22px; margin: 0 0 12px; color: var(--accent); font-size: 14px; }
.button, .login-form button, .page-actions button, .dialog-actions button { min-height: 44px; border-radius: 14px; padding: 0 18px; background: var(--canvas); box-shadow: var(--raised); font-weight: 750; }
.button-primary { color: var(--canvas); background: var(--accent) !important; box-shadow: -5px -5px 12px var(--light), 6px 6px 13px var(--shade) !important; }
.button:active, .login-form button:active, .page-actions button:active { box-shadow: var(--pressed); transform: translateY(1px); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 268px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px 22px; display: flex; flex-direction: column; background: var(--canvas); box-shadow: 10px 0 24px rgba(45, 53, 50, .08); z-index: 20; }
.sidebar-brand { display: flex; align-items: center; gap: 14px; padding: 0 8px 30px; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand small { margin-top: 3px; opacity: .58; }
#admin-navigation { display: grid; min-height: 0; gap: 6px; padding: 4px 7px 18px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.nav-group { display: grid; gap: 3px; }
.nav-disclosure, .nav-leaf { position: relative; width: 100%; min-height: 44px; border-radius: 13px; background: transparent; text-align: left; }
.nav-disclosure { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 11px; font-weight: 780; }
.nav-disclosure:hover, .nav-leaf:hover { box-shadow: -3px -3px 8px var(--light), 3px 3px 8px var(--shade); }
.nav-disclosure:active, .nav-leaf:active { box-shadow: var(--pressed); }
.nav-children { display: grid; gap: 3px; min-width: 0; }
.nav-zone-list { padding: 3px 0 7px 10px; }
.nav-system-list { padding: 2px 0 7px 14px; }
.nav-zone { min-width: 0; }
.nav-zone-toggle { padding-left: 12px; font-weight: 700; }
.nav-module-list { margin: 1px 0 5px 13px; padding-left: 10px; border-left: 1px solid rgba(45, 53, 50, .18); }
.nav-leaf { display: flex; align-items: center; padding: 0 12px; overflow-wrap: anywhere; font-size: 14px; }
.nav-root-leaf { min-height: 46px; font-size: 15px; font-weight: 780; }
.nav-leaf[aria-current="page"] { color: var(--accent); box-shadow: var(--pressed); font-weight: 800; }
.nav-leaf[aria-current="page"]::after { content: ""; position: absolute; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.nav-chevron { flex: 0 0 auto; width: 8px; height: 8px; margin-right: 3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .18s ease; }
.nav-disclosure[aria-expanded="true"] .nav-chevron { transform: rotate(225deg) translate(-1px, -1px); }
.nav-zone.is-disabled { opacity: .48; }
.nav-zone.is-disabled .nav-disclosure { cursor: not-allowed; }
.nav-zone-status { display: block; padding: 0 12px 8px; font-size: 12px; }
.nav-empty { margin: 6px 12px 10px; font-size: 13px; opacity: .62; }
.quiet-action { margin-top: auto; min-height: 44px; background: transparent; opacity: .72; }
.mobile-header { display: none; }
main { min-width: 0; padding: 46px clamp(28px, 5vw, 72px) 64px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 38px; }
.page-header h1 { margin: 0; font-size: 32px; letter-spacing: 0; }
.page-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.status-region { min-height: 24px; margin-bottom: 10px; color: var(--accent); font-weight: 700; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.summary { min-height: 142px; padding: 24px; border-radius: var(--radius); box-shadow: var(--raised); }
.summary strong { display: block; margin-top: 18px; font-size: 32px; }
.summary span { opacity: .68; }
.summary-name { overflow-wrap: anywhere; font-size: 20px !important; }
.zone-overview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.zone-overview-heading h2 { margin: 0 0 8px; font-size: 24px; }
.zone-overview-heading p { margin: 0; opacity: .64; }
.zone-overview-heading > strong { max-width: 42%; overflow-wrap: anywhere; text-align: right; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 44px 0 14px; }
.section-heading h2 { margin: 0; font-size: 19px; }
.flat-list { border-top: 1px solid rgba(45, 53, 50, .16); }
.list-row { display: grid; grid-template-columns: minmax(160px, 1.5fr) repeat(2, minmax(110px, .7fr)) auto; align-items: center; gap: 18px; min-height: 68px; padding: 12px 4px; border-bottom: 1px solid rgba(45, 53, 50, .14); }
.list-row.sortable-row { grid-template-columns: 48px minmax(160px, 1fr) minmax(110px, .7fr) auto; }
.list-row strong, .list-row small { display: block; overflow-wrap: anywhere; }
.list-row.is-selected { box-shadow: var(--pressed); border-radius: 14px; padding-inline: 14px; }
.list-row small { margin-top: 4px; opacity: .62; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.row-actions button { min-height: 36px; padding: 0 12px; border-radius: 11px; background: var(--canvas); box-shadow: -3px -3px 8px var(--light), 3px 3px 8px var(--shade); }
.toolbar { display: grid; grid-template-columns: minmax(200px, 1fr) 180px 180px; gap: 14px; margin-bottom: 18px; }
.zone-switcher { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.zone-switcher label { font-weight: 700; }
.zone-switcher select { min-height: 44px; min-width: 180px; border: 0; border-radius: 13px; background: var(--canvas); padding: 0 14px; box-shadow: var(--pressed); }
.split-workspace { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 32px; align-items: start; }
.split-workspace > * { min-width: 0; }
.editor { position: sticky; top: 36px; min-width: 0; padding: 24px; border-radius: var(--radius); box-shadow: var(--raised); }
.editor h2 { margin: 0 0 24px; }
.editor-form { position: static; width: 100%; padding: 0; box-shadow: none; }
.settings-stack { display: grid; min-width: 0; gap: 28px; }
.settings-stack .editor { position: static; }
.editor fieldset { margin: 0 0 24px; padding: 0; border: 0; }
.editor legend { margin-bottom: 12px; font-weight: 700; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.empty-state { padding: 72px 24px; text-align: center; border-top: 1px solid rgba(45, 53, 50, .14); border-bottom: 1px solid rgba(45, 53, 50, .14); }
.empty-state p { opacity: .66; }
dialog { width: min(440px, calc(100vw - 32px)); border: 0; border-radius: 20px; padding: 0; color: var(--ink); background: var(--canvas); box-shadow: var(--raised); }
dialog::backdrop { background: rgba(45, 53, 50, .28); }
dialog form { padding: 26px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
#editor-dialog { --dialog-inset: 36px; width: min(840px, calc(100vw - 64px)); max-height: min(860px, calc(100dvh - 64px)); overflow: hidden; }
.editor-dialog-shell { display: flex; flex-direction: column; max-height: min(860px, calc(100dvh - 64px)); }
.editor-dialog-header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 84px; padding: 20px var(--dialog-inset); border-bottom: 1px solid rgba(45, 53, 50, .14); }
.editor-dialog-header h2 { margin: 0; font-size: 22px; }
.dialog-close { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 13px; background: var(--canvas); box-shadow: -4px -4px 10px var(--light), 4px 4px 10px var(--shade); font-size: 26px; line-height: 1; }
.dialog-close:active { box-shadow: var(--pressed); }
.editor-dialog-body { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.editor-dialog-body .editor-form { flex: 0 1 auto; min-height: 0; max-height: min(690px, calc(100dvh - 227px)); margin: 0; padding: 32px var(--dialog-inset) 40px; overflow-y: auto; overscroll-behavior: contain; }
.editor-dialog-body > .dialog-actions { flex: 0 0 auto; z-index: 2; margin: 0; padding: 20px var(--dialog-inset) 28px; background: var(--canvas); border-top: 1px solid rgba(45, 53, 50, .12); }
.form-section { display: grid; gap: 22px; margin: 0; padding: 0; border: 0; }
.form-section + .form-section { margin-top: 38px; padding-top: 34px; border-top: 1px solid rgba(45, 53, 50, .14); }
.form-section .field { margin: 0; }
.form-section-title { margin: 0 0 2px; padding: 0; font-size: 16px; font-weight: 800; }
.field-hint { margin-top: 2px; opacity: .64; }
.category-note, .category-row, .account-action-row { display: grid; align-items: center; gap: 16px; border-bottom: 1px solid rgba(45, 53, 50, .14); }
.category-note { grid-template-columns: minmax(0, 1fr) auto; min-height: 64px; }
.category-note span { opacity: .62; font-size: 13px; }
.category-list { border-top: 1px solid rgba(45, 53, 50, .14); }
.category-row { grid-template-columns: 48px minmax(160px, 1fr) 88px; padding: 18px 10px; }
.category-row .field { margin: 0; }
.category-status { align-self: center; }
.category-create { min-inline-size: 0; }
.sort-handle { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--canvas); box-shadow: -4px -4px 10px var(--light), 4px 4px 10px var(--shade); cursor: grab; touch-action: none; }
.sort-handle:active { cursor: grabbing; box-shadow: var(--pressed); }
.sort-grip { display: grid; grid-template-columns: repeat(2, 4px); gap: 4px; }
.sort-grip i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .62; }
.sortable-row { position: relative; transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease; }
.sortable-row.is-dragging, .sortable-drag-preview { border-radius: 16px; opacity: .97; box-shadow: -12px -12px 26px var(--light), 16px 18px 32px rgba(45, 53, 50, .28); }
.sortable-placeholder { min-height: 68px; border-color: transparent; border-radius: 16px; box-shadow: var(--pressed); transition: none; }
.sortable-placeholder > * { visibility: hidden; }
.sortable-placeholder::before { content: ""; position: absolute; z-index: 4; top: -5px; left: 10px; right: 10px; height: 5px; border-radius: 5px; background: var(--accent); box-shadow: 0 0 0 6px rgba(238, 63, 77, .13); animation: sort-rail-pulse .72s ease-in-out infinite alternate; }
.sortable-drag-preview { position: fixed; z-index: 100; box-sizing: border-box; margin: 0; pointer-events: none; transform-origin: center; will-change: transform; }
.sortable-drag-preview .sort-handle { color: var(--accent); cursor: grabbing; box-shadow: var(--pressed); }
.sort-preview-position { position: absolute; z-index: 2; top: -10px; right: -8px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: var(--canvas); background: var(--accent); box-shadow: 0 6px 14px rgba(238, 63, 77, .27); font-size: 12px; font-weight: 900; }
.sortable-row.is-landing { animation: sort-land .46s cubic-bezier(.16, 1, .3, 1); }
.sortable-list.is-settling .sort-handle { pointer-events: none; }
.sortable-list[aria-busy="true"] .sort-handle { cursor: wait; opacity: .48; pointer-events: none; }
.sort-status { min-height: 20px; margin: 8px 0 0; color: var(--accent); font-size: 13px; font-weight: 700; }
.account-action-list { margin-top: 34px; border-top: 1px solid rgba(45, 53, 50, .14); }
.account-action-row { grid-template-columns: minmax(0, 1fr) auto; min-height: 78px; padding: 12px 4px; }
.account-action-row strong, .account-action-row small { display: block; }
.account-action-row small { margin-top: 5px; opacity: .62; }
.account-action-row button { min-height: 40px; padding: 0 14px; border-radius: 12px; background: var(--canvas); box-shadow: -3px -3px 8px var(--light), 3px 3px 8px var(--shade); font-weight: 750; }
.account-action-row button:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; }
[hidden] { display: none !important; }

@keyframes sort-rail-pulse {
  to { box-shadow: 0 0 0 8px rgba(238, 63, 77, .18); }
}
@keyframes sort-land {
  0% { transform: scale(1.035); }
  48% { transform: scale(.982); box-shadow: var(--pressed); }
  100% { transform: scale(1); }
}

@media (max-width: 980px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .split-workspace { grid-template-columns: 1fr; }
  .editor { position: static; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(292px, 84vw); overflow: hidden; transform: translateX(-110%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  #admin-navigation { flex: 1 1 auto; max-height: none; padding-bottom: 24px; }
  .mobile-header { position: sticky; top: 0; z-index: 15; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; min-height: 64px; padding: 8px 14px; background: var(--canvas); box-shadow: 0 8px 20px rgba(45, 53, 50, .08); text-align: center; }
  .icon-button { width: 44px; height: 44px; border-radius: 14px; background: var(--canvas); box-shadow: var(--raised); font-size: 23px; }
  .icon-button { display: grid; align-content: center; justify-items: center; gap: 4px; }
  .menu-line { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
  main { width: 100%; overflow-x: hidden; padding: 24px 18px 52px; }
  .page-header { display: block; margin-bottom: 26px; }
  .page-header h1 { font-size: 27px; }
  .page-actions { max-width: none; justify-content: flex-start; margin-top: 16px; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .summary { min-height: 118px; padding: 18px; }
  .summary strong { font-size: 26px; }
  .toolbar { grid-template-columns: 1fr; }
  .toolbar > :first-child { grid-column: auto; }
  .list-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 16px 2px; }
  .list-row > :nth-child(2), .list-row > :nth-child(3) { grid-column: 1; font-size: 13px; }
  .row-actions { grid-column: 1; grid-row: auto; justify-content: flex-start; flex-direction: row; }
  .editor { width: 100%; padding: 20px 16px; }
  .editor-form { padding: 0; }
  .zone-overview-heading { display: grid; gap: 10px; margin-bottom: 26px; }
  .zone-overview-heading > strong { max-width: none; text-align: left; }
  #editor-dialog { --dialog-inset: 20px; width: calc(100vw - 24px); height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); border-radius: 18px; }
  .editor-dialog-shell { height: 100%; max-height: none; }
  .editor-dialog-header { min-height: 72px; padding: 14px var(--dialog-inset); }
  .editor-dialog-header h2 { font-size: 19px; }
  .editor-dialog-body .editor-form { max-height: calc(100dvh - 174px); padding: 26px var(--dialog-inset) 34px; }
  .editor-dialog-body > .dialog-actions { padding: 16px var(--dialog-inset) 20px; }
  .form-section { gap: 20px; }
  .form-section + .form-section { margin-top: 32px; padding-top: 28px; }
  .list-row.sortable-row { grid-template-columns: 44px minmax(0, 1fr) auto; column-gap: 12px; }
  .list-row.sortable-row > :nth-child(2) { grid-column: 2; grid-row: 1; }
  .list-row.sortable-row > :nth-child(3) { grid-column: 2; grid-row: 2; }
  .list-row.sortable-row .row-actions { grid-column: 3; grid-row: 1 / span 2; }
  .category-row { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding-inline: 4px; }
  .category-status { grid-column: 2; }
  .dialog-actions { flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .summary-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .sortable-drag-preview { will-change: auto; }
  .sortable-row.is-landing { animation: none; }
}
