/* 导览系统 · 设计令牌
   文旅暖色：陶土赭橙 + 宣纸米白 + 墨褐，取自原系统 #F2A73D 金 / #F6695B 珊瑚一系 */
:root {
  --brand-900: #5a2e1b;
  --brand-800: #7a3e23;
  --brand-700: #9a532c;
  --brand-600: #b5653a;
  --brand-500: #c2703c;
  --brand-400: #d99560;
  --brand-300: #ebbe94;
  --brand-100: #fbeee1;
  --brand-50: #fef8f1;

  --gold-600: #a8762c;
  --gold-500: #d6a24a;
  --gold-300: #ebcb8c;
  --gold-100: #fbf1dc;

  --coral: #e0765f;
  --coral-soft: #fff1eb;
  --blue: #5b7e9e;
  --blue-soft: #edf3f8;

  --ink-900: #2b211b;
  --ink-800: #3b2f27;
  --ink-700: #57473c;
  --ink-600: #7a685b;
  --ink-500: #9c8b7d;
  --ink-400: #bcaea1;
  --ink-300: #dcd2c7;
  --ink-200: #ebe3d9;
  --ink-100: #f5f0e9;
  --page: #faf7f2;
  --white: #ffffff;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-xs: 0 1px 3px rgba(90, 46, 27, .06);
  --shadow-sm: 0 4px 16px rgba(90, 46, 27, .08);
  --shadow: 0 10px 32px rgba(90, 46, 27, .11);
  --shadow-lg: 0 22px 60px rgba(90, 46, 27, .18);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  /* 固定 0px：部分 WebView / 无头内核里 env(safe-area-inset-*) 会解析成无效值，
     使所有 calc(64px + var(--safe-top)) 整条失效，导致地图顶部栏与分类条重叠。
     这里保持确定的长度值，安全区由浏览器自身的 viewport-fit 处理。 */
  --safe-bottom: 0px;
  --safe-top: 0px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* 手机端禁止出现横向滚动条；clip 不会创建滚动容器，可保留 topbar 的 sticky 效果 */
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink-900);
  background: var(--page);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, p { margin: 0; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

.icon { display: inline-block; vertical-align: middle; flex: none; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hidden { display: none !important; }
.flex { display: flex; }
.between { display: flex; align-items: center; justify-content: space-between; }
.center { display: flex; align-items: center; justify-content: center; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-500); }
.small { font-size: 12px; }

/* 通用按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  background: var(--brand-600); color: #fff; font-size: 14px; font-weight: 600;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-700); box-shadow: var(--shadow-sm); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }
.btn.ghost:hover { background: var(--brand-100); }
.btn.line { background: transparent; color: var(--ink-700); border: 1px solid var(--ink-200); }
.btn.line:hover { border-color: var(--brand-400); color: var(--brand-700); }
.btn.danger { background: #e0584a; }
.btn.sm { height: 32px; padding: 0 13px; font-size: 12.5px; }
.btn.lg { height: 48px; padding: 0 26px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-700); }
.field .hint { font-size: 11.5px; color: var(--ink-500); }
.input, .textarea, .select {
  width: 100%; min-height: 40px; padding: 9px 12px;
  border: 1px solid var(--ink-200); border-radius: var(--radius-sm);
  background: #fff; outline: none; transition: border-color .18s, box-shadow .18s;
  font-size: 14px;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(18, 160, 140, .12);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235d736f' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* 卡片 */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: var(--brand-50); color: var(--brand-700); }
.badge.gold { background: var(--gold-100); color: var(--gold-600); }
.badge.coral { background: var(--coral-soft); color: var(--coral); }
.badge.gray { background: var(--ink-100); color: var(--ink-600); }

/* 空态 / 骨架 */
.empty { padding: 56px 20px; text-align: center; color: var(--ink-500); }
.empty .icon { color: var(--ink-300); margin-bottom: 10px; }
.empty p { font-size: 13px; }
.skeleton { background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-200) 50%, var(--ink-100) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Toast */
.toast-layer { position: fixed; z-index: 9999; left: 50%; top: 76px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: rgba(22, 39, 36, .93); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; box-shadow: var(--shadow); animation: toastIn .22s ease; max-width: 82vw; }
.toast.error { background: #c9483d; }
.toast.success { background: var(--brand-700); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* 全局加载 */
.global-loading { position: fixed; inset: 0; z-index: 950; display: grid; place-items: center;
  background: rgba(255,255,255,.45); backdrop-filter: blur(2px); }
.global-loading-box { display: flex; align-items: center; gap: 10px; padding: 12px 20px;
  background: rgba(22,39,36,.9); color: #fff; border-radius: 999px; font-size: 13px; box-shadow: var(--shadow); }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 手机端底部弹层 */
.bottom-sheet { position: fixed; z-index: 901; left: 0; right: 0; bottom: 0; max-height: 84vh;
  overflow-y: auto; background: #fff; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg); transform: translateY(100%); transition: transform .28s cubic-bezier(.22,.8,.3,1);
  padding-bottom: calc(16px + var(--safe-bottom)); }
.bottom-sheet.show { transform: none; }
.bottom-sheet::before { content: ''; display: block; width: 38px; height: 4px; border-radius: 4px;
  background: var(--ink-300); margin: 10px auto 4px; }

/* 遮罩层 / 弹窗 / 抽屉 */
.mask { position: fixed; inset: 0; background: rgba(10, 26, 23, .48); z-index: 900;
  opacity: 0; transition: opacity .24s ease; backdrop-filter: blur(2px); }
.mask.show { opacity: 1; }
.dialog { position: fixed; z-index: 901; left: 50%; top: 50%; transform: translate(-50%, -48%) scale(.97);
  width: min(420px, calc(100vw - 32px)); background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); opacity: 0; transition: all .24s ease; overflow: hidden; }
.dialog.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.dialog-head { padding: 20px 22px 0; font-size: 16px; font-weight: 700; }
.dialog-body { padding: 14px 22px 20px; color: var(--ink-600); font-size: 13.5px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 20px; }

.drawer-mask { position: fixed; inset: 0; background: rgba(10, 26, 23, .42); z-index: 900; opacity: 0; transition: opacity .25s; }
.drawer-mask.show { opacity: 1; }
.drawer { position: fixed; z-index: 901; right: 0; top: 0; bottom: 0; width: min(640px, 100vw);
  background: var(--page); box-shadow: var(--shadow-lg); transform: translateX(100%);
  transition: transform .28s cubic-bezier(.22,.8,.3,1); display: flex; flex-direction: column; }
.drawer.show { transform: none; }
.drawer-head { flex: none; padding: 18px 22px; background: #fff; border-bottom: 1px solid var(--ink-200);
  display: flex; align-items: center; justify-content: space-between; }
.drawer-head h3 { font-size: 16px; font-weight: 700; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
.drawer-foot { flex: none; padding: 14px 22px; background: #fff; border-top: 1px solid var(--ink-200);
  display: flex; justify-content: flex-end; gap: 10px; }
.drawer-close { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-500); }
.drawer-close:hover { background: var(--ink-100); color: var(--ink-900); }

/* 上传控件 */
.uploader { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.upload-box { width: 108px; height: 108px; border: 1.5px dashed var(--ink-300); border-radius: var(--radius-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--ink-500); font-size: 11.5px; background: #fff; cursor: pointer; overflow: hidden; position: relative; }
.upload-box:hover { border-color: var(--brand-500); color: var(--brand-600); background: var(--brand-50); }
.upload-box img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.upload-box .audio-file { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; text-align: center; }

/* 表格 */
.table-wrap { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-xs); }
.table-scroll { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
table.grid th { background: var(--ink-100); color: var(--ink-600); font-weight: 600; text-align: left;
  padding: 12px 14px; white-space: nowrap; font-size: 12.5px; }
table.grid td { padding: 12px 14px; border-top: 1px solid var(--ink-100); vertical-align: middle; }
table.grid tbody tr:hover { background: var(--brand-50); }
table.grid .thumb { width: 54px; height: 40px; object-fit: cover; border-radius: 8px; background: var(--ink-100); }
.row-actions { display: flex; gap: 6px; white-space: nowrap; }
.link-btn { color: var(--brand-600); font-size: 12.5px; font-weight: 600; padding: 4px 6px; border-radius: 6px; }
.link-btn:hover { background: var(--brand-50); }
.link-btn.danger { color: #d95448; }
.link-btn.danger:hover { background: #fff0ee; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 18px; font-size: 12.5px; color: var(--ink-600); }
.pager button { min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid var(--ink-200); border-radius: 8px; background: #fff; font-size: 12.5px; }
.pager button.active { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.pager button[disabled] { opacity: .45; }

/* 开关 / 复选 */
.switch { width: 42px; height: 24px; border-radius: 999px; background: var(--ink-300); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .2s; box-shadow: var(--shadow-xs); }
.switch.on { background: var(--brand-500); }
.switch.on::after { transform: translateX(18px); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--ink-200); background: #fff; font-size: 12.5px; color: var(--ink-700); white-space: nowrap; }
.chip.on { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.chip.gold.on { background: var(--gold-500); border-color: var(--gold-500); }
