/* 臻帝榴运营后台 V2：只覆盖视觉与通用交互，不改变既有业务钩子。 */
:root {
  --accent:#f7c63d;
  --accent-strong:#5f4300;
  --accent-soft:#fff6d6;
  --ink:#191b1f;
  --muted:#6f747d;
  --muted-strong:#50555e;
  --line:#e2e4e8;
  --line-strong:#d1d4d9;
  --surface:#ffffff;
  --surface-subtle:#f8f8f7;
  --canvas:#f2f3f4;
  --sidebar:#1a1b1e;
  --sidebar-hover:#292b30;
  --sidebar-muted:#9a9da5;
  --success:#23734a;
  --success-soft:#e8f4ed;
  --warning:#8b6108;
  --warning-soft:#fbf1d6;
  --danger:#b43b42;
  --danger-soft:#fae9ea;
  --focus:rgba(247,198,61,.25);
  --shadow-sm:0 2px 8px rgba(20,22,26,.05);
  --shadow-md:0 12px 34px rgba(20,22,26,.12);
  --sidebar-width:248px;
}

* { letter-spacing:0 !important; }
html { scrollbar-color:#b8bbc1 var(--canvas); scrollbar-width:thin; }
body { font-family:"PingFang SC","Microsoft YaHei UI","Microsoft YaHei",system-ui,sans-serif; font-size:14px; line-height:1.5; background:var(--canvas); }
::selection { color:#17130a; background:#ead087; }
::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-track { background:var(--canvas); }
::-webkit-scrollbar-thumb { border:3px solid var(--canvas); border-radius:8px; background:#b8bbc1; }
::-webkit-scrollbar-thumb:hover { background:#93979f; }

button,input,select,textarea { min-width:0; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
input,select,textarea { margin-top:7px; border:1px solid var(--line-strong); border-radius:6px; background:var(--surface); padding:10px 12px; color:var(--ink); transition:border-color .16s ease,box-shadow .16s ease,background .16s ease; }
input[type="checkbox"],input[type="radio"] { accent-color:var(--accent); }
input::placeholder,textarea::placeholder { color:#969aa2; }
input:hover,select:hover,textarea:hover { border-color:#b6bac1; }
input:focus,select:focus,textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--focus); }
button { transition:background-color .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease; }
button:active:not(:disabled) { transform:translateY(1px); }
button:disabled { cursor:not-allowed; opacity:.48; }

.primary,.secondary,.danger,.danger-button,.text-button { min-height:38px; border-radius:6px; padding:8px 14px; font-size:13px; font-weight:650; }
.primary { border:1px solid var(--accent); color:#17130a; background:var(--accent); box-shadow:0 2px 7px rgba(138,99,8,.13); }
.primary:hover { border-color:#ffd25c; background:#ffd25c; box-shadow:0 4px 12px rgba(138,99,8,.17); }
.secondary { border:1px solid var(--line-strong); color:#30343a; background:var(--surface); }
.secondary:hover { border-color:#aeb2b8; color:#15171a; background:var(--surface-subtle); }
.danger,.danger-button { border:1px solid var(--danger); color:#fff; background:var(--danger); }
.danger:hover,.danger-button:hover { border-color:#9f2d34; background:#9f2d34; }
.text-button { min-height:32px; color:var(--accent-strong); background:transparent; }
.text-button:hover { color:#2f2200; background:var(--accent-soft); }
.danger-text { color:var(--danger) !important; }
.danger-text:hover { background:var(--danger-soft); }

/* 登录 */
.login-screen { position:relative; isolation:isolate; overflow:hidden; padding:32px; background:#120f17; }
.login-rings { position:absolute; inset:0; z-index:0; }
.login-rings canvas { width:100%; height:100%; display:block; }
.login-panel { --login-accent:#f7c63d; position:relative; z-index:1; isolation:isolate; width:min(368px,100%); min-height:508px; display:flex; flex-direction:column; justify-content:center; padding:42px 40px 48px; overflow:visible; border:2px solid transparent; border-radius:10px; color:#fff; background:linear-gradient(#161616,#161616) padding-box,linear-gradient(163deg,#ff00ff 0%,#3700ff 100%) border-box; box-shadow:0 22px 66px rgba(0,0,0,.62); transition:box-shadow .25s cubic-bezier(0,0,0,1); }
.login-panel:hover { box-shadow:0 22px 66px rgba(0,0,0,.62),0 0 30px 1px rgba(204,0,255,.3); }
.login-panel::before { content:""; position:absolute; inset:0; z-index:-1; border-radius:inherit; background:linear-gradient(180deg,rgba(255,255,255,.035),transparent 30%); pointer-events:none; }
.login-panel .brand-mark { width:100%; height:52px; margin:0 0 26px; overflow:visible; border:0; border-radius:0; background:transparent; }
.login-panel .brand-mark img { width:100%; height:100%; padding:0; object-fit:contain; filter:brightness(0) invert(1); }
.login-panel h1 { margin:0; color:var(--login-accent); font-size:32px; font-weight:720; line-height:1.1; text-align:center; }
.login-panel p { margin:10px 0 32px; color:#f0f0f0; font-size:15px; text-align:center; }
.login-panel label { color:#bcbcbc; font-size:12px; font-weight:600; }
.login-panel label+label { margin-top:15px; }
.login-panel label>span { display:block; margin:0 0 7px 2px; }
.login-panel input { height:44px; margin:0; border:1px solid #dedede; border-radius:8px; color:var(--login-accent); background:transparent; caret-color:var(--login-accent); box-shadow:none; }
.login-panel input::placeholder { color:#737373; }
.login-panel input:hover { border-color:#fff; }
.login-panel input:focus { border-color:var(--login-accent); box-shadow:0 0 0 3px rgba(247,198,61,.12); }
.login-panel .primary { min-height:44px; margin-top:20px; border:1px solid var(--login-accent); border-radius:8px; color:var(--login-accent); background:transparent; box-shadow:none; }
.login-panel .primary:hover { color:#161616; background:var(--login-accent); box-shadow:0 7px 22px rgba(247,198,61,.18); }
.login-panel .form-error { min-height:19px; margin:8px 0 0; color:#ff7c7c; font-size:12px; text-align:center; }
.login-filing { position:absolute; right:0; bottom:max(14px,env(safe-area-inset-bottom)); left:0; z-index:1; text-align:center; }
.login-filing a { color:rgba(255,255,255,.58); font-size:12px; text-decoration:none; }
.login-filing a:hover { color:#fff; text-decoration:underline; }
.brand-transition { position:fixed; inset:0; z-index:1000; display:grid; place-items:center; overflow:hidden; background:#000; }
.brand-transition-stage { position:relative; width:min(52vw,560px); aspect-ratio:960/190; }
.brand-transition-logo { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; transform-origin:center; backface-visibility:hidden; will-change:transform,opacity; }

/* 固定后台框架 */
.sidebar { width:var(--sidebar-width); padding:18px 14px 14px; color:#fff; border:0; background:var(--sidebar); box-shadow:5px 0 22px rgba(10,11,13,.08); }
.sidebar-brand { flex-direction:row; align-items:center; gap:12px; min-height:66px; padding:0 8px 18px; border-color:#303238; }
.sidebar-brand>span { width:74px; height:42px; flex:0 0 auto; border:0; border-radius:0; background:transparent; }
.sidebar-brand>span img { padding:3px; }
.sidebar-brand>div { min-width:0; }
.sidebar-brand strong { overflow:hidden; color:#f2f2f1; font-size:14px; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
.sidebar-brand small { color:var(--sidebar-muted); font-size:10px; }
.sidebar nav { min-height:0; padding:16px 0 8px; overflow-y:auto; }
.sidebar nav::before { content:"运营工作台"; display:block; padding:0 12px 8px; color:#777b84; font-size:10px; font-weight:700; }
.sidebar nav button,.logout { min-height:42px; gap:11px; margin:2px 0; padding:10px 12px; border-radius:6px; color:#b5b8bf; font-size:13px; font-weight:550; }
.sidebar nav button span { width:22px; display:grid; place-items:center; color:#858991; font-size:16px; }
.sidebar nav button:hover { color:#f2f2f1; background:var(--sidebar-hover); }
.sidebar nav button:hover span { color:#d3b765; }
.sidebar nav button.active { color:#17130a; background:var(--accent); box-shadow:none; }
.sidebar nav button.active span { color:#17130a; }
.sidebar-footer { padding-top:12px; border-color:#303238; }
.sidebar-footer .theme-toggle,.sidebar-footer .logout { min-height:38px; margin:1px 0; padding:8px 11px; border-radius:6px; color:#969aa3; font-size:12px; }
.sidebar-footer .theme-toggle:hover,.sidebar-footer .logout:hover { color:#ececeb; background:#26282d; }
.sidebar-footer .theme-toggle-state { width:30px; height:17px; background:#4a4d55; }
.sidebar-footer .theme-toggle-state::after { width:13px; height:13px; }
body:not(.dark) .sidebar { color:#1c1d20; border-right:1px solid var(--line); background:#fff; }
body:not(.dark) .sidebar-brand,body:not(.dark) .sidebar-footer { border-color:#e4e5e7; }
body:not(.dark) .sidebar-brand strong { color:#1c1d20; }
body:not(.dark) .sidebar-brand small,body:not(.dark) .sidebar nav::before { color:#858991; }
body:not(.dark) .sidebar nav button,body:not(.dark) .sidebar-footer .theme-toggle,body:not(.dark) .sidebar-footer .logout { color:#555a63; }
body:not(.dark) .sidebar nav button span { color:#777c85; }
body:not(.dark) .sidebar nav button:hover,body:not(.dark) .sidebar-footer .theme-toggle:hover,body:not(.dark) .sidebar-footer .logout:hover { color:#1c1d20; background:#f3f3f1; }
body:not(.dark) .sidebar-footer .theme-toggle-state { background:#d4d6da; }
.sidebar-scrim { position:fixed; inset:0; z-index:19; visibility:hidden; padding:0; border:0; background:rgba(14,15,17,.5); opacity:0; pointer-events:none; transition:opacity .18s ease,visibility .18s ease; }
.main { width:calc(100% - var(--sidebar-width)); margin-left:var(--sidebar-width); }
.topbar-admin { position:sticky; top:0; z-index:15; height:76px; padding:0 28px; border-color:var(--line); background:rgba(255,255,255,.97); box-shadow:0 2px 9px rgba(20,22,26,.035); }
.topbar-heading { min-width:150px; }
.topbar-admin h2 { font-size:19px; font-weight:720; }
.topbar-admin p { margin-top:3px; font-size:11px; }
.topbar-tools { display:flex; align-items:center; gap:8px; margin-left:auto; }
.global-search-button,.density-toggle { height:38px; display:flex; align-items:center; gap:8px; padding:0 10px; border:1px solid var(--line); border-radius:6px; color:var(--muted-strong); background:var(--surface); font-size:12px; }
.global-search-button { width:246px; }
.global-search-button:hover,.density-toggle:hover { border-color:#c4b176; color:#3f350f; background:#fbf8ef; }
.global-search-button svg,.density-toggle svg,.command-search-wrap svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
.global-search-button kbd,.command-search-wrap kbd { margin-left:auto; padding:2px 6px; border:1px solid var(--line); border-bottom-color:#c7c9ce; border-radius:4px; color:#777b82; background:#f6f6f5; font:9px/1.5 inherit; white-space:nowrap; }
.density-toggle svg { width:16px; }
.admin-user { margin-left:18px; padding-left:18px; border-left:1px solid var(--line); }
.admin-user>span { width:33px; height:33px; color:#17130a; background:var(--accent); font-size:12px; }
.view-root { max-width:1720px; margin:0 auto; padding:26px 30px 52px; }
body.admin-fullscreen .sidebar { display:none; }
body.admin-fullscreen .main { width:100%; margin-left:0; }
body.admin-fullscreen .topbar-admin { display:none; }
body.admin-fullscreen .view-root { max-width:none; min-height:100vh; }
body.admin-fullscreen .dashboard-command { min-height:100vh; }

/* 页面、工具栏与通用数据表 */
.section-toolbar { align-items:flex-end; margin-bottom:16px; }
.section-toolbar h3 { color:var(--ink); font-size:19px; font-weight:720; }
.section-caption { margin:5px 0 0; color:var(--muted); font-size:12px; }
.toolbar-actions { justify-content:flex-end; flex-wrap:wrap; }
.toolbar-actions input,.toolbar-actions select { height:38px; margin:0; min-width:168px; padding:8px 10px; }
.panel,.settings-form,.combo-management { overflow:hidden; border:1px solid var(--line); border-radius:8px; background:var(--surface); box-shadow:var(--shadow-sm); }
.panel { margin-top:20px; }
.panel-head { min-height:58px; padding:14px 18px; border-color:var(--line); }
.panel-head h3 { font-size:15px; font-weight:700; }
.table-wrap { border:1px solid var(--line); border-radius:8px; background:var(--surface); box-shadow:var(--shadow-sm); }
.panel .table-wrap { border:0; border-radius:0; box-shadow:none; }
.view-root .table-wrap { max-height:min(720px,calc(100vh - 310px)); }
table { background:var(--surface); font-variant-numeric:tabular-nums; }
thead { position:sticky; top:0; z-index:2; }
th { position:sticky; top:0; z-index:2; }
th,td { padding:13px 15px; border-color:var(--line); font-size:12px; }
th { color:#5f646d; background:#f5f5f4; font-size:11px; font-weight:700; }
tbody tr { transition:background-color .13s ease; }
tbody tr:hover { background:#faf8f1; }
tbody tr[data-order] { cursor:pointer; }
td small { color:var(--muted); }
.cell-main { gap:11px; }
.thumb { width:44px; height:44px; border:1px solid #eee8d8; border-radius:6px; background:#fffaf0; }
.cell-copy strong { font-weight:650; }
.row-actions { gap:2px; }
.row-actions .text-button { padding:5px 8px; font-size:11px; }
.badge { min-height:23px; border:1px solid transparent; border-radius:999px; padding:2px 8px; color:#565b63; background:#eff0f1; font-size:10px; font-weight:650; }
.badge.on,.badge.done { border-color:#cfe6d7; color:var(--success); background:var(--success-soft); }
.badge.wait { border-color:#ebd9a5; color:var(--warning); background:var(--warning-soft); }
.badge.cancel { border-color:#efcfd2; color:var(--danger); background:var(--danger-soft); }
.status-toggle,.recommend-toggle { border-radius:999px; }
.empty-table { min-height:150px; display:grid; place-items:center; padding:38px 20px; color:var(--muted); }
.error-state { min-height:116px; display:grid; grid-template-columns:38px minmax(0,1fr) auto; align-items:center; gap:14px; padding:18px; border:1px solid #ebc6c9; border-radius:8px; color:var(--ink); background:var(--surface); box-shadow:var(--shadow-sm); }
.error-state>span { width:36px; height:36px; display:grid; place-items:center; border-radius:50%; color:var(--danger); background:var(--danger-soft); font-weight:800; }
.error-state strong { font-size:14px; }
.error-state p { margin:3px 0 0; color:var(--muted); font-size:12px; }
.loading { min-height:340px; }
.loading::before { content:""; width:22px; height:22px; margin-right:10px; border:2px solid #ddd8c9; border-top-color:var(--accent); border-radius:50%; animation:admin-spin .75s linear infinite; }
@keyframes admin-spin { to { transform:rotate(360deg); } }
.pagination { gap:8px; padding:16px 0 0; font-variant-numeric:tabular-nums; }
.pagination span { min-width:112px; text-align:center; }
.bulk-toolbar { margin:0 0 12px; padding:10px 12px; border-radius:7px; background:var(--surface); box-shadow:var(--shadow-sm); }
.segment-chip { border-radius:999px; }
.admin-nav-row { grid-template-columns:24px 34px minmax(0,1fr) 75px 66px; border-radius:6px; cursor:grab; }
.admin-nav-move { display:grid; grid-template-columns:1fr 1fr; gap:4px; }
.admin-nav-move button { width:30px; height:30px; padding:0; border:1px solid var(--line); border-radius:5px; color:var(--muted-strong); background:var(--surface); }
.admin-nav-move button:hover { border-color:#c8a84d; color:#684f0e; background:#fffaf0; }

/* 经营概览 */
.dashboard-intro { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:20px; }
.dashboard-intro h3 { margin:0; font-size:22px; font-weight:760; }
.dashboard-intro p { margin:5px 0 0; color:var(--muted); font-size:12px; }
.dashboard-quick-actions { display:flex; gap:8px; }
.stats-grid { gap:13px; }
.stat-card { position:relative; min-height:132px; display:block; overflow:hidden; padding:18px 19px; border:1px solid var(--line); border-radius:8px; color:var(--ink); background:var(--surface); box-shadow:var(--shadow-sm); text-align:left; }
.stat-card::after { content:""; position:absolute; inset:auto 0 0; height:3px; background:#d9d9d6; transform:scaleX(0); transform-origin:left; transition:transform .2s ease; }
.stat-card:hover { border-color:#d3c28f; box-shadow:0 7px 20px rgba(24,26,30,.075); transform:translateY(-1px); }
.stat-card:hover::after,.stat-card.attention::after { transform:scaleX(1); background:var(--accent); }
.stat-card span { color:var(--muted); font-size:11px; font-weight:650; }
.stat-card strong { margin-top:9px; font-size:27px; font-weight:760; line-height:1.25; font-variant-numeric:tabular-nums; }
.stat-card em { margin-top:6px; color:var(--muted); font-size:10px; }
.stat-card i { position:absolute; right:17px; bottom:15px; color:var(--accent-strong); font-size:10px; font-style:normal; opacity:0; transform:translateX(-4px); transition:opacity .18s ease,transform .18s ease; }
.stat-card:hover i { opacity:1; transform:none; }
.stat-card.attention strong { color:var(--accent-strong); }

.view-root.home-view { max-width:none; padding-top:0; padding-bottom:0; }
.dashboard-command { position:relative; min-height:calc(100vh - 76px); overflow:hidden; margin:0 -30px; isolation:isolate; color:#fff; background:#030507; }
.dashboard-rain { position:absolute; inset:0; z-index:0; width:100%; height:100%; opacity:.5; pointer-events:none; }
.dashboard-command-copy { position:absolute; top:50%; left:max(24px,calc(50% - 440px)); z-index:3; width:min(500px,50%); padding:0; text-shadow:0 2px 10px #000; transform:translateY(-50%); }
.dashboard-kicker { display:flex; align-items:center; gap:9px; color:#f7c63d; font:700 11px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace; }
.dashboard-kicker i { width:7px; height:7px; border-radius:50%; background:#f7c63d; box-shadow:0 0 14px rgba(247,198,61,.9); }
.dashboard-command h3 { margin:22px 0 8px; color:#fff; font-size:38px; font-weight:760; line-height:1.15; }
.dashboard-quick-actions { display:flex; gap:8px; }
.dashboard-command .dashboard-quick-actions button { min-height:38px; padding:8px 15px; border:1px solid rgba(255,255,255,.24); border-radius:4px; color:#e7e9ec; background:rgba(3,5,7,.72); font-size:12px; }
.dashboard-command .dashboard-quick-actions button:hover { border-color:#f7c63d; color:#fff; background:#16150f; }
.dashboard-command .dashboard-quick-actions button.active { border-color:#f7c63d; color:#17130a; background:#f7c63d; }
.dashboard-globe { position:absolute; z-index:2; top:50%; right:max(24px,calc(50% - 440px)); width:min(432px,40%); height:min(380px,62%); cursor:grab; transform:translateY(-50%); }
.dashboard-globe:active { cursor:grabbing; }
.dashboard-globe canvas { width:100%; height:100%; display:block; touch-action:none; }
.dashboard-globe.unavailable::before { content:""; position:absolute; top:50%; left:50%; width:260px; height:260px; border:1px solid rgba(255,255,255,.25); border-radius:50%; transform:translate(-50%,-50%); }
.dashboard-coordinates { position:absolute; right:28px; bottom:18px; z-index:3; color:#858d98; font:10px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace; }

/* 筛选、分段与表单 */
.order-filter-panel { gap:12px; margin-bottom:14px; padding:15px; border:1px solid var(--line); border-radius:8px; background:var(--surface); box-shadow:var(--shadow-sm); }
.order-filter-panel label>span { color:var(--muted-strong); font-weight:650; }
.order-filter-panel input,.order-filter-panel select { border-color:var(--line-strong); }
.product-library-tabs { margin-bottom:16px; padding:3px; border:1px solid var(--line); border-radius:7px; background:#e9eaec; }
.product-library-tabs button { border-radius:5px; }
.product-library-tabs button.active { color:#2d260f; background:var(--surface); box-shadow:0 2px 6px rgba(20,22,26,.08); }
.library-note { margin:0 0 14px; padding:11px 13px; border:1px solid #eadcae; border-left:1px solid #eadcae; border-radius:6px; color:#68541e; background:#fbf7ea; }
.settings-form { padding:22px; }
.form-section h3 { color:#2a2d32; font-size:14px; }
.form-section:last-child { margin-bottom:0; }
.field-grid { gap:15px; }

/* 弹窗 */
.editor-dialog,.order-dialog,.confirm-dialog,.command-dialog { color:var(--ink); border:1px solid var(--line); border-radius:8px; background:var(--surface); box-shadow:var(--shadow-md); }
.editor-dialog::backdrop,.order-dialog::backdrop,.confirm-dialog::backdrop,.command-dialog::backdrop { background:rgba(16,17,19,.58); }
.editor-dialog form>header,.order-detail-head { min-height:62px; padding:15px 20px; border-color:var(--line); background:var(--surface); }
.editor-dialog h3 { font-size:16px; }
.editor-heading p { margin:3px 0 0; color:var(--muted); font-size:11px; }
.editor-fields { gap:16px; padding:20px; }
.editor-dialog footer { padding:13px 20px; border-color:var(--line); background:var(--surface); }
.order-detail-body { padding:20px; }
.order-summary { gap:8px; }
.order-summary div { border:1px solid var(--line); border-radius:6px; background:var(--surface-subtle); }
.detail-section { border-color:var(--line); }
.confirm-dialog { width:min(420px,calc(100% - 30px)); padding:24px; }
.confirm-icon { color:var(--danger); background:var(--danger-soft); }

/* 快速导航 */
.command-dialog { width:min(590px,calc(100% - 28px)); max-height:min(680px,80vh); padding:0; overflow:hidden; }
.command-search-wrap { height:66px; display:flex; align-items:center; gap:11px; padding:0 18px; border-bottom:1px solid var(--line); color:#777b82; }
.command-search-wrap svg { width:19px; height:19px; flex:0 0 auto; }
.command-search-wrap input { height:42px; margin:0; padding:0; border:0; background:transparent; box-shadow:none; font-size:15px; }
.command-search-wrap input:focus { border:0; box-shadow:none; }
.command-meta { display:flex; justify-content:space-between; padding:11px 16px 7px; color:var(--muted); font-size:10px; }
.command-results { max-height:480px; padding:4px 9px 11px; overflow-y:auto; }
.command-result { width:100%; min-height:55px; display:grid; grid-template-columns:34px minmax(0,1fr) auto; align-items:center; gap:10px; padding:8px 10px; border:0; border-radius:6px; color:var(--ink); background:transparent; text-align:left; }
.command-result>span { width:32px; height:32px; display:grid; place-items:center; border:1px solid var(--line); border-radius:6px; color:#75622b; background:#faf7ee; }
.command-result strong,.command-result small { display:block; }
.command-result strong { font-size:13px; }
.command-result small { margin-top:2px; color:var(--muted); font-size:10px; }
.command-result kbd { visibility:hidden; color:#6d5b27; font:11px inherit; }
.command-result.active { background:var(--accent-soft); }
.command-result.active>span { border-color:#d9bf72; background:#fffaf0; }
.command-result.active kbd { visibility:visible; }
.command-empty { min-height:150px; display:grid; place-content:center; gap:4px; color:var(--muted); text-align:center; }
.command-empty strong { color:var(--ink); }
.command-empty span { font-size:11px; }

/* 标准/紧凑密度 */
body.compact .view-root { padding-top:20px; }
body.compact th,body.compact td { padding-top:9px; padding-bottom:9px; }
body.compact .thumb { width:36px; height:36px; }
body.compact .section-toolbar { margin-bottom:12px; }
body.compact .stat-card { min-height:112px; padding:14px 16px; }
body.compact .stat-card strong { font-size:23px; }
body.compact .panel { margin-top:14px; }
body.compact .order-filter-panel { padding:11px 13px; }

/* 商品编辑：和主后台共享一套字段、媒体与状态语言 */
.product-editor-dialog { border-radius:8px; background:var(--canvas); }
.product-editor-dialog form>header { min-height:66px; padding:16px 24px; background:var(--surface); }
.product-editor-dialog .editor-fields { padding:18px 22px 24px; background:var(--canvas); }
.product-editor-layout { gap:12px; }
.product-editor-tip { min-height:46px; border:1px solid #e4d59d; border-radius:6px; color:#65521d; background:#faf6e9; }
.product-editor-tip>span { color:#17130a; background:var(--accent); }
.product-editor-section { padding:19px 20px 22px; border:1px solid var(--line); border-radius:8px; background:var(--surface); box-shadow:var(--shadow-sm); }
.product-editor-section>header { margin-bottom:18px; padding-bottom:12px; border-color:var(--line); }
.product-editor-section>header span { color:#604b12; background:var(--accent-soft); }
.product-editor-section>header h4 { font-size:15px; }
.product-media-tile,.media-add-tile { border-radius:6px; }
.media-add-tile { color:#757a83; background:var(--surface-subtle); }
.media-add-tile:hover { border-color:#c8a340; color:#6b5110; background:#fffaf0; }
.product-field>span,.product-media-heading strong { color:var(--muted-strong); }
.product-editor-dialog .product-field input:focus,.product-editor-dialog .product-field select:focus,.product-editor-dialog .product-field textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--focus); }
.editor-switch { border-color:var(--line); border-radius:6px; }
.editor-switch:hover { border-color:#cfc39f; background:#fdfbf5; }
.editor-switch input:checked+i { background:var(--accent); }
.spec-group-editor,.product-record-line { border-color:var(--line); border-radius:6px; box-shadow:none; }
.product-editor-dialog form>footer { border-color:var(--line); background:var(--surface); box-shadow:0 -6px 18px rgba(20,22,26,.05); }
.combo-management { padding:22px 24px 28px; }
.combo-management-head h3,.coupon-admin-head h3 { font-size:20px; }
.section-eyebrow,.designer-kicker { color:#8a6811; font-size:10px; text-transform:none; }
.combo-setting-grid,.combo-offer-admin { border-radius:7px; background:var(--surface-subtle); }
.combo-product-row { border-radius:7px; }
.combo-product-row.selected { border-color:#dbc16f; background:#fdf9ed; box-shadow:none; }

/* 页面装修器：三栏工作台，主页面优先，复杂功能保留在折叠区。 */
.designer-shell { min-height:calc(100vh - 76px); margin:-26px -30px -52px; background:#e9eaec; }
.designer-toolbar { height:86px; padding:14px 22px; border-color:var(--line); background:var(--surface); }
.designer-toolbar h3 { margin-top:1px; font-size:18px; }
.designer-toolbar p { margin-top:2px; font-size:11px; }
.designer-publish { gap:9px; }
.designer-publish>span { margin-right:4px; }
.designer-grid { height:calc(100vh - 162px); min-height:690px; grid-template-columns:258px minmax(440px,1fr) 326px; align-items:stretch; overflow:hidden; background:#e9eaec; }
.designer-sidebar,.designer-inspector,.designer-stage { height:100%; min-height:0; }
.designer-sidebar,.designer-inspector { background:var(--surface); }
.designer-sidebar { border-color:var(--line); }
.designer-inspector { border-color:var(--line); }
.designer-side-scroll,.inspector-scroll { height:100%; max-height:100%; overflow-y:auto; }
.designer-nav-group { gap:2px; padding:15px 12px 0; }
.designer-group-title { padding:0 9px 7px; color:#858a93; font-size:9px; }
.designer-page { height:38px; border-radius:6px; color:#5a5f68; }
.designer-page:hover { background:#f5f5f3; }
.designer-page.active { color:#3d300c; background:var(--accent-soft); }
.designer-page.active i { color:#655018; background:#fff; }
.designer-more-pages { border-color:var(--line); }
.designer-more-pages.open>span { color:#7b5b0b; }
.designer-layers { margin-top:14px; padding:14px 12px 22px; border-color:var(--line); }
.designer-layer { min-height:54px; padding:7px; border-radius:6px; background:#f7f7f6; }
.designer-layer:hover { border-color:#d7d4ca; }
.designer-layer.active { border-color:#d9bd6d; background:#fbf5e4; box-shadow:inset 2px 0 var(--accent); }
.layer-eye.on { color:var(--success); }
.layer-actions button { border-color:var(--line); color:#686d76; background:var(--surface); }
.layer-actions button:hover { border-color:#c8a84d; color:#684f0e; background:#fffaf0; }
.designer-add select { border-color:var(--line-strong); }
.designer-add button { color:#17130a; background:var(--accent); }
.designer-stage { height:100%; padding:16px 22px 30px; overflow-y:auto; background:#e9eaec; }
.stage-head { max-width:430px; margin-bottom:12px; }
.live-pill { border-color:#d4d6da; border-radius:999px; background:var(--surface); }
.live-pill i { background:#29915c; }
.preview-mode-toggle { padding:2px; border:1px solid #d5d7dc; border-radius:6px; background:#dedfe2; }
.preview-mode-toggle button { border-radius:4px; }
.preview-mode-toggle button.active { color:#2e250c; background:#fff; box-shadow:0 1px 4px rgba(20,22,26,.1); }
.phone-frame { border-color:#222326; box-shadow:0 20px 44px rgba(22,23,26,.2); }
.designer-style-panel,.designer-category-row,.nav-inspector-row,.builder-row { border-color:var(--line); border-radius:6px; background:var(--surface-subtle); }
.designer-style-panel>summary::marker { color:var(--accent-strong); }
.inspector-title { border-color:var(--line); }
.inspector-title>span { color:#87640e; }
.inspector-field>span { color:var(--muted-strong); }
.inspector-help { color:var(--muted); }
.designer-product-checks label { border-color:var(--line); border-radius:6px; }
.designer-product-checks label:hover { border-color:#cbb36b; background:#fcf8ec; }
.designer-layer.drop-target { border-color:var(--accent); box-shadow:0 -2px 0 var(--accent); }
.designer-layer.drop-target.drop-after { box-shadow:0 2px 0 var(--accent); }
.pv-block-resize,.pv-logo-resize { border-color:#267de2; }

/* 深色模式保留相同信息层级，不让手机预览受影响。 */
body.dark {
  --ink:#ececea;
  --muted:#a4a7ae;
  --muted-strong:#c0c2c7;
  --line:#34373c;
  --line-strong:#474a51;
  --surface:#202226;
  --surface-subtle:#27292e;
  --canvas:#15171a;
  --accent-soft:#3a321e;
  --focus:rgba(216,174,57,.22);
  color-scheme:dark;
}
body.dark ::-webkit-scrollbar-track { background:var(--canvas); }
body.dark ::-webkit-scrollbar-thumb { border-color:var(--canvas); background:#565960; }
body.dark .sidebar { background:#111214; }
body.dark .sidebar-brand { border-color:#2b2d31; }
body.dark .sidebar-footer { border-color:#2b2d31; }
body.dark .sidebar nav button:hover { color:#f2f2f1; background:#26282d; }
body.dark .sidebar nav button.active { color:#17130a; background:var(--accent); box-shadow:none; }
body.dark .sidebar nav button.active span { color:#17130a; }
body.dark .sidebar-footer .theme-toggle:hover,body.dark .sidebar-footer .logout:hover { color:#ececeb; background:#26282d; }
body.dark .sidebar-footer .theme-toggle-state { background:#665b3a; }
body.dark .sidebar-footer .theme-toggle-state::after { background:#fff; }
body.dark .main,body.dark .view-root { background:var(--canvas); }
body.dark .topbar-admin { border-color:var(--line); background:rgba(32,34,38,.97); }
body.dark .global-search-button,body.dark .density-toggle { border-color:var(--line); color:var(--muted-strong); background:var(--surface-subtle); }
body.dark .global-search-button:hover,body.dark .density-toggle:hover { border-color:#806f3b; color:#eadcae; background:#312d22; }
body.dark .global-search-button kbd,body.dark .command-search-wrap kbd { border-color:#4b4e54; color:#b7bac0; background:#292b2f; }
body.dark input,body.dark select,body.dark textarea { border-color:var(--line-strong); color:var(--ink); background:#1b1d21; }
body.dark input::placeholder,body.dark textarea::placeholder { color:#777b83; }
body.dark .secondary { border-color:var(--line-strong); color:var(--ink); background:var(--surface-subtle); }
body.dark .secondary:hover { border-color:#686b72; background:#303238; }
body.dark .text-button { color:#e0c878; }
body.dark .text-button:hover { color:#f0dd9e; background:#39331f; }
body.dark .panel,body.dark .settings-form,body.dark .combo-management,body.dark .table-wrap,body.dark table,body.dark .bulk-toolbar,body.dark .order-filter-panel { border-color:var(--line); background:var(--surface); }
body.dark th { color:#b5b8be; background:#2b2d31; }
body.dark td { border-color:var(--line); }
body.dark tbody tr:hover { background:#282a2e; }
body.dark .thumb { border-color:#4a4127; background:#342e1d; }
body.dark .stat-card { border-color:var(--line); color:var(--ink); background:var(--surface); box-shadow:none; }
body.dark .stat-card:hover { border-color:#6d6039; }
body.dark .badge { color:#c4c6ca; background:#303238; }
body.dark .badge.on,body.dark .badge.done { border-color:#315b45; color:#81d2a5; background:#20382c; }
body.dark .badge.wait { border-color:#604f23; color:#e4c56e; background:#3a321e; }
body.dark .badge.cancel { border-color:#66383d; color:#ed9fa4; background:#3e2427; }
body.dark .error-state { border-color:#66383d; background:var(--surface); }
body.dark .product-library-tabs { border-color:var(--line); background:#15171a; }
body.dark .product-library-tabs button.active { color:#f0dfaa; background:#303238; }
body.dark .library-note { border-color:#5c4f2a; color:#d8c68f; background:#302b1f; }
body.dark .editor-dialog,body.dark .order-dialog,body.dark .confirm-dialog,body.dark .command-dialog { border-color:var(--line); color:var(--ink); background:var(--surface); }
body.dark .editor-dialog form>header,body.dark .order-detail-head,body.dark .editor-dialog footer { border-color:var(--line); background:var(--surface); }
body.dark .order-summary div { border-color:var(--line); background:var(--surface-subtle); }
body.dark .command-result { color:var(--ink); }
body.dark .command-result>span { border-color:var(--line); background:#2b2922; }
body.dark .command-result.active { background:#39331f; }
body.dark .product-editor-dialog,body.dark .product-editor-dialog .editor-fields { background:var(--canvas); }
body.dark .product-editor-section,body.dark .editor-switch,body.dark .spec-group-editor,body.dark .product-record-line { border-color:var(--line); background:var(--surface); }
body.dark .product-editor-tip { border-color:#5c4f2a; color:#d8c68f; background:#302b1f; }
body.dark .media-add-tile { border-color:var(--line-strong); color:var(--muted); background:var(--surface-subtle); }
body.dark .designer-shell,body.dark .designer-grid,body.dark .designer-stage { background:#16181b; }
body.dark .designer-toolbar,body.dark .designer-sidebar,body.dark .designer-inspector { border-color:var(--line); background:var(--surface); }
body.dark .designer-page { color:#b6b9c0; }
body.dark .designer-page:hover { background:#2a2c31; }
body.dark .designer-page.active { color:#ebd99f; background:#39331f; }
body.dark .designer-layer { background:#282a2f; }
body.dark .designer-layer.active { border-color:#78672f; background:#39331f; box-shadow:inset 2px 0 var(--accent); }
body.dark .designer-style-panel,body.dark .designer-category-row,body.dark .nav-inspector-row,body.dark .builder-row { border-color:var(--line); background:var(--surface-subtle); }
body.dark .phone-screen {
  --ink:#191b1f;
  --muted:#727985;
  --line:#e6eaf0;
  --surface:#fff;
  --canvas:#f3f7fb;
  color:#191b1f;
  color-scheme:light;
  background:#f7f7f7;
}

/* 响应式：平板保留数据密度，手机转为可操作的单列。 */
@media (max-width:1180px) {
  .global-search-button { width:176px; }
  .global-search-button span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .density-toggle span { display:none; }
  .designer-grid { grid-template-columns:232px minmax(410px,1fr) 292px; }
}
@media (max-width:1000px) {
  .topbar-tools { margin-left:auto; }
  .global-search-button { width:42px; justify-content:center; }
  .global-search-button span,.global-search-button kbd { display:none; }
  .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-command-copy { width:53%; padding-right:24px; padding-left:36px; }
  .dashboard-command h3 { font-size:32px; }
  .designer-grid { height:auto; min-height:0; grid-template-columns:220px minmax(390px,1fr); overflow:visible; }
  .designer-inspector { grid-column:1/-1; min-height:420px; border-top:1px solid var(--line); border-left:0; }
  .designer-sidebar,.designer-stage { height:760px; }
}
@media (max-width:720px) {
  :root { --sidebar-width:264px; }
  .sidebar { visibility:hidden; box-shadow:10px 0 34px rgba(0,0,0,.28); }
  .sidebar.open { visibility:visible; }
  body.sidebar-open { overflow:hidden; }
  body.sidebar-open .sidebar-scrim { visibility:visible; opacity:1; pointer-events:auto; }
  .main { width:100%; margin-left:0; }
  .topbar-admin { height:68px; padding:0 13px; }
  #menu-button { display:grid; place-items:center; margin-right:6px; }
  .topbar-heading { min-width:0; }
  .topbar-admin h2 { max-width:35vw; overflow:hidden; font-size:16px; text-overflow:ellipsis; white-space:nowrap; }
  .topbar-admin p { display:none; }
  .topbar-tools { gap:5px; }
  .density-toggle { width:38px; justify-content:center; padding:0; }
  .admin-user { margin-left:7px; padding-left:8px; }
  .admin-user>span { width:31px; height:31px; }
  .view-root { padding:18px 13px 40px; }
  .view-root.home-view { padding-top:0; padding-bottom:0; }
  .dashboard-command { min-height:max(650px,calc(100vh - 68px)); margin:0 -13px; }
  .dashboard-command-copy { position:relative; top:auto; left:auto; width:auto; padding:34px 22px 26px; transform:none; }
  .dashboard-command h3 { margin-top:16px; font-size:28px; }
  .dashboard-globe { top:300px; right:auto; left:50%; width:100%; height:280px; transform:translateX(-50%); }
  .dashboard-coordinates { right:15px; bottom:12px; }
  .dashboard-intro { align-items:flex-start; flex-direction:column; gap:12px; }
  .dashboard-quick-actions { width:100%; flex-wrap:wrap; }
  .dashboard-quick-actions button { flex:1; white-space:nowrap; }
  .stats-grid { grid-template-columns:1fr 1fr; }
  .stat-card { min-height:118px; padding:15px; }
  .stat-card strong { font-size:22px; }
  .stat-card i { display:none; }
  .section-toolbar { align-items:stretch; }
  .toolbar-actions { justify-content:stretch; }
  .toolbar-actions input,.toolbar-actions select,.toolbar-actions button { flex:1 1 145px; }
  .table-wrap { border-radius:6px; }
  th,td { padding:10px 11px; }
  .table-wrap table th:last-child,.table-wrap table td:last-child { position:sticky; right:0; min-width:92px; background:var(--surface); box-shadow:-8px 0 12px rgba(20,22,26,.08); }
  .table-wrap table th:last-child { z-index:4; background:#f5f5f4; }
  .table-wrap tbody tr:hover td:last-child { background:#faf8f1; }
  .order-filter-panel { grid-template-columns:1fr; }
  .product-editor-dialog .editor-fields { padding:12px; }
  .product-editor-section { padding:16px 14px 18px; }
  .product-form-grid,.product-form-grid.four-columns { grid-template-columns:1fr; }
  .product-form-grid>.full,.product-field.full { grid-column:auto; }
  .product-media-tile,.media-add-tile { width:92px; }
  .designer-shell { margin:-18px -13px -40px; }
  .designer-toolbar { position:sticky; top:68px; z-index:12; height:auto; align-items:flex-start; padding:13px; box-shadow:0 4px 14px rgba(20,22,26,.08); }
  .designer-toolbar p,.designer-publish>span { display:none; }
  .designer-grid { display:block; }
  .designer-sidebar,.designer-stage,.designer-inspector { width:100%; height:auto; min-height:0; }
  .designer-sidebar { border-right:0; border-bottom:1px solid var(--line); }
  .designer-stage { min-height:720px; }
  .designer-side-scroll,.inspector-scroll { height:auto; max-height:none; overflow:visible; }
  .designer-primary-pages { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .designer-primary-pages .designer-group-title { grid-column:1/-1; }
  .command-dialog { max-height:82vh; }
  body.dark .table-wrap table th:last-child { background:#2b2d31; }
  body.dark .table-wrap table td:last-child { background:var(--surface); }
  body.dark .table-wrap tbody tr:hover td:last-child { background:#282a2e; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}
@media (pointer:coarse) {
  .icon-button,.text-button,.designer-add button,.layer-actions button,.nav-move button,.candidate-publish,.candidate-unpublish,.status-toggle,.recommend-toggle,.combo-table-state { min-width:38px; min-height:38px; }
  .designer-page,.product-library-tabs button { min-height:42px; }
}
/* System users */
.system-users-table { min-width: 920px; }
.system-users-table td:first-child strong,
.system-users-table td:first-child small { display:block; }
.system-users-table td:first-child small { margin-top:4px; color:var(--muted, #7b7f86); }
.permission-editor { overflow:hidden; border:1px solid var(--line, #e7e7e7); border-radius:8px; }
.permission-editor-head,
.permission-row { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:12px 14px; }
.permission-editor-head { background:#f7f7f7; border-bottom:1px solid var(--line, #e7e7e7); }
.permission-editor-head span { color:var(--muted, #7b7f86); font-size:12px; }
.permission-row { margin:0; border-bottom:1px solid var(--line, #ededed); }
.permission-row:last-child { border-bottom:0; }
.permission-row > span strong,
.permission-row > span small { display:block; }
.permission-row > span small { margin-top:2px; color:var(--muted, #7b7f86); font-weight:400; }
.permission-row select { width:150px; flex:0 0 150px; }
body.dark .permission-editor-head { background:#202020; }
@media (max-width:640px) {
  .permission-editor-head { align-items:flex-start; flex-direction:column; gap:4px; }
  .permission-row select { width:132px; flex-basis:132px; }
}
