/* ============================================================
 * 今天吃啥 · 样式
 * 移动优先，暖色菜单 / 小票风
 * ============================================================ */

:root {
  --bg: #fff6ec;
  --bg-deep: #ffe8d2;
  --card: #ffffff;
  --card-soft: #fffaf3;
  --ink: #2a1d14;
  --ink-2: #6b5748;
  --ink-3: #a08c7c;
  --orange: #f25c2a;
  --orange-deep: #d9481a;
  --orange-soft: #ffe4d6;
  --yellow: #ffc24b;
  --green: #2e7d5d;
  --green-deep: #246349;
  --green-soft: #dcefe4;
  --line: #ebdccb;
  --line-soft: #f4e9dc;
  --shadow: 0 10px 30px rgba(80, 45, 20, 0.07);
  --shadow-sm: 0 4px 14px rgba(80, 45, 20, 0.06);
  --radius: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
    "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 110% -8%, #ffe1bf 0%, rgba(255, 225, 191, 0) 62%),
    radial-gradient(800px 500px at -15% 22%, #ffeedb 0%, rgba(255, 238, 219, 0) 58%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.sheet-open { overflow: hidden; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

a { color: inherit; }

[hidden] { display: none !important; }

::selection { background: #ffd7c0; }

:focus-visible {
  outline: 3px solid rgba(242, 92, 42, 0.3);
  outline-offset: 2px;
}

/* ---------------- 布局 ---------------- */

.page {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px calc(104px + env(safe-area-inset-bottom));
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(14px + env(safe-area-inset-top)) 2px 12px;
  background: linear-gradient(to bottom, rgba(255, 246, 236, 0.97) 62%, rgba(255, 246, 236, 0.75) 88%, rgba(255, 246, 236, 0));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
  transform: rotate(-4deg);
}

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

.brand-text h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.brand-text p {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

.status-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 46vw;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--shadow-sm);
}

.status-pill #statusText {
  overflow: hidden;
  text-overflow: ellipsis;
}

.content { padding-top: 4px; }

.view { animation: view-in 0.25s ease; }

/* ---------------- 通用组件 ---------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.card-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.hint {
  margin: 8px 0 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-3);
}

.hint code {
  background: var(--line-soft);
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 11px;
}

.empty-note {
  margin: 12px 2px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-3);
  text-align: center;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 2px 10px;
}

.section-head.tight { margin: 0 0 10px; }

.section-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 7px;
}

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange-deep);
  font-size: 11.5px;
  font-weight: 800;
}

.text-btn {
  border: 0;
  background: none;
  padding: 4px;
  color: var(--orange-deep);
  font-size: 12px;
  font-weight: 700;
}

/* ---------------- 筛选 ---------------- */

.filter-card { padding: 16px 16px 14px; }

.filter-row + .filter-row { margin-top: 15px; }

.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.filter-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

.filter-note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-3);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: #fffdfa;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.chip:active { transform: scale(0.96); }

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 5px 12px rgba(42, 29, 20, 0.2);
}

.chips-sm { gap: 7px; }

.chips-sm .chip {
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 500;
}

/* 开关行 */
.switch-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.switch-line input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #e9dccd;
  transition: background 0.2s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(60, 30, 10, 0.25);
  transition: transform 0.2s cubic-bezier(0.3, 0.8, 0.4, 1.2);
}

.switch-line input:checked + .switch-track { background: var(--orange); }
.switch-line input:checked + .switch-track::after { transform: translateX(16px); }
.switch-line input:focus-visible + .switch-track { outline: 3px solid rgba(242, 92, 42, 0.3); outline-offset: 2px; }

.switch-text { font-weight: 600; }

.switch-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
}

/* ---------------- 抽签按钮 ---------------- */

.draw-btn {
  width: 100%;
  border: 0;
  border-radius: 24px;
  background: linear-gradient(135deg, #ff7d3f 0%, #f2511f 55%, #e04414 100%);
  color: #fff;
  padding: 17px 18px;
  margin: 4px 0 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 13px;
  row-gap: 3px;
  text-align: left;
  box-shadow:
    0 16px 28px -12px rgba(224, 68, 20, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.14s ease, filter 0.14s ease;
}

.draw-btn:active { transform: scale(0.98); filter: brightness(0.97); }
.draw-btn:disabled { opacity: 0.7; }

.draw-btn-icon {
  grid-row: span 2;
  align-self: center;
  font-size: 30px;
  filter: drop-shadow(0 3px 6px rgba(120, 40, 0, 0.3));
}

.draw-btn-label {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.02em;
  align-self: end;
}

.draw-btn-sub {
  font-size: 11.5px;
  opacity: 0.86;
  align-self: start;
}

.draw-btn.play {
  background: linear-gradient(135deg, #4fa57b 0%, #2f815f 55%, #246a4d 100%);
  box-shadow:
    0 16px 28px -12px rgba(36, 106, 77, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ---------------- 结果小票 ---------------- */

.result-slot { margin-bottom: 6px; }

.ticket {
  position: relative;
  overflow: hidden;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px 18px 14px;
  margin-bottom: 16px;
  box-shadow: 0 20px 44px -26px rgba(90, 50, 20, 0.5);
  animation: ticket-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.22);
}

.ticket::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--orange) 0 14px, #ffd9be 14px 28px);
  opacity: 0.9;
}

.ticket.play::before {
  background: repeating-linear-gradient(90deg, var(--green) 0 14px, #cfe7d9 14px 28px);
}

.ticket.rolling { pointer-events: none; }

.ticket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.ticket-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--ink-3);
}

.ticket-stamp {
  font-size: 10px;
  font-weight: 700;
  color: var(--orange);
  border: 1px dashed currentColor;
  border-radius: 6px;
  padding: 3px 8px;
  transform: rotate(4deg);
  opacity: 0.85;
  white-space: nowrap;
}

.ticket.play .ticket-stamp { color: var(--green); }

.ticket-stamp.accepted {
  color: var(--green);
  background: var(--green-soft);
  border-style: solid;
  border-color: transparent;
  transform: rotate(-2deg);
  opacity: 1;
}

.ticket-emoji {
  font-size: 54px;
  line-height: 1;
  margin: 14px 0 8px;
  animation: emoji-pop 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.5);
  transform-origin: 20% 80%;
}

.ticket.rolling .ticket-emoji { animation: roll-bounce 0.35s ease infinite; }

.ticket-name {
  margin: 0;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.ticket.rolling .roll-name {
  min-height: 1.16em;
  color: var(--ink-2);
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.tag {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f7eee3;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.tag.fav {
  background: #fff1d6;
  color: #a9631a;
}

.tag.soft {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-weight: 500;
}

.ticket-reason {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
}

.ticket-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
  background: var(--card-soft);
  border-radius: 10px;
  padding: 8px 10px;
}

.ticket-avoid {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--ink-3);
}

.ticket-actions {
  display: flex;
  gap: 10px;
  margin-top: 17px;
}

.ticket-actions .btn-primary { flex: 1.15; }
.ticket-actions .btn-ghost { flex: 0.85; }

.ticket.play .btn-primary {
  background: linear-gradient(135deg, #4fa57b, #2f815f);
  box-shadow: 0 10px 20px -10px rgba(36, 106, 77, 0.65);
}

.ticket-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--orange-deep);
  font-size: 12.5px;
  font-weight: 700;
}

.ticket.play .link-btn { color: var(--green-deep); }

/* 初始提示 */
.hint-ticket {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 18px;
  margin-bottom: 16px;
  border: 1.5px dashed var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.hint-emoji {
  font-size: 32px;
  opacity: 0.8;
}

.hint-ticket p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-3);
}

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

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-primary {
  border: 0;
  background: linear-gradient(135deg, #ff7d3f, #f2511f);
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(224, 68, 20, 0.75);
}

.btn-ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
}

.btn-primary:active,
.btn-ghost:active { transform: scale(0.97); }

.btn-primary:disabled {
  opacity: 0.55;
  box-shadow: none;
  cursor: default;
}

.btn-primary.btn-sm,
.btn-ghost.btn-sm {
  padding: 9px 13px;
  font-size: 12.5px;
  border-radius: 12px;
}

.btn-ghost.danger { color: #c0392b; }

.btn-link {
  display: inline-flex;
  align-items: center;
  color: var(--orange-deep);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  padding: 8px 4px;
}

/* ---------------- 历史 ---------------- */

.history-block { margin-top: 8px; }

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
}

.history-item .h-emoji { font-size: 18px; flex: none; }

.history-item .h-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item .h-time {
  flex: none;
  font-size: 11px;
  color: var(--ink-3);
}

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

.tabbar {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 7px 12px calc(7px + env(safe-area-inset-bottom));
  background: rgba(255, 250, 243, 0.93);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}

.tab {
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0 5px;
  border-radius: 14px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
  transition: color 0.18s ease, background 0.18s ease;
}

.tab-icon {
  font-size: 20px;
  line-height: 1;
  filter: grayscale(1);
  opacity: 0.5;
  transition: filter 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.tab.active {
  color: var(--orange-deep);
  background: rgba(242, 92, 42, 0.08);
}

.tab.active .tab-icon {
  filter: none;
  opacity: 1;
  transform: translateY(-1px);
}

.tab[data-tab="play"].active {
  color: var(--green-deep);
  background: rgba(46, 125, 93, 0.09);
}

/* ---------------- 表单 ---------------- */

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

.field label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fffdf9;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder,
.field textarea::placeholder { color: #bca898; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #f0a17a;
  box-shadow: 0 0 0 3px rgba(242, 92, 42, 0.12);
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23a08c7c' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.field textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}

.field + .field { margin-top: 10px; }

.field-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.field-row > .field { margin-top: 0; }

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

.field-row + .field { margin-top: 10px; }

/* ---------------- 收藏 ---------------- */

.add-fav-form { animation: view-in 0.22s ease; }

.fav-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.fav-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px;
  box-shadow: var(--shadow-sm);
  animation: view-in 0.22s ease;
}

.fav-emoji {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 21px;
  background: #fff4e7;
  border-radius: 13px;
}

.fav-main { flex: 1; min-width: 0; }

.fav-name {
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.3;
  word-break: break-word;
}

.fav-meta {
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

.fav-meta.note { color: #b07a52; }

.fav-actions {
  flex: none;
  display: flex;
  gap: 6px;
  align-items: center;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: 9px;
  padding: 6px 9px;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
}

.mini-btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.mini-btn.danger { color: #c0392b; }

.search-row {
  display: flex;
  gap: 8px;
}

.search-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fffdf9;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.search-row input:focus {
  border-color: #f0a17a;
  box-shadow: 0 0 0 3px rgba(242, 92, 42, 0.12);
}

.paste-card details { border: 0; }

.paste-card summary {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-2);
  padding: 2px 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.paste-card summary::after {
  content: "＋";
  color: var(--ink-3);
  font-weight: 400;
}

.paste-card details[open] summary::after { content: "－"; }

.paste-card textarea {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #fffdf9;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}

/* ---------------- 设置 ---------------- */

.coords-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--card-soft);
  border: 1px dashed var(--line);
  border-radius: 12px;
  font-size: 12px;
  color: var(--ink-3);
}

.coords-line > span {
  flex: 1;
  min-width: 0;
  line-height: 1.5;
}

.coords-line .btn-ghost {
  flex: none;
  white-space: nowrap;
}

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

.data-actions + .data-actions { margin-top: 9px; }

.app-footnote {
  margin: 20px 0 8px;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.8;
  color: var(--ink-3);
  opacity: 0.85;
}

/* ---------------- 底部弹层 ---------------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(44, 27, 15, 0.38);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fade-in 0.2s ease;
}

.sheet {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  max-height: 82dvh;
  display: flex;
  flex-direction: column;
  background: #fffcf7;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -24px 70px rgba(60, 35, 15, 0.28);
  padding: 8px 18px calc(18px + env(safe-area-inset-bottom));
  animation: sheet-up 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}

.sheet-grabber {
  flex: none;
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  margin: 4px auto 10px;
}

.sheet-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sheet-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.3;
  word-break: break-word;
}

.sheet-sub {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--ink-3);
}

.icon-btn {
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1;
}

.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin-top: 12px;
  padding-bottom: 4px;
}

.sheet-loading,
.sheet-error,
.sheet-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 34px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-3);
  text-align: center;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--line);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.poi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.poi:last-child { border-bottom: 0; }

.poi-main { min-width: 0; flex: 1; }

.poi-name {
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.35;
  word-break: break-word;
}

.poi-meta {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink-3);
}

.poi-actions {
  flex: none;
  display: flex;
  gap: 7px;
}

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  max-width: 84%;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(42, 29, 20, 0.95);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------- 动画 ---------------- */

@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ticket-in {
  0% { opacity: 0; transform: translateY(14px) scale(0.965); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes emoji-pop {
  0% { transform: scale(0.55) rotate(-10deg); }
  60% { transform: scale(1.08) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes roll-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.04); }
}

@keyframes sheet-up {
  from { transform: translate(-50%, 100%); }
  to { transform: translate(-50%, 0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------------- 小屏适配 ---------------- */

@media (max-width: 360px) {
  .page { padding-left: 12px; padding-right: 12px; }
  .brand-text h1 { font-size: 19px; }
  .brand-text p { max-width: 34vw; }
  .status-pill { font-size: 10.5px; padding: 7px 9px; max-width: 44vw; }
  .ticket-name { font-size: 26px; }
  .draw-btn-label { font-size: 16.5px; }
  .field-row { flex-direction: column; gap: 0; }
  .field-row > .field + .field { margin-top: 10px; }
  .poi { flex-direction: column; align-items: stretch; }
  .poi-actions { justify-content: flex-end; }
}
