:root {
  --cream: #f5f0e6;
  --cream-2: #faf6ed;
  --paper: #fffdf8;
  --ink: #1c2b23;
  --ink-2: #4a5a50;
  --muted: #7d887f;
  --line: rgba(28, 43, 35, 0.1);
  --green: #173d2e;
  --green-2: #2f6b50;
  --accent: #d95d39;
  --accent-soft: #f6e0d6;
  --amber: #d08a28;
  --level-empty: #2f7d5a;
  --level-comfy: #6e8f3a;
  --level-busy: #d08a28;
  --level-crowded: #c9703c;
  --level-packed: #b84034;
  --panel-w: 404px;
  --topbar-h: 80px;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", system-ui, sans-serif;
  --shadow-panel: 0 32px 80px -34px rgba(20, 40, 29, 0.58);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

[data-level="empty"] {
  --level: var(--level-empty);
}
[data-level="comfy"] {
  --level: var(--level-comfy);
}
[data-level="busy"] {
  --level: var(--level-busy);
}
[data-level="crowded"] {
  --level: var(--level-crowded);
}
[data-level="packed"] {
  --level: var(--level-packed);
}

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

.app {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
  background: var(--cream);
}

.map-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  background: #e9e3d6;
  cursor: grab;
}

.map-viewport::before {
  content: "";
  position: absolute;
  inset: -36px;
  background: url("./assets/xiaoqu-map-ultra.jpg") center / cover no-repeat;
  filter: blur(14px) saturate(0.82) brightness(1.02);
  opacity: 0.55;
  transform: scale(1.04);
  pointer-events: none;
}

.map-viewport.is-dragging {
  cursor: grabbing;
}

.map-stage {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  transform-origin: 0 0;
  will-change: transform;
}

.map-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  filter: saturate(0.94) contrast(0.99) brightness(1.02);
}

.map-tint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(245, 240, 230, 0.34) 0%,
      rgba(245, 240, 230, 0.06) 26%,
      transparent 55%,
      rgba(245, 240, 230, 0.2) 100%
    ),
    radial-gradient(110% 90% at 45% 45%, transparent 52%, rgba(245, 240, 230, 0.24) 100%);
}

.map-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(245, 240, 230, 0.95) 0,
      rgba(245, 240, 230, 0.5) 72px,
      rgba(245, 240, 230, 0) 210px
    ),
    linear-gradient(90deg, rgba(245, 240, 230, 0.2), transparent 26%, transparent 74%, rgba(245, 240, 230, 0.3));
}

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

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  pointer-events: none;
}

.topbar > * {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--green);
  color: var(--cream);
  box-shadow: 0 12px 26px -14px rgba(18, 48, 34, 0.8);
}

.brand-mark svg {
  width: 28px;
  height: 28px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-text b {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-text em {
  margin-top: 6px;
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--muted);
}

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

.clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
  margin-right: 2px;
}

.clock span {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.clock b {
  margin-top: 3px;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 11px 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.8);
  box-shadow: 0 8px 20px -16px rgba(20, 40, 29, 0.5);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.mode-toggle:hover {
  background: var(--paper);
}

.mode-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(208, 138, 40, 0.14);
}

.mode-toggle.is-live .mode-dot {
  background: var(--level-empty);
  box-shadow: 0 0 0 3px rgba(47, 125, 90, 0.14);
}

.mode-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}

.switch {
  position: relative;
  width: 28px;
  height: 16px;
  flex: none;
  border-radius: 999px;
  background: rgba(28, 43, 35, 0.16);
  transition: background 0.22s ease;
}

.switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 40, 29, 0.25);
  transition: transform 0.22s var(--ease-out);
}

.mode-toggle[aria-checked="true"] .switch {
  background: var(--green-2);
}

.mode-toggle[aria-checked="true"] .switch i {
  transform: translateX(12px);
}

.icon-btn {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.8);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: background 0.2s ease;
}

.icon-btn:hover {
  background: var(--paper);
}

/* -------------------------------------------------------------------------- */
/* 地图辅助                                                                    */
/* -------------------------------------------------------------------------- */

.map-status {
  position: absolute;
  top: calc(var(--topbar-h) + 14px);
  left: 28px;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 10px 26px -22px rgba(20, 40, 29, 0.55);
  backdrop-filter: blur(12px);
  font-size: 10px;
  color: var(--ink-2);
  pointer-events: none;
}

.status-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--level-empty);
  box-shadow: 0 0 0 0 rgba(47, 125, 90, 0.4);
  animation: statusPulse 2.4s infinite;
}

.map-status.is-demo .status-pulse {
  background: var(--amber);
  animation-name: statusPulseAmber;
}

.map-status.is-offline .status-pulse {
  background: var(--level-packed);
  animation: none;
}

.map-tools {
  position: absolute;
  right: calc(var(--panel-w) + 44px);
  bottom: 28px;
  z-index: 9;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 14px 34px -22px rgba(20, 40, 29, 0.5);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.map-tools button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-bottom: 1px solid rgba(28, 43, 35, 0.07);
  background: transparent;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.map-tools button:last-child {
  border-bottom: 0;
}

.map-tools button:hover {
  background: rgba(28, 43, 35, 0.05);
  color: var(--ink);
}

.map-tools svg {
  width: 16px;
  height: 16px;
}

.legend {
  position: absolute;
  left: 28px;
  bottom: 26px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.8);
  box-shadow: 0 12px 28px -24px rgba(20, 40, 29, 0.5);
  backdrop-filter: blur(12px);
  font-size: 9px;
  color: var(--ink-2);
  pointer-events: none;
}

.legend-title {
  padding-right: 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.legend i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot);
}

.map-hint {
  position: absolute;
  left: 50%;
  bottom: 30px;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 360px);
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(23, 61, 46, 0.9);
  color: rgba(245, 240, 230, 0.9);
  box-shadow: 0 12px 30px -18px rgba(18, 48, 34, 0.8);
  backdrop-filter: blur(10px);
  font-size: 10px;
  letter-spacing: 0.02em;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.4s ease, transform 0.4s var(--ease-out);
  white-space: nowrap;
}

.map-hint.is-hidden {
  opacity: 0;
  transform: translate(-50%, 8px);
}

.hint-hand {
  display: inline-block;
  font-size: 13px;
  color: #f0c987;
  animation: handSway 2.6s ease-in-out infinite;
}

/* -------------------------------------------------------------------------- */
/* 地图标记                                                                    */
/* -------------------------------------------------------------------------- */

.markers {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.marker {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(var(--marker-scale, 1));
  transform-origin: 50% 0;
  filter: drop-shadow(0 10px 14px rgba(20, 40, 29, 0.18));
  transition: filter 0.2s ease;
}

.marker:hover {
  filter: drop-shadow(0 14px 18px rgba(20, 40, 29, 0.24));
}

.marker-anchor {
  position: relative;
  z-index: 2;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--level);
  box-shadow:
    0 0 0 3px rgba(255, 253, 248, 0.92),
    0 0 0 5px rgba(28, 43, 35, 0.08);
}

.marker-anchor::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid var(--level);
  border-radius: 50%;
  opacity: 0.45;
  animation: markerPulse 2.8s ease-out infinite;
}

.marker-pin {
  position: relative;
  min-width: 74px;
  margin-top: 6px;
  padding: 6px 9px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(8px);
  transition: transform 0.2s var(--ease-out), background 0.2s ease, border-color 0.2s ease;
}

.marker-pin::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 7px;
  height: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.8);
  border-left: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 1px;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
}

.marker:hover .marker-pin {
  transform: translateY(-2px);
  background: #fff;
}

.marker-name {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

.marker-name i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--level);
}

.marker-num {
  display: flex;
  align-items: baseline;
  gap: 2px;
  line-height: 1;
}

.marker-num b {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.marker-num em {
  font-style: normal;
  font-size: 8px;
  color: var(--muted);
}

.marker-state {
  margin-top: 2px;
  font-size: 7px;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--level);
}

.marker.is-active .marker-pin {
  border-color: var(--ink);
  background: var(--ink);
}

.marker.is-active .marker-name {
  color: rgba(245, 240, 230, 0.62);
}

.marker.is-active .marker-num b {
  color: var(--cream);
}

.marker.is-active .marker-num em {
  color: rgba(245, 240, 230, 0.55);
}

.marker.is-active .marker-state {
  color: rgba(245, 240, 230, 0.55);
}

.marker.is-active .marker-pin::before {
  border-color: var(--ink);
}

.marker.is-you .marker-pin {
  box-shadow: 0 0 0 2px var(--accent);
}

.marker.bump .marker-num b {
  animation: countBump 0.5s var(--ease-out);
}

/* -------------------------------------------------------------------------- */
/* 今日智能行程                                                                */
/* -------------------------------------------------------------------------- */

.ai-plan-card {
  margin: 0 0 14px;
  padding: 13px 13px 10px;
  border: 1px solid rgba(28, 43, 35, 0.1);
  border-radius: 18px;
  background: linear-gradient(145deg, #fffdf8 0%, #f5f8f2 100%);
  box-shadow: 0 12px 28px -24px rgba(20, 40, 29, 0.5);
}

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

.ai-plan-title {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
}

.ai-plan-title span {
  color: var(--amber);
  font-size: 13px;
}

.ai-plan-title b {
  font-size: 13px;
  letter-spacing: 0.02em;
}

.ai-plan-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.ai-plan-dorm {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 3px;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.ai-plan-dorm select {
  max-width: 112px;
  height: 27px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 253, 248, 0.9);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 9px;
}

.ai-plan-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-plan-step {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid rgba(28, 43, 35, 0.055);
}

.ai-plan-step:first-child { border-top: 0; }

.ai-plan-step.is-meal {
  margin: 3px 0;
  padding: 9px 8px;
  border: 1px solid #dcecdf;
  border-radius: 12px;
  background: #f5fbf6;
  cursor: pointer;
}

.ai-plan-step.is-meal:hover { background: #edf8f0; }

.ai-plan-time {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}

.ai-plan-time b {
  color: var(--ink);
  font-size: 17px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.ai-plan-time span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.ai-plan-leg {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.ai-plan-travel {
  display: flex;
  flex: 0 0 48px;
  flex-direction: column;
  align-items: center;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.1;
  white-space: nowrap;
}

.ai-plan-walk { color: var(--green-2); }
.ai-plan-bike { color: #6d7fa5; }

.ai-plan-arrow {
  margin: 2px 0;
  color: var(--amber);
  font-size: 13px;
  line-height: 0.8;
}

.ai-plan-dest {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ai-plan-dest b {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-plan-dest b em {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 5px;
  background: #e3f3e8;
  color: var(--green);
  font-size: 8px;
  font-style: normal;
  font-weight: 600;
  vertical-align: 1px;
}

.ai-plan-dest small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-plan-step.is-late .ai-plan-time b { color: var(--level-packed); }
.ai-plan-step.is-late .ai-plan-dest small { color: #b5483d; }

.ai-plan-empty {
  padding: 10px 9px;
  border-radius: 10px;
  background: #fbfaf5;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.ai-plan-foot {
  margin-top: 7px;
  color: var(--faint);
  font-size: 8px;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .ai-plan-card { padding: 12px 11px 9px; }
  .ai-plan-title b { font-size: 14px; }
  .ai-plan-head small { font-size: 9px; }
  .ai-plan-dorm { font-size: 9px; }
  .ai-plan-dorm select { max-width: 104px; height: 32px; font-size: 12px !important; }
  .ai-plan-step { grid-template-columns: 54px minmax(0, 1fr); padding: 10px 0; }
  .ai-plan-time b { font-size: 18px; }
  .ai-plan-travel { flex-basis: 52px; font-size: 9px; }
  .ai-plan-dest b { font-size: 14px; }
  .ai-plan-dest small { font-size: 9px; }
  .ai-plan-empty { font-size: 11px; }
  .ai-plan-foot { font-size: 9px; }
}

/* -------------------------------------------------------------------------- */
/* 右侧面板                                                                    */
/* -------------------------------------------------------------------------- */

.panel {
  position: absolute;
  top: calc(var(--topbar-h) + 14px);
  right: 24px;
  bottom: 24px;
  z-index: 20;
  width: var(--panel-w);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  background: rgba(250, 246, 238, 0.94);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(22px) saturate(1.08);
}

.panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 14px 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(28, 43, 35, 0.18) transparent;
}

.panel-scroll::-webkit-scrollbar {
  width: 6px;
}

.panel-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(28, 43, 35, 0.14);
}

.panel-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 9px 18px calc(9px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(28, 43, 35, 0.07);
  font-size: 9px;
  line-height: 1.45;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.55);
}

.foot-dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--amber);
}

.panel-foot.is-live .foot-dot {
  background: var(--level-empty);
}

/* -------------------------------------------------------------------------- */
/* Hero                                                                        */
/* -------------------------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 19px 20px 18px;
  border-radius: 22px;
  background:
    radial-gradient(120% 120% at 100% 0%, #2c5b46 0%, #173b2d 56%, #102c22 100%);
  box-shadow: 0 20px 34px -28px rgba(14, 36, 26, 0.9);
  color: var(--cream);
}

.hero::before {
  content: "";
  position: absolute;
  top: -92px;
  right: -72px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(245, 240, 230, 0.14);
  border-radius: 50%;
  box-shadow:
    0 0 0 34px rgba(245, 240, 230, 0.045),
    0 0 0 68px rgba(245, 240, 230, 0.025);
  pointer-events: none;
}

.hero-art {
  position: absolute;
  right: 2px;
  bottom: -40px;
  font-family: var(--serif);
  font-size: 150px;
  line-height: 1;
  color: rgba(245, 240, 230, 0.045);
  pointer-events: none;
  user-select: none;
}

.hero-eyebrow {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: rgba(245, 240, 230, 0.62);
}

.live-dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: #91d5ab;
  box-shadow: 0 0 0 0 rgba(145, 213, 171, 0.45);
  animation: statusPulse 2.4s infinite;
}

.mode-chip {
  margin-left: auto;
  padding: 3px 7px;
  border: 1px solid rgba(245, 240, 230, 0.14);
  border-radius: 999px;
  background: rgba(245, 240, 230, 0.08);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.mode-chip.demo {
  color: #f2c880;
}

.mode-chip.live {
  color: #9ad8b5;
}

.hero-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.hero-copy {
  min-width: 0;
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hero-copy p {
  margin: 7px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(245, 240, 230, 0.68);
}

.gauge {
  --p: 0;
  --c: var(--level-empty);
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(245, 240, 230, 0.14) 0);
}

.gauge::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #173b2d;
}

.gauge div {
  position: relative;
  z-index: 1;
  text-align: center;
  line-height: 1;
}

.gauge b {
  font-size: 18px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.gauge span {
  margin-left: 1px;
  font-size: 8px;
  color: rgba(245, 240, 230, 0.55);
}

.hero-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid rgba(245, 240, 230, 0.12);
  font-size: 9px;
  color: rgba(245, 240, 230, 0.58);
}

.hero-meta b {
  margin-right: 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}

.hero-meta .sep {
  width: 1px;
  height: 11px;
  background: rgba(245, 240, 230, 0.14);
}

.hero-cta {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 42px;
  margin-top: 14px;
  padding: 0 14px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s var(--ease-out);
}

.hero-cta:hover {
  background: #fffdf8;
  transform: translateY(-1px);
}

.hero-cta svg {
  width: 15px;
  height: 15px;
  transition: transform 0.2s var(--ease-out);
}

.hero-cta:hover svg {
  transform: translateX(3px);
}

/* 真实数据为空时的提示 */
.live-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px 13px;
  border: 1px dashed rgba(28, 43, 35, 0.16);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.6);
}

.live-empty-copy {
  flex: 1;
  min-width: 0;
}

.live-empty b {
  display: block;
  font-size: 11px;
  font-weight: 600;
}

.live-empty span {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  line-height: 1.5;
  color: var(--muted);
}

.live-empty button {
  flex: none;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: var(--green);
  color: var(--cream);
  font-size: 9px;
  cursor: pointer;
}

/* -------------------------------------------------------------------------- */
/* 列表                                                                        */
/* -------------------------------------------------------------------------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 19px 4px 9px;
}

.section-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.section-head span {
  font-size: 9px;
  color: var(--muted);
}

.canteen-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.canteen-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  overflow: hidden;
  padding: 12px 12px 12px 16px;
  border: 1px solid rgba(28, 43, 35, 0.07);
  border-radius: 17px;
  background: rgba(255, 253, 248, 0.7);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease-out),
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.canteen-card::before {
  content: "";
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--level);
}

.canteen-card:hover {
  transform: translateY(-1px);
  border-color: rgba(28, 43, 35, 0.12);
  background: var(--paper);
  box-shadow: 0 12px 24px -22px rgba(20, 40, 29, 0.55);
}

.canteen-card:focus-visible {
  outline: 2px solid var(--green-2);
  outline-offset: 2px;
}

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

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

.card-name {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.card-name em {
  overflow: hidden;
  font-style: normal;
  font-size: 8px;
  font-weight: 400;
  color: var(--muted);
  text-overflow: ellipsis;
}

.badge {
  flex: none;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--green);
  color: var(--cream);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge.you {
  background: var(--accent-soft);
  color: var(--accent);
}

.card-numbers {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 4px;
}

.card-numbers b {
  font-size: 23px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.card-numbers .capacity {
  font-size: 9px;
  color: var(--muted);
}

.trend {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(28, 43, 35, 0.045);
  color: var(--muted);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trend.up {
  background: rgba(208, 138, 40, 0.1);
  color: #a96625;
}

.trend.down {
  background: rgba(47, 125, 90, 0.1);
  color: var(--level-empty);
}

.meter {
  height: 5px;
  margin: 7px 0 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(28, 43, 35, 0.075);
}

.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--level);
  transition: width 0.6s var(--ease-out);
}

.card-foot {
  font-size: 9px;
  color: var(--muted);
}

.card-foot .wait {
  color: var(--ink-2);
}

.card-foot .status-text {
  color: var(--level);
  font-weight: 600;
}

.panel-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 4px 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(28, 43, 35, 0.07);
}

.panel-note-mark {
  width: 15px;
  height: 15px;
  flex: none;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border: 1px solid rgba(28, 43, 35, 0.16);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 9px;
  line-height: 1;
}

.panel-note p {
  margin: 0;
  font-size: 8px;
  line-height: 1.65;
  color: var(--muted);
}

.card-arrow {
  width: 14px;
  height: 14px;
  flex: none;
  color: rgba(28, 43, 35, 0.24);
}

/* -------------------------------------------------------------------------- */
/* 加载 / 错误                                                                 */
/* -------------------------------------------------------------------------- */

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(28, 43, 35, 0.045) 25%,
    rgba(28, 43, 35, 0.085) 37%,
    rgba(28, 43, 35, 0.045) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 18px;
}

.skeleton-hero {
  height: 226px;
  border-radius: 22px;
}

.skeleton-line {
  width: 38%;
  height: 12px;
  margin: 20px 4px 10px;
  border-radius: 6px;
}

.skeleton-card {
  height: 94px;
  margin-bottom: 7px;
}

.error-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 20px;
  border: 1px solid rgba(194, 76, 60, 0.16);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.8);
}

.error-card b {
  font-size: 13px;
}

.error-card p {
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
}

.error-card button {
  height: 34px;
  margin-top: 4px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: var(--cream);
  font-size: 10px;
  cursor: pointer;
}

/* -------------------------------------------------------------------------- */
/* 进行中的签到条                                                              */
/* -------------------------------------------------------------------------- */

.active-dock {
  position: fixed;
  left: calc((100vw - var(--panel-w) - 48px) / 2);
  bottom: 24px;
  z-index: 45;
  width: min(470px, calc(100vw - var(--panel-w) - 80px));
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px 12px;
  border: 1px solid rgba(245, 240, 230, 0.13);
  border-radius: 18px;
  background: rgba(23, 59, 45, 0.96);
  box-shadow: 0 22px 46px -24px rgba(12, 32, 22, 0.85);
  color: var(--cream);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
  animation: dockUp 0.35s var(--ease-out);
}

.dock-pulse {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: #91d5ab;
  box-shadow: 0 0 0 0 rgba(145, 213, 171, 0.45);
  animation: statusPulse 2.4s infinite;
}

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

.dock-title {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dock-title span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-sub {
  margin-top: 3px;
  font-size: 9px;
  color: rgba(245, 240, 230, 0.58);
  font-variant-numeric: tabular-nums;
}

.dock-sub b {
  color: #f2c880;
  font-weight: 600;
}

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

.dock-btn {
  height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(245, 240, 230, 0.14);
  border-radius: 9px;
  background: rgba(245, 240, 230, 0.08);
  color: var(--cream);
  font-size: 9px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease;
}

.dock-btn:hover {
  background: rgba(245, 240, 230, 0.16);
}

.dock-btn.primary {
  border-color: var(--cream);
  background: var(--cream);
  color: var(--ink);
}

.dock-progress {
  position: absolute;
  right: 13px;
  bottom: 5px;
  left: 13px;
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(245, 240, 230, 0.12);
}

.dock-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #f2c880;
  transition: width 1s linear;
}

/* -------------------------------------------------------------------------- */
/* 弹层                                                                        */
/* -------------------------------------------------------------------------- */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.no-anim {
  animation: none !important;
}

.modal-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(16, 32, 24, 0.42);
  backdrop-filter: blur(5px);
  pointer-events: auto;
  animation: fadeIn 0.2s ease;
}

.modal-layer.detail-layer {
  justify-content: flex-end;
  align-items: stretch;
  padding: 24px;
}

.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 420px;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 34px 90px -30px rgba(10, 28, 18, 0.7);
  animation: sheetIn 0.3s var(--ease-out);
}

.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(28, 43, 35, 0.06);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.18s ease;
}

.sheet-close:hover {
  background: rgba(28, 43, 35, 0.12);
}

.sheet-close svg {
  width: 15px;
  height: 15px;
}

.sheet-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 24px 6px;
  scrollbar-width: thin;
}

.sheet-scroll::-webkit-scrollbar {
  width: 6px;
}

.sheet-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(28, 43, 35, 0.14);
}

.detail-kicker {
  padding-right: 40px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.detail-head h2 {
  margin: 7px 0 9px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--ink-2);
}

.status-chip {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(28, 43, 35, 0.06);
  color: var(--level);
  font-size: 9px;
  font-weight: 600;
}

.detail-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 12px;
}

.big-number b {
  display: block;
  font-size: 46px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.big-number span {
  display: block;
  margin-top: 7px;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.detail-ring {
  --p: 0;
  position: relative;
  width: 86px;
  height: 86px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--level) calc(var(--p) * 1%), rgba(28, 43, 35, 0.07) 0);
}

.detail-ring::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--paper);
}

.detail-ring div {
  position: relative;
  z-index: 1;
  text-align: center;
}

.detail-ring b {
  display: block;
  font-size: 18px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.detail-ring span {
  display: block;
  margin-top: 3px;
  font-size: 8px;
  color: var(--muted);
}

.detail-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(28, 43, 35, 0.075);
}

.detail-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--level);
  transition: width 0.6s var(--ease-out);
}

.detail-desc {
  margin: 12px 0 18px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-2);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 20px;
}

.stat-grid div {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--cream-2);
}

.stat-grid b {
  display: block;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-grid span {
  display: block;
  margin-top: 4px;
  font-size: 8px;
  color: var(--muted);
}

.chart-card {
  padding: 13px 13px 10px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--cream-2);
}

.floor-card {
  margin: 0 0 14px;
}

.floor-list {
  display: grid;
  gap: 8px;
}

.floor-row {
  display: grid;
  grid-template-columns: minmax(74px, 1.1fr) minmax(36px, 2fr) 42px 38px;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}

.floor-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.floor-bar {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(28, 43, 35, 0.075);
}

.floor-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--level);
}

.floor-row b {
  text-align: right;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.floor-row small {
  text-align: right;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.section-head.small {
  margin: 0 0 12px;
}

.section-head.small h3 {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.section-head.small span {
  font-size: 8px;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 84px;
}

.chart .bar {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(28, 43, 35, 0.035);
}

.chart .bar i {
  display: block;
  width: 100%;
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  background: rgba(47, 107, 80, 0.32);
  transition: height 0.5s var(--ease-out);
}

.chart .bar.is-now i {
  background: var(--accent);
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 7px;
  color: var(--muted);
}

.signature {
  margin: 20px 0 4px;
}

.signature h3 {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tags span {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(28, 43, 35, 0.05);
  color: var(--ink-2);
  font-size: 9px;
}

.detail-tip {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 14px 0 4px;
  padding: 11px 12px;
  border: 1px dashed rgba(28, 43, 35, 0.14);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.5);
}

.detail-tip b {
  flex: none;
  font-size: 9px;
  font-weight: 600;
}

.detail-tip span {
  font-size: 9px;
  line-height: 1.6;
  color: var(--muted);
}

.detail-note {
  padding: 8px 0 18px;
  font-size: 9px;
  line-height: 1.65;
  color: var(--muted);
}

.sheet-cta {
  flex: none;
  padding: 13px 24px calc(15px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(12px);
}

.primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 47px;
  border: 0;
  border-radius: 13px;
  background: var(--green);
  color: var(--cream);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s var(--ease-out);
}

.primary-btn:hover {
  background: #1b4434;
}

.primary-btn:active {
  transform: scale(0.99);
}

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

.primary-btn svg {
  width: 15px;
  height: 15px;
}

.ghost-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  color: var(--ink-2);
  font-size: 10px;
  cursor: pointer;
}

.active-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(217, 93, 57, 0.16);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
}

.active-inline b {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* 对话框 */
.dialog {
  position: relative;
  width: min(420px, 100%);
  max-height: 90dvh;
  overflow-y: auto;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: 0 34px 90px -30px rgba(10, 28, 18, 0.7);
  animation: dialogIn 0.25s var(--ease-out);
}

.dialog-kicker {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.dialog h2 {
  margin: 7px 0 6px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.dialog-sub {
  margin: 0 0 20px;
  font-size: 11px;
  line-height: 1.65;
  color: var(--ink-2);
}

.field {
  margin-bottom: 18px;
}

.field > label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.field > label span {
  font-size: 8px;
  font-weight: 400;
  color: var(--muted);
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--cream-2);
}

.stepper button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease;
}

.stepper button:hover {
  background: var(--cream);
}

.stepper button:disabled {
  opacity: 0.35;
  cursor: default;
}

.stepper b {
  min-width: 22px;
  text-align: center;
  font-size: 21px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.stepper .unit {
  font-size: 9px;
  color: var(--muted);
}

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

.chip {
  height: 39px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--cream-2);
  color: var(--ink-2);
  font-size: 10px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.chip.is-active {
  border-color: var(--green);
  background: var(--green);
  color: var(--cream);
}

.checkin-preview {
  margin: 2px 0 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cream-2);
  font-size: 10px;
  line-height: 1.55;
  color: var(--ink-2);
}

.checkin-preview b {
  font-size: 13px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.checkin-preview .preview-level {
  color: var(--level);
  font-weight: 600;
}

.form-error {
  margin: 0 0 12px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(194, 76, 60, 0.08);
  color: #a53c2f;
  font-size: 9px;
  line-height: 1.5;
}

.fineprint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 8px;
  line-height: 1.5;
  color: var(--muted);
}

.dialog-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.dialog-actions button {
  flex: 1;
  height: 42px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font-size: 10px;
  cursor: pointer;
}

.dialog-actions button.primary {
  border-color: var(--green);
  background: var(--green);
  color: var(--cream);
}

.about-dialog {
  width: min(440px, 100%);
}

.about-intro {
  margin: 0 0 18px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-2);
}

.about-step {
  display: flex;
  gap: 11px;
  margin: 12px 0;
}

.about-step .num {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: var(--cream);
  font-size: 9px;
  font-weight: 600;
}

.about-step b {
  display: block;
  font-size: 11px;
  font-weight: 600;
}

.about-step p {
  margin: 3px 0 0;
  font-size: 9px;
  line-height: 1.6;
  color: var(--muted);
}

.about-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.about-section h3 {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 600;
}

.about-section p {
  margin: 0;
  font-size: 9px;
  line-height: 1.7;
  color: var(--muted);
}

.about-section a {
  color: var(--green-2);
  text-underline-offset: 2px;
}

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

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100vw - 32px);
  padding: 10px 15px;
  border: 1px solid rgba(245, 240, 230, 0.12);
  border-radius: 999px;
  background: rgba(23, 59, 45, 0.96);
  box-shadow: 0 16px 34px -18px rgba(12, 32, 22, 0.8);
  color: var(--cream);
  font-size: 10px;
  line-height: 1.4;
  animation: toastIn 0.28s var(--ease-out);
  backdrop-filter: blur(12px);
}

.toast svg {
  width: 13px;
  height: 13px;
  flex: none;
  color: #9ad8b5;
}

.toast.is-error svg {
  color: #f0a58f;
}

.toast.is-leaving {
  animation: toastOut 0.2s ease forwards;
}

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

@keyframes statusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(145, 213, 171, 0.45);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(145, 213, 171, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(145, 213, 171, 0);
  }
}

@keyframes statusPulseAmber {
  0% {
    box-shadow: 0 0 0 0 rgba(208, 138, 40, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(208, 138, 40, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(208, 138, 40, 0);
  }
}

@keyframes markerPulse {
  0% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  75% {
    transform: scale(1.65);
    opacity: 0;
  }
  100% {
    transform: scale(1.65);
    opacity: 0;
  }
}

@keyframes countBump {
  0% {
    transform: translateY(0);
  }
  35% {
    transform: translateY(-2px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes handSway {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(4px);
  }
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sheetIn {
  from {
    opacity: 0;
    transform: translateX(24px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dockUp {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

/* 桌面端可读性微调：不改变布局，只把过小的辅助文字提亮一点。 */
@media (min-width: 980px) {
  .panel-scroll { padding: 18px 18px 8px; }
  .panel-note p { font-size: 9px; line-height: 1.65; }
  .source-chip { font-size: 9px; }
  .marker-name { font-size: 10px; }
  .marker-state { font-size: 8px; }
  .map-status { font-size: 11px; }
}

/* -------------------------------------------------------------------------- */
/* 响应式                                                                      */
/* -------------------------------------------------------------------------- */

@media (max-width: 1240px) {
  :root {
    --panel-w: 372px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .legend {
    gap: 8px;
    padding: 8px 12px;
  }
}

@media (max-width: 1100px) {
  :root {
    --panel-w: 310px;
  }

  .clock {
    display: none;
  }

  .legend {
    display: none;
  }

  .hero {
    padding: 17px 18px 16px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .hero-meta {
    gap: 8px;
  }

  .card-name em {
    display: none;
  }
}

@media (max-width: 979px) {
  :root {
    --topbar-h: 64px;
    --panel-w: 100%;
  }

  .app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 0;
  }

  .topbar {
    position: relative;
    order: 1;
    flex: 0 0 64px;
    height: 64px;
    padding: 0 16px;
    background: var(--cream);
    border-bottom: 1px solid rgba(28, 43, 35, 0.06);
    z-index: 30;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .brand-mark svg {
    width: 23px;
    height: 23px;
  }

  .brand-text b {
    font-size: 21px;
  }

  .brand-text em {
    margin-top: 4px;
    font-size: 7px;
    letter-spacing: 0.18em;
  }

  .top-actions {
    gap: 7px;
  }

  .mode-toggle {
    height: 33px;
    padding: 0 9px 0 11px;
    gap: 6px;
  }

  .mode-label {
    font-size: 10px;
  }

  .switch {
    width: 25px;
    height: 15px;
  }

  .switch i {
    width: 11px;
    height: 11px;
  }

  .mode-toggle[aria-checked="true"] .switch i {
    transform: translateX(10px);
  }

  .icon-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .map-viewport {
    position: relative;
    inset: auto;
    order: 2;
    flex: 0 0 44dvh;
    min-height: 286px;
    max-height: 470px;
  }

  .map-vignette {
    background:
      linear-gradient(180deg, rgba(245, 240, 230, 0.55) 0, transparent 70px),
      linear-gradient(0deg, rgba(245, 240, 230, 0.38) 0, transparent 90px);
  }

  .map-status {
    top: 12px;
    left: 14px;
    padding: 6px 10px;
    font-size: 9px;
  }

  .map-tools {
    right: 12px;
    bottom: 22px;
    border-radius: 12px;
  }

  .map-tools button {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }

  .map-hint {
    bottom: 20px;
    max-width: calc(100% - 110px);
    padding: 7px 12px;
    font-size: 9px;
  }

  .panel {
    position: relative;
    inset: auto;
    order: 3;
    flex: 1;
    width: 100%;
    min-height: 0;
    margin-top: -18px;
    border: 0;
    border-radius: 24px 24px 0 0;
    background: var(--cream-2);
    box-shadow: 0 -18px 40px -28px rgba(20, 40, 29, 0.55);
    backdrop-filter: none;
    z-index: 25;
  }

  .panel-scroll {
    padding: 14px 14px 100px;
  }

  .app.has-active .panel-scroll {
    padding-bottom: 140px;
  }

  .app.has-active .panel-foot {
    display: none;
  }

  .panel-foot {
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
    font-size: 8px;
  }

  .hero {
    padding: 17px 18px 16px;
    border-radius: 20px;
  }

  .hero h1 {
    font-size: 27px;
  }

  .hero-copy p {
    font-size: 10px;
  }

  .gauge {
    width: 58px;
    height: 58px;
  }

  .gauge b {
    font-size: 16px;
  }

  .hero-meta {
    gap: 8px;
    margin-top: 13px;
    padding-top: 11px;
    font-size: 8px;
  }

  .hero-meta b {
    font-size: 12px;
  }

  .hero-cta {
    height: 41px;
    margin-top: 12px;
  }

  .section-head {
    margin-top: 16px;
  }

  .canteen-card {
    padding: 11px 11px 11px 15px;
    border-radius: 16px;
  }

  .card-numbers b {
    font-size: 22px;
  }

  .active-dock {
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    padding: 10px 12px 11px;
    border-radius: 16px;
    transform: none;
    animation: dockUpMobile 0.3s var(--ease-out);
  }

  .toast-root {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .modal-layer {
    align-items: flex-end;
    padding: 0;
  }

  .modal-layer.detail-layer {
    align-items: flex-end;
    padding: 0;
  }

  .sheet {
    width: 100%;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
    animation: sheetUp 0.3s var(--ease-out);
  }

  .sheet-scroll {
    padding: 24px 20px 4px;
  }

  .sheet-cta {
    padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
  }

  .detail-head h2 {
    font-size: 27px;
  }

  .big-number b {
    font-size: 42px;
  }

  .dialog {
    width: 100%;
    max-height: 92dvh;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    animation: sheetUp 0.3s var(--ease-out);
  }

  .dialog h2 {
    font-size: 24px;
  }

  .toast {
    font-size: 9px;
  }
}

@media (max-width: 420px) {
  .card-name em {
    display: none;
  }

  .hero-meta {
    gap: 7px;
  }

  .hero-meta b {
    font-size: 11px;
  }

  .hero-copy p {
    max-width: 210px;
  }

  .canteen-card {
    gap: 8px;
  }

  .card-arrow {
    display: none;
  }

  .mode-label {
    max-width: 52px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-height: 700px) and (max-width: 979px) {
  .map-viewport {
    flex-basis: 38dvh;
    min-height: 240px;
  }

  .hero {
    padding: 15px 16px 14px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .hero-copy p {
    margin-top: 5px;
  }

  .hero-meta {
    margin-top: 10px;
    padding-top: 9px;
  }

  .hero-cta {
    height: 38px;
    margin-top: 10px;
  }
}

/* 横屏手机：把地图铺满，面板像桌面端一样浮在右侧，避免只剩一条面板。 */
@media (max-height: 560px) and (orientation: landscape) {
  :root {
    --topbar-h: 64px;
    --panel-w: min(300px, 40vw);
  }

  .app {
    display: block;
  }

  .topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    padding: 0 16px;
    border-bottom: 0;
    background: linear-gradient(180deg, rgba(245, 240, 230, 0.96), rgba(245, 240, 230, 0.42) 72%, transparent);
  }

  .map-viewport {
    position: absolute;
    inset: 0;
    min-height: 0;
    max-height: none;
    flex: none;
  }

  .map-status {
    top: 72px;
    left: 16px;
  }

  .map-tools {
    right: calc(var(--panel-w) + 24px);
    bottom: 14px;
  }

  .map-hint {
    display: none;
  }

  .legend {
    display: none;
  }

  .panel {
    position: absolute;
    top: 72px;
    right: 10px;
    bottom: 10px;
    left: auto;
    width: var(--panel-w);
    margin: 0;
    flex: none;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    background: rgba(250, 246, 238, 0.94);
    box-shadow: var(--shadow-panel);
    backdrop-filter: blur(18px) saturate(1.06);
  }

  .panel-scroll {
    padding: 10px 10px 88px;
  }

  .panel-foot {
    display: none;
  }

  .hero {
    padding: 13px 14px 12px;
    border-radius: 17px;
  }

  .hero h1 {
    font-size: 22px;
  }

  .hero-eyebrow {
    font-size: 8px;
  }

  .hero-copy p {
    margin-top: 4px;
    font-size: 9px;
  }

  .gauge {
    width: 48px;
    height: 48px;
  }

  .gauge b {
    font-size: 14px;
  }

  .hero-meta {
    gap: 7px;
    margin-top: 8px;
    padding-top: 8px;
    font-size: 8px;
  }

  .hero-meta b {
    font-size: 11px;
  }

  .hero-cta {
    height: 34px;
    margin-top: 8px;
    font-size: 10px;
  }

  .section-head {
    margin: 12px 4px 7px;
  }

  .canteen-card {
    padding: 9px 9px 9px 13px;
  }

  .card-numbers b {
    font-size: 20px;
  }

  .panel-note {
    display: none;
  }

  .active-dock {
    left: calc((100vw - var(--panel-w) - 20px) / 2);
    bottom: 10px;
    width: min(420px, calc(100vw - var(--panel-w) - 40px));
    padding: 8px 10px 9px;
    border-radius: 15px;
    transform: translateX(-50%);
    animation: dockUp 0.3s var(--ease-out);
  }

  .dock-title {
    font-size: 10px;
  }

  .dock-sub {
    font-size: 8px;
  }

  .dock-btn {
    height: 26px;
    font-size: 8px;
  }

  .toast-root {
    bottom: 72px;
  }
}

.report-fab {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 36;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 16px;
  background: linear-gradient(135deg, #d95d39, #b9472d);
  color: #fffdf8;
  box-shadow: 0 14px 34px rgba(145, 55, 35, 0.34);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.report-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(145, 55, 35, 0.4);
}
.report-fab:active { transform: translateY(0); }
.report-fab-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.17);
  font-size: 18px;
}
.report-fab-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
}
.report-fab-copy b {
  font-size: 13px;
  letter-spacing: 0.04em;
}
.report-fab-copy small {
  font-size: 9px;
  color: rgba(255, 253, 248, 0.78);
}
@media (max-width: 979px) {
  .report-fab {
    left: 14px;
    bottom: 16px;
    padding: 8px 12px 8px 8px;
    border-radius: 14px;
  }
  .report-fab-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 16px;
  }
  .report-fab-copy b { font-size: 12px; }
  .report-fab-copy small { font-size: 8px; }
}

@keyframes sheetUp {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dockUpMobile {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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