/* ============================================================
   校园食光 · 视觉系统
   纸张底 + 墨色文字 + 辣椒橙点缀；卡片轻边框、弱阴影；
   控件统一圆角，信息层级靠字号与灰度拉开,不靠彩色底。
   ============================================================ */

:root {
  --paper: #fffcf7;
  --surface: #ffffff;
  --sunken: #f6f0e6;

  --ink: #1c1813;
  --ink-2: #4a4038;
  --muted: #8b8175;
  --faint: #b9afa1;

  --line: #efe7da;
  --line-2: #e5daca;

  --brand: #d9480f;
  --brand-dark: #ae3a0b;
  --brand-soft: #fceee3;
  --gold: #a9762a;

  --r-card: 16px;
  --r-ctrl: 12px;
  --r-pill: 999px;

  --shadow-card: 0 1px 2px rgba(28, 24, 19, 0.04), 0 14px 30px -24px rgba(28, 24, 19, 0.55);
  --gutter: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

body {
  background: #f0eae1;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; font-size: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
input, textarea { font-family: inherit; color: inherit; }
img { display: block; }
a { color: inherit; text-decoration: none; }

#app {
  position: relative;
  width: 100%;
  max-width: 440px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(80, 60, 40, 0.05), 0 24px 70px -34px rgba(70, 50, 30, 0.5);
}

#screen { min-height: 100dvh; padding-bottom: 100px; }
#screen.no-tab { padding-bottom: 24px; }

/* ---------------- 顶栏 ---------------- */
.header {
  position: sticky; top: 0; z-index: 20;
  padding: 16px 0 0;
  background: rgba(255, 252, 247, 0.92);
  backdrop-filter: blur(16px) saturate(1.1);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.header.scrolled { border-bottom-color: var(--line); }
.header-main { display: flex; align-items: flex-start; justify-content: space-between; padding: 0 var(--gutter) 12px; }
.brand { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: 2px; line-height: 1.2; }
.brand span { color: var(--brand); }
.brand-sub { margin: 4px 0 0; font-size: 11px; color: var(--muted); letter-spacing: 0.6px; }

.header-actions { display: flex; align-items: center; gap: 8px; padding-top: 2px; }
.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-2);
  flex: 0 0 auto;
  transition: transform 0.15s ease, background 0.15s ease;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:active { transform: scale(0.94); background: var(--sunken); }
.btn-login {
  height: 32px; padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--brand); color: #fff;
  font-size: 12.5px; font-weight: 500; letter-spacing: 0.5px;
}
.btn-login:active { transform: scale(0.96); }

.search-row { padding: 0 var(--gutter) 12px; }
.search-row input {
  width: 100%; height: 38px; padding: 0 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; outline: none;
  transition: border-color 0.15s ease;
}
.search-row input:focus { border-color: #e3bda6; }

/* 分区标签 */
.chips { display: flex; gap: 7px; overflow-x: auto; padding: 0 var(--gutter) 11px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; height: 30px; padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: transparent;
  font-size: 12.5px; color: var(--muted);
  transition: 0.16s ease;
}
.chip:active { transform: scale(0.96); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fdf8f0; font-weight: 500; }

.sort-row { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gutter) 10px; }
.sort-count { font-size: 11px; color: var(--faint); letter-spacing: 0.6px; }
.seg { display: flex; gap: 2px; padding: 2.5px; background: var(--sunken); border-radius: var(--r-pill); }
.seg button { padding: 4px 12px; border-radius: var(--r-pill); font-size: 11.5px; color: var(--muted); transition: 0.16s ease; }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(28, 24, 19, 0.08); }

/* ---------------- 动态卡片 ---------------- */
.card {
  margin: 0 14px 10px; padding: 14px 15px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  transition: transform 0.14s ease;
}
.card:active { transform: scale(0.995); }

.card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.avatar {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  color: #fff; font-size: 13px; font-weight: 500;
  flex: 0 0 auto; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }

.who { min-width: 0; flex: 1; }
.who-top { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; line-height: 1.3; }
.who-sub { margin-top: 2px; font-size: 11px; color: var(--faint); }
.zone-tag {
  display: inline-block; padding: 1px 7px;
  border-radius: 5px; background: var(--sunken);
  color: #7d6a55; font-size: 10.5px; font-weight: 400;
  letter-spacing: 0.2px;
}

.card-body { font-size: 14.5px; line-height: 1.72; color: #2c251e; white-space: pre-wrap; word-break: break-word; }
.card-body.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.media { margin-top: 10px; border-radius: 12px; overflow: hidden; background: var(--sunken); }
.media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.media.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.media.grid img { aspect-ratio: 1 / 1; }

.actions { display: flex; align-items: center; gap: 18px; margin-top: 11px; color: var(--muted); font-size: 12px; }
.action { display: flex; align-items: center; gap: 5px; transition: color 0.15s ease; }
.action svg { width: 17px; height: 17px; }
.action:active { transform: scale(0.94); }
.action.active.like, .action.active.like svg { color: var(--brand); }
.action.active.fav, .action.active.fav svg { color: var(--gold); }
.action.bump svg { animation: pop 0.34s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.26); } 100% { transform: scale(1); } }
.action.del {
  margin-left: auto; padding: 3px 11px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  color: var(--muted); font-size: 11.5px;
}
.action.del:active { background: var(--sunken); }
.card-more { margin-left: auto; padding: 0 2px; color: var(--faint); font-size: 17px; line-height: 1; letter-spacing: 1px; }

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  width: 100%; max-width: 440px;
  padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 249, 0.94);
  backdrop-filter: blur(18px) saturate(1.15);
  border-top: 1px solid rgba(28, 24, 19, 0.07);
}
.tabbar.hidden { display: none; }
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 2px 0; color: #a79d90; font-size: 10px; letter-spacing: 0.4px;
  transition: color 0.16s ease;
}
.tab .ico {
  display: grid; place-items: center;
  width: 42px; height: 27px; border-radius: var(--r-pill);
  transition: background 0.18s ease, color 0.18s ease;
}
.tab .ico svg { width: 21px; height: 21px; }
.tab.active { color: var(--ink); }
.tab.active .ico { background: var(--ink); color: #fff8ef; }

.tab.compose { position: relative; }
.tab.compose .ico { background: transparent; }
.tab.compose .fab {
  position: absolute; left: 50%; top: -25px;
  transform: translateX(-50%);
  z-index: 2;
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--brand); color: #fff;
  box-shadow: 0 8px 18px -9px rgba(217, 72, 15, 0.85), 0 0 0 3px rgba(255, 252, 247, 0.92);
  transition: transform 0.15s ease;
}
.tab.compose .fab svg { width: 21px; height: 21px; stroke-width: 2.2; }
.tab.compose:active .fab { transform: translateX(-50%) scale(0.93); }

/* ---------------- 详情 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 34px 1fr 34px;
  align-items: center;
  padding: 11px 14px;
  background: rgba(255, 252, 247, 0.92);
  backdrop-filter: blur(16px) saturate(1.1);
}
.topbar-title { text-align: center; font-size: 14px; font-weight: 500; letter-spacing: 0.5px; }

.gallery-wrap { position: relative; background: var(--sunken); }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: start; }
.gallery-count {
  position: absolute; right: 12px; bottom: 12px;
  padding: 2px 9px; border-radius: var(--r-pill);
  background: rgba(20, 14, 8, 0.52); color: #fff;
  font-size: 11px; letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
}

.detail-body { padding: 16px var(--gutter) 120px; }
.detail-author { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.detail-author .avatar { width: 38px; height: 38px; }
.detail-text { font-size: 15.5px; line-height: 1.82; color: #2c251e; white-space: pre-wrap; word-break: break-word; }
.detail-meta { margin-top: 12px; font-size: 11px; color: var(--faint); letter-spacing: 0.4px; }

.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 26px 0 4px; padding-top: 18px;
  border-top: 1px solid var(--line);
}
.section-title h3 { margin: 0; font-size: 13.5px; font-weight: 600; letter-spacing: 0.6px; }
.section-title span { font-size: 11px; color: var(--faint); }

.comment { display: flex; gap: 10px; padding: 13px 0; border-bottom: 1px solid #f7f1e7; }
.comment:last-child { border-bottom: none; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; justify-content: space-between; font-size: 11px; color: var(--faint); }
.comment-head b { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.comment-text { margin-top: 3px; font-size: 13.5px; line-height: 1.65; word-break: break-word; }

.dock {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  z-index: 40;
  display: flex; align-items: center; gap: 12px;
  width: 100%; max-width: 440px;
  padding: 9px 14px calc(9px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 249, 0.96);
  backdrop-filter: blur(16px) saturate(1.1);
  border-top: 1px solid var(--line);
}
.dock-input {
  flex: 1; height: 38px; padding: 0 15px;
  border-radius: var(--r-pill);
  background: var(--sunken); border: 1px solid transparent;
  outline: none; font-size: 13px;
  transition: 0.16s ease;
}
.dock-input:focus { background: var(--surface); border-color: var(--line-2); }
.dock .action { flex-direction: row; gap: 4px; font-size: 11.5px; color: var(--muted); }
.dock .action svg { width: 19px; height: 19px; }

/* ---------------- 发布 ---------------- */
.compose-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.compose-head h2 { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: 0.5px; text-align: center; }
.compose-head .btn-text { justify-self: start; }
.compose-head .btn-primary { justify-self: end; }
.btn-text { font-size: 13px; color: var(--muted); }
.btn-primary {
  display: inline-grid; place-items: center;
  height: 38px; padding: 0 18px;
  border-radius: var(--r-pill);
  background: var(--brand); color: #fff;
  font-size: 13.5px; font-weight: 500;
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { background: #e7dfd3; color: #a99e90; }
.btn-primary.block { display: grid; width: 100%; height: 46px; border-radius: 14px; font-size: 15px; }

.compose-body { padding: 16px var(--gutter); }
.compose-body textarea {
  width: 100%; min-height: 96px;
  border: none; outline: none; background: transparent;
  font-size: 15.5px; line-height: 1.78; resize: none;
}
.compose-body textarea::placeholder { color: var(--faint); }
.counter { text-align: right; font-size: 11px; color: var(--faint); letter-spacing: 0.5px; }

.picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 10px; }
.tile { position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: var(--sunken); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile .remove {
  position: absolute; top: 4px; right: 4px;
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(20, 14, 8, 0.55); color: #fff;
  font-size: 12px; line-height: 1;
}
.tile.add { display: grid; place-items: center; border: 1px dashed var(--line-2); color: var(--faint); font-size: 24px; font-weight: 300; }

.field-label { margin: 24px 0 10px; font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.zone-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.rule-note {
  margin-top: 22px; padding: 12px 14px;
  border-radius: var(--r-ctrl);
  background: var(--sunken);
  font-size: 11.5px; line-height: 1.75; color: #948872;
}

/* ---------------- 地图 ---------------- */
.map-wrap {
  position: relative; margin: 0 14px;
  border-radius: var(--r-card); overflow: hidden;
  border: 1px solid var(--line);
  background: #f8f4ea;
}
.map-wrap > svg { display: block; width: 100%; height: auto; }
.pin { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pin-dot {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); border: 2px solid #fff; color: #fff;
  font-size: 11px;
  box-shadow: 0 5px 12px -4px rgba(180, 60, 10, 0.55);
  transition: 0.16s ease;
}
.pin-label {
  padding: 1px 7px; border-radius: 5px;
  background: #fff; color: #5b4e42; font-size: 10px;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(80, 50, 20, 0.12);
}
.pin.active .pin-dot { background: var(--ink); transform: scale(1.06); }
.pin.active .pin-label { background: var(--ink); color: #fff; }

.zone-panel {
  margin: 12px 14px 0; padding: 15px;
  border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}
.zone-panel h3 { margin: 0 0 2px; font-size: 14.5px; font-weight: 600; letter-spacing: 0.5px; }
.zone-panel .hint { font-size: 11px; color: var(--faint); }
.zone-post { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f7f1e7; }
.zone-post:last-of-type { border-bottom: none; }
.zone-post img { width: 50px; height: 50px; border-radius: 9px; object-fit: cover; flex: 0 0 auto; }
.zone-post p {
  margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.zone-post span { font-size: 10.5px; color: var(--faint); }
.link-more { display: block; margin-top: 12px; text-align: center; font-size: 12.5px; color: var(--brand-dark); letter-spacing: 0.4px; }

/* ---------------- 我的 ---------------- */
.profile {
  margin: 14px 14px 0; padding: 18px;
  border-radius: 18px;
  background: linear-gradient(150deg, #241c15 0%, #3d2c20 58%, #5a3a26 100%);
  color: #fff8ee;
}
.profile-top { display: flex; align-items: center; gap: 12px; }
.profile .avatar {
  width: 50px; height: 50px; font-size: 18px;
  background: #f2e2cf !important;
  color: #4a3527;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.avatar-edit { position: relative; flex: 0 0 auto; border-radius: 50%; }
.avatar-edit:active { transform: scale(0.95); }
.avatar-cam {
  position: absolute; right: -3px; bottom: -3px;
  display: grid; place-items: center;
  width: 19px; height: 19px; border-radius: 50%;
  background: #2a2018; color: #fdf8f0;
  box-shadow: 0 0 0 2px rgba(58, 42, 30, 0.85);
}
.profile-name { font-size: 17px; font-weight: 600; letter-spacing: 0.6px; }
.profile-sub { margin-top: 3px; font-size: 11px; opacity: 0.6; letter-spacing: 0.5px; }
.profile-stats { display: flex; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.profile-stats div { flex: 1; text-align: center; }
.profile-stats b { display: block; font-size: 18px; font-weight: 600; letter-spacing: 0.5px; }
.profile-stats span { font-size: 10.5px; opacity: 0.6; letter-spacing: 0.8px; }

.menu {
  margin: 12px 14px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.menu-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 14px 15px;
  border-bottom: 1px solid #f7f1e7;
  font-size: 14px;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: #fbf7f0; }
.menu-item .left { display: flex; align-items: center; gap: 10px; }
.menu-item svg { width: 18px; height: 18px; color: #a3957f; }
.menu-item .chev { color: var(--faint); font-size: 14px; }

/* ---------------- 登录注册 ---------------- */
.auth { position: relative; padding: 58px 26px 40px; }
.auth-close {
  position: absolute; top: 16px; left: 16px;
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
}
.auth-close svg { width: 16px; height: 16px; }
.auth-logo {
  display: grid; place-items: center;
  width: 58px; height: 58px; border-radius: 18px;
  background: var(--brand); color: #fff;
  margin-bottom: 20px;
  box-shadow: 0 10px 22px -12px rgba(217, 72, 15, 0.8);
}
.auth-logo svg { width: 28px; height: 28px; }
.auth h1 { margin: 0; font-size: 25px; font-weight: 600; letter-spacing: 2px; }
.auth p.sub { margin: 6px 0 28px; font-size: 11px; color: var(--faint); letter-spacing: 1.6px; }
.field { margin-bottom: 15px; }
.field label { display: block; margin-bottom: 6px; font-size: 11px; color: var(--muted); letter-spacing: 0.8px; }
.field input {
  width: 100%; height: 46px; padding: 0 15px;
  border-radius: var(--r-ctrl);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 15px; outline: none;
  transition: 0.16s ease;
}
.field input:focus { border-color: #e3bda6; background: #fffdf9; }
.field-row { display: flex; gap: 9px; }
.field-row input { flex: 1; }
.code-btn {
  flex: 0 0 102px; height: 46px;
  border-radius: var(--r-ctrl);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 12px; color: var(--brand-dark);
}
.code-btn:disabled { color: var(--faint); }
.auth-foot { margin-top: 16px; text-align: center; font-size: 12.5px; color: var(--muted); }
.auth-foot a { color: var(--brand-dark); }
.demo-box {
  margin-top: 24px; padding: 13px 15px;
  border-radius: var(--r-ctrl);
  background: var(--sunken);
  font-size: 11px; line-height: 1.9; color: #918570;
  letter-spacing: 0.3px;
}
.demo-box b { font-weight: 500; color: #5b4e42; }

/* ---------------- 后台 ---------------- */
.tabs { display: flex; gap: 20px; padding: 4px var(--gutter) 0; border-bottom: 1px solid var(--line); }
.tabs button { position: relative; padding: 10px 0 11px; font-size: 13px; color: var(--muted); }
.tabs button.active { color: var(--ink); font-weight: 500; }
.tabs button.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--brand); border-radius: 2px;
}

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; padding: 14px; }
.stat { padding: 14px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); }
.stat b { display: block; font-size: 21px; font-weight: 600; letter-spacing: 0.5px; }
.stat span { font-size: 11px; color: var(--faint); }

.report {
  margin: 0 14px 10px; padding: 14px;
  border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}
.report-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--faint); }
.reason { padding: 2px 8px; border-radius: 5px; background: var(--brand-soft); color: var(--brand-dark); font-size: 10.5px; }
.report-quote {
  margin: 10px 0 4px; padding: 10px 12px;
  border-radius: 9px; background: #faf6ef;
  font-size: 12.5px; line-height: 1.6; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.report-meta { font-size: 10.5px; color: var(--faint); }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.btn-sm { flex: 1; height: 35px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; color: var(--ink-2); }
.btn-sm.danger { background: #fdeeeb; border-color: #f6d5cd; color: #b42318; }
.btn-sm.dark { background: var(--ink); border-color: var(--ink); color: #fff; }

.user-row { display: flex; align-items: center; gap: 11px; padding: 12px 15px; border-bottom: 1px solid #f7f1e7; }
.user-row .info { flex: 1; min-width: 0; }
.user-row .name { font-size: 13.5px; font-weight: 500; }
.user-row .sub { font-size: 11px; color: var(--faint); }
.badge { padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 400; }
.badge.ok { background: #eef5e6; color: #4c6b2f; }
.badge.off { background: #fbeceb; color: #b42318; }

/* ---------------- 通用 ---------------- */
.empty { padding: 56px 24px; text-align: center; color: var(--faint); font-size: 12.5px; line-height: 2; white-space: pre-line; }
.empty .btn-primary { display: grid; width: max-content; margin: 16px auto 0; }
.loading { padding: 40px; text-align: center; color: var(--faint); font-size: 11.5px; letter-spacing: 1.2px; }
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid #eae0d2; border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px; margin-right: 7px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.list-end { padding: 24px 0 8px; text-align: center; font-size: 10.5px; color: #c9bfb0; letter-spacing: 3px; }

.toast {
  position: fixed; left: 50%; bottom: 88px;
  transform: translate(-50%, 10px);
  z-index: 90;
  max-width: 76%; padding: 9px 16px;
  border-radius: var(--r-pill);
  background: rgba(28, 24, 19, 0.92); color: #fff8ef;
  font-size: 12.5px; text-align: center;
  opacity: 0; pointer-events: none;
  transition: 0.22s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.modal-mask {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(28, 20, 12, 0.38);
  animation: fade 0.2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative;
  width: 100%; max-width: 440px;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: var(--surface);
  animation: slideup 0.24s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.modal::before {
  content: ""; position: absolute; top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 34px; height: 4px; border-radius: 2px;
  background: #e7ddcd;
}
@keyframes slideup { from { transform: translateY(26px); } to { transform: translateY(0); } }
.modal h3 { margin: 6px 0 4px; font-size: 15.5px; font-weight: 600; letter-spacing: 0.4px; }
.modal p { margin: 0 0 14px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.modal-actions { display: flex; gap: 9px; margin-top: 16px; }
.modal-actions button { flex: 1; height: 44px; border-radius: var(--r-ctrl); font-size: 14px; }
.modal-actions .cancel { background: var(--sunken); color: var(--ink-2); }
.modal-actions .confirm { background: var(--brand); color: #fff; }
.option {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 13px 2px;
  border-bottom: 1px solid #f7f1e7;
  font-size: 14px; text-align: left;
}
.option:last-child { border-bottom: none; }
.option.danger { color: #b42318; }

@media (min-width: 480px) {
  #app { border-left: 1px solid #e8dfd0; border-right: 1px solid #e8dfd0; }
  .toast { max-width: 320px; }
}
