:root {
  --primary: #0F5C8A;
  --primary-light: #e8f2f8;
  --accent: #e8722c;
  --accent-light: #fdf0e6;
  --danger: #d9483b;
  --success: #2e9e6b;
  --text: #1a1f26;
  --text-2: #5a6673;
  --text-3: #98a3af;
  --line: #eaeef2;
  --bg: #f4f6f8;
  --card: #ffffff;
  --radius: 12px;
  --tab-h: 52px;
  --topbar-h: 48px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body { padding-bottom: calc(var(--tab-h) + var(--safe-b)); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

.loading { padding: 60px 0; text-align: center; color: var(--text-3); font-size: 14px; }
.empty { padding: 60px 20px; text-align: center; color: var(--text-3); font-size: 14px; }
.empty::before { content: "🗺"; display: block; font-size: 34px; margin-bottom: 10px; opacity: .45; }

/* ---------- 顶部栏 ---------- */
.navbar {
  position: sticky; top: var(--topbar-h); z-index: 50;
  display: flex; align-items: center; height: 46px; padding: 0 12px;
  background: var(--primary); color: #fff;
}
.navbar .back { width: 34px; font-size: 20px; line-height: 1; }
.navbar .title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; }
.navbar .right { min-width: 34px; text-align: right; font-size: 14px; }
.navbar.plain { background: #fff; color: var(--text); border-bottom: 1px solid var(--line); }

/* ---------- 全局顶部品牌栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 80;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.topbar .logo { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; color: var(--primary); letter-spacing: .3px; }
.topbar .logo .mark {
  width: 24px; height: 24px; border-radius: 7px; flex: none;
  background: linear-gradient(135deg, #1273a8, #0F5C8A); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.topbar .logo img { height: 34px; width: auto; object-fit: contain; }
.topbar .nav-right { display: flex; align-items: center; gap: 10px; }
.topbar .login-link { font-size: 14px; color: var(--primary); font-weight: 600; }
.topbar .usr { display: flex; align-items: center; gap: 6px; max-width: 62vw; }
.topbar .usr .name { font-size: 14px; color: var(--text); max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .lvl {
  flex: none; font-size: 11px; line-height: 1; padding: 3px 7px; border-radius: 10px;
  background: var(--accent-light); color: var(--accent); font-weight: 600; white-space: nowrap;
}

/* ---------- 通用块 ---------- */
.page { min-height: 100vh; }
.wrap { padding: 12px; }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.card + .card { margin-top: 0; }
.pad { padding: 14px; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-2); font-size: 13px; }
.tiny { font-size: 12px; color: var(--text-3); }
.tiny.dep { color: #e0392b; font-weight: 600; }

/* ---------- 底部备案信息模块 ---------- */
.site-footer {
  margin-top: 18px;
  padding: 20px 16px calc(24px + var(--safe-b));
  text-align: center;
  background: #f7f9fb;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.7;
}
.site-footer .beian-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin-bottom: 8px;
}
.site-footer .beian-links a { color: var(--text-2); text-decoration: none; }
.site-footer .beian-links a:hover { color: var(--primary); }
.site-footer .copy { color: var(--text-3); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sec-title { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 10px; }
.sec-title h3 { margin: 0; font-size: 17px; }
.sec-title .more { font-size: 13px; color: var(--text-3); }

.price { color: var(--accent); font-weight: 700; }
.price small { font-size: 12px; font-weight: 500; }
.price-old { color: var(--text-3); font-size: 12px; text-decoration: line-through; margin-left: 6px; }

.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 11px; background: var(--primary-light); color: var(--primary); margin-right: 5px; }
.tag.orange { background: var(--accent-light); color: var(--accent); }
.tag.green { background: #e6f6ee; color: var(--success); }
.tag.gray { background: #eef1f5; color: var(--text-2); }

.btn { display: block; width: 100%; padding: 11px; border-radius: 22px; text-align: center; font-size: 15px; background: #eef1f5; color: var(--text-2); }
.btn.primary { background: linear-gradient(135deg, #1273a8, #0F5C8A); color: #fff; font-weight: 600; }
.btn.accent { background: linear-gradient(135deg, #f2853a, #e8722c); color: #fff; font-weight: 600; }
.btn.ghost { background: #fff; border: 1px solid var(--primary); color: var(--primary); }
.btn:active { opacity: .82; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-sm { display: inline-block; width: auto; padding: 5px 14px; font-size: 13px; border-radius: 14px; }

.fld { display: block; margin-bottom: 12px; }
.fld > span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.fld input, .fld textarea, .fld select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; outline: none;
}
.fld input:focus, .fld textarea:focus { border-color: var(--primary); }
.fld textarea { min-height: 80px; resize: vertical; }
.fld-row { display: flex; gap: 10px; }
.fld-row .fld { flex: 1; }

/* ---------- 列表 ---------- */
.list-item { display: flex; gap: 10px; padding: 12px; background: #fff; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .thumb { width: 108px; height: 76px; border-radius: 8px; object-fit: cover; background: var(--line); flex: none; }
.list-item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-item .name { font-size: 15px; font-weight: 600; line-height: 1.4; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 .gcard { background: #fff; border-radius: var(--radius); overflow: hidden; }
.grid2 .gcard img { width: 100%; height: 108px; object-fit: cover; background: var(--line); }
.grid2 .gcard .gbody { padding: 8px 10px 10px; }

/* ---------- 首页 ---------- */
.hero { position: relative; height: 190px; background: var(--line); }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .hero-txt {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.6)); color: #fff;
}
.hero .hero-txt h2 { margin: 0; font-size: 19px; }
.hero .hero-txt p { margin: 3px 0 0; font-size: 12px; opacity: .88; }

.quick { display: flex; background: #fff; padding: 14px 0 10px; }
.quick a { flex: 1; text-align: center; font-size: 12px; color: var(--text-2); }
.quick .ico { display: block; font-size: 24px; margin-bottom: 5px; }

/* ---------- 详情 ---------- */
.detail-cover { width: 100%; height: 210px; object-fit: cover; background: var(--line); }
.detail-head { background: #fff; padding: 14px; }
.detail-head h1 { margin: 0 0 6px; font-size: 19px; line-height: 1.35; }
.detail-head .sub { color: var(--text-2); font-size: 13px; }
.price-bar { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.price-bar .price { font-size: 24px; }

.facts { display: flex; background: #fff; padding: 12px 0; margin-top: 10px; }
.facts div { flex: 1; text-align: center; border-right: 1px solid var(--line); }
.facts div:last-child { border-right: 0; }
.facts b { display: block; font-size: 15px; }
.facts span { font-size: 12px; color: var(--text-3); }

.block { background: #fff; margin-top: 10px; padding: 14px; }
.block h3 { margin: 0 0 10px; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.block h3::before { content: ""; width: 3px; height: 15px; background: var(--primary); border-radius: 2px; }
.hl li { margin-bottom: 6px; color: var(--text-2); font-size: 14px; }
.hl { padding-left: 18px; margin: 0; }

.itin { border-left: 2px solid var(--primary-light); padding-left: 14px; margin-left: 4px; }
.itin .day { position: relative; margin-bottom: 14px; }
.itin .day::before {
  content: ""; position: absolute; left: -21px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--primary);
}
.itin .day h4 { margin: 0 0 4px; font-size: 15px; }
.itin .day .meta { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.itin .day .txt { font-size: 14px; color: var(--text-2); }
.itin .day .txt p { margin: 0 0 4px; }

.rich p { margin: 0 0 8px; }
.rich img { border-radius: 8px; margin: 6px 0; }

/* ---------- 底部操作条 ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px; padding: 8px 12px calc(8px + var(--safe-b));
  background: #fff; border-top: 1px solid var(--line);
}
.actionbar .info { flex: none; }
.actionbar .btns { flex: 1; display: flex; gap: 8px; }
.actionbar .btn { border-radius: 20px; padding: 9px; }

/* ---------- TabBar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: flex; height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: #fff; border-top: 1px solid var(--line);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; color: var(--text-3); }
.tabbar a .ico { font-size: 21px; line-height: 1.2; }
.tabbar a.on { color: var(--primary); font-weight: 600; }

/* ---------- 弹层/提示 ---------- */
.modal-root {
  position: fixed; inset: 0; z-index: 100; display: flex;
  align-items: flex-end; justify-content: center; background: rgba(0,0,0,.45);
}
.modal-root[hidden] { display: none; }
.sheet {
  width: 100%; max-height: 82vh; overflow-y: auto; background: #fff;
  border-radius: 16px 16px 0 0; padding: 16px 14px calc(16px + var(--safe-b));
  animation: up .22s ease;
}
@keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet h3 { margin: 0 0 12px; font-size: 17px; text-align: center; }

.toast-root { position: fixed; left: 50%; top: 42%; transform: translateX(-50%); z-index: 200; pointer-events: none; }
.toast {
  background: rgba(0,0,0,.78); color: #fff; padding: 9px 16px;
  border-radius: 18px; font-size: 14px; margin-bottom: 8px; animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

/* ---------- 表单卡片 ---------- */
.cell { display: flex; align-items: center; padding: 13px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.cell:last-child { border-bottom: 0; }
.cell .k { width: 84px; flex: none; color: var(--text-2); font-size: 14px; }
.cell .v { flex: 1; text-align: right; color: var(--text); }
.cell .v input { width: 100%; text-align: right; border: 0; outline: none; background: none; }

.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 26px; height: 26px; border-radius: 50%; background: var(--primary-light); color: var(--primary); font-size: 16px; line-height: 1; }
.stepper .n { min-width: 22px; text-align: center; }

.status-pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.st-pending { background: #fdf3e6; color: #b8791f; }
.st-paid { background: #e6f6ee; color: #2e9e6b; }
.st-canceled, .st-refunded { background: #f2f4f6; color: #98a3af; }
.st-completed { background: var(--primary-light); color: var(--primary); }
