/* 省心寄 H5 共享样式 —— 品牌橙 #FF6B35 / 浅橙底 #FFF0E8 / 暖金 #F5A623 */
:root {
  --primary: #FF6B35;
  --primary-dark: #E8541C;
  --primary-light: #FF8F5E;
  --primary-bg: #FFF0E8;
  --gold: #F5A623;
  --ink: #2B2620;
  --ink-2: #666;
  --ink-3: #999;
  --line: #EEE;
  --bg: #F6F6F6;
  --ok: #2BA471;
  --danger: #E23B3B;
  --radius: 14px;
  --topbar-h: 52px;
  --tabbar-h: 56px;
  --maxw: 480px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; outline: none; border: none; background: none; }

/* ===== 布局骨架 ===== */
.shell { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; background: var(--bg);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 8px); }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center;
  justify-content: space-between; padding: 0 14px; background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(255,107,53,.18); }
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.topbar .brand .logo { width: 26px; height: 26px; border-radius: 7px; background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center; font-size: 15px; }
.topbar .acct { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.topbar .acct .uname { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .95; }
.topbar .linkbtn { padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.2); font-size: 13px; }
.topbar .linkbtn.primary { background: #fff; color: var(--primary); font-weight: 600; }

.content { padding: 14px; }

/* ===== 顶栏(无 tabbar 的登录/注册页用) ===== */
.center-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%); }
.auth-card { width: 100%; max-width: 360px; background: #fff; border-radius: 18px; padding: 26px 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; color: var(--ink); }
.auth-card .sub { color: var(--ink-3); font-size: 13px; margin-bottom: 22px; }
.auth-logo { width: 56px; height: 56px; border-radius: 14px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 14px; }

/* ===== 卡片 ===== */
.card { background: #fff; border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.card .card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card .card-h h3 { font-size: 15px; }
.card .card-h .more { font-size: 12px; color: var(--ink-3); }

/* ===== 按钮 ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  height: 46px; border-radius: 12px; background: var(--primary); color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: opacity .15s; }
.btn:active { opacity: .85; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--primary-bg); color: var(--primary); }
.btn.gold { background: var(--gold); }
.btn[disabled] { background: #ccc; cursor: not-allowed; }
.btn.sm { height: 34px; font-size: 13px; border-radius: 9px; width: auto; padding: 0 14px; }

/* ===== 表单 ===== */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.input { width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px;
  background: #fafafa; font-size: 15px; }
.input:focus { border-color: var(--primary); background: #fff; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

/* ===== 底部 tabbar ===== */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: var(--maxw);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; background: #fff; border-top: 1px solid var(--line); z-index: 40; }
.tabbar .tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-3); font-size: 11px; cursor: pointer; }
.tabbar .tab .ic { font-size: 20px; line-height: 1; }
.tabbar .tab.active { color: var(--primary); font-weight: 600; }

/* ===== 通用 ===== */
.row { display: flex; align-items: center; justify-content: space-between; }
.row + .row { margin-top: 10px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; background: var(--primary-bg); color: var(--primary); }
.tag.gray { background: #f1f1f1; color: var(--ink-3); }
.tag.gold { background: #FFF6E6; color: #C07A12; }
.tag.ok { background: #E7F6EF; color: var(--ok); }
.tag.warn { background: #FDECEC; color: var(--danger); }

/* 大数字金额展示 */
.balance-hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff;
  border-radius: var(--radius); padding: 22px 18px; margin-bottom: 14px; }
.balance-hero .label { font-size: 13px; opacity: .9; }
.balance-hero .amount { font-size: 32px; font-weight: 700; margin: 4px 0; }
.balance-hero .amount .unit { font-size: 16px; font-weight: 500; margin-left: 4px; }
.balance-hero .sub { font-size: 12px; opacity: .9; }

/* 统计格 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: #fff; border-radius: 12px; padding: 14px 10px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.stat .v { font-size: 18px; font-weight: 700; color: var(--primary); }
.stat .v.gold { color: var(--gold); }
.stat .k { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* 列表项 */
.list { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.list .item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: none; }
.list .item .av { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.list .item .main { flex: 1; min-width: 0; }
.list .item .main .t { font-size: 14px; }
.list .item .main .s { font-size: 12px; color: var(--ink-3); }
.list .item .val { font-size: 14px; font-weight: 600; color: var(--ink); text-align: right; white-space: nowrap; }
.list .item .val.gold { color: var(--gold); }

/* 任务卡 */
.task { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #fff;
  margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.task .tinfo { flex: 1; }
.task .tinfo .tn { font-size: 14px; }
.task .tinfo .td { font-size: 12px; color: var(--ink-3); }
.task .reward { color: var(--gold); font-weight: 700; font-size: 14px; white-space: nowrap; }

/* 区块标题 */
.section-title { font-size: 15px; font-weight: 700; margin: 4px 0 12px; display: flex; align-items: center; gap: 6px; }
.section-title::before { content: ''; width: 4px; height: 15px; background: var(--primary); border-radius: 2px; }

/* 功能宫格 */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid .cell { background: #fff; border-radius: var(--radius); padding: 18px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
  cursor: pointer; }
.grid .cell .emoji { font-size: 28px; }
.grid .cell .ct { font-size: 14px; font-weight: 600; margin-top: 8px; }
.grid .cell .cs { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* 空态 */
.empty { text-align: center; color: var(--ink-3); padding: 36px 0; font-size: 13px; }
.empty .e-emoji { font-size: 40px; margin-bottom: 8px; }

/* 头像 */
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Toast */
#toast { position: fixed; left: 50%; top: 42%; transform: translateX(-50%); z-index: 999; background: rgba(0,0,0,.82);
  color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; max-width: 80%; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }

/* 加载 */
.loading { text-align: center; color: var(--ink-3); padding: 20px; font-size: 13px; }

/* ===== 二级页（比价/订单/资讯） ===== */
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.page-head .back { width: 34px; height: 34px; border-radius: 10px; background: #fff; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.page-head h1 { font-size: 17px; font-weight: 700; flex: 1; }
.page-head .hlink { font-size: 12px; color: var(--primary); }
.subnav { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.subnav a { flex: none; padding: 7px 14px; border-radius: 999px; background: #fff; color: var(--ink-2);
  font-size: 13px; border: 1px solid var(--line); white-space: nowrap; }
.subnav a.cur { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }

/* 状态说明条 */
.notice { background: #FFF7E6; border: 1px solid #FFE0A3; color: #8A5A00; border-radius: 12px;
  padding: 12px 14px; font-size: 12px; line-height: 1.75; margin-bottom: 14px; }
.notice b { color: #B26A00; }
.notice.info { background: #EEF6FF; border-color: #CBE2FF; color: #2A5A96; }
.notice.info b { color: #1B4B87; }

/* 比价结果卡 */
.quote { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 12px;
  padding: 14px; margin-bottom: 10px; border: 2px solid transparent; cursor: pointer; }
.quote.sel { border-color: var(--primary); background: var(--primary-bg); }
.quote .qlogo { width: 42px; height: 42px; border-radius: 10px; background: var(--primary-bg);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex: none; }
.quote .qmain { flex: 1; min-width: 0; }
.quote .qname { font-size: 14px; font-weight: 600; }
.quote .qdesc { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.quote .qright { text-align: right; flex: none; }
.quote .qprice { font-size: 20px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.quote .qprice small { font-size: 11px; font-weight: 400; }
.quote .qold { font-size: 11px; color: var(--ink-3); text-decoration: line-through; }

/* 表单增强 */
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
textarea.input { height: auto; min-height: 82px; padding: 12px 14px; line-height: 1.6; resize: vertical; }
.input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .3px; }

/* 资讯列表 */
.catbar { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.catbar button { flex: none; padding: 7px 15px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.catbar button.cur { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.article-item { display: block; background: #fff; border-radius: 12px; padding: 14px 16px;
  margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.article-item .ai-cat { font-size: 11px; color: var(--primary); font-weight: 600; }
.article-item .ai-title { font-size: 15px; font-weight: 600; margin: 5px 0; line-height: 1.5; }
.article-item .ai-sum { font-size: 12px; color: var(--ink-3); line-height: 1.65; }
.article-item .ai-meta { font-size: 11px; color: var(--ink-3); margin-top: 9px; }

/* 文章正文 */
.article-body { background: #fff; border-radius: var(--radius); padding: 18px 16px; }
.article-body h1 { font-size: 19px; line-height: 1.5; margin-bottom: 10px; }
.article-body .meta { font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line);
  padding-bottom: 12px; margin-bottom: 12px; }
.article-body h3 { font-size: 15px; margin: 18px 0 8px; color: var(--primary-dark); }
.article-body p, .article-body li { font-size: 14px; line-height: 1.9; }
.article-body p { margin: 6px 0; }
.article-body ul { padding-left: 20px; margin: 6px 0 10px; }
.article-body li { margin-bottom: 6px; }
.article-body .source { margin-top: 22px; padding: 12px; background: #FAFAFA;
  border-radius: 10px; font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.article-body .source a { color: var(--primary); word-break: break-all; }
.article-body .disclaimer { margin-top: 12px; font-size: 12px; color: var(--ink-3); line-height: 1.7; }

/* 订单行 */
.order-card { background: #fff; border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.order-card .ono { font-size: 13px; font-weight: 600; font-family: ui-monospace, monospace; }
.order-card .orow { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.order-card .ohead { display: flex; justify-content: space-between; align-items: center; }
