/* ============================================================
   第二批派生页样式 · 全部复用 tokens.css 令牌，不另起配色/字号
   ============================================================ */

/* ---------- 通用分组与列表行 ---------- */
.p2-group {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 10px 12px;
  margin: 8px 12px;
}
.p2-group-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: var(--sp-2);
}
.p2-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: 7px 0;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.p2-row:last-child { border-bottom: none; }
.p2-row-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  background: var(--green-100);
  color: var(--green-800);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.p2-row-icon .icon { width: 20px; height: 20px; }
.p2-row-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.p2-row-title { font-size: var(--fs-md); color: var(--ink-900); font-weight: 600; }
.p2-row-title.is-danger { color: #C0392B; }
.p2-row-desc { font-size: var(--fs-xs); color: var(--ink-500); }
.p2-row-right { display: flex; align-items: center; color: var(--ink-300); }
.p2-chevron { width: 16px; height: 16px; }

/* 空状态 */
.p2-empty {
  margin: var(--sp-6) var(--sp-3);
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: var(--sp-6) var(--sp-4);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  text-align: center;
}
.p2-empty-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--green-100); color: var(--green-800);
  display: flex; align-items: center; justify-content: center;
}
.p2-empty-icon .icon { width: 28px; height: 28px; }
.p2-empty-title { font-size: var(--fs-lg); }
.p2-empty-desc { font-size: var(--fs-sm); color: var(--ink-500); margin-bottom: var(--sp-2); }

/* ---------- AI 咨询 ---------- */
.page--ai { display: flex; flex-direction: column; min-height: 100vh; padding-bottom: 120px; }
.ai-banner { width: 100%; height: 180px; overflow: hidden; }
.ai-banner img { width: 100%; height: 100%; object-fit: cover; }
.chat-list {
  flex: 1;
  padding: var(--sp-3);
  display: flex; flex-direction: column; gap: 10px;
}
.chat-row { display: flex; gap: 8px; align-items: flex-start; }
.chat-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-100); color: var(--green-800);
}
.chat-avatar .icon { width: 18px; height: 18px; }
.chat--user .chat-avatar { background: var(--orange-100); color: var(--orange-600); }
.chat-bubble {
  max-width: 72%;
  padding: 10px var(--sp-3);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--ink-900);
  font-size: var(--fs-md);
  line-height: 1.5;
}
.chat-bubble p { white-space: pre-wrap; }
.chat-chips {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  padding: 0 var(--sp-3) var(--sp-2);
}
.chip {
  flex: none;
  padding: 6px var(--sp-3);
  border-radius: 999px;
  background: var(--green-100); color: var(--green-800);
  font-size: var(--fs-xs);
}
.chat-dock {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--container-w);
  background: var(--card);
  padding: var(--sp-2) var(--sp-3) calc(var(--sp-2) + env(safe-area-inset-bottom));
  z-index: 30;
}
.chat-disclaimer { font-size: var(--fs-xs); color: var(--ink-500); text-align: center; margin-bottom: 6px; }
.chat-bar { display: flex; gap: var(--sp-2); }
.chat-input {
  flex: 1; min-width: 0; height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0 var(--sp-3);
  font-size: var(--fs-md);
  font-family: var(--font-stack);
  background: var(--green-50);
}
.chat-send { flex: none; height: 40px; padding: 0 var(--sp-4); }

/* ---------- 商城 ---------- */
.mall-cats {
  display: flex; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
}
.mall-cat {
  padding: 6px var(--sp-3);
  border-radius: 999px;
  background: var(--card);
  font-size: var(--fs-sm); color: var(--ink-700);
}
.mall-cat.is-active { background: var(--green-800); color: #fff; }
.mall-grid { padding: 0 var(--sp-3); }

/* ---------- 我的 ---------- */
.me-hero {
  position: relative;
  background: linear-gradient(165deg, var(--green-900), var(--green-700));
  padding: 12px 12px 14px;
}
.me-user { display: flex; align-items: center; gap: var(--sp-3); margin-top: 4px; }
.me-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.me-avatar .icon { width: 32px; height: 32px; color: #fff; }
.me-user-info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.me-name-row { display: flex; align-items: center; gap: var(--sp-2); }
.me-name { font-size: var(--fs-xl); font-weight: 700; color: #fff; }
.me-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); color: #fff;
  background: rgba(255,255,255,0.18);
  padding: 3px var(--sp-2); border-radius: var(--r-sm);
  align-self: flex-start;
}
.me-tag-icon { width: 13px; height: 13px; }
.me-stats { display: flex; margin-top: 12px; }
.me-stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.me-stat-num { font-size: var(--fs-lg); font-weight: 700; color: #fff; }
.me-stat-label { font-size: var(--fs-xs); color: rgba(255,255,255,0.85); }

.me-agent-card {
  display: flex; align-items: center; gap: var(--sp-3);
}
.me-agent-icon {
  width: 40px; height: 40px; border-radius: var(--r-md); flex: none;
  background: var(--green-100); color: var(--green-800);
  display: flex; align-items: center; justify-content: center;
}
.me-agent-icon .icon { width: 22px; height: 22px; }
.me-agent-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.me-agent-title { font-size: var(--fs-md); font-weight: 700; }
.me-agent-desc { font-size: var(--fs-xs); color: var(--ink-500); }
.me-agent-btn { flex: none; font-size: var(--fs-xs); padding: 7px var(--sp-3); }

/* ---------- 代理招商 ---------- */
.recruit-hero {
  margin: var(--sp-3);
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, #EAF4EE 0%, #DCEFE4 100%);
  display: flex; overflow: hidden; min-height: 158px;
}
.recruit-hero-main {
  flex: 1; min-width: 0; padding: var(--sp-4) var(--sp-3);
  display: flex; flex-direction: column; gap: var(--sp-2);
}
.recruit-title { font-size: var(--fs-xl); font-weight: 800; color: var(--green-900); line-height: 1.25; }
.recruit-sub { font-size: var(--fs-sm); color: var(--ink-700); }
.recruit-hero-btn { margin-top: auto; align-self: flex-start; }
.recruit-hero-img { width: 44%; flex: none; }
.recruit-hero-img img { width: 100%; height: 100%; object-fit: cover; }

.recruit-benefit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.recruit-benefit {
  background: var(--blue-100); border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-2); display: flex; flex-direction: column; gap: 4px;
  text-align: left; min-width: 0;
}
.recruit-benefit:nth-child(2) { background: var(--green-100); }
.recruit-benefit-title { font-size: var(--fs-sm); font-weight: 700; }
.recruit-benefit-desc { font-size: var(--fs-xs); color: var(--ink-500); line-height: 1.4; }

.recruit-level-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.recruit-level-card {
  background: var(--green-50); border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-2); display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center; min-width: 0;
}
.recruit-level-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--orange-100); color: var(--orange-600);
  display: flex; align-items: center; justify-content: center; margin-bottom: 2px;
}
.recruit-level-icon .icon { width: 20px; height: 20px; }
.recruit-level-name { font-size: var(--fs-sm); font-weight: 700; }
.recruit-level-desc { font-size: var(--fs-xs); color: var(--ink-500); line-height: 1.4; }
.recruit-cta-btn {
  background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
  box-shadow: var(--shadow-btn);
}
.recruit-cta { padding: var(--sp-3); }

/* ---------- 科普列表 / 详情 ---------- */
.science-list {
  display: flex; flex-direction: column; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
}
.science-detail {
  margin: var(--sp-3); background: var(--card);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: var(--sp-3);
}
.science-detail-title { font-size: var(--fs-xl); margin-bottom: var(--sp-1); }
.science-detail-desc { font-size: var(--fs-sm); color: var(--ink-500); margin-bottom: var(--sp-2); }
.science-detail-art {
  width: 100%; height: 150px; border-radius: var(--r-md); overflow: hidden; margin-bottom: var(--sp-2);
}
.science-detail-art img { width: 100%; height: 100%; object-fit: cover; }
.science-detail-body { font-size: var(--fs-md); line-height: 1.7; color: var(--ink-700); }

/* ---------- 积分 ---------- */
.points-balance {
  margin: var(--sp-3); padding: var(--sp-4) var(--sp-3);
  background: linear-gradient(165deg, var(--green-900), var(--green-700));
  border-radius: var(--r-lg); color: #fff; text-align: center;
}
.points-balance-label { font-size: var(--fs-sm); opacity: 0.85; }
.points-balance-num { font-size: 30px; font-weight: 700; margin: 4px 0; }
.points-balance-links { display: flex; justify-content: center; gap: var(--sp-4); }
.points-balance-links button { font-size: var(--fs-sm); color: #fff; text-decoration: underline; }
.points-history { padding: 0 var(--sp-3); }
.history-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: var(--r-md);
  padding: var(--sp-3); margin-bottom: var(--sp-2); box-shadow: var(--shadow-card);
}
.history-title { font-size: var(--fs-md); }
.history-time { font-size: var(--fs-xs); color: var(--ink-500); }
.history-points { font-weight: 700; color: var(--green-800); }
.history-points.is-expense { color: var(--orange-600); }
.exchange-balance { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); }
.exchange-list { display: flex; flex-direction: column; gap: var(--sp-2); padding: 0 var(--sp-3); }
.exchange-card {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  padding: var(--sp-2);
}
.exchange-img {
  width: 64px; height: 64px; border-radius: var(--r-md); overflow: hidden; flex: none;
}
.exchange-img img { width: 100%; height: 100%; object-fit: cover; }
.exchange-info { flex: 1; min-width: 0; }
.exchange-name { font-size: var(--fs-md); }
.exchange-spec { font-size: var(--fs-xs); color: var(--ink-500); margin: 2px 0; }
.exchange-cost { font-size: var(--fs-sm); color: var(--orange-600); font-weight: 700; }

/* ---------- 订单 ---------- */
.order-list { display: flex; flex-direction: column; gap: var(--sp-2); padding: 0 var(--sp-3); }
.order-card {
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  padding: var(--sp-3);
}
.order-card-head { display: flex; justify-content: space-between; margin-bottom: var(--sp-2); }
.order-id { font-size: var(--fs-xs); color: var(--ink-500); }
.order-status { font-size: var(--fs-xs); font-weight: 600; }
.order-status.is-wait { color: var(--orange-600); }
.order-status.is-done { color: var(--green-800); }
.order-item {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-1) 0; font-size: var(--fs-sm);
}
.order-item-name { flex: 1; }
.order-item-spec { color: var(--ink-500); font-size: var(--fs-xs); }
.order-item-price { color: var(--ink-900); }
.order-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--line);
}
.order-time { font-size: var(--fs-xs); color: var(--ink-500); }
.order-total { font-size: var(--fs-sm); }
.order-total b { color: var(--orange-600); }

/* ---------- 地址 ---------- */
.address-list { display: flex; flex-direction: column; gap: var(--sp-2); padding: 0 var(--sp-3); }
.address-card {
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: var(--sp-3);
}
.address-row { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-1); }
.address-name { font-weight: 600; font-size: var(--fs-md); }
.address-phone { color: var(--ink-500); font-size: var(--fs-sm); }
.address-default {
  font-size: var(--fs-xs); color: var(--green-800);
  background: var(--green-100); padding: 1px var(--sp-2); border-radius: var(--r-sm);
}
.address-detail { font-size: var(--fs-sm); color: var(--ink-700); }
.address-ops { display: flex; gap: var(--sp-4); margin-top: var(--sp-2); }
.address-ops button { font-size: var(--fs-sm); color: var(--ink-500); }
.op-icon { width: 14px; height: 14px; }

/* ---------- 客服 ---------- */
.service-card {
  margin: var(--sp-3); background: var(--card); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); padding: var(--sp-4);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-1);
}
.service-big-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--green-100); color: var(--green-800);
  display: flex; align-items: center; justify-content: center;
}
.service-big-icon .icon { width: 28px; height: 28px; }
.service-card-title { font-size: var(--fs-lg); }
.service-card-desc { font-size: var(--fs-sm); color: var(--ink-500); margin-bottom: var(--sp-2); }
.faq-row { padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); }
.faq-row:last-child { border-bottom: none; }
.faq-q { font-size: var(--fs-md); font-weight: 600; margin-bottom: 2px; }
.faq-a { font-size: var(--fs-sm); color: var(--ink-500); }

/* ---------- 设置 ---------- */
.switch {
  width: 44px; height: 24px; border-radius: 999px;
  background: var(--line); position: relative; transition: background 0.2s; flex: none;
}
.switch.is-on { background: var(--green-800); }
.switch-dot {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  transition: left 0.2s;
}
.switch.is-on .switch-dot { left: 23px; }
.setting-logout { padding: var(--sp-3); }
.btn--ghost {
  background: var(--card); color: #C0392B; border: 1px solid var(--line);
}

/* ---------- 消息 ---------- */
.message-list { display: flex; flex-direction: column; padding: 0 var(--sp-3); }
.message-row {
  display: flex; gap: var(--sp-2); align-items: flex-start;
  background: var(--card); border-radius: var(--r-md);
  padding: var(--sp-3); margin-bottom: var(--sp-2);
}
.message-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange-500); margin-top: 7px; flex: none; }
.message-dot.is-read { background: var(--line); }
.message-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.message-title { font-size: var(--fs-md); font-weight: 600; }
.message-desc { font-size: var(--fs-sm); color: var(--ink-500); }
.message-time { font-size: var(--fs-xs); color: var(--ink-300); }

/* ---------- 隐私 / 关于 ---------- */
.privacy-note { padding: var(--sp-3); font-size: var(--fs-xs); color: var(--ink-500); line-height: 1.6; }
.about-head {
  margin: var(--sp-3); padding: var(--sp-4);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); text-align: center;
}
.about-logo {
  width: 64px; height: 64px; border-radius: var(--r-xl);
  background: var(--green-100); color: var(--green-800);
  display: flex; align-items: center; justify-content: center;
}
.about-logo .icon { width: 34px; height: 34px; }
.about-name { font-size: var(--fs-xl); font-weight: 700; }
.about-slogan { font-size: var(--fs-sm); color: var(--ink-500); }
.about-version { font-size: var(--fs-xs); color: var(--ink-300); }
.about-intro { font-size: var(--fs-sm); line-height: 1.7; color: var(--ink-700); }

/* ---------- 代理中心 ---------- */
.agent-stats {
  display: flex; margin: var(--sp-3);
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  padding: var(--sp-3);
}
.agent-stat { flex: 1; text-align: center; }
.agent-stat-num { font-size: var(--fs-xl); font-weight: 700; color: var(--green-800); }
.agent-stat-label { font-size: var(--fs-xs); color: var(--ink-500); }

/* ---------- 代理申请 ---------- */
.apply-form { display: flex; flex-direction: column; gap: var(--sp-3); }
.apply-field { display: flex; flex-direction: column; gap: var(--sp-1); }
.apply-field span { font-size: var(--fs-sm); color: var(--ink-700); }
.apply-field input, .apply-field textarea {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--green-50); padding: 10px var(--sp-3);
  font-size: var(--fs-md); font-family: var(--font-stack); resize: none;
}

/* ---------- 底部固定操作条 ---------- */
.cart-bar { padding: var(--sp-3); }
