/* =============================================================
   沐澜美容店 · 商家 Web 端 UI 层
   依据《-_商家运营端UIUX设计规范_20261109.md》P0 部分落地。
   本文件在 style.css 之后引入，仅负责视觉与布局，不改动任何业务逻辑。
   整体换肤：只替换下方 :root 中的令牌即可。
   ============================================================= */

/* ---------------------------------------------------------- 1. 设计令牌 */
:root {
  /* 品牌色 */
  --brand-900: #43291F;
  --brand-800: #5E3A2E;
  --brand-700: #7B4A3A;
  --brand-600: #8C5A4A;
  --brand-400: #B98D7B;
  --brand-300: #D8B9AC;
  --brand-200: #EBD8CF;
  --brand-100: #F3E7E1;
  --brand-50: #FAF4F1;
  /* 香槟金 */
  --gold-600: #B08A57;
  --gold-500: #C8A06A;
  --gold-400: #D9BB8A;
  --gold-100: #F2E5CF;
  --gold-50: #FAF3E6;
  --sage-600: #3F5C4C;
  /* 中性 */
  --bg: #F6F3EF;
  --surface: #FFFFFF;
  --surface-2: #FBFAF8;
  --line: #E8E2DB;
  --line-strong: #D9D1C8;
  --ink-900: #2B2724;
  --ink-700: #4A433E;
  --ink-500: #7A716A;
  --ink-400: #9A918A;
  /* 语义 */
  --ok-600: #2F7D4F;
  --ok-100: #E7F3EC;
  --warn-600: #A9701C;
  --warn-100: #FBF0DC;
  --danger-600: #B03A3A;
  --danger-100: #F9E9E7;
  --info-600: #3A6B9E;
  --info-100: #E8F0F8;
  /* 形状 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 1px rgba(43, 39, 36, .04);
  --shadow-sm: 0 1px 2px rgba(43, 39, 36, .04), 0 2px 8px -4px rgba(43, 39, 36, .08);
  --shadow-md: 0 2px 6px -2px rgba(43, 39, 36, .06), 0 14px 34px -18px rgba(43, 39, 36, .18);
  --shadow-lg: 0 8px 20px -12px rgba(43, 39, 36, .18), 0 28px 64px -24px rgba(43, 39, 36, .3);
  --ring: 0 0 0 3px rgba(140, 90, 74, .18);
  /* 字体 */
  --font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --font-num: "Bahnschrift", "DIN Alternate", "Segoe UI", var(--font-sans);
  --font-serif: "Songti SC", "Noto Serif SC", "SimSun", serif;
  /* 兼容旧变量（style.css 仍在用） */
  --card: var(--surface);
  --ink: var(--ink-900);
  --muted: var(--ink-500);
  --accent: var(--brand-700);
  --ok: var(--ok-600);
  --error: var(--danger-600);
}

/* ---------------------------------------------------------- 2. 基础 */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-900);
  background:
    radial-gradient(1100px 520px at 8% -12%, #FCF8F3 0%, rgba(252, 248, 243, 0) 62%),
    radial-gradient(900px 480px at 100% -6%, #F7F1EA 0%, rgba(247, 241, 234, 0) 58%),
    var(--bg);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { color: var(--ink-900); }

h2 {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: .3px;
}

/* 页面级标题：细分割线 + 香槟金短线，作为每个页面的统一抬头 */
main > h2 {
  position: relative;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
main > h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 56px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-500), rgba(200, 160, 106, 0));
}

h3 {
  font-size: 15px;
  line-height: 1.5;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--ink-700);
}

a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }

p { margin: 10px 0; }

code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  background: var(--brand-50);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}

:focus-visible {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: var(--ring);
}

[hidden] { display: none !important; }

.muted { color: var(--ink-500); }
.hint {
  color: var(--ink-500);
  font-size: 13px;
  line-height: 1.6;
  margin: 10px 0 0;
}
.hint-inline { color: var(--ink-400); font-size: 12px; font-weight: 400; }
.amount, .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- 3. 应用骨架 */
.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 55% at 0% 0%, rgba(200, 160, 106, .14) 0%, rgba(200, 160, 106, 0) 62%),
    linear-gradient(180deg, var(--brand-900) 0%, #33201A 100%);
  color: #F3E7E1;
  padding: 22px 14px 16px;
  z-index: 40;
  box-shadow: inset -1px 0 0 rgba(200, 160, 106, .12);
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 20px;
  border-bottom: 1px solid rgba(200, 160, 106, .25);
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 2px;
  color: #FFF7EF;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--gold-400) 0%, var(--gold-600) 100%);
  color: var(--brand-900);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 2px 8px -2px rgba(0, 0, 0, .45);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text small {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1px;
  color: rgba(243, 231, 225, .6);
}

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 8px;
  color: rgba(243, 231, 225, .78);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 120ms ease-out, color 120ms ease-out;
  position: relative;
}
.nav-item:hover {
  background: rgba(255, 255, 255, .07);
  color: #FFF7EF;
  text-decoration: none;
}
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(200, 160, 106, .22), rgba(200, 160, 106, .1));
  color: #FFF7EF;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(200, 160, 106, .16);
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold-500);
}
.nav-icon { width: 20px; height: 20px; flex: 0 0 20px; }

.sidebar-foot {
  border-top: 1px solid rgba(200, 160, 106, .25);
  padding-top: 14px;
  margin-top: 12px;
  font-size: 13px;
}
.who { color: #FFF7EF; font-weight: 600; line-height: 1.45; }
.who-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-foot a {
  display: inline-block;
  margin-top: 8px;
  color: rgba(243, 231, 225, .75);
  font-size: 13px;
  text-decoration: none;
}
.sidebar-foot a:hover { color: var(--gold-500); text-decoration: none; }

.main-col { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: none;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar .menu-btn {
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--ink-700);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.topbar .topbar-brand { font-weight: 700; font-size: 15px; }
.topbar .topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-500); min-width: 0; }
.topbar .topbar-right span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.topbar .topbar-right a { font-size: 13px; }

main {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 32px 48px;
}
main > h2:first-child { margin-top: 0; }

.foot {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px 28px;
  color: var(--ink-400);
  font-size: 12px;
  line-height: 1.7;
}
.foot code { background: var(--brand-50); }

/* 抽屉遮罩 */
.nav-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(43, 39, 36, .45);
  z-index: 35;
  border: 0;
  padding: 0;
}

/* ---------------------------------------------------------- 4. 卡片与栅格 */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}
.card > h3:first-child { margin-top: 0; }
.card.narrow { max-width: 420px; margin: 40px auto; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid > .card { margin-bottom: 24px; }

/* 关键指标条：日报 / 月报的数字摘要 */
.stat-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 20px; }
.card > h3 + .stat-row { margin-top: 4px; }
.stat {
  flex: 1 1 160px;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #FFFFFF 0%, #FBF8F4 100%);
  box-shadow: var(--shadow-xs);
}
.stat-label { display: block; font-size: 12px; color: var(--ink-500); letter-spacing: .02em; }
.stat-value {
  display: block;
  margin-top: 2px;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-accent { color: var(--brand-700); }

/* 卡片抬头：标题与右侧说明/筛选之间固定一条浅分割线 */
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { margin: 0; }

.step-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-num);
}

/* ---------------------------------------------------------- 5. 按钮 */
button {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  min-height: 38px;
  padding: 0 16px;
  margin: 0;
  border: 1px solid rgba(67, 41, 31, .28);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #8E5A48 0%, var(--brand-700) 100%);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 2px rgba(67, 41, 31, .18);
  transition: background 140ms ease-out, box-shadow 140ms ease-out, transform 120ms ease-out, border-color 140ms ease-out;
}
button:hover {
  background: linear-gradient(180deg, #9A6450 0%, #87513F 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 3px 10px -4px rgba(67, 41, 31, .45);
}
button:active { transform: translateY(1px); box-shadow: inset 0 1px 3px rgba(67, 41, 31, .3); }
button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

button.btn-ghost {
  background: var(--surface);
  color: var(--brand-700);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}
button.btn-ghost:hover { background: var(--brand-50); border-color: var(--brand-300); box-shadow: var(--shadow-sm); }

button.btn-off {
  background: var(--surface);
  color: var(--danger-600);
  border-color: #E8C9C5;
  box-shadow: var(--shadow-xs);
}
button.btn-off:hover { background: var(--danger-100); border-color: #DBAEA8; box-shadow: var(--shadow-sm); }

button.btn-on {
  background: var(--surface);
  color: var(--ok-600);
  border-color: #C4DFCE;
  box-shadow: var(--shadow-xs);
}
button.btn-on:hover { background: var(--ok-100); border-color: #9FCDB1; box-shadow: var(--shadow-sm); }

button.btn-sm {
  min-height: 32px;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 500;
}

button.btn-lg { min-height: 48px; padding: 0 24px; font-size: 15px; }

button.btn-xl {
  min-height: 56px;
  padding: 0 28px;
  font-size: 17px;
  font-weight: 700;
  border-radius: 8px;
  letter-spacing: .5px;
}

button.btn-block { width: 100%; }

/* 行内小表单（表格里的操作） */
form.tiny { margin: 0; }
form.tiny button {
  min-height: 30px;
  min-width: 44px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  margin: 0 6px 4px 0;
}

/* ---------------------------------------------------------- 6. 表单 */
form { margin: 0; }

form label,
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  color: var(--ink-500);
}

.field-label { font-size: 13px; color: var(--ink-500); }

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-900);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 2px rgba(43, 39, 36, .035);
  transition: border-color 140ms ease-out, box-shadow 140ms ease-out, background 140ms ease-out;
  appearance: none;
}
textarea { min-height: 84px; padding: 10px 12px; resize: vertical; }

input::placeholder, textarea::placeholder { color: var(--ink-400); }

input:hover:not(:focus):not(:disabled),
select:hover:not(:focus):not(:disabled),
textarea:hover:not(:focus):not(:disabled) { border-color: var(--brand-300); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-600);
  background: #FFFDFC;
  box-shadow: var(--ring);
}

select {
  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' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%237A716A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
  appearance: auto;
  -webkit-appearance: auto;
  width: 18px;
  min-height: 0;
  height: 18px;
  padding: 0;
  margin: 0;
  flex: 0 0 18px;
  border: 0;
  background: none;
  accent-color: var(--brand-700);
  cursor: pointer;
}

input[type="date"] { min-height: 40px; }

input:disabled, select:disabled {
  background: var(--surface-2);
  color: var(--ink-400);
  cursor: not-allowed;
}

form.inline {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
form.inline label { min-width: 150px; flex: 1 1 150px; margin-bottom: 0; }
form.inline button { flex: 0 0 auto; }
form.inline.wrap label { flex: 1 1 160px; }

/* 复选行（账号角色、方案启用） */
label.inline-check,
label:has(> input[type="checkbox"]) {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--ink-700);
  font-size: 14px;
  margin-bottom: 6px;
}
label.inline-check {
  display: inline-flex;
  width: auto;
  margin: 0 14px 6px 0;
  white-space: nowrap;
}
.role-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  max-width: 540px;
  margin-bottom: 6px;
}
.role-grid label.inline-check { margin: 0; }

.field-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.field-row > * { flex: 1 1 220px; }

/* ---------------------------------------------------------- 7. 分段选择器 */
.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
}
.segmented label {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 10px;
  min-height: 40px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-500);
  cursor: pointer;
  text-align: center;
  transition: background 120ms ease-out, color 120ms ease-out, box-shadow 120ms ease-out;
  position: relative;
}
.segmented input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  min-height: 0;
  pointer-events: none;
}
.segmented label:hover { background: rgba(255, 255, 255, .7); color: var(--ink-700); }
.segmented input:checked + span {
  color: var(--brand-700);
  font-weight: 600;
}
.segmented label:has(input:checked) {
  background: var(--surface);
  color: var(--brand-700);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.segmented input:focus-visible + span {
  outline: 2px solid var(--brand-600);
  outline-offset: 3px;
  border-radius: 4px;
}
.segmented-sm label { min-height: 36px; font-size: 13px; }

/* ---------------------------------------------------------- 8. 表格 */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
td.muted, td .muted { white-space: nowrap; }
td.empty, td[colspan] { white-space: normal; max-width: none; }
th {
  color: var(--ink-500);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .04em;
  background: linear-gradient(180deg, #FCFAF7 0%, #F6F1EB 100%);
  white-space: nowrap;
  max-width: 180px;
}
thead th { border-bottom: 1px solid var(--line-strong); }
td.num, th.num { text-align: center; min-width: 88px; }
td.num, th.num, .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
tbody tr { transition: background-color 140ms ease-out; }
tbody tr:nth-child(even) { background: #FDFCFA; }
tbody tr:hover { background: var(--brand-50); }
tbody tr:last-child td { border-bottom: 0; }
td.empty, .empty {
  text-align: center;
  color: var(--ink-400);
  padding: 36px 12px;
  font-size: 13px;
}

/* ---------------------------------------------------------- 9. 反馈 */
.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.55;
  background: var(--surface);
  color: var(--ink-700);
}
.flash::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}
.flash.ok {
  background: var(--ok-100);
  border-color: #C4DFCE;
  color: #245E3B;
}
.flash.ok::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232F7D4F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12.5 2.8 2.8L16 9.5'/%3E%3C/svg%3E");
}
.flash.error {
  background: var(--danger-100);
  border-color: #EBC9C5;
  color: #8A2B2B;
}
.flash.error::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B03A3A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E");
}
.flash.info { background: var(--info-100); border-color: #C9DCEF; color: #2B557D; }
.flash.info::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233A6B9E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 7.5v.01'/%3E%3C/svg%3E");
}

.preview {
  background: var(--brand-50);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--ink-700);
}

/* ---------------------------------------------------------- 10. 折叠区 */
details { margin-top: 8px; }
details summary {
  cursor: pointer;
  color: var(--brand-700);
  font-size: 13px;
  font-weight: 500;
  padding: 4px 0;
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform 120ms ease-out;
  color: var(--ink-400);
}
details[open] > summary::before { transform: rotate(90deg); }
details form { margin-top: 12px; min-width: 220px; }
details form label { max-width: 320px; }

/* ---------------------------------------------------------- 11. 结算台 */
.settle-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
  /* 与下方「最近结算」卡片保持卡片间距：表单本身不是 .card，
     不补这段间距时右栏面板底边会贴住下方卡片顶边 */
  margin-bottom: 24px;
}
.settle-left { min-width: 0; }
.settle-left .card:last-child { margin-bottom: 0; }

.settle-aside {
  position: sticky;
  top: 20px;
  min-width: 0;
}

.amount-panel {
  background: linear-gradient(180deg, #FFFFFF 0%, #FDFAF7 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 22px;
}
.amount-label {
  font-size: 13px;
  color: var(--ink-500);
}
.amount-big {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 38px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--ink-900);
  margin: 4px 0 8px;
  transition: color 160ms ease-out;
}
.amount-big.is-zero { color: var(--ink-400); }
.amount-sub { font-size: 13px; color: var(--ink-500); margin-bottom: 16px; }

.amount-rows {
  margin: 0 0 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.amount-rows > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
}
.amount-rows dt { color: var(--ink-500); margin: 0; white-space: nowrap; }
.amount-rows dd {
  margin: 0;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  color: var(--ink-700);
  text-align: right;
  white-space: nowrap;
}
.amount-rows dd.discount { color: var(--ok-600); }

.pay-block { margin-bottom: 16px; }
.pay-block .field-label { display: block; margin-bottom: 8px; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: transparent; border: 0; padding: 0; }
.pay-grid label {
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
}
.pay-grid label:hover { border-color: var(--line-strong); background: var(--brand-50); }
.pay-grid label:has(input:checked) {
  border-color: var(--brand-600);
  background: var(--brand-50);
  box-shadow: none;
}

.amount-note { margin-bottom: 14px; }
.amount-note input { min-height: 40px; }

.balance-note {
  font-size: 13px;
  margin: 0 0 12px;
  color: var(--ink-500);
}
.balance-note.is-short { color: var(--danger-600); font-weight: 600; }
.hint.is-warn { color: var(--danger-600); font-weight: 600; }

.card-info {
  background: var(--brand-50);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink-700);
  margin: 12px 0 0;
}

.confirm-wrap { margin-top: 4px; }
.confirm-wrap .hint { margin-top: 10px; }
/* 确认按钮：左侧文案、右侧金额两端对齐，金额用等宽数字 */
#confirmBtn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#confirmAmount {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 项目行 */
.item-row {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 14px;
  margin-bottom: 12px;
}
.item-row:last-child { margin-bottom: 0; }

.line-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin-bottom: 10px;
}
.line-no {
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-700);
  background: var(--brand-100);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}
.line-total {
  margin-left: auto;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900);
}
.item-row .remove-row { margin: 0; }

.line-fields {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  /* 顶端对齐：数量列与项目列标签同高，控件落在同一水平线 */
  align-items: flex-start;
}
.line-fields + .line-fields { margin-top: 12px; }
.line-fields .field-grow { flex: 1 1 260px; min-width: 0; }
.line-fields .field-qty { flex: 0 0 132px; }
.line-fields .field { flex: 1 1 180px; min-width: 0; }
/* 数量列按与 label 相同的纵向结构排版，避免“标签到控件”的间距比其他列少 6px */
.field-qty {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-500);
}

.stepper {
  display: flex;
  align-items: stretch;
  width: 132px;
  height: 40px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
.stepper .step-btn {
  width: 40px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  color: var(--brand-700);
  font-size: 18px;
  font-weight: 500;
  box-shadow: none;
}
.stepper .step-btn:hover { background: var(--brand-50); }
.stepper .qty-input {
  flex: 1 1 auto;
  width: auto;
  height: 100%;
  min-width: 44px;
  min-height: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
  text-align: center;
  padding: 0;
  font-family: var(--font-num);
  appearance: textfield;
  -moz-appearance: textfield;
}
.stepper .qty-input::-webkit-outer-spin-button,
.stepper .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.line-upgrade { margin-top: 10px; }
.line-upgrade summary { color: var(--ink-500); font-size: 13px; }
.line-upgrade .line-fields { margin-top: 10px; }

.add-row-btn { margin-top: 4px; }

/* ---------------------------------------------------------- 12. 登录 */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background:
    radial-gradient(900px 480px at 88% -10%, #F3E7E1 0%, rgba(243, 231, 225, 0) 60%),
    radial-gradient(700px 420px at 0% 110%, #EFE9E2 0%, rgba(239, 233, 226, 0) 55%),
    var(--bg);
}
.auth-main {
  width: 100%;
  margin: 0;
  padding: 0;
  max-width: none;
  display: flex;
}
.auth-shell .flash {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  margin: 0;
  max-width: 420px;
  box-shadow: var(--shadow-md);
}
.login-page {
  display: grid;
  grid-template-columns: minmax(0, 46%) minmax(0, 1fr);
  width: 100%;
  min-height: 100vh;
}
.login-brand {
  background: linear-gradient(160deg, var(--brand-900) 0%, #3A241C 100%);
  color: #F6EBE3;
  padding: 56px 56px 40px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.login-brand::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -140px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  border: 1px solid rgba(200, 160, 106, .35);
  box-shadow: 0 0 0 40px rgba(200, 160, 106, .06);
}
.login-brand .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 0;
  margin: 0 0 40px;
  color: #FFF7EF;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
}
.login-quote {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1.5;
  letter-spacing: 2px;
  margin: 0 0 16px;
  color: #F6EBE3;
}
.login-sub { color: rgba(246, 235, 227, .62); font-size: 14px; line-height: 1.9; margin: 0; max-width: 360px; }
.login-foot {
  margin-top: auto;
  padding-top: 32px;
  font-size: 12px;
  color: rgba(246, 235, 227, .42);
  letter-spacing: .5px;
}
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  margin: 0;
  padding: 36px 34px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 32px rgba(43, 39, 36, .07);
}
.login-card h2 { font-size: 24px; margin-bottom: 4px; }
.login-card .hint { margin: 0 0 22px; }
.login-card form { display: flex; flex-direction: column; gap: 16px; }
.login-card label { font-size: 13px; }
.login-card input { min-height: 44px; }
.login-card button { min-height: 48px; width: 100%; margin-top: 6px; font-size: 15px; }

/* ---------------------------------------------------------- 12.5 提成方案 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}
.badge-gold { background: var(--gold-100); color: #7A5A2E; }
.badge-ok { background: var(--ok-100); color: var(--ok-600); }
.badge-off { background: var(--surface-2); color: var(--ink-400); border-color: var(--line); }
.badge-warn { background: var(--warn-100); color: var(--warn-600); }
.badge-brand { background: var(--brand-100); color: var(--brand-700); }

.plan-list { display: flex; flex-direction: column; gap: 12px; }

.plan-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}
.plan-card[open] { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.plan-card > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin: 0;
  cursor: pointer;
  font-size: 14px;
}
.plan-card > summary:hover { background: var(--brand-50); }
.plan-card > summary::before {
  content: "▸";
  display: inline-block;
  color: var(--ink-400);
  transition: transform 120ms ease-out;
}
.plan-card[open] > summary::before { transform: rotate(90deg); }
.plan-name { font-size: 15px; font-weight: 600; color: var(--ink-900); }
.plan-note { color: var(--ink-500); font-size: 12px; }
.plan-head-right { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

/* 方案卡改为常开展示 + 弹窗编辑 */
.plan-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.plan-card-head .plan-head-right { margin-left: auto; }
.plan-card-head button.btn-sm { min-height: 30px; }

.plan-body { padding: 4px 16px 18px; border-top: 1px solid var(--line); }

.plan-assign {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 16px;
}
.plan-assign-label {
  font-size: 12px;
  color: var(--ink-500);
  padding-top: 5px;
  white-space: nowrap;
}
.tech-tags { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 240px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--ink-700);
}
.tag b { color: var(--brand-700); font-weight: 600; }
.tag .rank { color: var(--ink-400); font-family: var(--font-num); }
.tag.is-empty { border-style: dashed; color: var(--ink-400); background: transparent; }

.plan-form { max-width: none; }
.plan-form label { max-width: none; }
.plan-meta-fields { margin-bottom: 16px; }
.plan-meta-fields > label { flex: 1 1 200px; }
.plan-meta-fields .switch-row {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  font-size: 14px;
  color: var(--ink-700);
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.scene-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.scene-card.is-off {
  background: var(--surface-2);
  border-style: dashed;
}
.scene-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.scene-name { font-size: 15px; font-weight: 600; color: var(--ink-900); }
.scene-code {
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-700);
  background: var(--brand-100);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}
.scene-desc {
  font-size: 12px;
  color: var(--ink-500);
  line-height: 1.65;
  min-height: 40px;
}
.scene-fields { display: flex; gap: 8px; align-items: flex-end; }
.scene-fields .field { flex: 1 1 auto; }
.scene-fields .field-mode { flex: 0 0 96px; }
.scene-unit {
  font-size: 12px;
  color: var(--ink-400);
  padding-bottom: 11px;
  white-space: nowrap;
}
.share-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--ink-500);
}
.share-figure {
  font-family: var(--font-num);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-900);
}
.share-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--line);
}
.share-bar .mine { background: var(--brand-700); }
.share-bar .shop { background: var(--gold-500); }
.share-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--ink-400);
}
.share-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 4px;
}
.share-legend .dot-mine { background: var(--brand-700); }
.share-legend .dot-shop { background: var(--gold-500); }

.scene-active {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-700);
}
.scene-active input { height: 18px; }

.default-note {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold-500);
  border-radius: var(--radius-sm);
  background: var(--brand-50);
  font-size: 13px;
  color: var(--ink-700);
  line-height: 1.7;
}
.default-note .default-title { font-weight: 600; color: var(--brand-700); }
.default-grid { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 6px; }
.default-item { color: var(--ink-500); font-size: 12px; }
.default-item b {
  font-family: var(--font-num);
  font-size: 15px;
  color: var(--ink-900);
  margin-left: 4px;
}
.default-item em {
  font-style: normal;
  color: var(--brand-700);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 5px;
  margin-right: 4px;
  font-family: var(--font-num);
  font-size: 11px;
}

.plan-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
}
.plan-pick:last-of-type { border-bottom: 0; }
.plan-pick label.inline-check { margin: 0; flex: 1 1 auto; }
.plan-pick input[type="number"] {
  width: 84px;
  min-height: 34px;
  padding: 4px 8px;
}
.plan-pick .pick-label { font-size: 12px; color: var(--ink-400); white-space: nowrap; }

/* 新增技师表单内的方案勾选：整行占满，选项横向排列 */
.plan-pick-list {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 14px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.plan-pick-list > .pick-label { font-weight: 600; color: var(--ink-700); }
.plan-pick-list .plan-pick { border-bottom: 0; padding: 0; }

.tech-plans { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tech-plans .tag .rank { margin-left: 2px; }
.cell-plans { white-space: normal; min-width: 220px; }
.cell-plans details summary { font-size: 12px; }

/* ---------------------------------------------------------- 12.6 会员弹层 */
.modal { margin-bottom: 24px; }
.modal-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px 22px;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.modal-head h3 { margin: 0 0 4px; font-size: 16px; color: var(--ink-900); }
.modal-sub { margin: 0; font-size: 13px; color: var(--ink-500); }
.modal-x {
  display: none;
  width: 40px;
  height: 40px;
  min-height: 40px;
  flex: 0 0 40px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-500);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  box-shadow: none;
}
.modal-x:hover { background: var(--brand-50); color: var(--brand-700); }
.modal-scrim { display: none; }
.modal-body { display: flex; flex-direction: column; gap: 12px; }
.modal-body > label { margin: 0; }
.modal-body > form { display: flex; flex-direction: column; gap: 12px; }
.modal-body > form + form {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.modal-body .modal-foot { margin-top: 2px; }
.modal-panel-wide { max-width: 720px; }
body.modal-ready .modal.is-open .modal-panel.modal-panel-wide { max-width: 720px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.modal-cancel { display: none; }

.modal-sum {
  background: var(--brand-50);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.sum-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-500);
}
.sum-row + .sum-row { margin-top: 6px; }
.sum-row b { font-family: var(--font-num); font-size: 15px; font-weight: 600; color: var(--ink-900); }
.sum-row.sum-total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-strong);
}
.sum-row.sum-total b { font-size: 20px; color: var(--brand-700); }

/* 仅当脚本成功执行并加上 .modal-ready 后才切换为遮罩层；
   否则弹层按普通卡片留在页内，表单始终可操作。 */
body.modal-ready .modal { display: none; }
body.modal-ready .modal.is-open {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 90;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 24px;
}
body.modal-ready .modal.is-open .modal-scrim {
  display: block;
  position: absolute;
  inset: 0;
  background: rgba(43, 39, 36, .46);
}
body.modal-ready .modal.is-open .modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
body.modal-ready .modal.is-open .modal-x,
body.modal-ready .modal.is-open .modal-cancel { display: inline-flex; }
body.modal-open { overflow: hidden; }

.cell-actions { white-space: nowrap; }
.cell-actions > button { margin-right: 6px; vertical-align: middle; }
.cell-actions .row-detail { display: inline-block; vertical-align: middle; }
.cell-actions .row-detail > summary { font-size: 13px; color: var(--brand-700); cursor: pointer; }
.cell-actions .row-detail form { margin-top: 10px; min-width: 200px; max-width: 260px; white-space: normal; }

/* ---------------------------------------------------------- 14. 单行不折行加固 */
/* 表格外的长内容一律单行 + 省略号，含表格的卡片由自身横向滚动承接（避免影响卡内 sticky 元素） */
.card:has(table) { overflow-x: auto; }

button { min-width: 68px; flex: 0 0 auto; white-space: nowrap; }
button.btn-sm { min-width: 44px; }
.modal-x, .topbar .menu-btn { min-width: 0; }

.badge {
  flex: 0 0 auto;
  height: 22px;
  line-height: 20px;
  padding: 0 9px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag {
  flex: 0 0 auto;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tech-tags, .tech-plans { flex-wrap: nowrap; overflow: hidden; }
.cell-plans .tech-plans { display: inline-flex; align-items: center; vertical-align: middle; max-width: 100%; }

/* 分段选择器：等分宽度不变，文案单行，过长则省略 */
.segmented { overflow: hidden; }
.segmented label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
}

/* 方案标题行与右侧徽章 */
.plan-card > summary > .plan-name {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 42%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-note {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 26%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-head-right { flex: 0 0 auto; flex-wrap: nowrap; }

/* 技师「已挂方案」单元格：单行省略，完整内容靠 title */
.cell-plans { white-space: nowrap; min-width: 0; max-width: 220px; }
.cell-plans details summary,
.cell-plans .tech-plans { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-actions { max-width: none; }

/* 表单控件：长文案不撑破容器 */
input, select, textarea { max-width: 100%; }
select { text-overflow: ellipsis; }

/* 单元格里的表单/按钮/徽章排成一行，不再上方下圆地堆叠 */
td form { display: inline-block; vertical-align: middle; }
td form + form { margin-left: 4px; }
td .muted, td .badge, td .tag { vertical-align: middle; }
td details { display: inline-block; vertical-align: middle; }
td details > summary { display: inline-block; vertical-align: middle; }
form.tiny button { margin: 0 6px 0 0; }
.cell-plans details.row-detail { display: inline-block; vertical-align: middle; margin-left: 6px; }

/* 技师行内「修改方案」入口：做成按钮样式，避免被当成普通文字忽略 */
summary.summary-btn {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--brand-300, var(--line));
  border-radius: var(--radius-sm, 6px);
  color: var(--brand-700);
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
summary.summary-btn::-webkit-details-marker { display: none; }
summary.summary-btn:hover { background: var(--brand-50); }
details[open] > summary.summary-btn { background: var(--brand-50); border-color: var(--brand-400, var(--brand-300)); }

/* 角色勾选：每个选项自身单行，选项之间按 360px 宽度换行（多选控件需要全部可见，不能裁掉） */
.role-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  width: 360px;
  max-width: 100%;
  margin-bottom: 6px;
}

/* 小票：长项目名由小票容器横向滚动承接，金额行不折行 */
.receipt-wrap { overflow-x: auto; }
.receipt { overflow-x: auto; }
.r-meta > div, .r-total > div { min-width: 0; }
.r-meta span, .r-total span { white-space: nowrap; }
.r-meta span:last-child, .r-total span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

/* ---------------------------------------------------------- 15. 响应式 */
@media (max-width: 1439px) {
  .settle-grid { grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (max-width: 1279px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 20px 10px 14px; align-items: center; }
  .sidebar .brand { flex-direction: column; gap: 6px; padding: 0 0 16px; }
  .sidebar .brand-text,
  .sidebar .nav-label,
  .sidebar .sidebar-foot .who { display: none; }
  .sidebar-foot { width: 100%; text-align: center; }
  .sidebar-foot a { font-size: 12px; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item.is-active::before { left: -10px; }
  main { padding: 24px 24px 40px; }
  .foot { padding: 0 24px 24px; }
  .settle-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; }
}

@media (max-width: 1119px) {
  .settle-grid { grid-template-columns: minmax(0, 1fr); }
  .settle-aside { position: static; }
  .scene-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  .app-shell { display: block; }
  .topbar { display: flex; }
  /* 窄屏顶部栏只留账号名，与左侧栏一致；中文角色不再显示 */
  .topbar .topbar-role { display: none; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 248px;
    height: 100vh;
    align-items: stretch;
    padding: 20px 14px 16px;
    transform: translateX(-102%);
    transition: transform 180ms cubic-bezier(.2, .8, .2, 1);
    overflow-y: auto;
  }
  .sidebar .brand { flex-direction: row; gap: 10px; padding: 0 8px 20px; }
  .sidebar .brand-text,
  .sidebar .nav-label { display: flex; }
  .sidebar .sidebar-foot .who { display: block; }
  .nav-item { justify-content: flex-start; padding: 0 12px; }
  .nav-item.is-active::before { left: -14px; }
  .sidebar-foot { text-align: left; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .nav-scrim { display: block; }
  main { padding: 20px 20px 40px; }
  .foot { padding: 0 20px 24px; }
  .grid { grid-template-columns: 1fr; }
  /* 表格保持真实表格布局（列宽稳定），由 .card 横向滚动承接超宽内容 */
  table { min-width: 100%; }
}

@media (max-width: 767px) {
  body { font-size: 14px; }
  main { padding: 16px 16px 32px; }
  .foot { padding: 0 16px 24px; }
  .card { padding: 16px; margin-bottom: 16px; border-radius: 8px; }
  h2 { font-size: 19px; }
  .grid { gap: 16px; }
  .form.inline, form.inline { flex-direction: column; align-items: stretch; }
  form.inline label, form.inline.wrap label { flex: 0 0 auto; min-width: 0; }
  form.inline button { width: 100%; }
  .field-row { flex-direction: column; }
  .field-row > * { flex: 1 1 auto; width: 100%; }
  /* 结算明细：项目下拉与数量步进器并排；技师/场景那一行仍单列 */
  .line-fields { gap: 10px; }
  .line-fields .field-grow { flex: 1 1 0; min-width: 0; }
  .line-fields .field-qty { flex: 0 0 auto; }
  .line-fields .field { flex: 1 1 100%; }
  /* 步进器收到 112：± 按钮保持 40px 触控，只收窄中间数字框 */
  .stepper { width: 112px; }
  .stepper .qty-input { min-width: 32px; }
  .amount-panel { padding: 16px; border-radius: 12px; }
  .amount-big { font-size: 34px; }
  .settle-aside { position: static; }
  .confirm-wrap { position: sticky; bottom: 0; padding-top: 8px; background: linear-gradient(180deg, rgba(255,255,255,0) 0%, var(--surface) 30%); }
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { padding: 24px 16px; align-items: flex-start; }
  .login-card { padding: 26px 20px; }
  .segmented label { padding: 0 6px; font-size: 13px; }
  .scene-grid { grid-template-columns: 1fr; }
  .plan-head-right { margin-left: 0; width: 100%; }
  .plan-card > summary { padding: 12px 14px; }
  .plan-body { padding: 4px 14px 16px; }
  .plan-assign-label { width: 100%; padding-top: 0; }
  .modal-panel { padding: 16px; }
  .modal-head { gap: 10px; }
  body.modal-ready .modal.is-open { padding: 12px; align-items: flex-start; }
  body.modal-ready .modal.is-open .modal-panel { max-height: calc(100vh - 24px); }
  .modal-foot { flex-direction: column; }
  .modal-foot button { width: 100%; min-height: 46px; }
  .cell-actions .row-detail form { min-width: 0; max-width: none; }
}

/* 超窄屏（360 级）：并排后项目下拉不足 100px，回退竖排并恢复原步进器宽度 */
@media (max-width: 379px) {
  .line-fields .field-grow,
  .line-fields .field-qty { flex: 1 1 100%; }
  .stepper { width: 132px; }
  .stepper .qty-input { min-width: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------------------------------------------------------- 16. 今日技师结算 */
.settle-list { display: flex; flex-direction: column; gap: 12px; }
.settle-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--surface-2);
}
.settle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.settle-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.settle-name { font-weight: 600; color: var(--ink-900); }
.settle-sum { display: flex; align-items: baseline; gap: 10px; }
.settle-sum .amount { font-size: 18px; font-weight: 600; color: var(--ink-900); }
.settle-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.settle-meta form.tiny { margin: 0; }
.settle-item details { margin-top: 10px; }
.empty-block { color: var(--ink-500); text-align: center; padding: 18px 0; margin: 0; }

/* ---------------------------------------------------------- 17. 全局质感细节 */
::selection { background: rgba(200, 160, 106, .3); color: var(--brand-900); }

/* 细滚动条：与整体中性色统一 */
* { scrollbar-width: thin; scrollbar-color: #D8CEC4 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #D8CEC4;
  border: 3px solid transparent;
  border-radius: var(--radius-pill);
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #C4B6A9; background-clip: content-box; }

/* 链接焦点：用描边代替输入框式的阴影 */
a:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
  border-radius: 4px;
  box-shadow: none;
}

/* 卡片入场只用透明度，避免影响 sticky / fixed 的定位上下文 */
@keyframes card-in { from { opacity: 0; } to { opacity: 1; } }
.card { animation: card-in 240ms ease-out both; }

/* 页脚与正文之间补一条极浅分割线 */
.foot { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 8px; }

/* 表格里的次要操作按钮更轻，减少视觉噪音 */
td button.btn-sm { min-height: 30px; font-weight: 500; }

/* ---------------------------------------------------------- 18. 结算历史 · 提成明细 */
td.cell-detail {
  overflow: visible;
  max-width: none;
  white-space: normal;
}
td.cell-detail:has(details[open]) { vertical-align: top; }
td.cell-detail .row-detail { display: inline-block; }

.comm-detail {
  min-width: 300px;
  max-width: 340px;
  margin-top: 10px;
  padding: 2px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  white-space: normal;
}
.comm-item { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.comm-item:last-child { border-bottom: 0; }
.comm-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.comm-amount {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-700);
}
.comm-rule {
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--ink-500);
  white-space: nowrap;
}
.comm-sub { margin-top: 2px; font-size: 12px; color: var(--ink-500); line-height: 1.55; }
.comm-sub span { white-space: nowrap; }
.comm-sub span + span::before { content: "·"; margin: 0 5px; color: var(--ink-400); }
.comm-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 6px;
  font-size: 12px;
}
.comm-foot .muted { font-size: 12px; }
.comm-foot form.tiny { margin: 0; }
.comm-foot form.tiny button { margin: 0; min-height: 28px; padding: 0 10px; font-size: 12px; }

/* 今日技师结算：合计提成 + 营业收入 */
.settle-total {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #FFFFFF 0%, #FBF8F4 100%);
  box-shadow: var(--shadow-xs);
}
.settle-total-item { font-size: 13px; color: var(--ink-500); }
.settle-total-item b {
  margin-left: 8px;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-900);
}
.settle-total-item.is-accent b { color: var(--brand-700); }


/* ---------------------------------------------------------- 19. 按钮绝对居中 */
/* 文案/图标在按钮内水平+垂直居中，表格操作按钮同排垂直居中 */
button,
input[type="submit"],
input[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
}

td form.tiny {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
form.tiny button { margin: 0 6px 0 0; }
td button,
td .cell-actions,
td .cell-plans { vertical-align: middle; }
.comm-foot form.tiny button { margin: 0; }
