/* 慧安暖家 Web —— 设计令牌与组件样式。改版依据 docs/web/ui-redesign/handoff-claude-code.md */

:root {
  color-scheme: light;

  /* 品牌 */
  --brand:        oklch(0.58 0.12 45);   /* #c06a45 陶土橙 */
  --brand-dark:   oklch(0.50 0.13 45);   /* #a5552f hover */
  --brand-tint:   oklch(0.96 0.024 60);  /* #fbeadd 浅底 */
  --shell:        oklch(0.32 0.035 55);  /* #493a30 深棕，侧栏/深色区块 */
  --shell-hover:  oklch(0.38 0.03 55);

  /* 文字 */
  --ink:          oklch(0.27 0.025 58);  /* #3a2f27 */
  --ink-soft:     oklch(0.55 0.015 65);  /* #82786f */
  --ink-mute:     oklch(0.62 0.015 65);  /* 表头、时间戳 */

  /* 背景与线 */
  --bg:           oklch(0.965 0.01 82);  /* #f7f3ec */
  --card:         oklch(0.995 0.004 80); /* #fffefb */
  --thead:        oklch(0.97 0.01 80);   /* #faf6f0 */
  --line:         oklch(0.90 0.012 78);  /* #e5ded4 */
  --line-soft:    oklch(0.95 0.008 78);
  --field:        oklch(0.87 0.012 76);  /* 控件描边 */
  --row-hover:    oklch(0.98 0.01 80);

  /* 状态 */
  --ok:           oklch(0.45 0.10 150);  /* #3d7a52 */
  --warn:         oklch(0.58 0.12 45);   /* 同品牌色 */
  --danger:       oklch(0.52 0.13 30);   /* #b04a3a */

  --radius:       10px;
  --radius-sm:    6px;
  --shadow:       0 1px 3px oklch(0.4 0.04 60 / 0.08);

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif; /* 仅页面标题与统计数字 */
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-family: var(--font-sans);

  /* 字号档位：默认是运营/配送台，下单端在 .shell-top 上整体放大 */
  --fs-page-title: 21px;
  --fs-card-title: 15px;
  --fs-body:       13px;
  --fs-table:      12.5px;
  --fs-meta:       11px;
  --fs-stat:       27px;
  --h-control:     38px;
}

/* 下单端（客户）与对外页面：字号与控件比运营台大一档 */
body.shell-top,
body.public-page,
body.login-page {
  --fs-page-title: 24px;
  --fs-card-title: 17px;
  --fs-body:       15px;
  --fs-table:      14.5px;
  --fs-meta:       12.5px;
  --fs-stat:       30px;
  --h-control:     46px;
}

* {
  box-sizing: border-box;
}

/* JS 一律用 hidden 属性控显隐；容器类的 display 会盖掉 UA 的 display:none */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-family: var(--font-sans);
}

a {
  color: var(--brand);
}

a:hover {
  color: var(--brand-dark);
}

/* 等宽：订单号 / RUN-* / SP-* / 日期 / 金额 */
.mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

body.shell-top .mono,
body.public-page .mono {
  font-size: 13px;
}

/* 状态文字色，枚举映射见 *.js 渲染处 */
.s-ok { color: var(--ok); }
.s-warn { color: var(--warn); }
.s-danger { color: var(--danger); }
.s-idle { color: var(--ink-soft); }

/* ---------- 外壳 A：运营台 / 配送台左侧导航 ---------- */
body.shell-side {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

.app-shell-nav {
  background: var(--shell);
  color: oklch(0.9 0.015 78);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.app-shell-nav .brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
  color: inherit;
  text-decoration: none;
}

.app-shell-nav .brand img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: none;
}

.app-shell-nav .brand span {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.06em;
}

.app-shell-nav .brand small {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: oklch(0.74 0.02 72);
}

.app-shell-nav .app-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-shell-nav .app-nav a {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: oklch(0.88 0.015 78);
  text-decoration: none;
  transition: background 0.15s;
}

.app-shell-nav .app-nav a:hover {
  background: var(--shell-hover);
  color: #fff;
}

.app-shell-nav .app-nav a.active {
  background: var(--brand);
  color: #fff;
}

.app-shell-nav .user-box {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid oklch(0.42 0.03 55);
}

.app-shell-nav .user-badge {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  padding: 0 8px;
}

.app-shell-nav .user-badge strong {
  font-size: 13px;
  font-weight: 500;
  color: oklch(0.95 0.01 78);
}

.app-shell-nav .user-badge small {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: oklch(0.74 0.02 72);
}

.app-shell-nav .shell-actions {
  display: flex;
  gap: 8px;
}

.app-shell-nav button {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  font-size: 12.5px;
  background: transparent;
  color: oklch(0.88 0.015 78);
  border: 1px solid oklch(0.45 0.03 55);
}

.app-shell-nav button:hover {
  background: var(--shell-hover);
  color: #fff;
}

/* ---------- 外壳 B：下单端顶栏 ---------- */
.app-header {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 0 40px;
  height: 66px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header .brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.app-header .brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.app-header .brand span {
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.06em;
}

.app-header .app-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: flex-end;
}

.app-header .app-nav a {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.app-header .app-nav a:hover {
  background: var(--bg);
  color: var(--ink);
}

.app-header .app-nav a.active {
  background: var(--brand-tint);
  color: var(--brand-dark);
}

.app-header .user-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header .user-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}

.app-header .user-badge strong {
  font-size: 14px;
  font-weight: 500;
}

.app-header .user-badge small {
  font-size: 11.5px;
  color: var(--ink-soft);
}

/* 平台管理员的中心切换器 */
.center-selector-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.center-selector-select {
  height: 32px;
  min-width: 150px;
}

.app-shell-nav .center-selector-label {
  flex-direction: column;
  align-items: stretch;
  padding: 0 8px;
  color: oklch(0.74 0.02 72);
}

.app-shell-nav .center-selector-select {
  background: oklch(0.38 0.03 55);
  border-color: oklch(0.45 0.03 55);
  color: oklch(0.92 0.01 78);
}

/* ---------- 布局 ---------- */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px;
}

/* 台账页铺满可用宽度；下单端保持居中易读宽度 */
body.shell-side main {
  max-width: none;
  margin: 0;
  padding: 24px 32px;
  min-width: 0;
}

body.shell-top main {
  max-width: 1240px;
  padding: 28px 56px;
}

/* 页头：标题 + mono 副标题，运营台里是一条贴边白条 */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

body.shell-side main > .page-head {
  margin: -24px -32px 24px;
  padding: 18px 32px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.page-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: var(--fs-page-title);
  color: var(--ink);
  margin: 0 0 20px;
}

.page-head .page-title,
.page-titles .page-title {
  margin: 0;
}

.page-titles {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.page-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  margin: 0;
}

/* 中文说明句用它，别用等宽的 .page-sub */
.page-note {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 同页多视图切换：标题下面一排下划线标签（4j） */
.page-head.with-tabs {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

/* 标签的下划线要压在页头那条边框上，所以下内边距归零 */
body.shell-side main > .page-head.with-tabs {
  padding-bottom: 0;
}

.tabs {
  display: flex;
  gap: 4px;
}

.tabs button {
  height: auto;
  padding: 10px 18px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-size: 14px;
  color: var(--ink-soft);
  /* 按钮基类的 border-color 过渡会让下划线切换时糊一下，标签页不要 */
  transition: none;
}

.tabs button:hover {
  background: none;
  color: var(--ink);
}

.tabs button.active {
  border-bottom-color: var(--brand);
  color: var(--brand-dark);
}

.tabs .count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  margin-left: 6px;
}

.section-title {
  font-size: var(--fs-card-title);
  font-weight: 500;
  margin: 26px 0 12px;
  color: var(--ink-soft);
}

.muted {
  color: var(--ink-soft);
  font-size: var(--fs-body);
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 18px;
  overflow: hidden;
}

/* 临时展开的操作卡（如订单分组表单）用品牌色边区分于常驻列表 */
.card.card-brand {
  border-color: var(--brand);
}

/* 标题里嵌的单号跟着卡片走品牌色 */
.card-brand > h2 code {
  font-size: 13.5px;
  color: var(--brand-dark);
}

/* 卡片自身不留白：表格铺满让表头贴边，其余子元素各自补左右 20px */
.card > * {
  padding-left: 20px;
  padding-right: 20px;
}

.card > table {
  padding: 0;
}

.card > h2 {
  padding: 14px 20px;
  margin: 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-card-title);
  font-weight: 500;
}

/* 标题栏带右侧计数/链接时用它，样式对齐 .card > h2 */
.card > .card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.card > .card-head > * {
  padding: 0;
  margin: 0;
  font-size: var(--fs-card-title);
  font-weight: 500;
}

.card > .card-head > :not(h2, h3) {
  font-size: var(--fs-meta);
  font-weight: 400;
  color: var(--ink-mute);
}

.card > :first-child:not(h2, h3, table, .card-head) {
  padding-top: 18px;
}

.card > :is(h2, .card-head) + :not(table) {
  padding-top: 16px;
}

.card > :last-child:not(table, [id$="pager"], .card-head) {
  padding-bottom: 18px;
}

.card > [id$="pager"] {
  padding: 0;
}

.card h3 {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  margin: 18px 0 12px;
}

/* 直接挂在 card 上的 h3 是分组标题行：结构同 h2、字号低一档。
   必须写在 .card h3 之后，同权重靠源码顺序压住它的 margin */
.card > h3 {
  padding: 12px 20px;
  margin: 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
}

/* ---------- 表格 ---------- */
table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--thead);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: left;
  padding: 10px 20px;
  font-weight: 400;
  white-space: nowrap;
}

tbody td {
  padding: 12px 20px;
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-table);
  vertical-align: middle;
}

tbody tr:hover {
  background: var(--row-hover);
}

/* 空状态显示时不留一排孤立表头 */
.card:has(> #empty:not([hidden])) > table {
  display: none;
}

/* 选中行：右侧/下方面板正在处理它 */
tbody tr.row-selected,
tbody tr.row-selected:hover {
  background: var(--brand-tint);
}

tbody tr.row-selected td:first-child {
  box-shadow: inset 3px 0 0 var(--brand);
}

td .mono,
th .mono {
  white-space: nowrap;
}

/* 状态文字折行会把行撑高，窄列里尤其明显 */
td .s-ok,
td .s-warn,
td .s-danger,
td .s-idle {
  white-space: nowrap;
}

/* 窄列里挤在主字段下的第二行（联系人、支付类型…） */
td .cell-sub {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--ink-mute);
}

/* 副行里的等宽串要允许断行，不然一串 ID 能把整列撑到溢出 */
td .cell-sub.mono {
  white-space: normal;
}

/* 行内操作按钮压扁，避免撑高台账行 */
td button,
.btn-small {
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
}

/* 窄表里按钮文字会被逐字折行，把操作列锁成一行 */
td button {
  white-space: nowrap;
}

/* 半宽表里姓名列会被长内容挤成一字一行，挂这个保住它 */
.nowrap {
  white-space: nowrap;
}

.mini-table td {
  padding: 7px 10px;
  font-size: 12px;
}

/* 表里的 <code> 是 ID/日期，跟 .mono 一个样式，不做成带框的 chip */
code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

body.shell-top code,
body.public-page code,
body.login-page code {
  font-size: 13px;
}

/* 正文里零散出现的 code（如 APP_ENV=test）保留浅底 */
p > code {
  background: var(--thead);
  border: 1px solid var(--line-soft);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---------- 统计卡 ---------- */
.stat-grid,
.stat-grid-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 8px;
}

/* 少于 5 张时按实际张数分列，尾部不留空格 */
.stat-grid:has(> :nth-child(2):last-child),
.stat-grid-inner:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, 1fr); }
.stat-grid:has(> :nth-child(3):last-child),
.stat-grid-inner:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
.stat-grid:has(> :nth-child(4):last-child),
.stat-grid-inner:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, 1fr); }

/* 分组内固定 5 列，两组的卡宽才对得齐 */
.stat-grid .stat-group .stat-grid-inner {
  grid-template-columns: repeat(5, 1fr);
}

/* #stats 里装的是分组时，改为纵向堆叠 */
.stat-grid:has(> .stat-group) {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.stat-group {
  margin-bottom: 0;
}

.stat-group-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  margin: 0 0 12px;
  letter-spacing: 0;
  text-transform: none;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px 19px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.stat-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
}

.stat-card.accent {
  border-color: var(--brand);
  background: var(--brand-tint);
}

.stat-value {
  font-family: var(--font-serif);
  font-size: var(--fs-stat);
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat-card.accent .stat-value {
  color: var(--brand-dark);
}

/* 金额卡：钱一律等宽，深底那张是本页的结论数字 */
.stat-card.money {
  padding: 20px 22px;
  gap: 8px;
}

.stat-card.money .stat-label {
  font-size: 12.5px;
  color: var(--ink-soft);
}

.stat-card.money .stat-value {
  font-family: var(--font-mono);
  font-size: 26px;
}

.stat-card.dark {
  background: var(--shell);
  border-color: var(--shell);
  color: oklch(0.96 0.012 80);
}

.stat-card.dark .stat-label {
  color: oklch(0.82 0.015 75);
}

.stat-card.dark .stat-value {
  color: inherit;
}

/* .s-* 定义在前，这里要比 .stat-value 的 color 更具体 */
.stat-value.s-danger {
  color: var(--danger);
}

.stat-label {
  font-size: var(--fs-body);
  color: var(--ink);
}

.stat-hint {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-mute);
  margin: 0;
}

/* ---------- 入口卡 ---------- */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.entry-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 17px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.entry-card:hover {
  border-color: var(--brand);
}

/* emoji 图标与品牌不符，一律不显示 */
.entry-icon {
  display: none;
}

.entry-title {
  font-size: 14px;
  font-weight: 500;
}

.entry-desc {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}

body.shell-top .entry-card {
  padding: 18px 20px;
}

body.shell-top .entry-title {
  font-size: 16px;
}

body.shell-top .entry-desc {
  font-size: 12px;
  font-family: var(--font-sans);
  letter-spacing: 0;
}

/* ---------- 按钮 ---------- */
button {
  height: var(--h-control);
  padding: 0 18px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

body.shell-top button {
  font-size: 15px;
}

button:hover {
  background: var(--brand-dark);
}

button.secondary {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
}

button.secondary:hover {
  background: var(--bg);
  border-color: var(--field);
}

button.dark {
  background: var(--shell);
}

button.dark:hover {
  background: var(--shell-hover);
}

button:disabled {
  background: var(--line);
  color: var(--ink-mute);
  cursor: not-allowed;
}

button.secondary:disabled {
  background: var(--card);
  color: var(--ink-mute);
}

.button-link {
  display: inline-flex;
  align-items: center;
  height: var(--h-control);
  padding: 0 16px;
  font-size: 13.5px;
  color: var(--ink-soft);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.button-link:hover {
  background: var(--bg);
  color: var(--ink);
}

.cta-button {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 26px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 15px;
}

.cta-button:hover {
  background: var(--brand-dark);
  color: #fff;
}

.cta-button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--field);
}

.cta-button.ghost:hover {
  background: var(--card);
  color: var(--ink);
}

/* ---------- 表单 ---------- */
label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

body.shell-top label {
  font-size: 14px;
}

textarea,
input,
select {
  width: 100%;
  height: var(--h-control);
  padding: 0 12px;
  margin-top: 4px;
  border: 1px solid var(--field);
  border-radius: var(--radius-sm);
  background: oklch(0.99 0.006 80);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--fs-body);
}

textarea {
  height: 88px;
  padding: 10px 12px;
  resize: none;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px oklch(0.58 0.12 45 / 0.12);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  height: auto;
  margin: 0;
  accent-color: var(--brand);
}

input[type="file"] {
  height: auto;
  padding: 9px 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0 18px;
}

.form-actions {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* 字段数固定时排满 4 / 5 列，最后一格可留给提交按钮 */
.form-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid.cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.form-grid > .form-actions {
  margin: 0 0 12px;
  align-items: flex-end;
}

.form-grid > .form-actions button {
  width: 100%;
}

/* 筛选按钮组，替代状态 select（4e / 5e / 6e） */
.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chips button {
  height: var(--h-control);
  padding: 0 14px;
  font-size: 13px;
  background: var(--card);
  color: var(--ink-soft);
  border: 1px solid var(--field);
}

.filter-chips button:hover {
  background: var(--bg);
  color: var(--ink);
}

.filter-chips button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.filter-chips button .count {
  font-family: var(--font-mono);
  font-size: 11px;
  margin-left: 6px;
  opacity: 0.75;
}

/* ---------- 台账工具栏 / 分页 ---------- */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  flex-wrap: wrap;
}

/* .list-toolbar 的 padding:0 会盖掉 .card > * 的左右留白，补回来 */
.card > .list-toolbar {
  padding-left: 20px;
  padding-right: 20px;
}

.list-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.list-toolbar label:has(input[type="search"]) {
  flex: 1;
  min-width: 240px;
}

.list-toolbar input,
.list-toolbar select {
  margin-top: 0;
  min-width: 150px;
}

.list-toolbar input[type="search"] {
  min-width: 0;
  flex: 1;
}

.list-toolbar .toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.list-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  margin: 12px 0 0;
}

.list-toolbar .list-meta {
  margin: 0;
  white-space: nowrap;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
}

/* 窄列里宁可整行换行，也别把「上一页」断成两行 */
.pager button {
  white-space: nowrap;
}

.pager-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}

/* ---------- 状态 pill ---------- */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 400;
  white-space: nowrap;
}

.badge-active,
.status-published,
.badge-published {
  color: var(--ok);
  background: oklch(0.95 0.03 150);
}

.badge-pending,
.status-draft,
.badge-draft {
  color: var(--brand-dark);
  background: var(--brand-tint);
}

.badge-muted {
  color: var(--ink-soft);
  background: var(--thead);
}

.badge-risk {
  color: var(--danger);
  background: oklch(0.95 0.03 30);
}

.today-row td,
tr.row-today td {
  background: var(--brand-tint);
}

.urgent-row td {
  background: oklch(0.97 0.02 40);
}

/* ---------- 配送端：工作台任务表 + 路线卡（5a / 5b）---------- */
.check-col {
  width: 44px;
  padding-right: 0;
}

.muted-cell {
  color: var(--ink-soft);
}

/* 线路名走 h2 拿卡片标题字号，编号缩小挂在后面 */
.route-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.route-head .mono {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-soft);
}

.route-head-aside {
  display: flex;
  align-items: center;
  gap: 12px;
}

.seq-col {
  width: 56px;
}

.seq {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 12px;
}

.seq-done {
  background: var(--ok);
  color: #fff;
}

.seq-current {
  background: var(--brand);
  color: #fff;
}

.seq-todo {
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

/* 待办性质的卡片：左侧品牌色竖条把它从同页其他卡里挑出来（5c）*/
.card.flagged {
  border-left: 3px solid var(--brand);
}

/* 卡头右侧的搜索框：覆盖 .card > .card-head > :not(h2,h3) 的 meta 字号 */
.card > .card-head > input[type="search"] {
  width: 240px;
  height: 34px;
  padding: 0 12px;
  font-size: var(--fs-body);
  color: var(--ink);
}

.cell-actions {
  display: flex;
  gap: 8px;
}

/* ---------- 左列表 + 右操作面板（5d / 5e）---------- */
.work-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.work-split > .card {
  margin-bottom: 0;
}

.head-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}

.head-tools .list-meta {
  margin: 0;
  white-space: nowrap;
}

.inline-select {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
}

.inline-select select {
  margin-top: 0;
  height: 32px;
  min-width: 84px;
  font-size: 13px;
}

/* 右侧面板：字段之间统一间距，主按钮压在底部 */
.checkin-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 22px;
}

.checkin-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.checkin-head h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: var(--fs-card-title);
  font-weight: 500;
}

.checkin-head .mono {
  font-size: 11px;
  color: var(--ink-soft);
}

.checkin-panel form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-mute);
}

.field-block > input,
.field-block > select,
.field-block > textarea {
  margin-top: 0;
}

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

/* 分段选择：一次三到五个互斥选项，选中态用品牌浅底 */
.seg-row {
  display: flex;
  gap: 8px;
}

.seg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.seg {
  flex: 1;
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: 14px;
  color: var(--ink-mute);
}

.seg:hover {
  border-color: var(--brand);
  background: var(--card);
}

.seg.on {
  border-color: var(--brand);
  background: var(--brand-tint);
  color: var(--brand-dark);
}

.check-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 13px;
  color: var(--ink-mute);
}

.check-line input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brand);
}

.panel-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-tall {
  height: 46px;
  font-size: 15px;
}

.foot-link {
  text-align: center;
  font-size: 12.5px;
}

/* 上报页左栏按设计留 620px，右栏吃掉余下宽度 */
.incident-split {
  grid-template-columns: 620px minmax(0, 1fr);
}

.card > .card-head.stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

/* 时间流：一条上报/通知一块，无表头 */
.feed-item {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.feed-item:last-child {
  border-bottom: 0;
}

.feed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  color: var(--ink);
}

.feed-body {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.feed-time {
  font-size: 10.5px;
  color: var(--ink-soft);
}

/* ---------- 深底行动条（生成日报等单一主操作）---------- */
.action-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 24px 26px;
  margin-bottom: 18px;
  background: var(--shell);
  border-radius: var(--radius);
  color: oklch(0.96 0.012 80);
}

.action-band h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 20px;
}

.action-band p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.8;
  color: oklch(0.84 0.015 75);
}

.action-band .list-meta {
  margin-top: 8px;
  color: oklch(0.84 0.015 75);
}

.action-band button {
  height: 42px;
  padding: 0 24px;
  font-size: 14px;
  white-space: nowrap;
}

/* ---------- 卡片列表（关怀跟进）---------- */
/* 保留 table/tbody 让 JS 仍按行渲染，视觉上退化成一叠卡片 */
.card-list,
.card-list tbody,
.card-list tr,
.card-list td {
  display: block;
}

.card-list tr:hover {
  background: none;
}

.card-list td {
  padding: 18px 22px;
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--fs-body);
}

.card-list tr.urgent-row td {
  background: var(--card);
  border-left: 3px solid var(--brand);
}

.card-head-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
}

.card-head-row > strong {
  font-size: 16px;
  font-weight: 500;
}

.card-head-row .mono {
  color: var(--ink-soft);
  font-size: 12px;
}

/* 次要指标推到右端，主标识和状态留在左边 */
.card-head-row .head-aside {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-soft);
}

.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field-pair > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
}

.field-pair input {
  height: 34px;
  margin-top: 0;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.card-actions button {
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
}

/* ---------- 主数据：左中心列表 + 右服务点/线路（4g）---------- */
.master-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* 列间距交给 grid / flex 的 gap，卡片自己的下外边距会多出一截 */
.master-grid > .card,
.master-col > .card {
  margin-bottom: 0;
}

.master-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 卡片标题后跟的中心名，弱化成副标题 */
.scope-tag {
  font-weight: 400;
  color: var(--ink-mute);
}

/* 单列可选列表：保留 table/tbody 让 JS 照常按行渲染 */
.pick-list,
.pick-list tbody,
.pick-list tr,
.pick-list td {
  display: block;
}

.pick-list td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.pick-list td[data-pick-center] {
  cursor: pointer;
}

.pick-list tr:last-child td {
  border-bottom: 0;
}

.pick-list tr:hover td {
  background: var(--row-hover);
}

/* 选中态用内阴影画左侧色条，不占位、行宽不跳 */
.pick-list tr.selected td {
  background: var(--brand-tint);
  box-shadow: inset 3px 0 0 var(--brand);
}

.pick-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.pick-row > strong {
  font-size: 14px;
  font-weight: 500;
}

.pick-row > span {
  font-size: 11.5px;
}

.pick-sub {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--ink-mute);
}

/* 行内文字操作：列表行里塞不下整颗按钮时用它。必须写在 td button 之后 */
button.link {
  height: auto;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  font-size: 12px;
  color: var(--brand-dark);
}

button.link:hover {
  background: none;
  text-decoration: underline;
}

/* ---------- 周菜单：运营编辑 + 只读预览（4l / 6d）---------- */
/* 客户视角只剩预览一栏，用 block 让隐藏的编辑列不占 grid gap */
.menu-layout {
  display: block;
}

body.shell-side .menu-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
  align-items: start;
}

body.shell-side .menu-layout > .card,
body.shell-side .menu-col > .card {
  margin-bottom: 0;
}

.menu-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 草稿编辑表：日期列定宽，三餐列均分 */
.menu-editor {
  table-layout: fixed;
}

.menu-editor th:first-child,
.menu-editor td:first-child {
  width: 92px;
}

.menu-editor td {
  padding: 8px 10px;
  vertical-align: top;
}

.menu-editor td:first-child {
  font-size: 12px;
  color: var(--ink-soft);
}

.meal-inputs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meal-inputs input {
  height: 34px;
  margin: 0;
}

/* 当前窗口菜单：一天一行，日期在左、三餐在右 */
.card > .flush {
  padding-left: 0;
  padding-right: 0;
}

.flush > .list-meta {
  padding: 0 20px 12px;
}

.menu-day {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.menu-day:last-child {
  border-bottom: 0;
}

/* 已经过去的两天压暗，当天挑出来 */
.menu-day.is-past {
  opacity: 0.5;
}

.menu-day.is-today {
  background: var(--brand-tint);
}

.menu-day-date {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--ink-soft);
}

.menu-day-meals {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
}

.menu-day-meals > p {
  display: flex;
  gap: 10px;
  margin: 0;
}

.meal-tag {
  flex: none;
  width: 2em;
  color: var(--ink-mute);
}

/* 下单端字号整体大一档，当天再大一号 */
body.shell-top .menu-day {
  grid-template-columns: 130px minmax(0, 1fr);
  padding: 15px 22px;
}

body.shell-top .menu-day-date {
  font-size: 14px;
}

body.shell-top .menu-day-meals {
  gap: 8px;
  font-size: 15px;
}

body.shell-top .menu-day.is-today .menu-day-meals {
  font-size: 16px;
}

/* ---------- 下单 / 套餐 ---------- */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.plan-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  height: auto; /* 覆盖全局 button 的固定高度，否则内容会溢出卡片 */
  text-align: left;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}

.plan-card:hover {
  border-color: var(--field);
}

.plan-card.selected {
  border-color: var(--brand);
  background: var(--brand-tint);
}

.plan-price {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
}

.plan-label {
  font-size: 15px;
  font-weight: 500;
}

.plan-desc {
  font-size: 13px;
  color: var(--ink-soft);
}

.pay-amount {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
}

.estimate-box {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--brand-tint);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}

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

.estimate-amount {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
}

/* ---------- 订单卡 ---------- */
.order-card .order-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.order-card .order-head strong {
  margin-right: 8px;
}

.order-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
}

.request-list {
  margin: 0 0 12px;
  padding-left: 18px;
  font-size: 13px;
  color: var(--ink-soft);
}

.inline-form {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

/* ---------- 关怀时间线 / 照片 ---------- */
.photo-preview {
  display: block;
  max-width: 220px;
  max-height: 220px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  border: 1px solid var(--line);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 60vh;
  overflow-y: auto;
}

.timeline-item {
  border-left: 3px solid var(--brand);
  padding: 4px 0 4px 12px;
}

.timeline-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

/* ---------- 勾选列表 / 选项组 ---------- */
.binding-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: var(--fs-body);
  color: var(--ink);
}

.choice-list {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0 0 14px;
}

.choice-list legend {
  padding: 0 4px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.choice-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
}

.choice-row + .choice-row {
  border-top: 1px solid var(--line-soft);
}

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.27 0.025 58 / 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 12px 32px oklch(0.27 0.025 58 / 0.2);
}

.modal-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 17px;
  margin: 0 0 14px;
}

.modal-error {
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ---------- 错误条 ---------- */
.error-banner {
  padding: 14px 18px;
  border: 1px solid oklch(0.58 0.12 45 / 0.4);
  border-radius: 8px;
  background: oklch(0.96 0.03 55);
  color: oklch(0.42 0.08 45);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* ---------- 通用排版 ---------- */
/* 中缝竖线靠右列的左边框，比伪元素稳 */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.two-col > * + * {
  padding-left: 32px;
  border-left: 1px solid var(--line);
}

/* 分栏顶部的小标题行（右栏标题 + 搜索），不占 section-title 的整段外边距 */
.card-row .page-head {
  margin-bottom: 12px;
}

.page-head > .section-title {
  margin: 0;
}

/* 两张 card 并排，各自留边框（区别于 .two-col 的中缝竖线） */
.card-row {
  display: grid;
  /* minmax(0,…) 否则表格的 min-content 会把一栏顶宽、两栏不再等分 */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.card-row > .card {
  margin-bottom: 18px;
}

.plain-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plain-list li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-body);
}

.plain-list li:last-child {
  border-bottom: 0;
}

.empty-box {
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 26px;
  text-align: center;
  color: var(--ink-soft);
  font-size: var(--fs-body);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.site-footer a {
  color: var(--ink-soft);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--brand);
  text-decoration: underline;
}

/* ---------- 对外页面（index / join） ---------- */
.public-page {
  background: oklch(0.985 0.008 80);
}

.public-page main {
  max-width: none;
  margin: 0;
  padding: 0;
}

.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 72px;
  border-bottom: 1px solid var(--line);
}

.public-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: oklch(0.30 0.03 55);
  text-decoration: none;
}

.public-brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.public-brand span {
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: 0.08em;
}

.public-header nav {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 14px;
}

.public-header nav a {
  color: oklch(0.42 0.02 60);
  text-decoration: none;
}

.public-header nav a:hover {
  color: var(--brand);
}

.public-header nav a.boxed {
  padding: 9px 18px;
  border: 1px solid oklch(0.85 0.015 75);
  border-radius: 5px;
  font-size: 13px;
  color: oklch(0.35 0.02 60);
}

.public-header nav a.boxed:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* 中文不走等宽：0.2em 字距把汉字拉散 */
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--brand);
}

.eyebrow-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* 首页 hero：左文右图 */
.home-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 560px;
  background: oklch(0.96 0.022 84);
  overflow: hidden;
}

.home-hero-text {
  padding: 56px 48px 56px 72px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.home-hero h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 46px;
  line-height: 1.45;
  color: var(--ink);
  text-wrap: pretty;
}

.hero-lede {
  margin: -6px 0 0;
  max-width: 460px;
  font-size: 16px;
  line-height: 2.05;
  color: oklch(0.44 0.02 62);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-actions .cta-button {
  height: 54px;
  padding: 0 28px;
}

.hero-actions .cta-button.ghost {
  font-family: var(--font-mono);
  background: var(--card);
}

.home-hero img {
  width: 100%;
  height: 100%;
  min-height: 560px;
  object-fit: cover;
  object-position: 60% center;
}

.public-section {
  padding: 80px 72px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.public-section + .public-section {
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 20px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 30px;
  color: var(--ink);
}

.section-head::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.feature-card {
  padding: 34px 30px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* 三步是有序流程，序号带信息；纯并列的卡片不要加 */
.feature-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--brand);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--brand);
}

.feature-card h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 21px;
  color: var(--ink);
}

.feature-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.95;
  color: oklch(0.48 0.02 62);
  text-wrap: pretty;
}

/* 联系我们深棕区块 */
.contact-band {
  margin: 0 72px 80px;
  padding: 48px 56px;
  background: var(--shell);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  color: oklch(0.96 0.012 80);
}

.contact-band h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 28px;
}

.contact-band-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-band p {
  margin: 0;
  font-size: 15px;
  line-height: 1.95;
  color: oklch(0.84 0.015 75);
}

.contact-band a:not(.cta-button) {
  color: oklch(0.85 0.05 60);
}

.contact-band .cta-button {
  align-self: flex-start;
  margin-top: 8px;
}

.contact-band img {
  width: 260px;
  border-radius: 8px;
  background: #fff;
}

.public-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 30px 72px 40px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
}

.public-footer a {
  color: var(--ink-soft);
  text-decoration: none;
}

.public-footer a:hover {
  color: var(--brand);
  text-decoration: underline;
}

/* 试点报名（join） */
.join-intro {
  padding: 76px 72px 56px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 64px;
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.join-intro-text {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.join-intro h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 44px;
  line-height: 1.4;
  color: var(--ink);
}

.join-intro p {
  margin: 0;
  max-width: 620px;
  font-size: 16px;
  line-height: 2.05;
  color: oklch(0.44 0.02 62);
  text-wrap: pretty;
}

.join-intro strong {
  color: var(--ink);
  font-weight: 500;
}

.join-aside {
  padding: 30px 28px;
  background: oklch(0.96 0.018 82);
  border: 1px solid oklch(0.88 0.02 78);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.join-aside p {
  margin: 0;
  font-size: 14px;
  line-height: 2;
  color: oklch(0.42 0.02 62);
  text-wrap: pretty;
}

.label-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* 同一位置的中文小标题用无衬线，字距收窄 */
.label-cn {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.public-section > h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 32px;
  color: var(--ink);
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-card {
  padding: 34px 30px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.step-card h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 24px;
  color: var(--ink);
}

.step-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.95;
  color: oklch(0.48 0.02 62);
  text-wrap: pretty;
}

.step-card .label-mono {
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--ink-mute);
}

.step-card.dark {
  background: var(--shell);
  border-color: var(--shell);
  color: oklch(0.96 0.012 80);
}

.step-card.dark h3 {
  color: inherit;
}

.step-card.dark p {
  color: oklch(0.84 0.015 75);
}

.step-card.dark .label-mono {
  color: oklch(0.78 0.02 72);
}

.notice {
  margin: 0;
  padding: 22px 26px;
  background: oklch(0.96 0.018 82);
  border-left: 3px solid var(--brand);
  border-radius: 4px;
  font-size: 15px;
  line-height: 1.95;
  color: oklch(0.38 0.025 60);
  text-wrap: pretty;
}

.split-section {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 56px;
  align-items: start;
}

/* 标题在窄列里，尾部横线没有可延伸的空间 */
.split-section .section-head::after {
  display: none;
}

.def-list {
  display: flex;
  flex-direction: column;
}

.def-list > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 28px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.95;
}

.def-list > div:last-child {
  border-bottom: 1px solid var(--line);
}

.def-list dt,
.def-list > div > span:first-child {
  color: var(--brand);
}

.def-list > div > span:last-child {
  color: oklch(0.42 0.02 62);
  text-wrap: pretty;
}

/* ---------- 登录 ---------- */
.login-page {
  min-height: 100vh;
  background: oklch(0.985 0.008 80);
}

.login-main {
  display: grid;
  grid-template-columns: 1fr 620px;
  min-height: 100vh;
  margin: 0;
  max-width: none;
  padding: 0;
}

.login-visual {
  position: relative;
  overflow: hidden;
  background: oklch(0.96 0.022 84);
}

.login-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-visual .public-brand {
  position: absolute;
  top: 40px;
  left: 48px;
  z-index: 1;
  color: #fff;
  text-shadow: 0 1px 10px rgba(41, 32, 26, 0.55);
}

.login-visual .public-brand img {
  position: static;
  width: 32px;
  height: 32px;
}

.login-visual .public-brand span {
  font-size: 17px;
}

/* 实色压暗条：带 alpha 的渐变在图片上层不稳定渲染，这里不用渐变 */
.login-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 34px 56px 36px 48px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: oklch(0.97 0.01 80);
  background: rgba(41, 32, 26, 0.86);
}

.login-caption h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.45;
}

.login-caption p {
  margin: 0;
  font-size: 14px;
  line-height: 1.95;
  color: oklch(0.88 0.015 78);
  max-width: 420px;
  text-wrap: pretty;
}

.login-pane {
  padding: 72px 72px 40px;
  display: flex;
  flex-direction: column;
  gap: 34px;
  background: oklch(0.985 0.008 80);
}

.login-pane h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 30px;
  color: var(--ink);
}

.login-intro {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-intro p {
  margin: 0;
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-soft);
}

.role-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 单列：「运营中心经理 + center_dispatcher」两栏放不下会折行 */
.role-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
}

.role-grid button {
  height: 62px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--field);
  border-radius: 8px;
  background: var(--card);
  font-size: 15px;
  color: var(--ink);
  text-align: left;
}

.role-grid button:hover {
  border-color: var(--brand);
  background: oklch(0.97 0.016 82);
}

.role-grid button small {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-mute);
  white-space: nowrap;
}

.login-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
}

.login-foot a {
  color: var(--ink-soft);
  text-decoration: none;
}

.login-foot a:hover {
  color: var(--brand);
  text-decoration: underline;
}

/* 退出认证：清掉浏览器缓存的 Basic 口令，走 nginx 的 /auth-logout */
.login-session {
  display: flex;
  justify-content: flex-end;
  font-size: 12px;
}

/* ---------- 下单端首页（6a）---------- */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 30px 34px;
  margin-bottom: 20px;
  background: var(--shell);
  border-radius: var(--radius);
  color: oklch(0.96 0.012 80);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 28px;
}

.hero p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.9;
  color: oklch(0.85 0.015 75);
}

.hero-cta {
  padding: 15px 26px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-size: 15.5px;
  white-space: nowrap;
  text-decoration: none;
}

.hero-cta:hover {
  background: var(--brand-dark);
  color: #fff;
}

/* 左「今日三餐」+ 右 2×2 快捷入口 */
.home-split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.home-split > section {
  margin-bottom: 0;
}

.home-split .section-title {
  margin-top: 0;
}

/* 餐次行自己带内边距，分隔线才能铺满卡片 */
.card > .meal-rows {
  padding: 0;
}

.meal-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.meal-row:last-child {
  border-bottom: 0;
}

.meal-name {
  width: 52px;
  color: var(--ink-soft);
}

.meal-dish {
  flex: 1;
}

.meal-state {
  font-size: 14px;
}

.entry-grid.entry-pair {
  grid-template-columns: 1fr 1fr;
}

body.shell-top .entry-card {
  justify-content: center;
  min-height: 84px;
}

body.shell-top .entry-desc.mono {
  font-family: var(--font-mono);
}

/* 电话入口用品牌浅底跟其余三格区分 */
.entry-card.entry-call {
  background: var(--brand-tint);
  border-color: color-mix(in oklch, var(--brand) 45%, transparent);
}

.entry-card.entry-call .entry-title,
.entry-card.entry-call .entry-desc {
  color: var(--brand-dark);
}

body.shell-top .stat-hint {
  font-family: var(--font-sans);
  font-size: 12.5px;
  letter-spacing: 0;
}

/* ---------- 下单页（6b）---------- */
.subscribe-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  align-items: start;
}

.subscribe-main,
.subscribe-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.subscribe-main > .card,
.subscribe-side > .card {
  margin-bottom: 0;
}

.form-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid .span-2 {
  grid-column: span 2;
}

.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plan-mark {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--brand);
}

.summary-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--ink-soft);
}

.summary-row.summary-cut {
  color: var(--ink-mute);
}

.summary-row.summary-total {
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 16px;
  color: var(--ink);
}

.summary-row.summary-total .mono {
  color: var(--brand-dark);
}

/* 规则说明块：浅米底，与旁边的白卡片区分 */
.note-block {
  padding: 18px 20px;
  background: oklch(0.96 0.018 82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-title {
  font-size: 14px;
  color: var(--ink);
}

.note-block p {
  margin: 0;
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* ---------- 我的订单（6c）---------- */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-list > .order-card {
  margin-bottom: 0;
  padding-top: 22px;
  padding-bottom: 22px;
}

/* 左边框区分订单状态：生效中绿、待支付品牌色、暂停灰 */
.order-card.is-active {
  border-left: 3px solid var(--ok);
}

.order-card.is-pending {
  border-color: var(--brand);
}

.order-card.is-paused {
  background: var(--bg);
  border-left: 3px solid var(--line);
}

.order-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.order-ident {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.order-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.order-title {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--ink);
}

.order-meta {
  font-size: 12.5px;
  color: var(--ink-soft);
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.order-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.fact-label {
  font-size: 12.5px;
  color: var(--ink-soft);
}

.fact-value {
  font-size: 14.5px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.order-note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.pay-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
}

.pay-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-soft);
}

.order-card .request-list {
  margin: 14px 0 0;
}

/* 待支付卡：一行摘要 + 右侧金额与支付按钮 */
.order-card.order-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.order-pay {
  display: flex;
  align-items: center;
  gap: 14px;
}

.order-pay .pay-amount {
  font-size: 20px;
}

.empty-block {
  padding: 22px 26px;
  border: 1px dashed var(--field);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--ink-soft);
}

/* ---------- 通知（6e） ---------- */
.notif-list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.notif-list:empty {
  display: none;
}

.notif-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--brand-tint);
}

.notif-row:last-child {
  border-bottom: none;
}

.notif-row.read {
  background: var(--card);
}

.notif-dot {
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--brand);
}

.notif-row.read .notif-dot {
  background: var(--line);
}

.notif-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.notif-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.notif-title {
  font-size: calc(var(--fs-body) + 1.5px);
  color: var(--ink);
}

.notif-row.read .notif-title {
  color: var(--ink-soft);
}

.notif-time {
  flex: none;
  font-size: var(--fs-meta);
  color: var(--ink-mute);
}

.notif-summary {
  margin: 0;
  font-size: var(--fs-body);
  line-height: 1.8;
  color: var(--ink-soft);
}

.notif-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: calc(var(--fs-meta) + 1.5px);
}

.notif-foot:empty {
  display: none;
}

/* 行内次要操作：外观是链接，语义仍是按钮 */
.link-button {
  height: auto;
  padding: 0;
  border: none;
  background: none;
  color: var(--brand);
  font-size: inherit;
  text-decoration: underline;
}

.link-button:hover {
  background: none;
  color: var(--brand-dark);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .entry-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-grid,
  .stat-grid-inner {
    grid-template-columns: repeat(3, 1fr);
  }

  .public-header,
  .public-section,
  .join-intro {
    padding-left: 40px;
    padding-right: 40px;
  }

  .home-hero-text {
    padding: 48px 32px 48px 40px;
  }

  .contact-band {
    margin-left: 40px;
    margin-right: 40px;
  }

  .public-footer {
    padding-left: 40px;
    padding-right: 40px;
  }

  .login-main {
    grid-template-columns: 1fr 540px;
  }

  .login-pane {
    padding: 56px 48px 32px;
  }
}

@media (max-width: 900px) {
  body.shell-side {
    grid-template-columns: 1fr;
  }

  .app-shell-nav {
    position: static;
    height: auto;
  }

  .app-shell-nav .app-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  body.shell-side main {
    padding: 20px;
  }

  body.shell-side main > .page-head {
    margin: -20px -20px 20px;
    padding: 16px 20px;
  }

  body.shell-top main {
    padding: 20px;
  }

  .two-col,
  .plan-grid,
  .entry-grid,
  .stat-grid,
  .stat-grid-inner {
    grid-template-columns: 1fr 1fr;
  }

  .app-header {
    padding: 0 20px;
  }

  .home-hero,
  .join-intro,
  .split-section,
  .login-main {
    grid-template-columns: 1fr;
  }

  .home-hero {
    min-height: 0;
  }

  .home-hero-text {
    padding: 44px 24px;
  }

  .home-hero img {
    min-height: 0;
    height: 300px;
  }

  .home-hero h1,
  .join-intro h1 {
    font-size: 34px;
  }

  .public-header,
  .public-section,
  .join-intro,
  .public-footer {
    padding-left: 24px;
    padding-right: 24px;
  }

  .public-section {
    padding-top: 52px;
    padding-bottom: 52px;
    gap: 28px;
  }

  .join-intro {
    padding-top: 48px;
    padding-bottom: 40px;
    gap: 32px;
  }

  .feature-grid,
  .step-grid {
    grid-template-columns: 1fr;
  }

  .contact-band {
    margin: 0 24px 52px;
    padding: 36px 28px;
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-band img {
    width: 200px;
  }

  .login-visual {
    min-height: 260px;
  }

  .login-pane {
    padding: 40px 24px 28px;
  }
}

@media (max-width: 640px) {
  .contact-card-body {
    flex-direction: column;
  }

  .role-grid,
  .def-list > div {
    grid-template-columns: 1fr;
  }

  .def-list > div {
    gap: 6px;
  }

  .two-col,
  .plan-grid,
  .entry-grid,
  .stat-grid,
  .stat-grid-inner {
    grid-template-columns: 1fr;
  }
}

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

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
