/* Meparel 店务 · 手机优先，电脑端保留完整工作空间。色彩、字体与动效见 docs/design-refresh-20261019.md */
:root {
  color-scheme: light;
  --ground: #F6F3ED; --surface: #FFFFFF; --field: #ECE7DE; --tone: #F0ECE4; --hover: #FAF8F4;
  --ink: #211F1C; --ink-2: #5F5951; --ink-3: #6E675E;
  --bronze: #86663F; --night: #262B27; --night-2: #343A35;
  --sand: #EAE3D8; --mist: #E3E4DE; --blush: #EBE2DC; --sage: #DEE2DA;
  --success: #3D654F; --error: #963E35;
  --line: #DDD6CA; --hairline: #ECE7DE;
  --radius: 16px;
  --radius-control: 12px;
  --radius-sm: 8px;
  --radius-sheet: 24px;
  --space-field: 24px;
  --font-system: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Segoe UI', 'Microsoft YaHei', sans-serif;
  --sans: var(--font-system);
  --ease-silk: cubic-bezier(.16, 1, .3, 1);
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --t-press: 160ms; --t-enter: 560ms; --t-sheet: 420ms;
  --float-shadow: 0 10px 30px rgba(33, 31, 28, .10), 0 2px 6px rgba(33, 31, 28, .05);
  /* 旧变量名保留给少数内联引用 */
  --bg: var(--ground); --card: var(--surface); --bg-soft: var(--field); --text: var(--ink); --text-2: var(--ink-2); --text-3: var(--ink-3); --gold: var(--bronze); --green: var(--night);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font: 15px/1.6 var(--sans); color: var(--ink); background: var(--ground); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.hidden, [hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, input, select, textarea, [role="button"] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.text-muted { color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #D5CEC2; border-radius: 4px; }

/* ===================== 动效 ===================== */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes modalRise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes letterRise { from { opacity: 0; transform: translateY(.45em); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* 路由切换：首屏内容依次浮现（CSS 动画结束即为常态，不依赖脚本显示内容） */
.route-enter > :not(.loading-box) { animation: rise var(--t-enter) var(--ease-silk) backwards; }
.route-enter > :nth-child(2) { animation-delay: 70ms; }
.route-enter > :nth-child(3) { animation-delay: 140ms; }
.route-enter > :nth-child(4) { animation-delay: 210ms; }
.route-enter > :nth-child(n+5) { animation-delay: 280ms; }
/* 列表行依次出现，最多错开 10 行 */
.table tbody tr, .dash-item, .pickup-list-row, .feature-link { animation: rowIn 420ms var(--ease-silk) backwards; }
.table tbody tr:nth-child(2), .dash-item:nth-child(2), .pickup-list-row:nth-child(2), .feature-link:nth-child(2) { animation-delay: 40ms; }
.table tbody tr:nth-child(3), .dash-item:nth-child(3), .pickup-list-row:nth-child(3), .feature-link:nth-child(3) { animation-delay: 80ms; }
.table tbody tr:nth-child(4), .dash-item:nth-child(4), .pickup-list-row:nth-child(4), .feature-link:nth-child(4) { animation-delay: 120ms; }
.table tbody tr:nth-child(5), .dash-item:nth-child(5), .pickup-list-row:nth-child(5), .feature-link:nth-child(5) { animation-delay: 160ms; }
.table tbody tr:nth-child(6), .dash-item:nth-child(6), .feature-link:nth-child(6) { animation-delay: 200ms; }
.table tbody tr:nth-child(7), .feature-link:nth-child(7) { animation-delay: 240ms; }
.table tbody tr:nth-child(8) { animation-delay: 280ms; }
.table tbody tr:nth-child(9) { animation-delay: 320ms; }
.table tbody tr:nth-child(n+10) { animation-delay: 360ms; }
/* 按下反馈 */
.btn, .tab, .tab-btn, .nav-item, .mobile-nav-item, .quick-link, .feature-link, .pager-btn, .icon-button, .profile-button, .m-row, .img-add { transition: transform var(--t-press) var(--ease-out), background-color var(--t-press) var(--ease-out), color var(--t-press) var(--ease-out), opacity var(--t-press) var(--ease-out); }
.btn:active:not(:disabled), .tab:active, .tab-btn:active, .nav-item:active, .mobile-nav-item:active, .quick-link:active, .feature-link:active, .pager-btn:active:not(:disabled), .icon-button:active, .profile-button:active, .img-add:active { transform: scale(.97); }
.m-row:has(.row-hit:active) { transform: scale(.985); }

/* ===================== 登录 ===================== */
.login-view { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) 400px; align-items: center; gap: clamp(48px, 8vw, 128px); max-width: 1080px; margin: 0 auto; padding: 64px 48px; }
.login-wordmark { font: 600 56px/1.1 var(--font-system); letter-spacing: 0; color: var(--ink); }
.wordmark-letters { display: inline-flex; }
.wordmark-letters > span { display: inline-block; animation: letterRise 720ms var(--ease-silk) backwards; }
.wordmark-letters > span:nth-child(2) { animation-delay: 60ms; }
.wordmark-letters > span:nth-child(3) { animation-delay: 120ms; }
.wordmark-letters > span:nth-child(4) { animation-delay: 180ms; }
.wordmark-letters > span:nth-child(5) { animation-delay: 240ms; }
.wordmark-letters > span:nth-child(6) { animation-delay: 300ms; }
.wordmark-letters > span:nth-child(7) { animation-delay: 360ms; }
.login-tagline { margin-top: 20px; color: var(--ink-2); font-size: 15px; animation: rise var(--t-enter) var(--ease-silk) 420ms backwards; }
.login-card { background: var(--surface); border-radius: var(--radius); padding: 40px; animation: rise var(--t-enter) var(--ease-silk) 300ms backwards; }
.login-welcome { margin-bottom: 28px; }
.login-welcome h2 { font: 600 22px/1.35 var(--font-system); letter-spacing: 0; }
.login-welcome p { color: var(--ink-2); font-size: 14px; margin-top: 6px; }
.login-card .field { margin-bottom: 18px; }
.login-card .btn-primary { min-height: 48px; margin-top: 8px; font-size: 15px; }
.password-control { position: relative; }
.password-control .input { padding-right: 64px; }
.password-control button { position: absolute; right: 2px; top: 2px; bottom: 2px; min-width: 56px; padding: 0 12px; border: 0; background: transparent; color: var(--bronze); font-size: 14px; border-radius: var(--radius); }

/* ===================== 主框架 ===================== */
.main-view { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { width: 232px; flex: 0 0 232px; display: flex; flex-direction: column; background: var(--tone); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 26px 22px 18px; }
.brand-pearl { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; color: #fff; background: var(--night); font: 600 18px/1 var(--font-system); border-radius: var(--radius-control); }
.brand-pearl::before { content: "M"; }
.brand-text strong { display: block; font: 600 20px/1.3 var(--font-system); letter-spacing: 0; color: var(--ink); }
.brand-text span { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 12px 20px; }
.nav-group-title { padding: 20px 12px 6px; font-size: 13px; color: var(--ink-3); }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-control); color: var(--ink-2); margin: 2px 0; font-size: 15px; }
.nav-item:hover { background: rgba(33, 31, 28, .05); color: var(--ink); }
.nav-item.active { background: var(--night); color: #fff; }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex-shrink: 0; }
.nav-icon svg { width: 20px; height: 20px; }
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar { min-height: 64px; flex: 0 0 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 36px; gap: 12px; }
.topbar-title { font-size: 14px; font-weight: 400; color: var(--ink-3); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-admin { font-size: 14px; color: var(--ink-2); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-button { display: flex; gap: 10px; align-items: center; border: 0; background: none; min-height: 44px; min-width: 44px; justify-content: center; padding: 0 6px; border-radius: var(--radius-control); }
.profile-avatar { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--field); font: 18px/1 var(--font-system); flex-shrink: 0; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--ink-2); font-size: 22px; }
.icon-button:hover, .profile-button:hover { background: rgba(33, 31, 28, .05); }
.mobile-brand, .mobile-nav { display: none; }
.content { --pt: 12px; flex: 1; min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: var(--pt) 36px 48px; scrollbar-gutter: stable; overscroll-behavior-y: contain; }
.content:focus { outline: none; }
.content-with-actions { padding-bottom: 0; scroll-padding-bottom: 104px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head-left { min-width: 0; }
.page-title { font: 600 24px/1.35 var(--font-system); letter-spacing: 0; color: var(--ink); }
.page-subtitle { color: var(--ink-3); font-size: 14px; margin-top: 8px; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; align-items: center; }
.network-status { padding: 8px 16px; background: var(--blush); color: var(--error); text-align: center; font-size: 14px; }

/* ===================== 按钮 ===================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--radius-control); min-height: 44px; padding: 10px 18px; font-size: 15px; line-height: 1.4; white-space: nowrap; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #3A3631; }
.btn-ghost { background: var(--field); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: #E3DDD2; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #82352D; }
.btn-danger-ghost { background: #F3E6E2; color: var(--error); }
.btn-danger-ghost:hover:not(:disabled) { background: #EDDAD4; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn.loading::before { content: ''; display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(127, 127, 127, .3); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; }
.btn-link { background: none; border: 0; color: var(--bronze); min-height: 36px; padding: 6px 8px; font-size: 14px; border-radius: var(--radius-control); }
.btn-link:hover { background: var(--tone); }
.btn-link.danger { color: var(--error); }

/* ===================== 表单 ===================== */
.field { min-width: 0; margin-bottom: var(--space-field); }
.field-label { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 8px; line-height: 1.5; }
.req { color: var(--error); margin-left: 3px; }
.input, select.input, textarea.input { display: block; box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; margin: 0; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-control); min-height: 44px; padding: 10px 12px; font-size: 15px; line-height: 22px; color: var(--ink); outline: none; transition: border-color var(--t-press), outline-color var(--t-press); }
input.input, select.input { height: 44px; }
input.input, textarea.input { appearance: none; -webkit-appearance: none; }
.input::placeholder { color: #8F877C; }
.input:hover { border-color: #CBC2B4; }
.input:focus { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 1px; }
.input.error { border-color: var(--error); outline: 1px solid var(--error); outline-offset: 1px; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235F5951' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
textarea.input { min-height: 112px; resize: vertical; line-height: 1.6; }
input.input::-webkit-date-and-time-value { min-height: 22px; text-align: left; }
input.input::-webkit-datetime-edit { padding: 0; }
.field-error { color: var(--error); font-size: 13px; }
.field-error:empty { display: none; }
.field-error:not(:empty) { margin-top: 6px; }
.field-hint { color: var(--ink-3); font-size: 13px; margin-top: 8px; line-height: 1.7; }
.birthday-mode-picker { border: 0; padding: 0; }
.birthday-mode-picker .field-label { padding: 0; }
.birthday-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.birthday-mode-option { position: relative; display: flex; align-items: flex-start; min-height: 76px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); cursor: pointer; transition: border-color var(--t-press), background-color var(--t-press), transform var(--t-press); }
.birthday-mode-option:hover { border-color: #BDA98E; background: var(--hover); }
.birthday-mode-option:has(input:checked) { border-color: var(--bronze); background: #F4EEE5; }
.birthday-mode-option:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.birthday-mode-option::before { content: ''; position: absolute; top: 14px; left: 14px; width: 18px; height: 18px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); box-sizing: border-box; }
.birthday-mode-option:has(input:checked)::before { border-color: var(--bronze); background: var(--bronze); box-shadow: inset 0 0 0 4px var(--surface); }
.birthday-mode-radio { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.birthday-mode-copy { display: block; min-width: 0; padding-left: 28px; }
.birthday-mode-title { display: block; font-size: 14px; line-height: 1.4; font-weight: 600; color: var(--ink); }
.birthday-mode-description { display: block; margin-top: 4px; color: var(--ink-3); font-size: 13px; line-height: 1.45; }
.birthday-preview { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 22px; padding: 12px 14px; border-left: 3px solid var(--bronze); background: #F4EEE5; color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.birthday-preview-label { flex: 0 0 auto; color: var(--ink); font-size: 13px; }
.birthday-preview-text { min-width: 0; }
.birthday-conditional[hidden] { display: none; }
.birthday-mode-picker.error .birthday-mode-option { border-color: var(--error); }
.birthday-mode-picker .field-error { margin-top: 8px; }
.form-row { display: flex; gap: 20px; }
.form-row .field { flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; }
.form-field { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.form-field input, .point-check input { width: 20px; height: 20px; accent-color: var(--ink); }
.inline-row { display: flex; gap: 10px; align-items: center; }
.inline-row .input { flex: 1; }

/* 开关 */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; min-width: 48px; min-height: 44px; }
.switch-input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-slider { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #D6CEC1; transition: background var(--t-press); }
.switch-slider::before { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 240ms var(--ease-silk); }
.switch-input:checked + .switch-slider { background: var(--ink); }
.switch-input:checked + .switch-slider::before { transform: translateX(18px); }
.switch-input:focus-visible + .switch-slider { outline: 2px solid var(--ink); outline-offset: 3px; }
.switch-wrap { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.field .switch-wrap { padding-top: 0; }
.switch-label { font-size: 14px; color: var(--ink-2); }

/* ===================== 面板 ===================== */
.panel { background: var(--surface); border-radius: var(--radius); margin-bottom: 24px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 20px 20px 8px; }
.panel-title { font-size: 15px; font-weight: 600; }
.panel-subtitle { color: var(--ink-3); font-size: 13px; }
.panel-body { padding: 16px 20px 20px; }
.panel-body.no-pad { padding: 8px 0 0; }
.panel-body > .btn { margin-top: 12px; }
.panel-footer-action { margin-top: 12px; }

/* ===================== 表格 ===================== */
.table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
table.table { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 14px; vertical-align: middle; }
.table th { color: var(--ink-3); font-weight: 500; font-size: 13px; white-space: nowrap; background: var(--surface); border-bottom: 1px solid var(--hairline); height: 44px; }
.table td { border-bottom: 1px solid var(--hairline); height: 52px; }
.table tbody tr:last-child td { border-bottom: 0; }
@media (hover: hover) { .table tbody tr:hover td { background: var(--hover); } }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .mono { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.table .low { color: var(--error); font-weight: 600; }
.table td.m-summary { display: none; }
.table td:has(> .btn-link), .table td:has(> .row-actions) { white-space: nowrap; }
.table td:has(> .row-inline) > .row-inline { margin-left: 6px; }
.table td.num.cell-primary, .table .cell-money { font: 600 16px/1.4 var(--font-system); color: var(--bronze); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.role-badges { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cell-flex { display: flex; align-items: center; gap: 12px; min-width: 150px; }
.cell-info { min-width: 0; }
.cell-primary { font-weight: 500; color: var(--ink); }
.cell-sub { color: var(--ink-3); font-size: 13px; margin-top: 6px; line-height: 1.6; }
.table-thumb { width: 44px; height: 55px; border-radius: var(--radius-sm); object-fit: cover; background: var(--sand); flex-shrink: 0; }
.avatar-placeholder { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ink-2); background: var(--sand); font-family: var(--font-system); }
.thumb-cell { width: 56px; }
.pos { color: var(--bronze); font-weight: 600; }
.neg { color: var(--ink-3); }
.cat-add td { padding: 10px 14px; }
.cat-add .input { min-width: 0; }
/* 宽屏：表头吸顶（表格不再自身横向滚动，跟随内容区滚动） */
@media (min-width: 1100px) {
  .panel:has(> .panel-body > .table-wrap) { overflow: visible; }
  .panel:has(> .panel-body > .table-wrap) .table-wrap { overflow: visible; }
  .content .table th { position: sticky; top: calc(-1 * var(--pt)); z-index: 2; }
  .content:has(.filter-tabs) .table th { top: calc(62px - var(--pt)); }
}

/* ===================== 徽章：平涂浅色，无描边 ===================== */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.badge-pending { background: #F3E4DF; color: #8A3A2F; }
.badge-paid, .badge-gold { background: #EFE6D8; color: #6B5032; }
.badge-shipped { background: var(--mist); color: #3F4A48; }
.badge-completed, .badge-points { background: var(--sage); color: #345845; }
.badge-cancelled, .badge-neutral, .badge-off { background: var(--field); color: var(--ink-2); }
.badge-mall { background: var(--sand); color: var(--ink-2); }

/* ===================== Toast ===================== */
#toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 10000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-radius: var(--radius); background: var(--ink); color: #fff; font-size: 14px; line-height: 1.6; box-shadow: var(--float-shadow); /* taste-skill-ignore: transient floating notification */ opacity: 0; transform: translateY(-14px); transition: opacity 320ms var(--ease-out), transform var(--t-sheet) var(--ease-silk); max-width: 80vw; pointer-events: auto; }
.toast.show { opacity: 1; transform: none; }
.toast-success { background: var(--success); }
.toast-error { background: var(--error); }
.toast-info { background: var(--night); }
.toast-message { min-width: 0; overflow-wrap: anywhere; }
.toast-dismiss { flex-shrink: 0; border: 0; color: inherit; background: transparent; min-width: 44px; min-height: 44px; padding: 8px; text-decoration: underline; }

/* ===================== 弹窗 ===================== */
#modal-root { position: fixed; inset: 0; z-index: 9000; pointer-events: none; }
.modal-overlay { position: fixed; inset: 0; z-index: 9000; background: rgba(33, 31, 28, .42); display: flex; align-items: flex-start; justify-content: center; padding: 48px 20px; overflow-y: auto; pointer-events: auto; animation: fadeIn 260ms var(--ease-out); }
.modal { background: var(--ground); border-radius: var(--radius-sheet); width: 560px; max-width: 100%; box-shadow: 0 30px 80px rgba(33, 31, 28, .22); /* taste-skill-ignore: modal floats above a dimmed page */ display: flex; flex-direction: column; max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); overflow: hidden; animation: modalRise var(--t-sheet) var(--ease-silk); }
.modal.modal-wide { width: 720px; }
.modal.modal-xl { width: 900px; }
.modal-header { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 12px 16px 12px 22px; background: var(--surface); }
.modal-title { font-size: 17px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.modal-close { display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; appearance: none; background: var(--field); border: 0; line-height: 1; color: var(--ink-2); border-radius: 50%; flex: 0 0 44px; }
.modal-close svg, .img-cell .img-del svg { display: block; width: 20px; height: 20px; pointer-events: none; }
.modal-close:hover { color: var(--ink); background: #E3DDD2; }
.modal-body { flex: 1 1 auto; min-height: 0; padding: 20px 22px; overflow-y: auto; overscroll-behavior-y: contain; }
.modal-body > .panel:last-child { margin-bottom: 0; }
.modal-footer { flex-shrink: 0; background: var(--surface); padding: 14px 22px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--hairline); }
.modal-footer > div { display: flex; gap: 10px; justify-content: flex-end; }
.modal-confirm { background: var(--surface); }
.modal-confirm .modal-body { padding-top: 4px; }
.modal-confirm .modal-footer { border-top: 0; padding-top: 6px; }
.modal-confirm .confirm-text { color: var(--ink-2); font-size: 15px; }
.confirm-text strong { color: var(--error); }
.account-modal .btn + .btn { margin-top: 10px; }
.account-summary { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; padding: 16px; background: var(--surface); border-radius: var(--radius); }
.account-summary .profile-avatar { width: 48px; height: 48px; font-size: 24px; }
.account-summary h3 { font-size: 17px; font-weight: 600; }
.account-summary p { font-size: 14px; }

/* ===================== 分页 ===================== */
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; gap: 12px; flex-wrap: wrap; }
.pager-info { color: var(--ink-3); font-size: 13px; }
.pager-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.pager-btn { min-width: 40px; min-height: 40px; padding: 6px 12px; border: 0; background: var(--field); color: var(--ink-2); border-radius: var(--radius-control); font-size: 14px; font-variant-numeric: tabular-nums; }
.pager-btn:hover:not(:disabled) { color: var(--ink); background: #E3DDD2; }
.pager-btn:disabled { opacity: .45; cursor: not-allowed; }
.pager-btn.active { background: var(--ink); color: #fff; }
.panel .pager { margin: 0; padding: 12px 0 0; }

/* ===================== 筛选 ===================== */
.filter-tabs { position: sticky; top: calc(-1 * var(--pt, 0px)); z-index: 6; margin: 0 -36px 12px; padding: 8px 36px; background: var(--ground); }
.tabs { display: inline-flex; max-width: 100%; overflow-x: auto; background: var(--field); border-radius: var(--radius); padding: 3px; gap: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; z-index: 1; flex-shrink: 0; border: 0; background: transparent; border-radius: var(--radius-control); min-height: 40px; padding: 8px 18px; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { background: var(--night); color: #fff; font-weight: 500; }
.tabs.seg { position: relative; }
.seg.seg-ready .tab.active { background: var(--night); }
.seg-indicator { position: absolute; left: 0; top: 3px; bottom: 3px; width: 100px; border-radius: var(--radius-control); background: var(--night); transform-origin: 0 0; opacity: 0; pointer-events: none; transition: transform var(--t-sheet) var(--ease-silk); }
.seg-ready .seg-indicator { opacity: 1; }
.filter-bar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .field { margin-bottom: 0; }
.filter-bar .field-error:empty { display: none; }
.filter-bar .input { min-width: 140px; }
.filter-bar .field:has(input[type="text"]), .filter-bar .field:has(input[type="search"]) { flex: 1 1 240px; }
.filter-compact .filter-more { display: contents; }
.filter-compact .filter-more > .field { order: 1; }
.filter-compact .filter-search { order: 2; }
.filter-compact .filter-actions { order: 3; display: flex; gap: 8px; }
.filter-compact > .filter-clear { order: 4; }
.filter-toggle { display: none; }
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }

/* ===================== 工作台 ===================== */
.dashboard-head { margin-bottom: 20px; }
.dashboard-date { color: var(--ink-3); font-size: 14px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr); gap: 16px; margin-bottom: 8px; align-items: stretch; }
.sales-overview { background: var(--night); color: #fff; border-radius: var(--radius); padding: 14px 20px; display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 116px; }
.sales-caption { display: flex; justify-content: space-between; align-items: center; color: #C9CFC9; font-size: 14px; }
.sales-total { font: 600 32px/1.3 var(--font-system); letter-spacing: 0; margin: 2px 0 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sales-footnote { font-size: 13px; color: #B9C0BA; }
.overview-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; min-height: 116px; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.stat-metric { min-width: 0; background: transparent; border-radius: 0; padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.overview-stats .stat-metric + .stat-metric { border-left: 1px solid var(--hairline); }
.stat-icon { color: var(--ink-3); display: inline-flex; }
.stat-icon svg { width: 20px; height: 20px; }
.stat-value { font: 600 24px/1.35 var(--font-system); letter-spacing: 0; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-label { color: var(--ink-2); font-size: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 10px; }
.section-heading .section-title { margin: 0; }
.section-link { color: var(--bronze); font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; }
.section-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.dash-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash-cols .panel { margin-bottom: 0; }
.dashboard-tasks .panel-head { min-height: 72px; }
.dashboard-tasks .dash-item { min-height: 74px; }
.dashboard-tasks .panel-head .badge { margin-left: auto; }
.dashboard-tasks .panel-body { padding: 4px 20px 8px; }
.empty.dashboard-empty { align-items: flex-start; padding: 6px 0; gap: 4px; text-align: left; }
.empty.dashboard-empty .empty-mark { display: none; }
.dashboard-empty-note { color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.dashboard-empty-lines { display: grid; gap: 4px; }
.dash-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.dash-item + .dash-item { border-top: 1px solid var(--hairline); }
.dash-thumb { width: 40px; height: 50px; border-radius: var(--radius-sm); object-fit: cover; background: var(--sand); flex-shrink: 0; }
.dash-item-info { flex: 1; min-width: 0; }
.dash-item-name { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dash-item-sub { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-item-right { font: 600 16px/1.4 var(--font-system); color: var(--bronze); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-stock { font-size: 13px; color: var(--ink-3); }
.dash-stock.low { color: var(--error); font-weight: 600; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.quick-link { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--surface); border-radius: var(--radius); }
.quick-link:hover { background: var(--hover); }
.quick-icon, .feature-icon { width: 20px; height: 20px; border-radius: 0; display: grid; place-items: center; color: var(--ink-2); background: transparent; flex-shrink: 0; }
.quick-icon svg, .feature-icon svg { width: 18px; height: 18px; }
.quick-link strong { display: block; font-size: 15px; font-weight: 500; }
.quick-link small { display: block; font-size: 13px; color: var(--ink-3); }
.trend-panel { margin-top: 0; }
.trend-zero { display: flex; align-items: baseline; gap: 12px; min-height: 40px; }
.trend-zero-value { font: 600 20px/1.35 var(--font-system); color: var(--ink); font-variant-numeric: tabular-nums; }
.trend-zero-caption { color: var(--ink-2); font-size: 14px; }
.trend-chart { display: flex; align-items: flex-end; gap: 14px; height: 160px; padding-top: 8px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.trend-amount { font-size: 13px; color: var(--ink-3); margin-bottom: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.trend-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.trend-bar { width: 60%; max-width: 32px; background: var(--bronze); border-radius: 2px 2px 0 0; }
.trend-label { font-size: 13px; color: var(--ink-3); margin-top: 8px; font-variant-numeric: tabular-nums; }
.trend-table { margin-top: 12px; }
.trend-table summary { cursor: pointer; color: var(--bronze); min-height: 44px; display: flex; align-items: center; font-size: 14px; }
.trend-table table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.trend-table th, .trend-table td { text-align: right; padding: 8px; border-bottom: 1px solid var(--hairline); }
.trend-table th { color: var(--ink-3); font-weight: 500; font-size: 13px; }
.trend-table th:first-child, .trend-table td:first-child { text-align: left; }

/* 全部功能 */
.feature-section { margin: 20px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.feature-link { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; background: var(--surface); border-radius: var(--radius); font-size: 15px; }
.feature-link:hover { background: var(--hover); }
.feature-arrow { margin-left: auto; color: var(--ink-3); font-size: 20px; line-height: 1; }
.account-entry { margin-top: 28px; }

/* ===================== 空状态 / 加载 ===================== */
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: var(--ink-3); padding: 12px 16px; font-size: 14px; }
.loading-box { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 64px 0; color: var(--ink-3); font-size: 14px; animation: fadeIn 400ms var(--ease-out) 120ms backwards; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--field); border-top-color: var(--ink); animation: spin .8s linear infinite; }

/* ===================== 图片上传 ===================== */
.img-upload { position: relative; cursor: pointer; }
.img-upload-preview { position: relative; overflow: hidden; border: 1px dashed #CFC7B9; border-radius: var(--radius); background: var(--tone); display: flex; align-items: center; justify-content: center; min-height: 110px; transition: border-color var(--t-press); }
.img-upload:hover .img-upload-preview { border-color: var(--ink-3); }
.img-upload-preview img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.img-upload-preview.has-img { border-style: solid; border-color: transparent; min-height: 160px; }
.img-upload-preview.uploading { opacity: .65; pointer-events: none; }
.img-upload-hint { color: var(--ink-3); font-size: 13px; position: relative; z-index: 1; padding: 10px; }
.img-upload-preview.has-img .img-upload-hint { position: absolute; bottom: 0; left: 0; right: 0; background: var(--night); color: #fff; padding: 6px; text-align: center; }
.img-upload-size { position: absolute; top: 8px; right: 8px; z-index: 3; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--night); color: #fff; font-size: 13px; line-height: 1.5; pointer-events: none; }
.ratio-wide .img-upload-preview { aspect-ratio: 16 / 9; }
.ratio-splash .img-upload-preview { aspect-ratio: 9 / 16; }
.ratio-main .img-upload-preview { aspect-ratio: 75 / 56; }
.ratio-banner .img-upload-preview { aspect-ratio: 343 / 150; }
.ratio-square .img-upload-preview { aspect-ratio: 1 / 1; }
.img-list { display: flex; flex-wrap: wrap; gap: 10px; }
.img-list .img-empty { color: var(--ink-3); font-size: 13px; }
.img-cell { position: relative; width: 90px; height: 112.5px; border-radius: var(--radius-sm); overflow: hidden; background: var(--sand); }
.img-cell img { width: 100%; height: 100%; object-fit: cover; }
.img-cell .img-del { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; appearance: none; border-radius: 0 0 0 var(--radius); border: 0; background: rgba(33, 31, 28, .62); color: #fff; line-height: 1; }
.img-cell.cover::after { content: '封面'; position: absolute; bottom: 0; left: 0; right: 0; background: var(--night); color: #fff; font-size: 13px; text-align: center; padding: 2px; }
.img-add { width: 90px; height: 112.5px; border-radius: var(--radius-sm); border: 1px dashed #CFC7B9; background: var(--tone); color: var(--ink-3); font-size: 26px; display: flex; align-items: center; justify-content: center; }
.img-add:hover { border-color: var(--ink-3); color: var(--ink); }

/* ===================== 首页装修 / 详情块 ===================== */
.home-section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin: 4px 0 14px; }
.banner-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px; border-radius: var(--radius); margin-bottom: 10px; background: var(--ground); }
.banner-row .banner-img-col { width: 200px; flex: 0 0 200px; margin-bottom: 0; }
.banner-row .banner-img-col .img-upload { width: 100%; }
.banner-row .img-upload-preview { min-height: 0; }
.banner-row .img-upload-preview img { object-fit: contain; }
.banner-row .banner-fields { flex: 1; min-width: 0; }
.announce-row { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--radius); margin-bottom: 10px; background: var(--ground); }
.announce-row-foot { margin-top: 8px; display: flex; justify-content: flex-end; }
.save-bar { position: sticky; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--hairline); margin: 24px -36px 0; padding: 14px 36px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.save-bar-note { flex: 1; min-width: 0; color: var(--ink-2); font-size: 14px; }
.home-image-field .img-upload { width: 100%; min-width: 0; max-width: 560px; }
.home-image-field .img-upload-preview { width: 100%; min-width: 0; min-height: 0; }
.home-image-field .img-upload-preview img { object-fit: contain; }
.home-image-field .ratio-main { max-width: 480px; }
.home-image-field .ratio-splash { max-width: 220px; }
.detail-block { border-radius: var(--radius); padding: 14px; margin-bottom: 10px; background: var(--ground); }
.detail-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.detail-block-type { font-size: 13px; color: var(--ink-2); }

/* ===================== 订单详情 ===================== */
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.detail-head .cell-primary { font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.detail-actions { display: flex; gap: 8px; margin-top: 12px; }
.timeline { margin-bottom: 4px; }
.tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.tl-item::before { content: ''; position: absolute; left: 4px; top: 14px; bottom: 0; width: 2px; background: var(--field); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); flex: 0 0 10px; margin-top: 6px; z-index: 1; }
.tl-dot.done { background: var(--line); }
.tl-body { flex: 1; }
.tl-title { font-size: 14px; font-weight: 500; }
.tl-time { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.detail-table td { padding: 8px 6px; }
.amount-line { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.amount-line.total { font-size: 15px; font-weight: 600; color: var(--ink); border-top: 1px solid var(--hairline); margin-top: 8px; padding-top: 12px; align-items: baseline; }
.amount-line.total .val { color: var(--bronze); font: 600 20px/1.35 var(--font-system); }
.express-box { background: var(--tone); border-radius: var(--radius); padding: 12px 14px; margin-top: 10px; font-size: 14px; }
.address-summary { background: var(--surface); padding: 14px; border-radius: var(--radius); margin-bottom: 20px; overflow-wrap: anywhere; }

/* ===================== 会员详情 ===================== */
.tab-bar { display: flex; gap: 4px; margin-bottom: 16px; }
.tab-btn { border: 0; background: none; min-height: 44px; padding: 10px 14px; font-size: 15px; color: var(--ink-2); border-radius: var(--radius-control); flex-shrink: 0; }
.tab-btn.active { color: var(--ink); font-weight: 600; background: var(--field); }
.member-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.avatar-lg { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--sand); }
.kv { display: flex; gap: 8px; padding: 9px 0; font-size: 14px; }
.kv + .kv { border-top: 1px solid var(--hairline); }
.kv .k { width: 90px; color: var(--ink-3); flex: 0 0 90px; }
.kv .v { color: var(--ink); flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* ===================== 等级 ===================== */
.tier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tier-card { background: var(--surface); border-radius: var(--radius); padding: 20px; }
.tier-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tier-level { color: var(--bronze); font: 600 16px/1.4 var(--font-system); }
.tier-card .field { margin-bottom: var(--space-field); }

/* ===================== 积分核对 ===================== */
.point-adjustment-form [hidden], .point-review[hidden], .point-adjustment-form[hidden] { display: none !important; }
.point-note { color: var(--ink-2); font-size: 14px; line-height: 1.7; margin: 12px 0 18px; }
.point-check { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; line-height: 1.6; cursor: pointer; }
.point-check input { flex: 0 0 auto; margin: 3px 0 0; }
.point-error { color: var(--error); line-height: 1.6; }
.point-review .v { overflow-wrap: anywhere; }
.point-review .field { margin-top: 16px; }
.point-review .inline-row { flex-wrap: wrap; }
.point-presets { flex-wrap: wrap; margin-bottom: 12px; }

/* ===================== 核销与门店 ===================== */
.pickup-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
.pickup-entry { background: var(--night); color: #fff; padding: 24px; border-radius: var(--radius); margin-bottom: 16px; }
.pickup-entry h3 { font: 600 22px/1.4 var(--font-system); letter-spacing: 0; margin-bottom: 4px; }
.pickup-entry p { color: #B9C0BA; font-size: 14px; }
.pickup-code-row { display: flex; gap: 8px; margin: 18px 0 4px; }
.pickup-code-row .input { flex: 1; min-width: 0; font-size: 20px; font-weight: 600; letter-spacing: 0; text-transform: uppercase; border-color: transparent; font-variant-numeric: tabular-nums; }
.pickup-code-row .input::placeholder { letter-spacing: 0; text-transform: none; }
.pickup-code-row .input:focus { outline: 2px solid #fff; outline-offset: 2px; }
.pickup-entry .btn { background: var(--ground); color: var(--ink); min-width: 88px; }
.pickup-entry .btn:hover:not(:disabled) { background: #fff; }
.pickup-entry .field-error { color: #F0C2B8; }
.pickup-result .badge { margin-bottom: 12px; }
.pickup-result .btn { width: 100%; margin-top: 16px; }
.pickup-metrics { display: flex; gap: 12px; margin-bottom: 16px; }
.pickup-metrics > div { flex: 1; padding: 16px 20px; border-radius: var(--radius); background: var(--surface); }
.pickup-metrics strong { display: block; font: 600 24px/1.35 var(--font-system); color: var(--ink); font-variant-numeric: tabular-nums; }
.pickup-metrics span { font-size: 14px; color: var(--ink-2); }
.pickup-list-row { padding: 12px 0; }
.pickup-list-row + .pickup-list-row { border-top: 1px solid var(--hairline); }
.pickup-empty { align-items: flex-start; gap: 6px; padding: 8px; text-align: left; }
.pickup-empty-note { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.pickup-list-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pickup-list-row .cell-primary { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pickup-list-row .cell-sub { margin-top: 4px; }
.pickup-list-row .btn { margin-top: 8px; }
.store-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.store-grid .panel { margin: 0; }
.store-grid .detail-actions { padding-top: 14px; }
.store-address { font-size: 15px; }

/* ===================== 编辑器与图片裁切 ===================== */
.editor-section-nav { position: sticky; top: -20px; z-index: 4; display: flex; gap: 4px; overflow-x: auto; margin: -20px -22px 16px; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--hairline); scrollbar-width: none; }
.editor-section-nav button { flex: 1 0 auto; min-height: 44px; border: 0; background: transparent; color: var(--ink-2); border-radius: var(--radius-control); padding: 8px 12px; font-size: 14px; }
.editor-section-nav button.active { background: var(--field); color: var(--ink); font-weight: 500; }
.product-editor .panel { scroll-margin-top: 70px; }
.image-editor-note { color: var(--ink-2); font-size: 14px; margin-bottom: 16px; }
.crop-preview { width: 100%; position: relative; overflow: hidden; background: #fff; border-radius: var(--radius-control); margin: 0 auto; }
.crop-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-orientation: from-image; }
.crop-size { text-align: center; font-size: 13px; color: var(--ink-3); margin: 10px 0 16px; }
.crop-fit { display: flex; width: 100%; margin-bottom: 20px; }
.crop-fit .tab { flex: 1; white-space: nowrap; }
.crop-slider { width: 100%; min-height: 44px; accent-color: var(--ink); }
.crop-positions .field { margin-bottom: 8px; }

.skip-link { position: fixed; left: 16px; top: 12px; z-index: 11000; padding: 12px 20px; background: var(--ink); color: #fff; border-radius: var(--radius); transform: translateY(-180%); }
.skip-link:focus { transform: none; }

/* ===================== 中等宽度 ===================== */
@media (max-width: 1180px) {
  .sidebar { width: 208px; flex-basis: 208px; }
  .topbar { padding: 0 24px; }
  .content { --pt: 8px; padding: var(--pt) 24px 36px; }
  .filter-tabs { margin-inline: -24px; padding-inline: 24px; }
  .save-bar { margin-inline: -24px; padding-inline: 24px; }
  .quick-link { padding: 14px 12px; gap: 10px; }
  .quick-icon { width: 20px; height: 20px; }
}
@media (max-width: 900px) and (min-width: 761px) {
  .sidebar { width: 190px; flex-basis: 190px; }
  .sidebar-brand { padding-inline: 16px; }
  .overview-grid { grid-template-columns: 1fr; }
  .quick-grid, .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-cols, .store-grid, .pickup-layout { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: 1fr; }
  .sales-overview { min-height: 132px; }
  .stat-metric { padding: 16px; }
}

/* ===================== 手机 ===================== */
@media (max-width: 760px) {
  .main-view { display: block; height: var(--visual-height, 100dvh); padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .keyboard-open .main-view { padding-bottom: 0; }
  .keyboard-open .mobile-nav { display: none; }
  .main-area { height: 100%; }
  .sidebar { display: none; }
  .topbar { flex-basis: auto; min-height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0 20px; background: var(--ground); }
  .topbar-heading { display: flex; align-items: center; min-width: 0; gap: 12px; }
  .mobile-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font: 600 20px/1.25 var(--font-system); letter-spacing: 0; color: var(--ink); }
  .mobile-brand span { font: 13px/1.2 var(--sans); padding-left: 10px; border-left: 1px solid var(--line); color: var(--ink-3); }
  .topbar-title, .topbar-admin { display: none; }
  .topbar-right { gap: 0; }
  .icon-button { font-size: 22px; }
  .profile-avatar { width: 30px; height: 30px; font-size: 16px; }
  .content { --pt: 4px; padding: var(--pt) 16px 24px; scrollbar-gutter: auto; }
  .content-with-actions { padding-bottom: 0; scroll-padding-bottom: 130px; }

  /* 底部导航：浮起的白底，选中项上方的指示条滑动 */
  .mobile-nav { position: fixed; display: grid; grid-template-columns: repeat(5, 1fr); left: 0; right: 0; bottom: 0; height: calc(60px + env(safe-area-inset-bottom)); padding: 0 8px env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--hairline); z-index: 100; }
  .mobile-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); min-height: 56px; font-size: 13px; position: relative; }
  .mobile-nav-item .nav-icon { width: 24px; height: 24px; }
  .mobile-nav-item.active { color: var(--ink); font-weight: 600; }
  .mobile-nav-indicator { position: absolute; top: 0; left: 8px; width: calc((100% - 16px) / 5); height: 2px; pointer-events: none; transition: transform var(--t-sheet) var(--ease-silk); }
  .mobile-nav-indicator::before { content: ''; position: absolute; left: 50%; top: 0; width: 28px; height: 2px; margin-left: -14px; background: var(--ink); border-radius: 0 0 2px 2px; }

  .page-head { gap: 16px; align-items: flex-start; margin: 8px 0 20px; }
  .page-title { font-size: 22px; }
  .page-subtitle { font-size: 13px; margin-top: 8px; }
  .content:has(.filter-compact) .page-head .page-subtitle { display: none; }
  .page-head-actions .btn { padding: 10px 14px; font-size: 14px; }
  .btn, .btn-sm, .btn-link, .pager-btn, .tab, .tab-btn { min-height: 44px; }
  .input, select.input, textarea.input { font-size: 16px; min-height: 48px; padding: 11px 12px; line-height: 24px; }
  input.input, select.input { height: 48px; }
  select.input { padding-right: 36px; }
  textarea.input { min-height: 120px; line-height: 1.6; }
  input.input::-webkit-date-and-time-value { min-height: 24px; }
  .field { margin-bottom: var(--space-field); }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .form-row { flex-direction: column; gap: 0; }
  .inline-row { flex-wrap: wrap; }
  .inline-row .input { min-width: 120px; }
  .panel { margin-bottom: 20px; }
  .panel-head { padding: 20px 16px 8px; }
  .panel-body { padding: 16px; }

  /* 筛选：标签吸顶横滑；关键词常显，其余收进「筛选」 */
  .filter-tabs { margin: 0 -16px 8px; padding: 6px 16px; }
  .filter-tabs .tabs { width: 100%; }
  .filter-tabs .tab { flex: 1 0 auto; padding-inline: 14px; }
  .filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; margin-bottom: 20px; }
  .filter-bar .field { min-width: 0; margin: 0; }
  .filter-bar .input { min-width: 0; }
  .filter-compact .filter-search { grid-column: 1; }
  .filter-compact .filter-search .field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .filter-compact .filter-actions { grid-column: 2; align-self: end; }
  .filter-compact .filter-actions .btn { min-height: 48px; padding-inline: 14px; }
  .filter-compact .filter-actions .btn-primary { display: none; }
  .filter-compact:not(:has(.filter-more)) .filter-actions .btn-primary { display: inline-flex; }
  .filter-toggle { display: inline-flex; }
  .filter-toggle[aria-expanded="true"] { background: #DDD6CA; }
  .filter-compact .filter-search { order: 1; }
  .filter-compact .filter-actions { order: 2; }
  .filter-compact .filter-more { order: 3; }
  .filter-compact .filter-more { display: none; grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 10px; padding: 12px; background: var(--surface); border-radius: var(--radius); }
  .filter-compact.open .filter-more { display: grid; animation: rise 320ms var(--ease-silk); }
  .filter-compact.open .filter-actions .btn-primary { display: inline-flex; }
  .filter-compact > .filter-clear { grid-column: 1 / -1; }

  /* 通用表格 → 每条记录一块白底，字段带标题 */
  .table-wrap:has(.responsive-table) { overflow: visible; }
  table.responsive-table { display: block; width: 100%; min-width: 0; font-size: 14px; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .responsive-table tbody { display: grid; gap: 12px; background: var(--ground); }
  .responsive-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 16px; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
  .responsive-table td, .responsive-table td.num { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; min-width: 0; height: auto; padding: 0; border: 0; overflow-wrap: anywhere; background: transparent !important; }
  .responsive-table td.num { align-items: flex-end; text-align: right; font-variant-numeric: tabular-nums; }
  .responsive-table td.num::before { align-self: flex-start; text-align: left; }
  .responsive-table td::before { content: attr(data-label); color: var(--ink-3); font-size: 13px; font-weight: 400; }
  .responsive-table td.card-lead { grid-column: 1 / -1; font-size: 15px; color: var(--ink); font-weight: 500; }
  .responsive-table .card-lead::before, .responsive-table .card-actions::before, .responsive-table td.m-summary::before { display: none; }
  .responsive-table td.card-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 12px; padding-top: 8px; }
  .responsive-table .card-actions .btn-link { background: var(--field); padding: 8px 14px; color: var(--ink); }
  .responsive-table .card-actions .btn-link.danger { color: var(--error); background: #F3E6E2; margin-left: auto; }
  .responsive-table .cell-flex { min-width: 0; align-items: flex-start; }
  .responsive-table .table-thumb { width: 56px; height: 70px; }
  .responsive-table .cat-add .input { max-width: none !important; }
  /* 分类管理：一张连续的工作面板，记录之间用规则分层，避免通用
     表格卡片的圆角与底色反复切断阅读路径。 */
  .category-panel { overflow: hidden; }
  .category-panel > .panel-body { padding: 0 16px 16px; }
  .category-table { display: block; width: 100%; min-width: 0; }
  .category-table thead { display: none; }
  .category-table tbody { display: block; background: transparent; }
  .category-table tbody tr,
  .category-table tbody tr.cat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; padding: 18px 0; margin: 0; background: transparent; border: 0; border-top: 1px solid var(--hairline); border-radius: 0; overflow: visible; }
  .category-table tbody tr.cat-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 20px; padding: 16px 12px; margin: 4px 0 0; background: var(--tone); border-top: 0; border-radius: var(--radius); overflow: visible; }
  .category-table tbody tr.cat-edit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: transparent; }
  .category-table td,
  .category-table td.num { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; min-width: 0; height: auto; padding: 0; border: 0; text-align: left; overflow-wrap: anywhere; background: transparent !important; }
  .category-table td::before { color: var(--ink-3); font-size: 12px; line-height: 1.4; letter-spacing: .02em; }
  .category-table td.card-lead { grid-column: 1 / -1; font-size: 16px; font-weight: 600; color: var(--ink); }
  .category-table td.card-lead::before { display: none; }
  .category-table td.num { font-size: 16px; line-height: 1.4; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
  .category-table td.num::before { align-self: flex-start; font-size: 12px; font-weight: 400; color: var(--ink-3); }
  .category-table tbody tr.cat-row > td:nth-child(4) { grid-column: auto; align-items: flex-end; text-align: right; }
  .category-table tbody tr.cat-row > td:nth-child(4)::before { align-self: flex-end; }
  .category-table tbody tr.cat-edit > td:nth-child(4) { grid-column: 1 / -1; align-items: flex-start; text-align: left; }
  .category-table tbody tr.cat-edit > td:nth-child(4)::before { align-self: flex-start; }
  .category-table tbody tr.cat-edit > td.card-lead .input { width: 100%; max-width: none !important; }
  .category-table td.card-actions { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; padding-top: 2px; }
  .category-table td.card-actions::before { display: none; }
  .category-table td.card-actions .btn-link { min-height: 44px; padding: 8px 14px; background: var(--field); color: var(--ink); }
  .category-table td.card-actions .btn-link.danger { margin-left: 0; background: #F3E6E2; color: var(--error); }
  .category-table .cat-add .input { width: 100%; max-width: none !important; }
  .category-table .cat-add td:nth-child(4) { min-height: 34px; }
  .category-table .cat-add td:nth-child(5) { padding-top: 2px; }
  .category-table .cat-add td:nth-child(5) .btn { min-height: 44px; }
  .panel:has(.responsive-table) > .panel-body.no-pad { padding-top: 6px; }

  /* 记录卡：摘要与操作分层排布；按钮留在正常文档流，整行仍可点。 */
  .panel:has(> .panel-body.no-pad .m-row) > .panel-head { display: none; }
  .panel:has(.m-row) > .panel-body.no-pad { padding: 0; }
  .panel-body:not(.no-pad) > .table-wrap:has(.m-row) { margin: 4px -16px -16px; }
  .responsive-table tr.m-row > td::before { display: none; }
  .responsive-table tbody tr.m-row { position: relative; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; }
  .responsive-table tr.m-row > td { display: none; }
  .responsive-table tr.m-row > td.m-summary { order: -1; display: flex; flex-direction: row; align-items: flex-start; gap: 12px; padding: 16px; }
  .responsive-table tr.m-row > td.card-actions, .responsive-table tr.m-row > td:has(.row-hit) { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 0 16px; }
  .responsive-table tr.m-row > td.card-actions:has(> :not(.row-hit)), .responsive-table tr.m-row > td.card-actions:has(.row-actions > :not(.row-hit)) { padding-bottom: 16px; }
  .m-row .row-actions { display: contents; }
  .m-row .row-hit { position: absolute; inset: 0; z-index: 1; width: 100%; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: var(--radius); background: transparent !important; color: transparent !important; font-size: 0; }
  .m-row .row-hit:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
  .m-row .card-actions > :not(.row-hit), .m-row .row-actions > :not(.row-hit) { position: relative; z-index: 2; }
  .m-row .card-actions .btn-link:not(.row-hit), .m-row .card-actions .btn-sm:not(.row-hit) { min-width: 44px; min-height: 44px; padding: 10px 14px; font-size: 14px; background: var(--field); color: var(--ink); }
  .m-row .card-actions .btn-link.danger, .m-row .card-actions .btn-danger-ghost { margin-left: 0; background: #F3E6E2; color: var(--error); }
  .m-row .card-actions .btn-sm.row-inline:not(.row-hit) { margin-left: auto; background: var(--ink); color: #fff; padding-inline: 18px; }
  .m-row .card-actions .btn-primary:not(.row-inline):not(.row-hit) { background: var(--ink); color: #fff; }
  .m-row:has(.row-hit) { cursor: pointer; }
  @media (hover: hover) { .m-row:has(.row-hit):hover { background: var(--hover); } }
  .m-thumb { width: 52px; height: 65px; border-radius: var(--radius-sm); object-fit: cover; background: var(--sand); flex-shrink: 0; font-size: 20px; }
  .m-avatar { width: 44px; height: 44px; border-radius: 50%; }
  .m-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
  .m-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
  .m-line:first-child { align-items: center; }
  .m-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; line-height: 1.5; }
  .m-no { font-variant-numeric: tabular-nums; letter-spacing: 0; }
  .m-end { flex-shrink: 0; display: inline-flex; gap: 4px; }
  .m-end .role-badges { flex-wrap: nowrap; }
  .m-meta { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; line-height: 1.6; }
  .m-line + .m-line + .m-line .m-meta { font-size: 13px; color: var(--ink-3); }
  .m-low { color: var(--error); font-weight: 600; }
  .m-amount { flex-shrink: 0; font: 600 16px/1.4 var(--font-system); color: var(--bronze); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
  .m-amount.is-points { color: var(--ink); }
  .m-amount.neg { color: var(--ink-3); font-weight: 500; }
  .m-amount.pos { font-weight: 600; }
  .content:has(.m-row) .pager { margin-top: 12px; }

  /* 弹窗：手机全屏，沿 silk 曲线自下而上 */
  .modal-overlay { padding: 0; align-items: stretch; overflow: hidden; top: var(--visual-top, 0px); bottom: auto; height: var(--visual-height, 100dvh); }
  .modal, .modal.modal-wide, .modal.modal-xl { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; box-shadow: none; /* taste-skill-ignore: full-screen mobile editor */ animation: sheetUp var(--t-sheet) var(--ease-silk); }
  .modal-header { padding: calc(8px + env(safe-area-inset-top)) 12px 8px 20px; min-height: calc(60px + env(safe-area-inset-top)); }
  .modal-body { padding: 16px; }
  .editor-section-nav { top: -16px; margin: -16px -16px 16px; padding: 6px 10px; }
  .modal-footer { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--hairline); }
  .modal-footer > div { width: 100%; display: flex; flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; min-height: 48px; white-space: normal; }
  .modal-confirm { align-self: flex-end; height: auto; max-height: calc(100% - 48px); width: 100%; border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; box-shadow: var(--float-shadow); /* taste-skill-ignore: confirmation sheet floats over the page */ }
  .modal-confirm .modal-header { min-height: auto; padding: 20px 16px 8px 20px; }
  .modal-confirm .modal-body { padding: 4px 20px 12px; }
  .modal-confirm .modal-footer { padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }
  .detail-head, .detail-actions { flex-wrap: wrap; gap: 10px; }
  .detail-actions .btn { flex: 1; white-space: normal; }
  .banner-row { flex-direction: column; padding: 12px; }
  .banner-row .banner-img-col { width: 100%; max-width: none; flex-basis: auto; }
  .banner-row .banner-fields { width: 100%; }
  .save-bar { margin: 20px -16px 0; padding: 10px 16px; gap: 10px; }
  .save-bar .btn { min-height: 48px; flex-shrink: 0; }
  .pager { gap: 10px; }
  .pager-btn { min-width: 44px; min-height: 44px; padding-inline: 10px; }

  /* 工作台 */
  .dashboard-head { flex-direction: row; align-items: baseline; justify-content: space-between; margin: 6px 0 12px; }
  .dashboard-head .page-subtitle { display: none; }
  .dashboard-head .page-head-actions { width: auto; }
  .dashboard-date { font-size: 13px; }
  .overview-grid { grid-template-columns: 1fr; gap: 16px; margin-bottom: 0; }
  .sales-overview { padding: 18px 20px; min-height: 0; }
  .sales-total { font-size: 40px; margin: 8px 0 4px; }
  .sales-footnote { font-size: 13px; }
  .overview-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; background: transparent; border-radius: 0; overflow: visible; }
  .overview-stats .stat-metric, .overview-stats .stat-metric:last-child { grid-column: auto; min-height: 92px; padding: 16px 12px; gap: 8px; background: var(--surface); border: 0; border-radius: var(--radius); }
  .overview-stats .stat-value { font-size: 24px; }
  .overview-stats .stat-label { font-size: 13px; }
  .section-heading { margin: 24px 0 12px; }
  .dash-cols, .tier-grid, .store-grid, .pickup-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .dashboard-tasks .panel-body { padding: 4px 16px 8px; }
  .dashboard-tasks .panel-head { padding-top: 20px; }
  .dash-item { padding: 16px 0; }
  .dash-item-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.45; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
  .quick-link { min-height: 56px; padding: 8px 12px; gap: 10px; }
  .quick-icon { width: 20px; height: 20px; background: transparent; }
  .quick-link strong { font-size: 15px; }
  .quick-link small { display: none; }
  .trend-chart { gap: 4px; height: 132px; }
  .trend-amount { writing-mode: vertical-rl; align-self: center; min-height: 42px; }
  .feature-section { margin: 16px 0; }
  .feature-section .section-title { margin-bottom: 8px; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .feature-link { min-height: 56px; padding: 10px 12px; gap: 10px; font-size: 15px; }
  .feature-icon { width: 32px; height: 32px; background: transparent; }
  .feature-arrow { display: none; }

  /* 核销 */
  .pickup-metrics { gap: 8px; margin-bottom: 12px; }
  .pickup-metrics > div { padding: 12px 16px; }
  .pickup-metrics strong { font-size: 24px; }
  .pickup-entry { padding: 20px 16px; margin-bottom: 12px; }
  .pickup-code-row { gap: 8px; }
  .pickup-code-row .input { font-size: 20px; }
  .pickup-code-row .btn { padding-inline: 14px; min-height: 48px; }

  /* 登录 */
  .login-view { display: block; max-width: 440px; padding: max(72px, calc(env(safe-area-inset-top) + 48px)) 24px 48px; }
  .login-wordmark { font-size: 40px; }
  .login-tagline { margin-top: 12px; }
  .login-card { background: transparent; padding: 0; margin-top: 48px; }
  .login-welcome { margin-bottom: 22px; }
  .login-card .btn-primary { min-height: 52px; }

  #toast-container { top: calc(12px + env(safe-area-inset-top)); width: 100%; padding: 0 16px; }
  .toast { max-width: 100%; }
}
@media (max-width: 359px) {
  .content { padding-inline: 16px; }
  .topbar { padding-left: 14px; }
  .filter-tabs { margin-inline: -16px; padding-inline: 16px; }
  .page-head { flex-wrap: wrap; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; }
  .save-bar { margin-inline: -16px; padding-inline: 16px; }
  .sales-overview { padding: 16px; }
  .sales-total { font-size: 34px; }
  .overview-stats .stat-value { font-size: 21px; }
  .feature-link { padding: 10px 8px; gap: 8px; }
  .responsive-table tbody tr { padding: 16px; }
  .responsive-table tbody tr.m-row { padding: 0; }
  .responsive-table tr.m-row > td.m-summary { padding: 16px; }
  .login-wordmark { font-size: 36px; }
}

/* 减少动态效果：取消位移与延迟，内容直接可见 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .btn:active, .tab:active, .tab-btn:active, .nav-item:active, .mobile-nav-item:active, .quick-link:active, .feature-link:active, .pager-btn:active, .icon-button:active, .profile-button:active, .img-add:active, .m-row:has(.row-hit:active) { transform: none !important; }
  .spinner, .btn.loading::before { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
}

@media (forced-colors: active) {
  button:focus-visible, a:focus-visible, [tabindex]:focus-visible, .input:focus { outline: 2px solid Highlight; outline-offset: 3px; }
  .input, select.input, textarea.input { border-color: CanvasText; }
  .tab.active, .nav-item.active { outline: 2px solid Highlight; }
  .seg-indicator, .mobile-nav-indicator { display: none; }
}

/* 分区编辑：目录与单项编辑分开，保存区独立于滚动内容。 */
.content-task-editor { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.content-task-editor.route-enter { animation: none; }
.content-task-editor > .page-head { flex-shrink: 0; }
  .content-task-editor > .save-bar { position: relative; flex-shrink: 0; margin: 0; padding: 14px 0; background: var(--ground); border-top: 1px solid var(--line); }
.content-task-editor > .save-bar .save-bar-note { margin: 0; }
.form-workspace { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; }
.workspace-intro { color: var(--ink-2); font-size: 14px; line-height: 1.6; margin: 0 0 8px; }
.workspace-status { flex-shrink: 0; font-size: 13px; line-height: 1.6; color: var(--ink-3); margin: 0 0 16px; }
.workspace-index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; overflow-y: auto; padding-bottom: 20px; align-content: start; }
.workspace-link { width: 100%; min-width: 0; min-height: 88px; display: flex; align-items: center; gap: 16px; text-align: start; padding: 16px 20px; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.workspace-link-copy { flex: 1; min-width: 0; display: block; }
.workspace-link-title { display: block; font-size: 16px; font-weight: 600; line-height: 1.5; }
.workspace-link-summary { display: block; font-size: 13px; line-height: 1.6; color: var(--ink-2); margin-top: 4px; overflow-wrap: anywhere; }
.workspace-arrow { flex: 0 0 16px; text-align: end; font-size: 26px; color: var(--ink-3); }
.workspace-draft { display: inline-block; color: var(--bronze); font-size: 13px; line-height: 1.6; margin-top: 4px; }
.workspace-link.active { background: var(--field); }
.workspace-stage { display: none; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 24px; scroll-padding-top: 80px; scroll-padding-bottom: 24px; }
.workspace-toolbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; background: var(--ground); padding: 0 0 12px; }
.workspace-back { flex-shrink: 0; }
.workspace-select { min-width: 0; flex: 1; }
.workspace-panel { margin: 0; }
.workspace-panel .panel-body > .field:last-child { margin-bottom: 0; }
.workspace-panel .btn-sm { min-height: 44px; min-width: 44px; }
.workspace-panel .panel-title, .workspace-panel .tier-level { outline-offset: 4px; }
.workspace-editing { display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); column-gap: 24px; }
.workspace-editing > .workspace-status { grid-column: 1 / -1; }
.workspace-editing > .workspace-index { display: flex; flex-direction: column; gap: 8px; }
.workspace-editing > .workspace-index .workspace-link { padding: 14px 16px; min-height: 80px; }
.workspace-editing > .workspace-stage { display: block; }
.workspace-editing .workspace-back { display: none; }
.workspace-modal .modal-body { display: flex; flex-direction: column; overflow: hidden; }
.workspace-modal { box-shadow: none; /* taste-skill-ignore: workspace editor is a modal layer */ }
.workspace-modal .modal-footer { border-top: 1px solid var(--line); }
.modal-feedback { flex-shrink: 0; max-height: 25dvh; overflow-y: auto; padding: 12px 16px; background: var(--surface); }
.modal-feedback:empty { display: none; }
.modal-feedback .toast { width: 100%; max-width: none; box-shadow: none; /* taste-skill-ignore: status feedback inside modal */ opacity: 1; transform: none; }
.modal-feedback .toast + .toast { margin-top: 8px; }
.workspace-modal .workspace-toolbar { background: var(--surface); }
.workspace-modal .workspace-stage { padding-right: 2px; }
.workspace-panel .detail-block .img-upload, .workspace-panel .detail-block .img-upload-preview { width: 100%; min-width: 0; min-height: 0; }
.workspace-panel .detail-block-head { gap: 8px; }
.workspace-panel .detail-block-head .btn { flex-shrink: 0; }
.workspace-panel.tier-card { align-self: start; padding: 20px; }
.home-entry { margin-bottom: 12px; padding: 0 16px; border-radius: var(--radius-control); background: var(--ground); }
.home-entry > summary { cursor: pointer; min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 12px 0; list-style: none; color: var(--ink); }
.home-entry > summary::-webkit-details-marker { display: none; }
.home-entry > summary::after { content: '+'; margin-inline-start: auto; font-size: 22px; }
.home-entry[open] > summary::after { content: '−'; }
.home-entry-copy { min-width: 0; flex: 1; }
.home-entry-title { display: block; font-size: 15px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.home-entry-note { display: block; font-size: 13px; line-height: 1.6; color: var(--ink-2); margin-top: 4px; }
.home-entry .banner-row, .home-entry .announce-row { padding: 0 0 16px; margin: 0; border: 0; background: transparent; }
.home-entry .banner-row { border-radius: 0; }
.home-entry .img-upload-preview { background: var(--surface); }
.feature-search { margin-bottom: 20px; }
@media (hover: hover) { .workspace-link:hover { background: var(--field); } }
@media (max-width: 1100px) {
  .workspace-editing { display: flex; }
  .workspace-editing > .workspace-index { display: none; }
  .workspace-editing > .workspace-stage { display: block; flex: 1; }
  .workspace-editing .workspace-back { display: inline-flex; min-height: 48px; padding-inline: 12px; }
  .workspace-panel .banner-row { flex-wrap: wrap; }
  .workspace-panel .banner-fields { flex: 1 1 260px; }
}
@media (max-width: 760px) {
  .content-task-editor { padding-bottom: 0; }
  .content-task-editor > .page-head { margin-bottom: 16px; }
  .content-task-editor > .save-bar { margin: 0 -16px; padding: 10px 16px; background: var(--surface); }
  .content-task-editor > .save-bar .btn { min-width: 112px; }
  .content-task-editor > .save-bar .save-bar-note { font-size: 13px; line-height: 1.5; }
  .workspace-index { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .workspace-link { min-height: 80px; padding: 14px 16px; }
  .birthday-mode-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .birthday-mode-option { min-height: 68px; padding: 13px 14px; }
  .birthday-preview { align-items: flex-start; flex-direction: column; gap: 2px; margin-bottom: 20px; }
  .workspace-editing { display: flex; }
  .workspace-editing > .workspace-index { display: none; }
  .workspace-editing > .workspace-stage { display: block; flex: 1; }
  .workspace-editing .workspace-back { display: inline-flex; min-height: 48px; padding-inline: 12px; }
  .workspace-toolbar { gap: 8px; }
  .workspace-status { margin-bottom: 12px; }
  .workspace-modal .modal-body { padding-bottom: 0; }
  .workspace-panel.tier-card { padding: 16px; }
  .home-entry { padding-inline: 12px; }
  .home-entry .banner-row .banner-img-col { margin: 0 0 16px; }
}

/* Maintenance uses one readable column on phones; values align on the right. */
.maintenance-counts { margin: 0 0 20px; }
.maintenance-counts > div { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--border, #e8e8e8); }
.maintenance-counts dt { color: var(--muted, #5f6368); }
.maintenance-counts dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.maintenance-details { margin: 0 0 20px; overflow-wrap: anywhere; }
.maintenance-details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; text-decoration: underline; text-underline-offset: 4px; }
.maintenance-details ul { padding-left: 20px; line-height: 1.8; }
.maintenance-review { margin-bottom: 20px; }
.maintenance-result { padding: 16px; border: 1px solid var(--border, #e8e8e8); border-radius: 16px; overflow-wrap: anywhere; }

.kv .v, .member-balance { font-variant-numeric: tabular-nums; }
.member-head + .tab-bar { overflow-x: auto; scrollbar-width: none; }
.member-head + .tab-bar .tab-btn { flex-shrink: 0; white-space: nowrap; }
.maintenance-inventory .panel-head { align-items: flex-start; flex-direction: column; }
.maintenance-inventory .panel-subtitle { max-width: 76ch; line-height: 1.7; }
.maintenance-inventory .panel-body > .btn { margin-top: 0; }
.maintenance-counts { margin-bottom: 12px; }
.maintenance-details { margin-bottom: 12px; }
.maintenance-links { display: flex; gap: 12px; flex-wrap: wrap; }
.maintenance-links > .btn { margin-top: 0; }

.accounts-panel .panel-head { align-items: flex-start; flex-direction: column; }
.accounts-panel .panel-body { padding-top: 8px; }

.modal { font-variant-numeric: tabular-nums; }

.maintenance-inventory .panel-body { padding-top: 8px; }
