/* ============================================================
   聪策略 · components.css — 全站统一组件库（新标准 · 根路径）
   v2026-07-12  与 /theme.css 配套，提供所有页面共用的"外壳"
   组件：顶部导航 / 移动抽屉 / 移动端 tabbar / 页脚 / 按钮 /
   表单输入 / 认证弹窗 / 个人中心 / 图标按钮 / 文字链接。
   模块专属样式（.bs-*）仍由各页面内联 <style> 负责。
   ============================================================ */

/* ─────────────────────────────────────────────
   一、顶部导航（header）
   ───────────────────────────────────────────── */
header#top {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  background: rgba(254, 250, 246, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}
.logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}
.logo-icon { width: 32px; height: 32px; border-radius: 8px; display: block; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--accent); background: var(--accent-soft); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-auth { display: flex; align-items: center; gap: 8px; }
.nav-login-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--body);
  transition: border-color .15s, color .15s;
}
.nav-login-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-signup-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--body);
  transition: background .15s;
}
.nav-signup-btn:hover { background: var(--accent-hover); }
.nav-user-btn {
  display: none;                 /* 登录后由 auth.js 显示 */
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 16px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-family: var(--body);
  transition: background .15s;
}
.nav-user-btn:hover { background: var(--accent-soft); }

/* 汉堡按钮（移动端） */
.nav-burger {
  display: none;
  width: 40px; height: 40px;
  border: none; background: none; cursor: pointer;
  flex-direction: column; gap: 5px;
  align-items: center; justify-content: center;
  padding: 0;
}
.nav-burger span {
  display: block; width: 20px; height: 2px;
  background: var(--ink); border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动抽屉 */
.nav-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.42);
  z-index: 200;
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s;
  backdrop-filter: blur(2px);
}
.nav-overlay.open { opacity: 1; visibility: visible; }
.nav-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(82vw, 320px);
  background: var(--surface);
  z-index: 201;
  padding: 76px 20px 28px;
  display: flex; flex-direction: column; gap: 4px;
  transform: translateX(100%);
  transition: transform .28s ease;
  overflow-y: auto;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
}
.nav-drawer.open { transform: translateX(0); }
.nav-drawer a {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-drawer a:hover { background: var(--accent-soft); color: var(--accent); }
.drawer-divider { height: 1px; background: var(--border-light); margin: 8px 4px; }
.drawer-cta { font-weight: 700 !important; color: var(--accent) !important; }

/* ─────────────────────────────────────────────
   二、移动端底部 tabbar
   ───────────────────────────────────────────── */
.mobile-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 150;
  display: none;                 /* 移动端显示 */
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.mobile-tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex: 1; font-size: 11px; color: var(--muted);
  text-decoration: none; line-height: 1.2;
}
.mobile-tabbar .ic { font-size: 20px; line-height: 1; }
.mobile-tabbar a:hover { color: var(--accent); }
.mobile-tabbar a.active { color: var(--accent); }

/* ─────────────────────────────────────────────
   三、页脚
   ───────────────────────────────────────────── */
footer {
  background: var(--warm-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 48px 0 28px;
  font-size: 14px;
  margin-top: 64px;
}
.footer-grid {
  display: flex; justify-content: space-between;
  gap: 32px; flex-wrap: wrap;
}
.footer-brand { font-family: var(--display); font-size: 20px; font-weight: 700; color: #fff; }
.footer-desc { color: rgba(255, 255, 255, 0.6); margin-top: 12px; line-height: 1.7; max-width: 32ch; }
.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col h5 { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 12px; }
.footer-col a { display: block; color: rgba(255, 255, 255, 0.62); padding: 4px 0; font-size: 14px; text-decoration: none; transition: color .2s; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 32px; padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.45); font-size: 13px;
}
.footer-bottom a { color: rgba(255, 255, 255, 0.6); text-decoration: none; }
.footer-bottom a:hover { color: #fff; }

/* ─────────────────────────────────────────────
   四、按钮扩展（与 theme.css 的 .btn 体系协同）
   ───────────────────────────────────────────── */
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(232, 101, 45, 0.25); }

/* ─────────────────────────────────────────────
   五、表单输入基座
   （模块内 .input / .select；认证弹窗裸 input；个人中心 .user-input）
   ───────────────────────────────────────────── */
.input,
.input-num,
.user-input,
.select,
.modal-field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--body);
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus,
.input-num:focus,
.user-input:focus,
.select:focus,
.modal-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input-num { text-align: right; font-variant-numeric: tabular-nums; }
.select {
  appearance: none; -webkit-appearance: none;
  padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%236b6560' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.pwd-field { margin-top: 10px; }
.suffix {
  position: absolute;
  right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 13px; pointer-events: none;
}

/* ─────────────────────────────────────────────
   六、认证弹窗（#authModal · .modal-box）
   ───────────────────────────────────────────── */
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  max-width: min(380px, 90vw);
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border-light); margin-bottom: 24px; }
.modal-tab {
  padding: 10px 20px; font-size: 14px; font-weight: 500;
  color: var(--ink-soft); cursor: pointer;
  border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  font-family: var(--body);
}
.modal-tab:hover { color: var(--accent); }
.modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.modal-sub { color: var(--ink-soft); font-size: 14px; text-align: center; margin-bottom: 24px; }
.modal-error {
  display: none; color: var(--red);
  background: var(--red-bg); padding: 10px 14px;
  border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px;
}
.modal-success {
  display: none; color: var(--green);
  background: var(--green-bg); padding: 10px 14px;
  border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px;
}
.modal-field { margin-bottom: 16px; }
.modal-field label { display: block; font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.modal-btn {
  width: 100%; margin-top: 8px; height: 46px; font-size: 15px;
  border: none; border-radius: var(--radius);
  background: var(--accent); color: #fff; font-weight: 600; cursor: pointer;
  font-family: var(--body); transition: background .15s, transform .15s;
}
.modal-btn:hover { background: var(--accent-hover); }
.modal-btn:active { transform: translateY(1px); }

/* ─────────────────────────────────────────────
   七、个人中心弹窗（#userModal · .user-panel）
   ───────────────────────────────────────────── */
.user-panel {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  max-width: min(380px, 90vw);
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  max-height: 90vh;
  overflow-y: auto;
}
.user-panel-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: var(--warm-surface); color: var(--ink-soft);
  cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.user-panel-close:hover { background: var(--border); color: var(--ink); }
.user-panel-header { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.user-panel-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent-bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; overflow: hidden; flex-shrink: 0;
}
.user-panel-info { display: flex; flex-direction: column; }
.user-panel-name { font-family: var(--display); font-size: 18px; font-weight: 700; color: var(--ink); }
.user-panel-phone { color: var(--muted); font-size: 13px; margin-top: 2px; }
.user-form-group { margin-bottom: 16px; }
.user-form-label { display: block; font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.user-btn-row { display: flex; gap: 12px; margin-top: 20px; }
.user-btn {
  flex: 1; height: 44px; border-radius: var(--radius-md);
  border: none; font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: var(--body); transition: background .15s, border-color .15s, color .15s;
}
.user-btn-primary { background: var(--accent); color: #fff; }
.user-btn-primary:hover { background: var(--accent-hover); }
.user-btn-secondary { background: var(--surface); border: 1.5px solid var(--border); color: var(--ink); }
.user-btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ─────────────────────────────────────────────
   八、图标按钮 / 文字链接
   ───────────────────────────────────────────── */
.icon-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: none; background: var(--warm-surface); color: var(--ink-soft);
  cursor: pointer; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s; flex-shrink: 0;
}
.icon-btn.ok { background: var(--green-bg); color: var(--green); }
.icon-btn.ok:hover { background: var(--green); color: #fff; }
.icon-btn.del { background: var(--red-bg); color: var(--red); }
.icon-btn.del:hover { background: var(--red); color: #fff; }
.link-accent {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; padding: 6px 0;
  color: var(--accent); font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: var(--body);
  transition: opacity .15s;
}
.link-accent:hover { opacity: 0.78; }

/* ─────────────────────────────────────────────
   九、响应式
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .mobile-tabbar { display: flex; }
  body { padding-bottom: 66px; }
}
@media (max-width: 480px) {
  .nav-auth .nav-login-btn,
  .nav-auth .nav-signup-btn { padding: 8px 12px; font-size: 13px; }
}

/* ─────────────────────────────────────────────
   十、深色模式（令牌随 [data-theme="dark"] 切换）
   ───────────────────────────────────────────── */
[data-theme="dark"] header#top { background: rgba(26, 24, 23, 0.86); }

/* ─────────────────────────────────────────────
   十一、模块统一 Shell 组件（新标准 v2026-07-18）
   ───────────────────────────────────────────── */

/* 页面容器 */
.page { max-width: 1000px; margin: 0 auto; padding: 40px 22px 90px; }

/* 模块 Header */
.page > header {
  margin-bottom: 28px; padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }

/* Brand Dot（品牌色方块 + 模块图标文字） */
.brand-dot {
  width: 38px; height: 38px;
  background: linear-gradient(145deg, var(--accent), var(--accent-hover));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 19px;
  box-shadow: 0 4px 12px rgba(214, 90, 22, .28);
  flex-shrink: 0;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}
.brand-dot.red-theme { background: linear-gradient(145deg, #e5452f, #d23a24); }

/* 更新时间行 */
.updated { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* Project Switcher（统一到 components.css） */
.project-switcher { position: relative; display: inline-flex; align-items: center; user-select: none; }
.ps-trigger {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  padding: 3px 8px; margin-left: -4px; border-radius: 7px; transition: background .15s;
}
.ps-trigger:hover { background: var(--accent-bg); }
.ps-trigger .ps-chevron { width: 13px; height: 13px; color: var(--accent); transition: transform .18s; flex-shrink: 0; }
.project-switcher.open .ps-trigger .ps-chevron { transform: rotate(180deg); }
.ps-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 185px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-hover); padding: 6px; z-index: 500;
  display: none; flex-direction: column; gap: 1px;
  animation: psIn .18s ease;
}
.project-switcher.open .ps-dropdown { display: flex; }
@keyframes psIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.ps-dropdown a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink);
  font-size: 13px; font-weight: 500; transition: background .12s; min-height: 40px; white-space: nowrap;
}
.ps-dropdown a:hover { background: var(--accent-bg); }
.ps-dropdown a.current { color: var(--accent); background: var(--accent-bg); font-weight: 600; }
.ps-dropdown a.current::after {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); margin-left: 8px;
}
.ps-dropdown .ps-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Login Gate */
.login-gate {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center; padding: 80px 20px;
}
.login-gate .gate-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent-bg); display: flex; align-items: center; justify-content: center;
}
.login-gate .gate-icon svg { width: 28px; height: 28px; }
.login-gate h3 { font-family: var(--display); font-size: 18px; color: var(--ink); font-weight: 600; }
.login-gate p { font-size: 14px; color: var(--muted); max-width: 40ch; }
.gate-btn {
  display: inline-block; padding: 10px 28px; background: var(--accent); color: #fff;
  border-radius: var(--radius-md); font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; text-decoration: none; font-family: var(--body);
  transition: background .2s, box-shadow .2s;
}
.gate-btn:hover { background: var(--accent-hover); box-shadow: 0 4px 14px rgba(214, 90, 22, .28); }

/* Data Disclaimer Footer */
.data-disclaimer { text-align: center; color: var(--muted); font-size: 11px; margin-top: 36px; line-height: 1.9; }
.data-disclaimer .dot { opacity: .5; margin: 0 6px; }

/* Confirm Dialog */
.confirm-box { max-width: 340px; padding: 30px 28px 24px; text-align: center; }
.confirm-box p { font-size: 15px; color: var(--ink); margin-bottom: 22px; line-height: 1.6; }
.confirm-actions { display: flex; gap: 12px; }
.confirm-actions button {
  flex: 1; height: 42px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: var(--body); border: none; transition: background .15s;
}
.confirm-cancel { background: var(--warm-surface); color: var(--ink-soft); }
.confirm-cancel:hover { background: var(--border); }
.confirm-ok { background: var(--red); color: #fff; }
.confirm-ok:hover { background: #b82f2f; }

/* Toast Container（模块级 Toast） */
.toast-wrap {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%);
  z-index: 2000; display: flex; flex-direction: column; gap: 10px; align-items: center;
  pointer-events: none;
}
.toast {
  pointer-events: auto; background: var(--warm-dark); color: #fff;
  padding: 11px 22px; border-radius: 10px; font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 28px rgba(45, 42, 38, .22); opacity: 0;
  transform: translateY(-12px); transition: opacity .25s, transform .25s; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }
.toast.info { background: var(--warm-dark); }

/* 响应式 */
@media (max-width: 768px) {
  .page { padding: 22px 14px 80px; }
  .ps-dropdown { left: 0; right: auto; width: auto; min-width: auto; }
  header > div { flex-wrap: wrap; gap: 10px; }
  .nav-auth { margin-left: auto; }
}
@media (max-width: 480px) {
  .page { padding: 28px 14px 72px; }
}

/* ═══ 微信扫码登录 ═══ */
.wechat-tab-content {
    text-align: center;
    padding: 10px 0 0;
}
.wechat-qrcode-wrap {
    display: inline-block;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    margin-bottom: 16px;
    line-height: 0;
}
.wechat-qrcode-wrap img {
    display: block;
}
.wechat-qrcode-tip {
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 8px;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   Mobile Optimization v2026-07-15
   ═══════════════════════════════════════════════════════════ */

/* 极小屏弹窗（320-380px） */
@media (max-width: 380px) {
  .modal-box { padding: 24px 16px; }
  .user-panel { padding: 24px 16px; }
  .modal-tabs { gap: 2px; }
  .modal-tab { padding: 8px 14px; font-size: 13px; }
  .modal-btn { height: 42px; font-size: 14px; }
}

/* 页面底部间距 — 无 tabbar 页面减少留白 */
.page {
  padding: 40px 22px 90px;
}
body.no-tabbar .page {
  padding-bottom: 40px;
}
@media (max-width: 768px) {
  .page { padding: 22px 14px 80px; }
  body.no-tabbar .page { padding-bottom: 32px; }
}
@media (max-width: 480px) {
  .page { padding: 28px 14px 72px; }
  body.no-tabbar .page { padding-bottom: 28px; }
}

/* 移动端 tabbar 触摸目标 */
.mobile-tabbar a {
  min-height: 48px;
  padding-top: 4px;
}

/* 登录门 */
@media (max-width: 480px) {
  .login-gate { padding: 60px 16px; }
  .login-gate h3 { font-size: 16px; }
}

/* 项目切换器下拉 */
@media (max-width: 480px) {
  .ps-dropdown {
    left: -10px;
    min-width: 200px;
  }
}

/* 微信扫码 */
@media (max-width: 480px) {
  .wechat-qrcode-wrap img {
    width: 180px;
    height: 180px;
  }
}

/* 确认弹窗 */
@media (max-width: 380px) {
  .confirm-box { padding: 24px 20px; }
  .confirm-box p { font-size: 14px; }
  .confirm-actions { flex-direction: column; gap: 8px; }
}
