/* ============================================================
   干饭记 · 样式
   移动优先，暖纸质色调，桌面端收成一条手机宽度的列
   ============================================================ */

:root {
  --paper: #FBF6EF;
  --paper-2: #F4EBDF;
  --card: #FFFFFF;
  --ink: #2A211A;
  --ink-2: #5B4D42;
  --muted: #98897C;
  --line: #EDE2D4;
  --line-strong: #DFD1BF;
  --accent: #E4572E;
  --accent-2: #F08A3C;
  --accent-soft: #FCEBE3;
  --gold: #EEA02E;
  --sage: #6E8F69;
  --sage-soft: #EAF0E6;
  --radius: 20px;
  --shadow-sm: 0 2px 6px rgba(74, 48, 28, .05);
  --shadow: 0 10px 30px rgba(74, 48, 28, .09), 0 2px 6px rgba(74, 48, 28, .05);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", Georgia, serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 50% -8%, #FFFBF5 0%, #F6EDE2 42%, #EFE3D5 100%) fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, textarea { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

#app {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow: 0 0 90px rgba(80, 50, 30, .12);
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(var(--safe-t) + 14px) 18px 12px;
  background: linear-gradient(180deg, rgba(251, 246, 239, .97) 55%, rgba(251, 246, 239, .82));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 14px;
  font-size: 21px;
  background: linear-gradient(145deg, #FFF4E6, #FBE3CE);
  box-shadow: inset 0 0 0 1px rgba(228, 87, 46, .12), var(--shadow-sm);
}

.brand-text { min-width: 0; }

.brand-text h1 {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.15;
  letter-spacing: .12em;
  font-weight: 600;
}

.brand-text p {
  margin-top: 3px;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--muted);
  white-space: nowrap;
}

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

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px 0 4px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 600;
  max-width: 140px;
}
.user-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.av {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  background: var(--c, var(--accent));
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35);
}
.av.sm { width: 22px; height: 22px; font-size: 12px; }
.av.lg { width: 46px; height: 46px; font-size: 24px; }
.av.xl { width: 62px; height: 62px; font-size: 32px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--ink-2);
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:active { transform: scale(.94); }

/* ---------- 主体 ---------- */

#main { flex: 1 1 auto; }

.view { padding: 2px 18px calc(120px + var(--safe-b)); animation: rise .3s ease both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.feed-top { padding: 2px 0 12px; }

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0 4px;
  -webkit-overflow-scrolling: touch;
}
.filter-row::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .12s ease;
}
.chip:active { transform: scale(.96); }
.chip b { font-weight: 600; color: var(--muted); font-size: 12px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.on b { color: rgba(255, 255, 255, .62); }
.chip .av { width: 20px; height: 20px; font-size: 11px; margin-left: -4px; }

/* ---------- 本周小卡 ---------- */

.hero {
  position: relative;
  overflow: hidden;
  margin: 4px 0 18px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #2E2A24 0%, #423A30 60%, #4E4335 100%);
  color: #F7EEE2;
  box-shadow: 0 14px 30px rgba(46, 42, 36, .22);
}
.hero::after {
  content: "";
  position: absolute;
  right: -40px; top: -60px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(240, 138, 60, .55), rgba(240, 138, 60, 0) 68%);
}
.hero-kicker {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; letter-spacing: .18em; color: rgba(247, 238, 226, .62);
}
.hero-kicker .dot-live { display: inline-flex; align-items: center; gap: 6px; }
.hero-kicker i { width: 6px; height: 6px; border-radius: 50%; background: #F2A93B; box-shadow: 0 0 0 4px rgba(242, 169, 59, .16); }
.hero-grid { display: flex; align-items: flex-end; gap: 18px; margin-top: 12px; position: relative; z-index: 1; }
.hero-stat b { font-family: var(--serif); font-size: 25px; font-weight: 600; letter-spacing: .01em; }
.hero-stat b em { font-style: normal; font-size: 13px; font-family: var(--sans); color: rgba(247, 238, 226, .6); margin-left: 2px; }
.hero-stat span { display: block; margin-top: 2px; font-size: 11px; color: rgba(247, 238, 226, .55); letter-spacing: .08em; }
.hero-top { margin-left: auto; text-align: right; max-width: 52%; }
.hero-top b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-top span { font-size: 11px; color: rgba(247, 238, 226, .55); }

/* ---------- 时间线 ---------- */

.day { margin-bottom: 24px; }
.day-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 0 2px 10px;
}
.day-head h2 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .06em;
}
.day-head .day-meta { margin-left: auto; font-size: 11px; color: var(--muted); letter-spacing: .06em; }

.card {
  overflow: hidden;
  margin-bottom: 14px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  animation: rise .34s ease both;
}
.card:active { transform: scale(.994); }

.card-photo { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(140deg, #F6ECDF, #EADCC9); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card-photo.fallback { display: grid; place-items: center; }
.card-photo.fallback span { font-size: 52px; opacity: .5; }

.score-pill {
  position: absolute; top: 10px; right: 10px;
  display: inline-flex; align-items: center; gap: 3px;
  height: 30px; padding: 0 11px 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(10px);
  font-size: 14px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(40, 26, 16, .16);
}
.score-pill svg { width: 13px; height: 13px; fill: var(--gold); }
.score-pill.low { color: #9C3B22; background: rgba(255, 240, 234, .95); }
.score-pill.low svg { fill: #C2563A; }
.score-pill.mid { color: #4F5F4A; background: rgba(243, 248, 240, .95); }
.score-pill.mid svg { fill: var(--sage); }

.author-pill {
  position: absolute; left: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  height: 27px; padding: 0 10px 0 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  font-size: 12px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(40, 26, 16, .12);
}
.author-pill .av { width: 21px; height: 21px; font-size: 11px; }

.card-body { padding: 13px 15px 14px; }
.card-title { display: flex; align-items: baseline; gap: 8px; }
.card-title h3 { font-size: 16.5px; font-weight: 650; letter-spacing: .01em; line-height: 1.35; }
.card-title time { margin-left: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.card-sub span + span::before { content: " · "; color: var(--line-strong); }

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--paper-2);
  font-size: 11.5px;
  color: var(--ink-2);
  letter-spacing: .02em;
}
.card-note {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}

.card-foot { display: flex; align-items: center; gap: 7px; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--muted); }
.card-foot .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }

/* ---------- 空状态 ---------- */

.empty { padding: 44px 20px 20px; text-align: center; }
.empty-art {
  width: 108px; height: 108px; margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 46px;
  background: radial-gradient(circle at 35% 30%, #FFF6EA, #F2E4D2);
  box-shadow: inset 0 0 0 1px rgba(223, 209, 191, .7), 0 12px 30px rgba(74, 48, 28, .08);
}
.empty h3 { font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: .04em; }
.empty p { margin: 8px auto 20px; max-width: 286px; font-size: 13px; line-height: 1.7; color: var(--muted); }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px;
  border-radius: 14px;
  font-size: 14.5px; font-weight: 600;
  background: #fff; border: 1px solid var(--line);
  transition: transform .12s ease, box-shadow .2s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 10px 22px rgba(228, 87, 46, .3);
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-block { width: 100%; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13px; border-radius: 11px; }
.btn-danger { color: #B23B22; border-color: #F3D3C9; background: #FFF6F2; }

/* ---------- 口味页 ---------- */

.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 4px 0 16px;
  border-radius: 13px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.seg button {
  flex: 1;
  height: 36px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink-2);
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.seg button.on { background: #fff; color: var(--ink); font-weight: 650; box-shadow: var(--shadow-sm); }

.person-hero {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.person-hero::before {
  content: "";
  position: absolute; inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--c, var(--accent)), transparent 140%);
}
.ph-top { display: flex; align-items: center; gap: 12px; }
.ph-name { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: .04em; }
.ph-sub { margin-top: 3px; font-size: 12px; color: var(--muted); }
.ph-score { margin-left: auto; text-align: right; }
.ph-score b { font-family: var(--serif); font-size: 30px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.ph-score b em { font-style: normal; font-size: 12px; font-family: var(--sans); color: var(--muted); margin-left: 2px; }
.ph-score span { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); letter-spacing: .1em; }

.ph-stats { display: flex; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.stat { flex: 1; }
.stat b { display: block; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }

.panel { margin-top: 14px; padding: 16px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.panel-title { font-size: 13px; font-weight: 650; letter-spacing: .06em; }
.panel-sub { margin-left: auto; font-size: 11px; color: var(--muted); }

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 58px 1fr 34px; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-label { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { display: block; height: 8px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #EFAE6A, var(--accent)); transition: width .5s cubic-bezier(.2, .8, .25, 1); }
.bar-val { text-align: right; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.dist { display: flex; align-items: flex-end; gap: 8px; height: 92px; }
.dist-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.dist-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.dist-bar { width: 100%; min-height: 4px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #F2A93B, #E4572E); opacity: .85; }
.dist-label { font-size: 11px; color: var(--muted); }
.dist-count { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.best-list { display: flex; flex-direction: column; }
.best-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.best-item:last-child { border-bottom: 0; padding-bottom: 0; }
.rank {
  width: 24px; height: 24px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 8px;
  font-family: var(--serif);
  font-size: 13px; font-weight: 600;
  background: var(--paper-2); color: var(--ink-2);
}
.best-item:nth-child(1) .rank { background: #FFF0D6; color: #A26A13; }
.best-main { min-width: 0; }
.best-main b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.best-main span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.best-score { margin-left: auto; font-size: 13px; font-weight: 650; color: var(--accent); font-variant-numeric: tabular-nums; }

.compare-note {
  margin-top: 14px; padding: 14px 16px;
  border-radius: 16px;
  background: var(--sage-soft);
  font-size: 13px; line-height: 1.7; color: #45543F;
}
.compare-note b { font-weight: 650; }

.mini-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.mini-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 5px; vertical-align: 1px; }

.name-select { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.name-select::after {
  content: "▾";
  position: absolute; right: 1px;
  font-size: 10px; color: var(--muted);
  pointer-events: none;
}
.name-select select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink);
  padding: 2px 16px 2px 0;
  max-width: 104px;
  text-overflow: ellipsis;
}
.name-select select:focus-visible { outline-offset: 2px; }

.sim-row { display: flex; align-items: center; gap: 14px; }
.sim-row b {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.sim-row b em { font-style: normal; font-size: 13px; font-family: var(--sans); color: var(--muted); margin-left: 1px; }

/* ---------- 底部导航 ---------- */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 40;
  width: min(520px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 16px calc(10px + var(--safe-b));
  background: rgba(255, 252, 247, .92);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-top: 1px solid var(--line);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 78px;
  padding: 6px 0;
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--muted);
  border-radius: 12px;
  transition: color .18s ease;
}
.tab svg { width: 21px; height: 21px; }
.tab.is-active { color: var(--ink); }
.tab.is-active svg { stroke: var(--accent); }

.tab-add {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  margin-top: -22px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(140deg, var(--accent) 0%, #F2793C 60%, #F5A24C 100%);
  box-shadow: 0 10px 24px rgba(228, 87, 46, .38), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform .14s ease;
}
.tab-add svg { width: 25px; height: 25px; }
.tab-add:active { transform: scale(.94); }

/* ---------- 面板 / 弹层 ---------- */

.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.scrim { position: absolute; inset: 0; background: rgba(38, 25, 16, .44); opacity: 0; transition: opacity .26s ease; backdrop-filter: blur(2px); }
.sheet-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 0 calc(22px + var(--safe-b));
  border-radius: 26px 26px 0 0;
  background: var(--paper);
  transform: translateY(101%);
  transition: transform .34s cubic-bezier(.22, .85, .28, 1);
  box-shadow: 0 -20px 50px rgba(50, 30, 18, .2);
}
.sheet.open .scrim { opacity: 1; }
.sheet.open .sheet-panel { transform: none; }

.sheet-grab { width: 38px; height: 4px; margin: 6px auto 4px; border-radius: 99px; background: var(--line-strong); }

.sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 12px;
  background: linear-gradient(180deg, var(--paper) 72%, rgba(251, 246, 239, 0));
}
.sheet-head h2 { font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: .08em; text-align: center; }
.sheet-head .left { justify-self: start; }
.sheet-head .right { justify-self: end; }

.ghost-btn { font-size: 13.5px; color: var(--muted); padding: 8px 4px; }
.text-btn { font-size: 13.5px; font-weight: 650; color: var(--accent); padding: 8px 4px; }

.sheet-content { padding: 0 18px; }

/* 拍照区 */

.photo-box {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 2px 0 18px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(145deg, #FFF7EC, #F3E6D4);
  border: 1.5px dashed var(--line-strong);
  display: grid;
  place-items: center;
}
.photo-box.has { border-style: solid; border-color: transparent; box-shadow: var(--shadow); }
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.photo-cta { text-align: center; padding: 16px; }
.photo-cta .cam {
  display: grid; place-items: center;
  width: 58px; height: 58px; margin: 0 auto 10px;
  border-radius: 50%;
  font-size: 26px;
  background: #fff;
  box-shadow: var(--shadow);
}
.photo-cta b { display: block; font-size: 14px; font-weight: 650; }
.photo-cta em { display: block; margin-top: 5px; font-style: normal; font-size: 12px; color: var(--muted); }
.photo-retake {
  position: absolute; right: 10px; bottom: 10px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  font-size: 12px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(40, 26, 16, .18);
}
.photo-actions {
  position: absolute;
  left: 0; right: 0; bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
}
.photo-actions .chip {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  border-color: transparent;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(40, 26, 16, .14);
}

/* 表单 */

.field { margin-bottom: 18px; }
.field > label {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: .14em;
  color: var(--muted);
}
.field > label::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .75; }

.field input[type="text"], .field input[type="number"], .field input[type="password"], .field textarea, .select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 13px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 15px;
  transition: border-color .18s ease, box-shadow .18s ease;
  appearance: none;
}
.field input::placeholder, .field textarea::placeholder { color: #BCAC9C; }
.field input:focus, .field textarea:focus, .select:focus { outline: none; border-color: #E9B79F; box-shadow: 0 0 0 4px rgba(228, 87, 46, .08); }
.field textarea { min-height: 88px; resize: vertical; line-height: 1.6; font-size: 14px; }

.row-2 { display: grid; grid-template-columns: 1fr 118px; gap: 10px; }
.hint { margin-top: 7px; font-size: 11.5px; color: var(--muted); }

/* 星级 */

.rate-row { display: flex; align-items: center; gap: 14px; }
.rate-num { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 44px; }

.stars { position: relative; display: inline-flex; gap: 3px; line-height: 0; }
.stars svg { width: 15px; height: 15px; flex: 0 0 auto; }
.stars .empty-path { fill: #E7DAC9; }
.stars .fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  display: flex; gap: 3px;
  overflow: hidden;
  width: var(--p, 0%);
}
.stars .fill svg { fill: var(--gold); }
.stars.big { gap: 6px; }
.stars.big svg { width: 34px; height: 34px; }
.stars.big .fill { gap: 6px; }
.stars.big.tap { cursor: pointer; touch-action: manipulation; }

/* 标签 */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-add { border-style: dashed; color: var(--muted); }
.tag-custom { display: flex; gap: 8px; margin-top: 10px; }
.tag-custom input {
  flex: 1; height: 40px; padding: 0 12px;
  border-radius: 11px; border: 1px solid var(--line); background: #fff; font-size: 14px;
}
.tag-custom input:focus { outline: none; border-color: #E9B79F; }

/* 详情 */

.detail-photo { margin: -2px -18px 0; aspect-ratio: 4 / 3; background: linear-gradient(140deg, #F6ECDF, #EADCC9); }
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.detail-body { padding: 18px 0 4px; }
.detail-title { display: flex; align-items: flex-start; gap: 10px; }
.detail-title h2 { font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: .02em; line-height: 1.35; }
.detail-score { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.detail-score svg { width: 16px; height: 16px; fill: var(--gold); }
.detail-meta { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.detail-meta span + span::before { content: " · "; color: var(--line-strong); }
.detail-note { margin-top: 14px; font-size: 14px; line-height: 1.75; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.detail-actions { display: flex; gap: 10px; margin-top: 20px; }
.detail-actions .btn { flex: 1; }

/* 设置 */

.section { margin-bottom: 20px; }
.section > h3 {
  margin: 0 2px 9px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .16em; color: var(--muted);
}
.panel-list { border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 14px 15px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.list-item:last-child { border-bottom: 0; }
.list-item .li-main { min-width: 0; }
.list-item .li-main b { display: block; font-weight: 600; font-size: 14.5px; }
.list-item .li-main span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.list-item .li-tail { margin-left: auto; color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.list-item .check { color: var(--accent); font-size: 15px; }
.list-item:active { background: #FDF8F2; }

.sync-box { padding: 15px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.sync-status { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.status-dot { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--line-strong); flex: 0 0 auto; }
.status-dot.ok { background: #4E9B5E; box-shadow: 0 0 0 4px rgba(78, 155, 94, .12); }
.status-dot.err { background: #C9503A; box-shadow: 0 0 0 4px rgba(201, 80, 58, .12); }
.status-dot.wait { background: #E2A33C; box-shadow: 0 0 0 4px rgba(226, 163, 60, .12); }

.sync-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.sync-actions .btn { flex: 1 1 0; min-width: 0; padding: 0 8px; font-size: 13px; }

.link-out { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(228, 87, 46, .25); }

.about { padding: 4px 2px 0; font-size: 11.5px; line-height: 1.8; color: var(--muted); text-align: center; }

/* ---------- 欢迎页 ---------- */

.onboarding {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(700px 400px at 50% 0%, #FFF7EC, #F6EBDC 55%, #EFE1D1 100%);
  overflow-y: auto;
}
.onboarding[hidden] { display: none; }
.onb-inner { width: min(420px, 100%); text-align: center; }
.onb-mark { font-size: 54px; margin-bottom: 14px; }
.onb-title { font-family: var(--serif); font-size: 30px; letter-spacing: .2em; font-weight: 600; }
.onb-sub { margin-top: 10px; font-size: 13px; line-height: 1.8; color: var(--muted); }
.onb-card { margin-top: 26px; padding: 20px; border-radius: 22px; background: rgba(255, 255, 255, .82); box-shadow: var(--shadow); backdrop-filter: blur(10px); text-align: left; }
.onb-card label { display: block; margin-bottom: 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .14em; color: var(--muted); }
.onb-card input { width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 15px; }
.onb-card input:focus { outline: none; border-color: #E9B79F; box-shadow: 0 0 0 4px rgba(228, 87, 46, .08); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: 8px; }
.emoji-pick {
  aspect-ratio: 1; display: grid; place-items: center;
  font-size: 19px; border-radius: 10px;
  background: var(--paper-2);
  transition: background .16s ease, transform .12s ease;
}
.emoji-pick.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px rgba(228, 87, 46, .45); transform: scale(1.04); }
.onb-card .btn { margin-top: 18px; }

/* ---------- 提示 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-b));
  z-index: 90;
  transform: translate(-50%, 14px);
  max-width: min(430px, calc(100vw - 40px));
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(38, 28, 20, .92);
  color: #FBF3E9;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 弹层打开时，提示挪到顶部，避免压在表单中间 */
body.sheet-open .toast {
  top: calc(var(--safe-t) + 16px);
  bottom: auto;
  background: rgba(255, 252, 247, .97);
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(40, 26, 16, .22);
  transform: translate(-50%, -12px);
}
body.sheet-open .toast.show { transform: translate(-50%, 0); }

/* ---------- 桌面端 ---------- */

@media (min-width: 720px) {
  body { padding: 24px 0; }
  #app { min-height: calc(100dvh - 48px); border-radius: 30px; overflow: hidden; }
  .tabbar { bottom: 24px; border-radius: 0 0 30px 30px; }
  .sheet-panel { border-radius: 26px; margin-bottom: 24px; }
  .toast { bottom: 120px; }
}

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