/* ============================================================
   base.css —— 全局变量 / 重置 / 骨架 / 底部导航 / Toast
   设计宽度 375px，容器最大 480px，适配 320 ~ 480
   ============================================================ */

:root {
  --brand: #1f8cf0;
  --brand-deep: #0a6ed4;
  --brand-soft: #e9f4ff;
  --orange: #ff8a2b;
  --red: #ff4d4f;
  --green: #1fb87a;
  --text: #151d2b;
  --sub: #717d8f;
  --weak: #a3adbd;
  --line: #eaeff6;
  --page: #f3f6fa;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 6px 18px rgba(20, 45, 80, .06);
  --tab-h: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: #e2e8f1;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; border: 0; background: none; padding: 0; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ---------- 页面容器 ---------- */
.app {
  position: relative;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--page);
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  overflow: hidden;
}

/* ---------- 通用工具 ---------- */
.clamp-1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide { display: none !important; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: stretch;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 6px 0 calc(4px + env(safe-area-inset-bottom));
  box-shadow: 0 -3px 14px rgba(20, 45, 80, .05);
  z-index: 60;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px 0;
  color: #8c97a8;
  font-size: 11px;
  line-height: 1.2;
}

.tab-icon { position: relative; display: flex; }
.tab-icon svg { width: 23px; height: 23px; }

.tab-item.is-active { color: var(--brand); }
.tab-item.is-active .tab-name { font-weight: 600; }

.tab-badge {
  position: absolute;
  top: -5px;
  left: 14px;
  padding: 0 4px;
  height: 14px;
  line-height: 14px;
  font-size: 9px;
  color: #fff;
  background: var(--red);
  border-radius: 7px 7px 7px 2px;
  white-space: nowrap;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 8px);
  max-width: 76%;
  padding: 9px 16px;
  font-size: 13px;
  line-height: 1.4;
  color: #fff;
  text-align: center;
  background: rgba(22, 31, 45, .88);
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 999;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 子页面通用头部 ---------- */
.page-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px;
  padding-top: env(safe-area-inset-top);
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 30;
}
.back-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; color: #2a3444; }
.back-btn svg { width: 20px; height: 20px; }
.page-title { font-size: 16px; font-weight: 600; letter-spacing: .3px; }
.page-head .head-slot { margin-left: auto; font-size: 12px; color: var(--weak); }
