/* ==========================================
   网赚任务平台 - 主样式 v2
   设计目标：金融级可信度（深蓝金融风）
   配色原则：
     - 主色深蓝 = 支付/金融行业信任色
     - 金色仅用于收益数字 = 传递"钱"
     - 无促销感渐变，避免"不靠谱"联想
   ========================================== */

:root {
  /* 品牌色 */
  --brand:        #0d1f3c;
  --brand-light:  #1a3a63;
  --brand-lighter:#e8eef7;

  /* 收益金 */
  --gold:         #b8860b;
  --gold-light:   #fdf6e3;

  /* 中性 */
  --bg:           #f7f8fa;
  --card:         #ffffff;
  --text:         #1f2329;
  --text-2:       #5f6672;
  --text-3:       #8f959e;
  --line:         #e5e6eb;
  --line-soft:    #f0f1f3;

  /* 语义 */
  --ok:           #00a870;
  --ok-light:     #e8f8f2;
  --warn:         #d98a00;
  --err:          #e34d59;

  --radius:  8px;
  --radius-lg: 12px;
  --shadow:  0 1px 3px rgba(13, 31, 60, .06), 0 1px 2px rgba(13, 31, 60, .04);
  --shadow-lg: 0 4px 16px rgba(13, 31, 60, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-light); }
h1, h2, h3 { margin: 0 0 12px; font-weight: 600; letter-spacing: -.01em; }

/* ---------- 顶栏 ----------
   布局原则：logo 固定宽 → nav 自适应（可省略）→ 右侧区固定，永不换行。
   之前 .nav{flex:1} 会把右侧挤到第二行，导致「钱包/按钮」折行。 */
.topbar {
  background: var(--brand);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.topbar .topbar-in {
  display: flex; align-items: center; gap: 20px;
  height: 60px; flex-wrap: nowrap;
}
.logo {
  font-size: 18px; font-weight: 600; color: #fff; letter-spacing: .5px;
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; white-space: nowrap;
}
.logo-mark {
  width: 24px; height: 24px; border-radius: 6px;
  background: linear-gradient(135deg, #d4a017, var(--gold));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #1a1300;
  flex-shrink: 0;
}

/* 导航：不设 flex:1，让它按内容宽度收缩，多余空间留给右侧 */
.nav {
  display: flex; align-items: center; gap: 1px;
  flex: 0 1 auto; min-width: 0;
  overflow: hidden;
}
/* 汉堡按钮：桌面隐藏，≤1024px 显示（见响应式区） */
.nav-toggle { display: none; }
.nav a {
  padding: 7px 12px; border-radius: 6px;
  color: rgba(255,255,255,.72); font-size: 14px; line-height: 1.4;
  white-space: nowrap; flex-shrink: 0;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.on { background: rgba(255,255,255,.14); color: #fff; font-weight: 500; }

/* 右侧聚合区：钱包 / 语言 / 账号，纵向不换行 */
.topbar-right {
  display: flex; align-items: center; gap: 14px;
  margin-left: auto; flex-shrink: 0; white-space: nowrap;
}
.userbox { display: flex; align-items: center; gap: 8px; }

/* 钱包：标签在上、数值在下，避免「Points 70 · Balance 1.00」挤成两行 */
.wallet {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px; border-radius: 8px;
  background: rgba(255,255,255,.08);
  white-space: nowrap; flex-shrink: 0;
}
.wallet-item { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.wallet-item em {
  font-style: normal; font-size: 10.5px; line-height: 1;
  color: rgba(255,255,255,.55); letter-spacing: .02em;
}
.wallet-item b {
  color: var(--gold); font-size: 14px; font-weight: 600; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.wallet-sep { width: 1px; height: 22px; background: rgba(255,255,255,.16); }

.topbar .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; white-space: nowrap; }
.topbar .btn:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.35); color: #fff; }
.topbar .btn-main { background: var(--gold); border-color: var(--gold); color: #1a1300; }
.topbar .btn-main:hover { background: #d4a017; border-color: #d4a017; color: #1a1300; }
.topbar .btn-ghost { background: transparent; border-color: rgba(255,255,255,.24); color: rgba(255,255,255,.8); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ---------- 语言下拉 ---------- */
.langsel { position: relative; flex-shrink: 0; }
.langsel-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 9px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px; cursor: pointer;
  color: rgba(255,255,255,.85); font-size: 12px; font-weight: 600;
  letter-spacing: .03em;
  transition: background .15s, border-color .15s;
}
.langsel-btn:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.3); }
.langsel-btn svg { opacity: .7; }
.langsel.open .langsel-btn { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.35); }

.langsel-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 168px; padding: 5px;
  background: #fff; border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(16,24,40,.16);
  display: none; z-index: 120;
}
.langsel.open .langsel-menu { display: block; }
.langsel-menu a {
  display: block; padding: 8px 12px; border-radius: 6px;
  font-size: 13.5px; color: var(--text-1); white-space: nowrap;
  transition: background .12s;
}
.langsel-menu a:hover { background: var(--bg-2); }
.langsel-menu a.on {
  background: var(--brand); color: #fff; font-weight: 500;
}

/* ---------- 公告 ---------- */
.notice { background: #fffbe6; border-bottom: 1px solid #ffe58f; padding: 10px 0; font-size: 13px; }

/* ---------- 信任条（关键信任设计） ---------- */
.trustbar { background: var(--card); border-bottom: 1px solid var(--line); }
.trustbar .wrap { display: flex; gap: 36px; padding: 12px 0; }
.trust-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.trust-icon {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ok-light); color: var(--ok);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; padding: 8px 18px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-size: 14px; font-family: inherit; text-align: center; line-height: 1.4;
  transition: all .15s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--line); color: var(--text); }
.btn-main { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-main:hover { background: var(--brand-light); border-color: var(--brand-light); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: #a07809; border-color: #a07809; color: #fff; }
.btn-lg { padding: 12px 32px; font-size: 16px; }
.btn-mini { padding: 5px 12px; font-size: 13px; }
.btn-block { display: block; width: 100%; margin-top: 6px; }

/* ---------- Hero ---------- */
.hero { padding: 44px 0 40px; background: var(--brand); }
.hero h1 { font-size: 30px; margin-bottom: 12px; color: #fff; letter-spacing: -.02em; }
.hero .sub { font-size: 15px; color: rgba(255,255,255,.72); margin: 0 0 26px; max-width: 640px; }
.hero-btns { display: flex; gap: 12px; }
.hero-btns .btn:not(.btn-gold) { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
.hero-btns .btn:not(.btn-gold):hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.5); color: #fff; }

/* 新用户路径指引 */
.hero-path {
  display: flex; align-items: center;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg); padding: 18px 22px; margin-top: 30px;
}
.hero-path-item { display: flex; align-items: center; gap: 10px; flex: 1; }
.hero-path-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--gold); color: #1a1300;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.hero-path-txt { font-size: 12px; color: rgba(255,255,255,.7); }
.hero-path-txt b { display: block; color: var(--gold); font-size: 19px; font-weight: 600; line-height: 1.3; }
.hero-path-arrow { color: rgba(255,255,255,.25); font-size: 16px; padding: 0 12px; }

.hero-stat { display: flex; gap: 48px; margin-top: 30px; }
.hero-stat b { display: block; font-size: 28px; font-weight: 600; line-height: 1.2; color: var(--gold); }
.hero-stat span { font-size: 13px; color: rgba(255,255,255,.6); }

/* ---------- 筛选 ---------- */
.filterbar {
  display: flex; gap: 6px; margin-bottom: 18px;
  background: var(--card); padding: 8px; border-radius: var(--radius); box-shadow: var(--shadow);
}
.filterbar a { padding: 7px 18px; border-radius: 6px; color: var(--text-2); font-size: 14px; }
.filterbar a:hover { background: var(--bg); }
.filterbar a.on { background: var(--brand); color: #fff; font-weight: 500; }

/* ========== 合规相关组件（广告标识 / 声明 / 协议勾选） ========== */

/* 任务卡片的「广告」标识 —— 《互联网广告管理办法》第九条要求广告具有可识别性 */
.badge-ad {
  font-size: 10px; padding: 1px 5px; border-radius: 3px;
  margin-left: 4px; background: #fff1f0; color: #cb272d;
  border: 1px solid #ffd6d4; font-weight: 400;
}

/* 首页顶部广告声明条 */
.ad-notice {
  background: #fff8f6; border: 1px solid #ffdcd7;
  border-left: 3px solid #cb272d;
  border-radius: var(--radius); padding: 13px 16px;
  font-size: 13px; color: var(--text-2); line-height: 1.75;
}
.ad-notice strong { color: #cb272d; margin-right: 8px; }
.ad-notice a { color: var(--brand); text-decoration: underline; }

/* 协议文档页提示框 */
.notice-box {
  background: var(--bg); border-left: 3px solid var(--brand);
  border-radius: 6px; padding: 14px 18px; margin: 12px 0;
  font-size: 13px; line-height: 1.85;
}
.notice-box ul { margin: 6px 0; padding-left: 20px; }
.notice-box li { margin: 3px 0; }

/* 注册页协议勾选 */
.agree-line {
  display: flex; align-items: flex-start; gap: 8px;
  cursor: pointer; line-height: 1.7; font-size: 12.5px;
}
.agree-line input { width: auto; margin: 3px 0 0; flex-shrink: 0; }
.agree-link { color: var(--brand); text-decoration: underline; }

/* 难度梯度说明条 */
.level-guide {
  display: flex; gap: 10px; margin-bottom: 8px; flex-wrap: wrap;
}.lg-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 0.5px solid var(--line);
  border-radius: 20px; padding: 5px 14px 5px 6px;
}
.lg-badge {
  font-size: 12px; font-weight: 500;
  padding: 2px 10px; border-radius: 14px;
}
.lg-desc { font-size: 12px; color: var(--text-3); }

@media (max-width: 768px) {
  .level-guide { gap: 6px; }
  .lg-item { padding: 4px 10px 4px 4px; }
  .lg-desc { font-size: 11px; }
}
@media (max-width: 480px) {
  .lg-desc { display: none; }
  .lg-item { padding: 4px 6px; }
}

/* 任务卡片 */
.tasklist { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.taskcard {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 180px;
  border: 1px solid transparent;
  transition: box-shadow .18s, border-color .18s;
}
.taskcard:hover { box-shadow: var(--shadow-lg); border-color: rgba(13,31,60,.08); }
.taskcard .cat {
  align-self: flex-start; font-size: 12px; color: var(--brand);
  background: var(--brand-lighter); padding: 2px 8px; border-radius: 4px; margin-bottom: 8px;
}
.taskcard h3 { font-size: 15px; margin-bottom: 6px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.taskcard .desc { font-size: 13px; color: var(--text-3); flex: 1; margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.taskcard .foot { display: flex; align-items: flex-end; justify-content: space-between; }
.taskcard .pts { color: var(--gold); font-weight: 600; font-size: 19px; line-height: 1.2; }
.taskcard .pts small { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 2px; }
.badge { font-size: 11px; padding: 1px 6px; border-radius: 3px; margin-left: 6px; vertical-align: middle; }
.badge-need { background: #fff1f0; color: #cb272d; }
.badge-hot { background: #fff2e8; color: #d46b08; }

/* ---------- 卡片/通用 ---------- */
.card { background: var(--card); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow); margin: 18px 0; }
.sec-title { font-size: 17px; margin: 28px 0 14px; display: flex; align-items: center; gap: 8px; }
.sec-title::before { content: ''; width: 3px; height: 16px; background: var(--brand); border-radius: 2px; }
.dim { color: var(--text-2); font-size: 13px; }
.tip { font-size: 13px; color: var(--text-3); margin: 12px 0 0; }
.big { font-size: 34px; font-weight: 600; color: var(--gold); line-height: 1.3; }
.money { color: var(--gold); font-weight: 600; }
.empty { text-align: center; color: var(--text-3); padding: 50px 0; grid-column: 1/-1; }

/* ---------- 表单 ---------- */
label { display: block; margin-bottom: 16px; font-size: 13px; color: var(--text-2); }
input[type=text], input[type=password], input[type=number], select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 6px; font-size: 14px;
  font-family: inherit; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13,31,60,.08);
}
.inp {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 14px; font-family: inherit; width: 100%;
}
.auth-card h2 { text-align: center; margin-bottom: 24px; }

/* ---------- 表格 ---------- */
.tablewrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); }
th { background: #fafbfc; color: var(--text-2); font-weight: 500; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfc; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 4px; font-size: 12px; }
.tag-ok { background: var(--ok-light); color: var(--ok); }
.tag-wait { background: #fff7e8; color: #d25f00; }
.tag-err { background: #fff1f0; color: #cb272d; }
.tag-dist { background: var(--brand-lighter); color: var(--brand); }

/* ---------- 分页 ---------- */
.pager { display: flex; justify-content: center; gap: 6px; padding: 24px 0; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 7px 13px; border-radius: 6px; background: #fff;
  border: 1px solid var(--line); color: var(--text-2);
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- 兑换 ---------- */
.exchange-bar { display: flex; gap: 52px; align-items: center; }
.exchange-bar .big { font-size: 30px; }
.ex-form { flex: 1; }
.ex-form .row { display: flex; align-items: center; gap: 12px; }
.ex-form .row input { width: 150px; margin-top: 0; }
.ex-form .arrow { color: var(--text-3); }
.ex-form #ex-yuan { font-size: 20px; font-weight: 600; color: var(--gold); }

.goods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.goodcard { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .18s; }
.goodcard:hover { box-shadow: var(--shadow-lg); }
.goodcard .thumb { height: 118px; background: linear-gradient(135deg, #f7f8fa, #eef0f4); display: flex; align-items: center; justify-content: center; font-size: 30px; }
.goodcard .body { padding: 13px; flex: 1; display: flex; flex-direction: column; }
.goodcard h3 { font-size: 14px; margin-bottom: 8px; }
.goodcard .foot { display: flex; align-items: center; justify-content: space-between; }
.goodcard .pts { color: var(--gold); font-weight: 600; }

/* ---------- 提现 ---------- */
.balance-hero { text-align: center; padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.withdraw-flow {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 22px;
  font-size: 13px; color: var(--text-2);
}
.withdraw-flow .step { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.withdraw-flow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex-shrink: 0; }
.withdraw-flow .line { flex: 1; height: 1px; background: var(--line); min-width: 16px; }

/* ---------- 邀请 ---------- */
.inv-code { display: flex; gap: 40px; align-items: center; margin: 22px 0; }
.inv-code .code { font-size: 30px; font-weight: 600; color: var(--brand); letter-spacing: 2px; }
.inv-links { flex: 1; }
.inv-links .inp { margin-top: 6px; margin-bottom: 8px; }
.inv-stat { display: flex; gap: 48px; padding: 20px 0; border-top: 1px solid var(--line); }
.inv-stat b { display: block; font-size: 23px; color: var(--brand); }
.inv-stat span { font-size: 13px; color: var(--text-3); }

/* 自营任务说明块 */
.self-desc {
  background: var(--bg); border-radius: var(--radius);
  padding: 16px 18px; margin: 20px 0;
  font-size: 14px; color: var(--text-2); line-height: 1.8;
  white-space: pre-wrap;
}

/* ---------- 中间页 ---------- */
.goto-box { margin-top: 30px; }
/* 中间页窄屏：步骤改为纵向，按钮占满 */
@media (max-width: 768px) {
  .goto-box { margin-top: 16px; }
  .goto-actions .btn { width: 100%; }
}
.steps { display: flex; gap: 10px; margin-bottom: 24px; }
.step { flex: 1; text-align: center; padding: 11px; background: var(--bg); border-radius: 6px; color: var(--text-3); font-size: 13px; }
.step.done { background: var(--ok-light); color: var(--ok); }
.step.on { background: var(--brand-lighter); color: var(--brand); font-weight: 500; }
.countdown { text-align: center; font-size: 15px; color: var(--text-2); margin: 22px 0; }
.countdown #cd-num { font-size: 28px; color: var(--brand); font-weight: 600; }
.goto-actions { text-align: center; margin: 22px 0; }
.proof-box { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.proof-box h3 { font-size: 15px; }
.proof-box .inp { margin-bottom: 10px; }

/* ---------- 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(13,31,60,.45); display: none; align-items: center; justify-content: center; z-index: 999; }
.mask.on { display: flex; }
.modal { background: #fff; border-radius: var(--radius-lg); padding: 26px; width: 430px; max-width: 92vw; max-height: 88vh; overflow-y: auto; box-shadow: 0 12px 40px rgba(13,31,60,.2); }
.modal h3 { margin-bottom: 18px; }
.modal-foot { display: flex; gap: 10px; margin-top: 22px; }
.modal-foot .btn { flex: 1; }

/* ---------- 页脚 ---------- */
.foot { margin-top: auto; background: var(--card); border-top: 1px solid var(--line); padding: 30px 0; color: var(--text-3); font-size: 13px; }
.foot-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 48px; }
.foot-col h4 { font-size: 13px; color: var(--text-2); margin: 0 0 12px; font-weight: 600; }
.foot-col a { color: var(--text-3); display: block; margin-bottom: 8px; }
.foot-col a:hover { color: var(--brand); }
.foot-bottom { border-top: 1px solid var(--line-soft); margin-top: 24px; padding-top: 16px; font-size: 12px; color: var(--text-3); }
.foot-compliance { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; top: 76px; transform: translateX(-50%);
  background: rgba(13,31,60,.92); color: #fff; padding: 11px 22px;
  border-radius: 8px; font-size: 14px; z-index: 1000; display: none; max-width: 80vw;
}
.toast.on { display: block; }
.toast.err { background: rgba(200,45,55,.94); }
.toast.ok { background: rgba(0,150,90,.94); }

@media (max-width: 1280px) {
  .tasklist, .goods { grid-template-columns: repeat(3, 1fr); }
}


/* ==========================================
   响应式适配
   断点策略（内容驱动，非设备驱动）：
     ≥1600  大屏桌面      容器加宽，5 列
     ≤1280  窄笔记本/小屏  3 列
     ≤1024  平板          2 列，导航折叠
     ≤768   手机          1 列，单列导航
     ≤480   小屏手机      进一步压缩间距
   ========================================== */

/* ---------- 容器与全局 ---------- */
/* 三档容器宽度
   wide   (1200)  首页 / 任务列表 —— 多列网格
   mid    (860)   内容页（About / 协议）—— 之前用 460px 太窄，
                          右侧留出大片空白，视觉上像"半截页面"
   narrow (460)   登录 / 注册 / 单表单 —— 这类才真的需要窄 */
.wrap {
  width: 1200px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}
.wrap.mid    { width: 880px; }
.wrap.narrow { width: 460px; }

/* 大屏：容器加宽，多放一列任务 */
@media (min-width: 1600px) {
  .wrap { width: 1440px; }
  .tasklist, .goods { grid-template-columns: repeat(5, 1fr); }
}

/* 平板横屏 / 窄笔记本 */
@media (max-width: 1280px) {
  .wrap { padding: 0 20px; }
  .tasklist, .goods { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 平板：导航折叠成抽屉 ---------- */
@media (max-width: 1180px) {
  .wrap { padding: 0 18px; }

  .topbar .topbar-in { height: 56px; gap: 12px; }
  .logo { font-size: 17px; }

  /* 汉堡按钮 */
  .nav-toggle {
    display: flex !important;
    align-items: center; justify-content: center;
    width: 38px; height: 38px; flex-shrink: 0;
    background: transparent; border: none; cursor: pointer;
    border-radius: 6px; order: -1;
  }
  .nav-toggle span {
    display: block; width: 18px; height: 1.5px; background: #fff;
    position: relative; transition: background .2s;
  }
  .nav-toggle span::before, .nav-toggle span::after {
    content: ''; position: absolute; left: 0; width: 18px; height: 1.5px; background: #fff;
    transition: transform .2s;
  }
  .nav-toggle span::before { top: -6px; }
  .nav-toggle span::after  { top: 6px; }
  .nav-toggle.open span { background: transparent; }
  .nav-toggle.open span::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle.open span::after  { transform: translateY(-6px) rotate(-45deg); }

  /* 抽屉式导航 */
  .nav {
    position: fixed; top: 56px; left: 0; right: 0; z-index: 99;
    background: var(--brand);
    flex-direction: column; gap: 0;
    padding: 8px 18px 18px;
    box-shadow: 0 8px 20px rgba(13,31,60,.2);
    transform: translateY(-10px);
    opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
    max-height: calc(100vh - 56px); overflow-y: auto;
  }
  .nav.on { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav a { padding: 13px 10px; border-radius: 6px; font-size: 15px; }

  .userbox { margin-left: auto; }
  /* 窄屏：钱包收成极简一行（只显示数字），仍可见余额 */
  .wallet {
    display: flex; padding: 4px 9px; gap: 7px;
    background: rgba(255,255,255,.06);
  }
  .wallet-item em { display: none; }        /* 窄屏隐藏标签 */
  .wallet-item b { font-size: 13px; }
  .wallet-sep { height: 14px; }
  .topbar-right { gap: 8px; }

  .hero { padding: 32px 0 30px; }
  .hero h1 { font-size: 25px; }
  .hero .sub { font-size: 14px; }

  .tasklist, .goods { grid-template-columns: repeat(2, 1fr); }

  .exchange-bar { flex-direction: column; align-items: stretch; gap: 22px; }
  .inv-code { flex-direction: column; align-items: stretch; gap: 20px; }
  .inv-stat { gap: 30px; flex-wrap: wrap; }
  .hero-stat { gap: 28px; flex-wrap: wrap; }

  .trustbar .wrap { gap: 20px; flex-wrap: wrap; padding: 10px 18px; }
  .trust-item { font-size: 12px; }

  .foot-inner { flex-direction: column; gap: 24px; }
}

/* ---------- 手机 ---------- */
@media (max-width: 768px) {
  .wrap { padding: 0 14px; }

  .topbar .topbar-in { height: 54px; }
  .logo { font-size: 16px; }
  .logo-mark { width: 20px; height: 20px; font-size: 11px; }
  .nav { top: 54px; }

  .hero { padding: 26px 0 24px; }
  .hero h1 { font-size: 21px; line-height: 1.35; }
  .hero .sub { font-size: 13px; margin-bottom: 20px; }
  .hero-btns { flex-direction: column; gap: 10px; }
  .hero-btns .btn { width: 100%; text-align: center; }

  /* 路径指引改为纵向 */
  .hero-path { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px; }
  .hero-path-item { width: 100%; }
  .hero-path-arrow { display: none; }
  .hero-path-txt b { font-size: 17px; }

  .hero-stat { gap: 20px; margin-top: 22px; }
  .hero-stat b { font-size: 23px; }

  .tasklist, .goods { grid-template-columns: 1fr; }
  .taskcard { min-height: auto; }

  .filterbar {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    white-space: nowrap; padding: 6px;
  }
  .filterbar a { padding: 7px 14px; flex-shrink: 0; }

  .card { padding: 20px 18px; margin: 14px 0; }
  .sec-title { font-size: 16px; margin: 22px 0 12px; }
  .big { font-size: 28px; }

  /* 表单按钮加大，适合触摸 */
  .btn { padding: 10px 18px; }
  .btn-lg { padding: 13px 26px; font-size: 15px; }
  input[type=text], input[type=password], input[type=number], select, textarea { padding: 11px 13px; }

  .ex-form .row { flex-wrap: wrap; }
  .ex-form .row input { width: 100%; }

  /* 表格横向滚动，不撑破布局 */
  .tablewrap { -webkit-overflow-scrolling: touch; }
  table { min-width: 560px; }

  .trustbar .wrap { gap: 12px 18px; }
  .trust-item:nth-child(n+4) { display: none; }   /* 手机只显示前 3 条 */

  .pager a, .pager span { padding: 8px 12px; }

  .modal { width: auto; margin: 0 16px; padding: 22px 18px; }
  .toast { left: 14px; right: 14px; transform: none; max-width: none; text-align: center; }

  .foot { padding: 24px 0; }
  .foot-inner { gap: 20px; }
}

/* ---------- 小屏手机 ---------- */
@media (max-width: 480px) {
  .wrap { padding: 0 12px; }

  .hero h1 { font-size: 19px; }
  .hero-path-txt { font-size: 11px; }
  .hero-path-txt b { font-size: 16px; }

  .userbox .btn { padding: 5px 10px; font-size: 12px; }

  .card { padding: 18px 15px; }
  .steps { flex-direction: column; gap: 8px; }
  .hero-stat { gap: 16px; }
  .hero-stat b { font-size: 20px; }

  .ex-form .row { gap: 8px; }
  .withdraw-flow { flex-direction: column; align-items: stretch; gap: 8px; }
  .withdraw-flow .line { display: none; }
  .inv-stat { gap: 20px; }
  .inv-code .code { font-size: 25px; }
}

/* ---------- 触摸设备：去掉 hover 依赖 ---------- */
@media (hover: none) {
  .taskcard:hover,
  .goodcard:hover { transform: none; box-shadow: var(--shadow); border-color: transparent; }
  .btn:hover { border-color: var(--line); color: var(--text); }
  .btn-main:hover { background: var(--brand); color: #fff; }
  .btn-gold:hover { background: var(--gold); color: #fff; }
  .topbar .btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
  .pager a:hover { border-color: var(--line); color: var(--text-2); }
}

/* ---------- 超窄屏兜底（折叠屏外屏等）---------- */
@media (max-width: 340px) {
  .wrap { padding: 0 10px; }
  .hero h1 { font-size: 17px; }
  .logo { font-size: 14px; }
}

/* ---------- 内容页排版（消除"半截页面"观感） ----------
   问题：About / 协议等文字页内容少，底部大片空白看着像页面没加载完。
   做法：给内容页一个最小高度 + 更大的行高与段间距，让文字自然铺开。 */
.page-doc { min-height: 62vh; padding: 8px 0 40px; }
.page-doc > h2 {
  font-size: 26px; font-weight: 650; letter-spacing: -.01em;
  margin: 0 0 6px; color: var(--text);
}
.page-doc > h3 {
  font-size: 16px; font-weight: 600;
  margin: 34px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.page-doc > h3:first-of-type { margin-top: 26px; }
.page-doc > p { margin: 0 0 14px; line-height: 1.78; color: var(--text-1); }
.page-doc > ul, .page-doc > ol { margin: 0 0 16px; padding-left: 22px; }
.page-doc > ul li { margin-bottom: 9px; line-height: 1.75; color: var(--text-1); }
.page-doc > ul li::marker { color: var(--text-3); }
.page-doc strong { color: var(--text); font-weight: 600; }
.page-doc table { width: 100%; border-collapse: collapse; margin: 4px 0 18px; }
.page-doc table th, .page-doc table td {
  padding: 10px 12px; border: 1px solid var(--line);
  font-size: 13.5px; text-align: left; vertical-align: top;
  line-height: 1.65;
}
.page-doc table th { background: var(--bg-2); font-weight: 600; color: var(--text); }

/* 两栏信息网格：About 页的联系信息等用它，比裸 table 更整洁 */
.info-grid {
  display: grid; grid-template-columns: 150px 1fr;
  gap: 0; border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; margin: 0 0 20px;
}
.info-grid dt {
  padding: 11px 14px; background: var(--bg-2);
  font-size: 13px; font-weight: 600; color: var(--text-2);
  border-bottom: 1px solid var(--line);
}
.info-grid dd {
  margin: 0; padding: 11px 14px;
  font-size: 13.5px; color: var(--text-1);
  border-bottom: 1px solid var(--line);
  word-break: break-word;
}
.info-grid dt:last-of-type, .info-grid dd:last-of-type { border-bottom: 0; }

/* ---------- 打印 ---------- */
@media print {
  .topbar, .trustbar, .foot, .pager, .filterbar, .toast, .mask { display: none !important; }
  body { background: #fff; }
  .card, .taskcard { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}
