/* =====================================================================
   SuperLens · 2026深圳无人机展
   设计系统 · 以 iOS / Android 默认浏览器为目标，向 Apple HIG 看齐。
   - 配色：iOS System Blue 为主，红色仅服务"路线"
   - 排版：SF / PingFang，权重 400/500/600 节奏
   - 形状：12-22 px 圆角节奏，发丝边框
   - 动效：cubic-bezier(0.32, 0.72, 0, 1) 标准缓动
   ===================================================================== */

:root {
  /* 地图坐标系（map-viewer.js 使用） */
  --paper-w: 5062;
  --paper-h: 3543;

  /* 表面 */
  --bg: #f2f2f7;
  --bg-2: #e9e9ee;
  --surface: #ffffff;
  --surface-2: #f9f9fb;
  --surface-elev: rgba(255, 255, 255, 0.78);
  --surface-overlay: rgba(255, 255, 255, 0.94);
  --scrim: rgba(0, 0, 0, 0.32);

  /* 文本层级（iOS label tokens） */
  --label: #1c1c1e;
  --label-2: #3c3c43;
  --label-3: rgba(60, 60, 67, 0.6);
  --label-4: rgba(60, 60, 67, 0.3);

  /* 分隔与填充 */
  --separator: rgba(60, 60, 67, 0.14);
  --separator-strong: rgba(60, 60, 67, 0.22);
  --fill-1: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.18);
  --fill-3: rgba(120, 120, 128, 0.26);

  /* 品牌 */
  --brand: #0a84ff;
  --brand-pressed: #0066cc;
  --brand-tint: rgba(10, 132, 255, 0.12);
  --brand-tint-strong: rgba(10, 132, 255, 0.20);

  /* 语义 */
  --danger: #ff3b30;
  --danger-tint: rgba(255, 59, 48, 0.12);
  --success: #34c759;
  --warning: #ff9f0a;
  --warning-tint: rgba(255, 159, 10, 0.16);

  /* 阴影 */
  --shadow-1: 0 1px 2px rgba(15, 23, 28, 0.06), 0 0 0 0.5px rgba(15, 23, 28, 0.04);
  --shadow-2: 0 4px 14px rgba(15, 23, 28, 0.07), 0 1px 3px rgba(15, 23, 28, 0.04);
  --shadow-3: 0 18px 48px rgba(15, 23, 28, 0.16), 0 6px 14px rgba(15, 23, 28, 0.06);
  --shadow-sheet: 0 -10px 36px rgba(15, 23, 28, 0.16);
  --shadow-cta: 0 8px 20px rgba(10, 132, 255, 0.24);

  /* 圆角 */
  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-2xl: 22px;
  --r-pill: 999px;

  /* 缓动 */
  --ease-smooth: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

body {
  display: flex;
  justify-content: center;
  padding: 18px 18px 56dvh;
  min-height: 100vh;
  min-height: 100dvh;
}

/* 默认禁选文本（地图/控件），可读区域显式打开 */
input, textarea,
.review-list, .review-item, .review-main,
.detail-body, .detail-section, .detail-attachment,
.ai-answer, .export-image,
.route-meta, .route-warning {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

button { font-family: inherit; }

/* =================================================================
   1. 语言切换（iOS-style 分段控件）
   ================================================================= */

.lang-toggle {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: 16px;
  z-index: 110;
  display: inline-flex;
  padding: 2px;
  background: var(--surface-elev);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-2);
  isolation: isolate;
  transition: opacity 200ms var(--ease-smooth);
}

/* 滑动指示器 */
.lang-toggle::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 2px;
  left: 2px;
  width: 48px;
  height: 32px;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: transform 320ms var(--ease-smooth);
  pointer-events: none;
}
.lang-toggle:has(#lang-en.is-active)::before { transform: translateX(48px); }

.lang-toggle button {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1px;
  color: var(--label-2);
  cursor: pointer;
  transition: color 220ms var(--ease-smooth);
  touch-action: manipulation;
}

.lang-toggle button.is-active { color: var(--label); }

/* :has() 不支持的回退 */
@supports not selector(:has(*)) {
  .lang-toggle::before { display: none; }
  .lang-toggle button.is-active {
    background: var(--surface);
    box-shadow: var(--shadow-1);
    border-radius: var(--r-pill);
  }
}

body.image-viewer-open .lang-toggle {
  opacity: 0;
  pointer-events: none;
}

/* =================================================================
   2. 地图视口
   ================================================================= */

.map-viewport {
  position: relative;
  width: min(96vw, 1540px);
  aspect-ratio: var(--paper-w) / var(--paper-h);
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 0.5px solid var(--separator);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

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

.map-viewport, .map-viewport * {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.map-shell {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--surface);
  overflow: hidden;
  transform-origin: 0 0;
}

.hall {
  position: absolute;
  left: calc(var(--x) / var(--paper-w) * 100%);
  top: calc(var(--y) / var(--paper-h) * 100%);
  width: calc(var(--w) / var(--paper-w) * 100%);
  height: calc(var(--h) / var(--paper-h) * 100%);
  overflow: hidden;
  background: var(--surface);
  contain: layout paint size;
  pointer-events: none;
}

.hall img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  -webkit-user-drag: none;
}

.route-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.route-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.route-line-underlay { stroke: rgba(255, 255, 255, 0.94); stroke-width: 18; }
.route-line-main {
  stroke: var(--danger);
  stroke-width: 8;
  stroke-dasharray: 24 14;
  filter: drop-shadow(0 6px 8px rgba(255, 59, 48, 0.28));
}
.route-transfer-dot { fill: #ffcf44; stroke: #7a4d00; stroke-width: 5; }
.route-booth-box {
  fill: rgba(255, 207, 68, 0.06);
  stroke: rgba(255, 59, 48, 0.7);
  stroke-width: 2.5;
}
.route-stop { fill: rgba(28, 28, 30, 0.85); stroke: rgba(255, 255, 255, 0.95); stroke-width: 4; }
.route-stop-text {
  fill: #fff;
  font-size: 23px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
}

/* 地图缩放控件 —— 磨砂 pill，垂直居中，远离顶部 中/EN 也避开底部弹起的面板 */
.map-controls {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-pill);
  background: var(--surface-elev);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow-2);
  touch-action: manipulation;
}

.map-controls button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  font-size: 20px;
  font-weight: 400;
  color: var(--label);
  cursor: pointer;
  transition: background 160ms var(--ease-smooth), transform 100ms var(--ease-smooth);
  touch-action: manipulation;
}
.map-controls button:active { background: var(--fill-2); transform: scale(0.94); }

/* =================================================================
   3. 底部面板
   ================================================================= */

.bottom-panel {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 20;
  width: min(960px, calc(100vw - 28px));
  max-height: min(58dvh, 580px);
  transform: translateX(-50%);
  padding: 16px 18px 14px;
  border-radius: var(--r-2xl);
  background: var(--surface-elev);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  box-shadow: var(--shadow-3);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  -webkit-user-select: text;
  user-select: text;
}

.phase {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  flex: 1 1 auto;
  animation: phase-in 360ms var(--ease-smooth);
}

.phase[hidden] { display: none; }

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

.phase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
}

.phase-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--label);
}

.phase-status {
  min-height: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--danger);
}
.phase-status:empty { display: none; }

.phase-footer {
  position: sticky;
  bottom: -14px;
  margin: 6px -18px -14px;
  margin-top: auto;             /* 面板被拉高时把 footer 顶到底 */
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--surface-overlay) 65%, rgba(255, 255, 255, 0));
  display: flex;
  gap: 10px;
}

/* =================================================================
   4. 阶段 0 · 提问
   ================================================================= */

.app-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 2px;
}

.app-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--label);
}

.app-lead {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--label-3);
}

.ask-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#ask-input {
  width: 100%;
  min-height: 78px;
  resize: none;
  padding: 12px 14px;
  border: 1px solid var(--separator);
  border-radius: var(--r-lg);
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  color: var(--label);
  background: var(--surface);
  outline: none;
  transition: border-color 200ms var(--ease-smooth),
              box-shadow 200ms var(--ease-smooth);
}

#ask-input::placeholder { color: var(--label-3); font-weight: 400; }

#ask-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-tint);
}

.ask-actions { display: flex; gap: 10px; align-items: center; }

/* 主 CTA —— 用纯 .primary 选择器，避免后续被 .ask-actions / .phase-footer 路径"碰巧"提权 */
.primary {
  height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-lg);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  box-shadow: var(--shadow-cta);
  transition: transform 100ms var(--ease-smooth),
              background 180ms var(--ease-smooth),
              box-shadow 200ms var(--ease-smooth),
              color 200ms var(--ease-smooth),
              opacity 180ms var(--ease-smooth);
  touch-action: manipulation;
}

/* 在 ask-actions / phase-footer 里需要拉满宽度，但不重复 background，避免提权 */
.ask-actions .primary,
.phase-footer .primary { flex: 1; }

.primary:active:not(:disabled):not(.is-loading) {
  transform: scale(0.97);
  background: var(--brand-pressed);
  box-shadow: 0 4px 10px rgba(10, 132, 255, 0.20);
}

.primary:disabled,
.primary.is-loading {
  background: var(--fill-2);
  color: var(--label-3);
  box-shadow: none;
  cursor: not-allowed;
}

.primary.is-loading { cursor: progress; }

.primary.is-loading::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 10px;
  vertical-align: -3px;
  border: 2px solid rgba(60, 60, 67, 0.22);
  border-top-color: var(--label-2);
  border-radius: 50%;
  animation: super-spin 0.7s linear infinite;
}

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

.ask-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

.examples-label {
  color: var(--label-3);
  font-size: 13px;
  margin-right: 2px;
}

.chip {
  height: 32px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--label);
  background: var(--fill-1);
  border: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 160ms var(--ease-smooth), transform 100ms var(--ease-smooth);
  touch-action: manipulation;
}
.chip:hover { background: var(--fill-2); }
.chip:active { transform: scale(0.96); background: var(--fill-3); }

.ask-tip {
  margin: 6px 0 0;
  padding: 10px 12px;
  background: var(--brand-tint);
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.5;
  color: var(--label-2);
}

.app-footer {
  margin-top: auto;             /* 面板被拉高时把 footer 顶到底 */
  padding-top: 10px;
  border-top: 0.5px solid var(--separator);
  text-align: center;
  color: var(--label-3);
}

.app-footer p { margin: 2px 0; font-size: 11px; font-weight: 400; }

.footer-poweredby a {
  color: var(--brand);
  text-decoration: none;
  margin-left: 4px;
  font-weight: 500;
}
.footer-poweredby a:hover, .footer-poweredby a:focus-visible {
  text-decoration: underline;
  outline: none;
}

/* =================================================================
   5. 阶段 1 · 勾选推荐
   ================================================================= */

.text-button {
  height: 30px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--fill-1);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--label);
  cursor: pointer;
  transition: background 160ms var(--ease-smooth),
              color 160ms var(--ease-smooth),
              transform 100ms var(--ease-smooth);
  touch-action: manipulation;
}
.text-button:hover { background: var(--fill-2); }
.text-button:active { background: var(--fill-3); transform: scale(0.96); }
.text-button.is-active {
  background: var(--brand-tint);
  color: var(--brand);
}

/* 顶部"← 重新提问 / ↺ 重新提问"按钮：iOS 风格透明文本按钮 */
#review-back, #route-back, #route-restart {
  background: transparent;
  color: var(--brand);
  padding: 0 6px;
  height: 32px;
}
#review-back:hover, #route-back:hover, #route-restart:hover {
  background: var(--fill-1);
}
#review-back:active, #route-back:active, #route-restart:active {
  background: var(--fill-2);
}

/* AI 解释 —— 用紫色暗示这是 AI 生成的内容（iOS Siri 调） */
.ai-explanation {
  --ai-purple: #af52de;
  --ai-purple-tint: rgba(175, 82, 222, 0.10);
  --ai-purple-border: rgba(175, 82, 222, 0.24);
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--ai-purple-tint);
  border: 0.5px solid var(--ai-purple-border);
}

.ai-explanation summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--label-2);
  padding: 4px 0;
  position: relative;
  padding-left: 22px;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-explanation summary::-webkit-details-marker { display: none; }
.ai-explanation summary::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ai-purple);
  border-bottom: 1.5px solid var(--ai-purple);
  transform: translate(0, -70%) rotate(-45deg);
  transition: transform 220ms var(--ease-smooth);
}
.ai-explanation[open] summary::before {
  transform: translate(0, -30%) rotate(45deg);
}

/* 显式 "AI" 徽章 */
.ai-explanation summary::after {
  content: "AI";
  display: inline-grid;
  place-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: var(--r-pill);
  background: var(--ai-purple);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1;
  order: -1;            /* 出现在文字前面 */
  margin-left: 0;
}

.ai-answer {
  margin-top: 10px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--label);
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--r-sm);
  border: 0.5px solid var(--ai-purple-border);
  max-height: 220px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.ai-answer p { margin: 0.4em 0; }
.ai-answer ul, .ai-answer ol { padding-left: 1.5em; margin: 0.4em 0; }
.ai-answer li { margin: 0.2em 0; }
.ai-answer strong { color: var(--label); }
.ai-answer code {
  background: var(--fill-1);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.92em;
}
.ai-answer h1, .ai-answer h2, .ai-answer h3 {
  font-size: 15px;
  margin: 0.8em 0 0.3em;
  font-weight: 600;
}

/* 起点 / 终点选择器 */
.endpoints-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 0.5px solid var(--separator);
}

.endpoints-picker > .endpoint-hint { grid-column: 1 / -1; }

.endpoint-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.endpoint-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--label-2);
}

.endpoint-combo {
  position: relative;
  min-width: 0;
}

.endpoint-input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 34px 0 10px;
  border: 1px solid var(--separator);
  border-radius: var(--r-sm);
  background: var(--surface);
  font: inherit;
  font-size: 16px;       /* >=16 避免 iOS 聚焦时缩放 */
  font-weight: 600;
  color: var(--label);
  font-family: var(--font-mono);
  transition: border-color 200ms var(--ease-smooth),
              box-shadow 200ms var(--ease-smooth);
}

.endpoint-input::placeholder {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--label-3);
}

.endpoint-input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-tint);
}

/* CSS 绘制的 chevron 按钮 */
.endpoint-trigger {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  font-size: 0;
  color: var(--label-3);
  cursor: pointer;
  transition: background 160ms var(--ease-smooth),
              color 160ms var(--ease-smooth);
}
.endpoint-trigger:hover, .endpoint-trigger:active {
  background: var(--fill-1);
  color: var(--label);
}
.endpoint-trigger::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.endpoint-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 260px;
  overflow: auto;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 0.5px solid var(--separator);
  box-shadow: var(--shadow-3);
  animation: dropdown-in 200ms var(--ease-out);
  -webkit-overflow-scrolling: touch;
}

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

.endpoint-options[hidden] { display: none; }
.endpoint-options li { margin: 0; }

.endpoint-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  color: var(--label);
  cursor: pointer;
  transition: background 140ms var(--ease-smooth);
}
.endpoint-option:hover, .endpoint-option:focus-visible {
  background: var(--fill-1);
  outline: none;
}
.endpoint-option.is-current {
  background: var(--brand-tint);
  color: var(--brand);
}
.endpoint-option-code {
  font-family: var(--font-mono);
  font-weight: 600;
}
.endpoint-option-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--label-3);
  font-weight: 400;
}

.endpoint-hint {
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--danger);
  background: var(--danger-tint);
  border-radius: var(--r-sm);
}

.review-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.review-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--label-2);
}

.review-quick-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* "+ 添加自定义展位" 单独成行的入口按钮 */
.custom-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px dashed rgba(10, 132, 255, 0.36);
  border-radius: var(--r-md);
  background: var(--brand-tint);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  transition: background 160ms var(--ease-smooth),
              border-color 160ms var(--ease-smooth),
              transform 100ms var(--ease-smooth);
  touch-action: manipulation;
}
.custom-toggle:hover { background: var(--brand-tint-strong); }
.custom-toggle:active { transform: scale(0.99); }

.custom-toggle-plus {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-block;
  transition: transform 240ms var(--ease-smooth);
}
.custom-toggle-plus::before,
.custom-toggle-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: currentColor;
  border-radius: 999px;
}
.custom-toggle-plus::before {
  width: 14px; height: 2px;
  transform: translate(-50%, -50%);
}
.custom-toggle-plus::after {
  width: 2px; height: 14px;
  transform: translate(-50%, -50%);
}

/* 打开状态：变成"×"，背景反相 */
.custom-toggle.is-open {
  background: var(--surface);
  border-style: solid;
  border-color: var(--separator);
  color: var(--label-2);
}
.custom-toggle.is-open .custom-toggle-plus { transform: rotate(45deg); }

/* 自定义添加区 */
.custom-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--brand-tint);
  border: 0.5px solid rgba(10, 132, 255, 0.22);
  animation: dropdown-in 240ms var(--ease-out);
}

.custom-add-row[hidden] { display: none; }
.custom-add-row > .custom-add-hint,
.custom-add-row > .custom-results { grid-column: 1 / -1; }

.custom-add-input {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--separator);
  border-radius: var(--r-sm);
  background: var(--surface);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--label);
  font-family: var(--font-mono);
  text-transform: uppercase;
  transition: border-color 200ms var(--ease-smooth),
              box-shadow 200ms var(--ease-smooth);
}

.custom-add-input::placeholder {
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--label-3);
  text-transform: none;
}

.custom-add-input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-tint);
}

.custom-add-btn {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.22);
  transition: transform 100ms var(--ease-smooth),
              background 180ms var(--ease-smooth);
}
.custom-add-btn:active { transform: scale(0.96); background: var(--brand-pressed); }
.custom-add-btn:disabled { background: var(--fill-2); color: var(--label-3); box-shadow: none; }

.custom-add-hint {
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--danger);
  background: var(--danger-tint);
  border-radius: var(--r-sm);
}

.custom-results {
  list-style: none;
  margin: 6px 0 0;
  padding: 6px;
  max-height: 240px;
  overflow: auto;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 0.5px solid var(--separator);
  box-shadow: var(--shadow-2);
  -webkit-overflow-scrolling: touch;
}
.custom-results[hidden] { display: none; }
.custom-results li { margin: 0; }

.search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--label);
  transition: background 140ms var(--ease-smooth);
}
.search-result:hover, .search-result:focus-visible {
  background: var(--fill-1);
  outline: none;
}
.search-result[disabled] { cursor: not-allowed; opacity: 0.55; }

.search-result-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--label);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-booth {
  font-size: 12px;
  font-weight: 500;
  color: var(--label-3);
  font-family: var(--font-mono);
}

.search-result-tag {
  font-size: 11px;
  color: var(--danger);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--danger-tint);
  white-space: nowrap;
}

/* 推荐列表 */
.review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 0.5px solid var(--separator);
  position: relative;
  cursor: pointer;
  transition: background 160ms var(--ease-smooth),
              border-color 160ms var(--ease-smooth),
              transform 100ms var(--ease-smooth);
}

.review-item:active { transform: scale(0.995); }

.review-item.is-selected {
  background: var(--brand-tint);
  border-color: rgba(10, 132, 255, 0.28);
}

.review-item.is-disabled {
  background: var(--surface-2);
  color: var(--label-3);
  border-style: dashed;
  cursor: not-allowed;
}
.review-item.is-disabled:active { transform: none; }

/* 自定义圆形 checkbox（iOS 风） */
.review-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin: 0;
  border: 1.5px solid var(--separator-strong);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  transition: background 200ms var(--ease-smooth),
              border-color 200ms var(--ease-smooth),
              transform 120ms var(--ease-smooth);
  position: relative;
  flex: 0 0 auto;
}
.review-checkbox:checked {
  background: var(--brand);
  border-color: var(--brand);
}
.review-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 6px;
  height: 11px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
  animation: checkbox-pop 240ms var(--ease-spring);
}
.review-checkbox:active { transform: scale(0.88); }
.review-checkbox:disabled { cursor: not-allowed; opacity: 0.5; }

@keyframes checkbox-pop {
  0%   { opacity: 0; transform: rotate(45deg) scale(0.3); }
  60%  { opacity: 1; transform: rotate(45deg) scale(1.15); }
  100% { opacity: 1; transform: rotate(45deg) scale(1); }
}

.review-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.review-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--label);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.review-sub {
  font-size: 12.5px;
  color: var(--label-3);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.review-shared-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--warning-tint);
  color: #a76700;
  font-size: 11px;
  font-weight: 600;
  vertical-align: 1px;
}

.tier-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  vertical-align: 1px;
  letter-spacing: 0.1px;
}

.tier-badge-core { color: #fff; background: var(--brand); }
.tier-badge-recommended { color: #a76700; background: var(--warning-tint); }
.tier-badge-manual { color: var(--label-2); background: var(--fill-2); }

.review-reason {
  display: -webkit-box;
  margin-top: 2px;
  font-size: 12px;
  font-style: italic;
  color: var(--label-3);
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* tier 左侧色条 */
.review-item.tier-core::before,
.review-item.tier-recommended::before,
.review-item.tier-manual::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 999px 999px 0;
}
.review-item.tier-core::before { background: var(--brand); }
.review-item.tier-recommended::before { background: var(--warning); }
.review-item.tier-manual::before { background: var(--label-3); }
.review-item.tier-related { opacity: 0.94; }

.review-booth {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-family: var(--font-mono);
}

.review-booth-code {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
}

.review-item.is-disabled .review-booth-code { color: var(--label-3); }

.review-booth-hall {
  font-size: 11px;
  color: var(--label-3);
  font-family: var(--font-sans);
  font-weight: 500;
}

.review-booth-tag {
  font-size: 10px;
  color: var(--danger);
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--danger-tint);
}

.review-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--label-3);
  font-size: 14px;
}

.review-show-more {
  display: flex;
  justify-content: center;
  margin-top: 2px;
}

/* iOS settings-row 风格：右侧只留 chevron 图标按钮，更轻量更不挤 */
.row-detail-btn {
  position: relative;
  width: 32px;
  height: 32px;
  align-self: center;
  padding: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  font-size: 0;
  color: var(--label-3);
  cursor: pointer;
  transition: background 160ms var(--ease-smooth),
              color 160ms var(--ease-smooth),
              transform 100ms var(--ease-smooth);
  flex: 0 0 auto;
}
.row-detail-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translate(-65%, -50%) rotate(-45deg);
}
.row-detail-btn:hover { background: var(--fill-1); color: var(--label-2); }
.row-detail-btn:active { transform: scale(0.92); background: var(--fill-2); }

/* =================================================================
   6. 阶段 2 · 路线
   ================================================================= */

.route-meta {
  margin: 0;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--label);
  background: var(--brand-tint);
  border-radius: var(--r-pill);
  align-self: flex-start;
  max-width: 100%;
}

.route-warning {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--danger);
  padding: 8px 12px;
  background: var(--danger-tint);
  border-radius: var(--r-sm);
}

.route-warning span {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  background: rgba(255, 255, 255, 0.55);
  font-family: var(--font-mono);
  font-size: 12px;
}

.route-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.route-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.route-list-button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 50px;
  padding: 10px 12px;
  border: 0.5px solid var(--separator);
  border-radius: var(--r-md);
  background: var(--surface);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  color: var(--label);
  transition: background 160ms var(--ease-smooth),
              border-color 160ms var(--ease-smooth),
              transform 100ms var(--ease-smooth);
}

.route-list-button:active { transform: scale(0.995); }
.route-list-button:focus-visible {
  outline: 3px solid var(--brand-tint-strong);
  outline-offset: 2px;
}
.route-list-button.is-selected {
  background: var(--brand-tint);
  border-color: rgba(10, 132, 255, 0.32);
}

.route-list-index {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 14px;
  font-weight: 600;
}

.route-list-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.route-list-code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--label-2);
}

.route-list-name {
  font-size: 14px;
  color: var(--label);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-list-name-pending {
  color: var(--label-3);
  font-weight: 400;
  font-style: italic;
}

/* =================================================================
   7. 图片全屏查看器
   ================================================================= */

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.96);
  touch-action: none;
  animation: viewer-fade-in 260ms var(--ease-smooth);
}

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

.image-viewer[hidden] { display: none; }
.image-viewer, .image-viewer * {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.image-viewer-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
}

.image-viewer-img {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  max-width: none;
  max-height: none;
  -webkit-user-drag: none;
  transition: opacity 200ms var(--ease-smooth);
}

.image-viewer-close {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  z-index: 110;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 22px;
  font-weight: 500;
  cursor: pointer;
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  transition: background 160ms var(--ease-smooth),
              transform 100ms var(--ease-smooth);
  touch-action: manipulation;
}
.image-viewer-close:active {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(0.95);
}

.image-viewer-hint {
  position: absolute;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
  animation: hint-fade 4.5s ease forwards;
}

@keyframes hint-fade {
  0%   { opacity: 0; transform: translate(-50%, 8px); }
  8%   { opacity: 1; transform: translate(-50%, 0); }
  82%  { opacity: 1; }
  100% { opacity: 0; }
}

/* =================================================================
   8. 详情弹窗（底部 sheet）
   ================================================================= */

.detail-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: end center;
  padding: 0;
  background: var(--scrim);
  animation: scrim-in 260ms var(--ease-smooth);
}

.detail-sheet[hidden] { display: none; }

@keyframes scrim-in {
  from { background: rgba(0, 0, 0, 0); }
  to   { background: var(--scrim); }
}

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

.detail-card {
  width: min(720px, 100%);
  max-height: 92dvh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  background: var(--surface);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  box-shadow: var(--shadow-sheet);
  overflow: hidden;
  animation: sheet-up 380ms var(--ease-smooth);
  will-change: transform;
}

.detail-card::before {
  content: "";
  display: block;
  margin: 8px auto 4px;
  width: 36px;
  height: 5px;
  border-radius: 999px;
  background: var(--separator-strong);
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px 14px;
  border-bottom: 0.5px solid var(--separator);
}

.detail-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.detail-title strong {
  font-size: 17px;
  font-weight: 600;
  color: var(--label);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-title span {
  font-size: 12px;
  color: var(--label-3);
  font-family: var(--font-mono);
}

.detail-close-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--fill-2);
  font-family: inherit;
  font-size: 18px;
  font-weight: 500;
  color: var(--label-2);
  cursor: pointer;
  transition: background 160ms var(--ease-smooth),
              transform 100ms var(--ease-smooth);
  flex: 0 0 auto;
}
.detail-close-btn:hover { background: var(--fill-3); color: var(--label); }
.detail-close-btn:active { background: var(--fill-3); transform: scale(0.92); }

.detail-body {
  padding: 14px 16px 20px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.detail-loading, .detail-empty {
  margin: 24px 0;
  text-align: center;
  color: var(--label-3);
  font-size: 14px;
}

.detail-section + .detail-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 0.5px solid var(--separator);
}

.detail-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.detail-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 0.5px solid var(--separator);
}

.detail-section-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--label);
  line-height: 1.3;
}

.detail-section-en {
  font-size: 12px;
  color: var(--label-3);
  margin-top: 1px;
}

.detail-section-meta {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--label);
}

.detail-section-meta strong { color: var(--label-2); font-weight: 600; }

.detail-section-body {
  margin: 10px 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--label);
  white-space: pre-wrap;
}

.detail-section-body strong {
  display: block;
  margin-bottom: 4px;
  color: var(--label-2);
  font-weight: 600;
}

.detail-attachments {
  margin: 12px 0;
  padding: 8px;
  border: 0.5px solid var(--separator);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.detail-attachments-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--label-2);
  padding: 4px 6px 6px;
  letter-spacing: 0.2px;
}

.detail-attachment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  margin-bottom: 4px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--surface);
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  color: var(--label);
  cursor: pointer;
  transition: background 160ms var(--ease-smooth);
}

.detail-attachment:last-child { margin-bottom: 0; }
.detail-attachment:hover, .detail-attachment:focus-visible {
  background: var(--fill-1);
  outline: none;
}
.detail-attachment:active { background: var(--fill-2); }

.detail-attachment-icon { font-size: 18px; width: 26px; text-align: center; }

.detail-attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.detail-attachment-size {
  font-size: 11px;
  color: var(--label-3);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.detail-qr-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 12px 0;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 0.5px solid var(--separator);
}

.detail-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.detail-qr-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  background: var(--surface);
  border: 0.5px solid var(--separator);
  border-radius: var(--r-md);
  cursor: zoom-in;
}

.detail-qr-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--label-3);
}

.detail-video-wrap {
  margin: 12px 0;
  padding: 10px;
  border-radius: var(--r-md);
  background: #111;
  display: grid;
  gap: 6px;
}

.detail-video-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.detail-video {
  width: 100%;
  max-height: 320px;
  background: #000;
  border-radius: var(--r-sm);
}

.detail-video-error {
  margin: 0;
  padding: 14px 8px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}
.detail-video-wrap.detail-video-failed .detail-video-error { display: block; }
.detail-video-wrap:not(.detail-video-failed) .detail-video-error { display: none; }

.detail-product-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-products-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--label-2);
  letter-spacing: 0.2px;
  margin-bottom: 4px;
}

.detail-product {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 0.5px solid var(--separator);
}

.detail-product.detail-product-no-img { grid-template-columns: minmax(0, 1fr); }

.detail-product-img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 0.5px solid var(--separator);
  cursor: zoom-in;
}

.detail-product-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-product-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--label);
}

.detail-product-meta {
  font-size: 12px;
  font-weight: 500;
  color: var(--brand);
  font-family: var(--font-mono);
}

.detail-product-intro {
  margin: 4px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--label);
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-product-intro-toggle {
  display: none;
  align-self: flex-start;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.detail-product-intro-toggle:hover,
.detail-product-intro-toggle:focus-visible {
  text-decoration: underline;
  outline: none;
}

.detail-product-body.has-overflow .detail-product-intro-toggle { display: inline-block; }
.detail-product-body.is-expanded .detail-product-intro {
  -webkit-line-clamp: unset;
  display: block;
  overflow: visible;
}

.detail-actions {
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 0.5px solid var(--separator);
  background: var(--surface);
}

.detail-actions .primary {
  flex: 1;
  height: 52px;
  font-size: 16px;
}

/* =================================================================
   9. 导出弹窗（路线图片）
   ================================================================= */

.export-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: end center;
  padding: 0;
  background: var(--scrim);
  animation: scrim-in 260ms var(--ease-smooth);
}

.export-sheet[hidden] { display: none; }

.export-card {
  width: min(720px, 100%);
  max-height: min(88dvh, 760px);
  display: grid;
  gap: 12px;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-sheet);
  animation: sheet-up 380ms var(--ease-smooth);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  will-change: transform;
}

.export-card::before {
  content: "";
  margin: 8px auto 0;
  width: 36px;
  height: 5px;
  border-radius: 999px;
  background: var(--separator-strong);
}

.export-header {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.export-header strong { font-size: 17px; font-weight: 600; }

.export-close {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-pill);
  font: inherit;
  font-weight: 500;
  font-size: 13px;
  color: var(--label);
  background: var(--fill-1);
  cursor: pointer;
  transition: background 160ms var(--ease-smooth),
              transform 100ms var(--ease-smooth);
}
.export-close:hover { background: var(--fill-2); }
.export-close:active { background: var(--fill-3); transform: scale(0.96); }

.export-image {
  width: 100%;
  max-height: 56dvh;
  object-fit: contain;
  border: 0.5px solid var(--separator);
  border-radius: var(--r-md);
  background: var(--surface);
  user-select: auto;
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
}

.export-hint {
  margin: 0;
  color: var(--label-3);
  font-size: 13px;
  line-height: 1.5;
}

.export-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.export-actions button,
.export-actions a {
  flex: 1;
  height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-md);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  color: var(--label);
  background: var(--fill-1);
  text-decoration: none;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: background 160ms var(--ease-smooth),
              transform 100ms var(--ease-smooth);
}
.export-actions button:active,
.export-actions a:active {
  background: var(--fill-2);
  transform: scale(0.97);
}

.export-actions button:first-child {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 6px 16px rgba(10, 132, 255, 0.22);
}
.export-actions button:first-child:active {
  background: var(--brand-pressed);
}

/* =================================================================
   10. 无障碍：减弱动效
   ================================================================= */

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

/* =================================================================
   11. 移动端断点
   ================================================================= */

@media (max-width: 680px) {
  body {
    align-items: flex-start;
    padding: 12px 12px 60dvh;
  }

  .map-shell {
    width: 100%;
    height: auto;
    aspect-ratio: var(--paper-w) / var(--paper-h);
  }

  .map-viewport {
    width: 100%;
    height: 48dvh;
    min-height: 280px;
    aspect-ratio: auto;
    border-radius: var(--r-lg);
  }

  .map-controls { right: 8px; top: 50%; }

  .bottom-panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    max-height: 66dvh;
    transform: none;
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    padding: 8px 16px calc(14px + env(safe-area-inset-bottom));
  }

  /* 移动端面板顶部 drag handle */
  .bottom-panel::before {
    content: "";
    display: block;
    margin: 0 auto 8px;
    width: 40px;
    height: 5px;
    border-radius: 999px;
    background: var(--separator-strong);
    flex: 0 0 auto;
    transition: background 200ms var(--ease-smooth),
                transform 200ms var(--ease-smooth);
  }
  .bottom-panel.is-dragging::before,
  .bottom-panel:active::before {
    background: var(--label-3);
    transform: scaleX(1.18);
  }

  .phase-footer {
    bottom: calc(-14px - env(safe-area-inset-bottom));
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .app-title { font-size: 20px; }
  .app-lead { font-size: 13px; }

  .chip { height: 30px; font-size: 12.5px; padding: 0 11px; }

  .detail-card { max-height: 92dvh; }
  .image-viewer-close { width: 40px; height: 40px; right: 12px; }
}

/* 超小屏（iPhone SE / 小米 Mini 等） */
@media (max-width: 380px) {
  body { padding-left: 8px; padding-right: 8px; }
  .ask-examples { gap: 5px; }
  .chip { font-size: 12px; padding: 0 9px; }
  .review-item { grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: 10px; padding: 10px; }
  .review-name { font-size: 14px; }
}

/* =================================================================
   12. 打印
   ================================================================= */

@media print {
  body { padding: 0; background: #fff; }
  .map-viewport { width: 100vw; box-shadow: none; border: 0; }
  .bottom-panel, .map-controls, .export-sheet,
  .detail-sheet, .lang-toggle { display: none; }
}
