/* ============================================================
 * 家庭待办 · WEB 桌面版
 * 设计令牌（桌面优先，更高密度）。品牌色沿用 sage 绿。
 * 临期配色按桌面规范用 amber（不再用 rose，rose 留给快递/危险）。
 * ============================================================ */

:root {
  --bg-app: #F4F6F3;
  --bg-surface: #FFFFFF;
  --bg-sidebar: #FBFCFB;
  --bg-sunken: #F1F3EF;
  --bg-hover: #EEF1EC;

  --text-1: #1F1E1B;
  --text-2: #56544F;
  --text-3: #8C877C;
  --text-4: #ABA69B;

  --border: #E6E8E3;
  --border-soft: #EFF1EC;

  --brand: #5F8A6E;
  --brand-deep: #4F7A5E;
  --brand-soft: #E8F0EA;

  --wood: #B08546;
  --wood-soft: #F7EFE0;
  --amber: #D99A2B;
  --amber-soft: #FBF1DD;
  --rose: #C26A6A;
  --rose-soft: #F7EAEA;
  --blue: #3E7CB1;

  --font-ui: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px;
  --r-lg: 14px; --r-md: 10px; --r-sm: 8px; --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(31,30,27,.05);
  --shadow-pop: 0 8px 28px rgba(31,30,27,.12);
}

/* 「我的」页的家庭服务行：桌面侧栏没地方放这些入口，改由这里直达 */
.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
  cursor: pointer;
  border-radius: var(--r-md);
}
.service-row:hover { background: var(--bg-hover); }
.service-row + .service-row { border-top: 1px solid var(--border-soft); }
.service-sub { font-size: 12.5px; font-weight: 500; color: var(--text-3); }

/* ---------------- 点餐页（1.10.0） ---------------- */
.meal-slots {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: var(--bg-sunken);
  border-radius: var(--r-pill);
}
.meal-slot {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 0;
  border-radius: var(--r-pill);
  cursor: pointer;
}
.meal-slot.on { background: var(--brand); color: #fff; }

.meal-dish {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 6px;
}
.meal-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13px;
  border-top: 1px solid var(--border-soft);
}
.qtybox {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-sunken);
  border-radius: var(--r-pill);
  padding: 3px;
}
.qtybox button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--bg-surface);
  color: var(--text-1);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.qtybox span {
  min-width: 22px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.meal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.meal-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.meal-table td { padding: 10px 16px; border-bottom: 1px solid var(--border-soft); }
.tag-pick {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
}

/* ---------------- 家庭账单（1.11.0） ---------------- */
.bill-mini-row { display: flex; gap: 10px; margin: 12px 0; }
.bill-mini {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 14px;
}
.bill-mini-ico { font-size: 18px; }
.bill-mini-label { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.bill-mini-val { font-size: 16px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.bill-mini-amt { font-size: 12.5px; color: var(--text-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.bill-mini-diff { font-size: 11.5px; margin-top: 4px; }
.rose { color: var(--rose); }
.sage { color: var(--brand-deep); }
.gray { color: var(--text-4); }

.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; margin: 12px 0; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.ratio-bar {
  display: flex;
  height: 12px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--bg-sunken);
}
.ratio-seg { display: block; background: #B9B3A6; }
.seg-water { background: var(--blue); }
.seg-electric { background: var(--amber); }
.seg-gas { background: var(--rose); }
.seg-food { background: var(--brand); }
.seg-daily { background: #9AAE9F; }
.seg-subscription { background: var(--wood); }
.seg-property { background: #8C877C; }
.seg-other { background: #C9C4B8; }
.ratio-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--text-2); }
.bill-empty { color: var(--text-3); font-size: 12.5px; line-height: 1.8; padding: 8px 0; }
.bill-sub { color: var(--text-3); font-size: 11.5px; margin-left: 6px; }

.cat-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chip {
  border: 0;
  background: var(--bg-sunken);
  color: var(--text-2);
  font-size: 12px;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
}
.cat-chip.on { background: var(--brand); color: #fff; }

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-1);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
a { color: var(--brand-deep); }

.hidden { display: none !important; }

/* hidden 属性必须永远赢：命令面板 #command-palette 用 .cmd{display:flex} 定位，
   若不强制 [hidden]，作者样式的 display:flex 会盖过 UA 的 [hidden]{display:none}，
   导致 ⌘K 面板常驻可见。 #drawer-root 同理。 */
[hidden] { display: none !important; }

kbd {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 11px;
  background: var(--bg-sunken);
  color: var(--text-2);
  font-family: inherit;
}

/* ============================================================
 * 认证层（桌面左右分栏）
 * ============================================================ */

.auth {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-app);
  padding: 24px;
}

.auth-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  width: min(880px, 100%);
  min-height: 540px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-pop);
}

.auth-aside {
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
}

.auth-logo {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
}
.auth-logo svg { width: 30px; height: 30px; }

.auth-h1 { font-size: 28px; font-weight: 700; margin: 20px 0 6px; }
.auth-tagline { font-size: 14px; opacity: .9; margin: 0; }
.auth-points { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-direction: column; gap: 12px; }
.auth-points li {
  font-size: 13px; opacity: .92;
  padding-left: 22px; position: relative; line-height: 1.5;
}
.auth-points li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(255,255,255,.22); font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}

.auth-main { padding: 32px 34px; display: flex; flex-direction: column; gap: 12px; }

.server-row { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--r-md); padding: 8px 10px; }
.server-icon { width: 18px; height: 18px; color: var(--text-3); flex-shrink: 0; }
#server-url { flex: 1; border: none; outline: none; font-size: 13px; background: transparent; color: var(--text-1); min-width: 0; }
.server-test { border: 1px solid var(--brand); color: var(--brand-deep); background: var(--brand-soft); border-radius: var(--r-sm); padding: 6px 12px; font-size: 13px; cursor: pointer; flex-shrink: 0; }
.server-hint { font-size: 12px; color: var(--text-3); min-height: 16px; }
.server-hint.ok { color: var(--brand-deep); }
.server-hint.err { color: var(--rose); }

.seg { display: flex; background: var(--bg-sunken); border-radius: var(--r-md); padding: 4px; gap: 4px; }
.seg-item { flex: 1; border: none; background: transparent; border-radius: var(--r-sm); padding: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.seg-item.active { background: #fff; color: var(--text-1); font-weight: 600; box-shadow: var(--shadow-1); }

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field span { font-size: 12.5px; color: var(--text-2); }
.field input { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 11px; font-size: 14px; background: #fff; color: var(--text-1); outline: none; }
.field input:focus { border-color: var(--brand); }
.btn-primary { background: var(--brand); color: #fff; border: none; border-radius: var(--r-md); padding: 11px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: var(--brand-deep); }
.auth-tip { font-size: 11.5px; color: var(--text-4); margin: 0; }

/* ============================================================
 * 应用外壳
 * ============================================================ */

.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
}

.sidebar-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 0 4px; }
.brand-logo { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-logo svg { width: 20px; height: 20px; }
.brand-name { font-size: 15px; font-weight: 700; color: var(--text-1); line-height: 1.2; }
.brand-family { font-size: 12px; color: var(--text-3); }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--r-md);
  color: var(--text-2); font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; background: transparent; width: 100%;
  text-align: left; position: relative;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-hover); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill); background: var(--text-4); color: #fff;
  font-size: 11px; display: none; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.nav-badge:not(:empty) { display: flex; }
.nav-badge.wood { background: var(--wood); }
.nav-badge.amber { background: var(--amber); }
.nav-badge.rose { background: var(--rose); }

.new-btn {
  margin: 8px 0 14px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; border: none; border-radius: var(--r-md);
  padding: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.new-btn:hover { background: var(--brand-deep); }
.new-btn svg { width: 18px; height: 18px; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.presence { display: flex; align-items: center; padding: 2px 4px; min-height: 28px; flex-wrap: wrap; }
.presence .avatar { margin-right: -6px; box-shadow: 0 0 0 2px var(--bg-sidebar); }
.presence .presence-more { font-size: 11px; color: var(--text-3); margin-left: 8px; }
.nav-item.subtle { font-size: 13px; color: var(--text-3); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg-app); }

.topbar {
  height: 60px; flex-shrink: 0; display: flex; align-items: center; gap: 16px;
  padding: 0 20px; background: var(--bg-surface); border-bottom: 1px solid var(--border);
}
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: 18px; font-weight: 700; margin: 0; color: var(--text-1); }
.topbar-title p { font-size: 12.5px; color: var(--text-3); margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.search-trigger {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); background: var(--bg-sunken);
  border-radius: var(--r-pill); padding: 7px 12px; color: var(--text-2);
  font-size: 13px; cursor: pointer;
}
.search-trigger:hover { border-color: var(--brand); }
.search-trigger svg { width: 16px; height: 16px; }

.sync-pill {
  display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 6px 12px; font-size: 12.5px; color: var(--text-2); background: #fff;
}
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-4); flex-shrink: 0; }
.sync-pill.online .sync-dot { background: var(--brand); }
.sync-pill.offline .sync-dot { background: var(--rose); }
.sync-pill.connecting .sync-dot { background: var(--amber); animation: pulse 1.1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.btn-new-top { background: var(--brand); color: #fff; border: none; border-radius: var(--r-sm); padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-new-top:hover { background: var(--brand-deep); }

.avatar-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; border: none; font-weight: 700; cursor: pointer; font-size: 14px; flex-shrink: 0; }
.avatar-btn:hover { background: var(--brand-deep); }

.icon-btn { background: transparent; border: none; color: var(--text-2); cursor: pointer; border-radius: var(--r-sm); padding: 6px; display: inline-flex; }
.icon-btn:hover { background: var(--bg-hover); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.hamburger { display: none; }

.page { flex: 1; overflow-y: auto; padding: 22px 26px; }

.view-home { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.view-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; align-items: start; }
.view-purchase, .view-remind, .view-mine { max-width: 920px; }

.view-home > .section-title, .view-home > .chips, .view-home > .overview,
.view-home > .empty, .view-home > .entry,
.view-items > .section-title, .view-items > .summary-bar, .view-items > .quick-add,
.view-items > .empty { grid-column: 1 / -1; }

/* ============================================================
 * 通用组件（沿用视图类名，按桌面令牌重做）
 * ============================================================ */

.overview {
  display: flex; gap: 14px; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 22px;
}
.ov-item { display: flex; flex-direction: column; gap: 2px; }
.ov-num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ov-num.sage { color: var(--brand); }
.ov-num.wood { color: var(--wood); }
.ov-num.rose { color: var(--rose); }
.ov-label { font-size: 12.5px; color: var(--text-3); }
.ov-div { width: 1px; background: var(--border); margin: 4px 0; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: var(--r-pill); padding: 6px 13px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }

.section-title { font-size: 12.5px; font-weight: 700; color: var(--text-3); letter-spacing: .3px; margin: 18px 0 10px; }

.empty { text-align: center; padding: 56px 20px; color: var(--text-3); }
.empty svg { width: 46px; height: 46px; color: var(--border); margin-bottom: 12px; }
.empty p { font-size: 15px; font-weight: 600; color: var(--text-2); margin: 0; }
.empty small { font-size: 12.5px; color: var(--text-4); }

.task {
  display: flex; gap: 12px; align-items: flex-start; width: 100%;
  text-align: left; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px; cursor: pointer; margin: 0;
  transition: border-color .12s, box-shadow .12s;
}
.task:hover { border-color: var(--brand); box-shadow: var(--shadow-1); }
.task.done { opacity: .62; }
.task.done .task-title { text-decoration: line-through; }
.task-body { min-width: 0; flex: 1; }
.task-title { font-size: 15px; font-weight: 600; color: var(--text-1); display: block; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; font-size: 12.5px; color: var(--text-3); align-items: center; }

.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; }
.tag.express { background: var(--rose-soft); color: var(--rose); }
.tag.buy { background: var(--wood-soft); color: var(--wood); }
.tag.house { background: var(--brand-soft); color: var(--brand-deep); }
.tag.plain { background: var(--bg-sunken); color: var(--text-3); }
.tag.gray { background: var(--bg-sunken); color: var(--text-3); }
.tag.sage { background: var(--brand-soft); color: var(--brand-deep); }
.tag.wood { background: var(--wood-soft); color: var(--wood); }
.tag.rose { background: var(--rose-soft); color: var(--rose); }

.pickup-inline { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--rose-soft); color: var(--rose); padding: 1px 7px; border-radius: 5px; font-size: 12px; font-weight: 700; letter-spacing: .5px; }

.checkbox { width: 22px; height: 22px; flex-shrink: 0; cursor: pointer; margin-top: 1px; }

.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; flex-shrink: 0; }
.avatar.sage { background: var(--brand); }
.avatar.wood { background: var(--wood); }
.avatar.rose { background: var(--rose); }
.avatar.gray { background: var(--text-4); }
.avatar.blue { background: var(--blue); }
.avatar.solid { box-shadow: 0 0 0 2px #fff; }

.person { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.person-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-txt { min-width: 0; }
.person-name { font-size: 14px; font-weight: 600; color: var(--text-1); }
.person-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.activity { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.act-txt { min-width: 0; }
.act-main { font-size: 13px; color: var(--text-1); }
.act-time { font-size: 11.5px; color: var(--text-4); margin-top: 2px; }

.card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; }

.setting-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 10px; }
.setting-card h4 { margin: 0; font-size: 13px; font-weight: 700; color: var(--text-1); }

.input-box { display: flex; flex-direction: column; gap: 5px; }
.input-box label { font-size: 12.5px; color: var(--text-2); }
.input-box input { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; font-size: 14px; background: #fff; color: var(--text-1); outline: none; width: 100%; }
.input-box input:focus { border-color: var(--brand); }

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

.switch-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.switch { width: 38px; height: 22px; border-radius: var(--r-pill); background: var(--text-4); position: relative; cursor: pointer; flex-shrink: 0; transition: background .15s; }
.switch.on { background: var(--brand); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch.on::after { transform: translateX(16px); }

.mini-btn { border: 1px solid var(--border); background: #fff; border-radius: 7px; padding: 5px 10px; font-size: 12.5px; color: var(--text-2); cursor: pointer; flex-shrink: 0; }
.mini-btn:hover { border-color: var(--brand); color: var(--brand-deep); }
.mini-btn.ghost { background: transparent; border-color: transparent; color: var(--brand-deep); }
.mini-btn.urge { background: var(--brand); color: #fff; border-color: var(--brand); }
.mini-btn.urge:hover { background: var(--brand-deep); }

.btn-ghost { border: 1px solid var(--border); background: #fff; border-radius: var(--r-sm); padding: 9px 14px; font-size: 13.5px; color: var(--text-1); cursor: pointer; width: 100%; margin-top: 8px; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-deep); }
.btn-block { background: var(--brand); color: #fff; border: none; border-radius: var(--r-sm); padding: 10px 14px; font-size: 14px; font-weight: 600; cursor: pointer; width: 100%; }
.btn-block:hover { background: var(--brand-deep); }
.btn-danger { background: var(--rose-soft); color: var(--rose); border: 1px solid transparent; border-radius: var(--r-sm); padding: 10px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; width: 100%; margin-top: 8px; }
.btn-danger:hover { background: var(--rose); color: #fff; }

.summary-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--brand-soft); border-radius: var(--r-sm); font-size: 13px; color: var(--brand-deep); margin-bottom: 12px; }

.quick-add { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 12px; background: #fff; margin-bottom: 14px; }
.quick-add svg { width: 18px; height: 18px; color: var(--text-3); flex-shrink: 0; }
.quick-add input { flex: 1; border: none; outline: none; font-size: 14px; background: transparent; color: var(--text-1); min-width: 0; }

.notice { display: flex; gap: 9px; align-items: flex-start; padding: 11px 13px; border-radius: var(--r-sm); font-size: 12.5px; line-height: 1.5; margin: 10px 0; }
.notice svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.notice.ok { background: var(--brand-soft); color: var(--brand-deep); }
.notice.info { background: #EAF1F8; color: var(--blue); }
.notice.warn { background: var(--amber-soft); color: #9a6a14; }

.invite-code { font-size: 20px; font-weight: 700; letter-spacing: 2px; color: var(--brand-deep); font-variant-numeric: tabular-nums; }

.entry { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--wood-soft); border: 1px solid transparent; border-radius: var(--r-md); padding: 14px; margin-top: 14px; cursor: pointer; width: 100%; text-align: left; }
.entry:hover { border-color: var(--wood); }
.entry h4 { margin: 0; font-size: 14px; color: var(--wood); }
.entry p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-3); }

.item-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.item-card:hover { border-color: var(--brand); box-shadow: var(--shadow-1); }
.item-card.off { opacity: .6; }
.item-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.item-name { font-size: 15px; font-weight: 600; color: var(--text-1); }
.item-sub { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.item-actions { margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-qty { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 30px; text-align: center; flex-shrink: 0; }
.item-gap { flex: 1; }
.item-actions .mini-btn { min-width: 30px; }

.link-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-deep); cursor: pointer; margin-top: 6px; width: fit-content; }
.link-chip.done { background: var(--brand-soft); color: var(--brand-deep); }
.link-chip.todo { background: var(--wood-soft); color: var(--wood); }

.pickup-card { background: var(--rose-soft); border-radius: var(--r-md); padding: 14px; margin-bottom: 12px; }
.pickup-label { font-size: 12px; color: var(--rose); }
.pickup-code { font-size: 26px; font-weight: 700; letter-spacing: 2px; color: var(--rose); font-variant-numeric: tabular-nums; margin: 4px 0; }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rose); color: var(--rose); background: #fff; border-radius: var(--r-sm); padding: 5px 10px; font-size: 12.5px; cursor: pointer; }
.copy-btn svg { width: 15px; height: 15px; }
.pickup-hint { font-size: 11.5px; color: var(--text-3); margin: 6px 0 0; }

.info-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.info-row span { color: var(--text-3); }
.info-row b { color: var(--text-1); font-weight: 600; }
.info-row b.sage { color: var(--brand-deep); }

/* ============================================================
 * 弹层 / 提示
 * ============================================================ */

.modal-mask { position: fixed; inset: 0; background: rgba(31,30,27,.4); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-head .cancel { border: none; background: transparent; color: var(--text-3); cursor: pointer; font-size: 13.5px; padding: 4px 8px; }
.modal-head .save { border: none; background: transparent; color: var(--brand-deep); font-weight: 700; cursor: pointer; font-size: 13.5px; padding: 4px 8px; }
.modal-body { padding: 16px; }

.toast-root { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; }
.toast { background: var(--text-1); color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow-pop); max-width: 320px; animation: toast-in .2s ease; }
.toast.ok { background: var(--brand-deep); }
.toast.err { background: var(--rose); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.inapp-banner { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow-pop); display: flex; gap: 10px; align-items: center; z-index: 1500; max-width: 420px; cursor: pointer; }
.inapp-banner .bi { width: 22px; height: 22px; flex-shrink: 0; }
.inapp-banner .bt { display: flex; flex-direction: column; min-width: 0; }
.inapp-banner .bt b { font-size: 13px; }
.inapp-banner .bt span { font-size: 12px; color: var(--text-3); }
.inapp-banner .bx { border: none; background: var(--bg-sunken); color: var(--text-2); border-radius: 7px; padding: 4px 10px; font-size: 12px; cursor: pointer; flex-shrink: 0; }

/* ============================================================
 * 右侧详情抽屉
 * ============================================================ */

.drawer { position: fixed; inset: 0; z-index: 900; visibility: hidden; }
.drawer.open { visibility: visible; }
.drawer-mask { position: absolute; inset: 0; background: rgba(31,30,27,.28); opacity: 0; transition: opacity .2s; }
.drawer.open .drawer-mask { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; height: 100%; width: 384px; max-width: 92vw; background: #fff; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease; }
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drawer-kind { font-size: 13px; font-weight: 700; color: var(--text-3); }
.drawer-body { padding: 16px; overflow-y: auto; flex: 1; }

/* ============================================================
 * 命令面板 ⌘K
 * ============================================================ */

.cmd { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: flex-start; justify-content: center; }
.cmd-mask { position: absolute; inset: 0; background: rgba(31,30,27,.35); }
.cmd-panel { position: relative; margin-top: 12vh; width: min(560px, 92vw); background: #fff; border-radius: 14px; box-shadow: var(--shadow-pop); overflow: hidden; display: flex; flex-direction: column; }
.cmd-input-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.cmd-input-wrap svg { width: 18px; height: 18px; }
.cmd-input { flex: 1; border: none; outline: none; font-size: 15px; color: var(--text-1); background: transparent; }
.cmd-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.cmd-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; cursor: pointer; font-size: 14px; color: var(--text-1); }
.cmd-item .cmd-ico { color: var(--text-3); display: flex; flex-shrink: 0; }
.cmd-item .cmd-ico svg { width: 18px; height: 18px; }
.cmd-item .cmd-sub { margin-left: auto; font-size: 12px; color: var(--text-3); }
.cmd-item.active { background: var(--brand-soft); color: var(--brand-deep); }
.cmd-foot { display: flex; gap: 6px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.cmd-foot kbd { margin-right: 2px; }

/* ============================================================
 * 响应式兜底（<1024 简化，不回退手机外框）
 * ============================================================ */

@media (max-width: 1023px) {
  .view-home { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar { width: 64px; padding: 14px 10px; align-items: center; }
  .brand-txt, .nav-item span, .new-btn span, .nav-badge, .presence .presence-more { display: none; }
  .sidebar-brand { justify-content: center; padding: 0; }
  .nav-item { justify-content: center; padding: 11px; }
  .new-btn { padding: 11px; }
  .nav-item.subtle { justify-content: center; }
}

@media (max-width: 640px) {
  .sidebar {
    position: fixed; left: 0; top: 0; height: 100%; z-index: 800;
    transform: translateX(-100%); transition: transform .2s ease; align-items: stretch;
    box-shadow: var(--shadow-pop);
  }
  .sidebar.open { transform: none; }
  .icon-btn.hamburger { display: inline-flex; }
  .presence { display: none; }
  .topbar { gap: 10px; padding: 0 14px; }
  .topbar-title h1 { font-size: 16px; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .page { padding: 16px; }
}
