/* ============================================================
   旭彭AI H5 移动端 · 现代科技风样式 V3.0
   深色主题 / 毛玻璃卡片 / 渐变主色 / 底部Tab / 安全区适配
   ============================================================ */

/* ---------- CSS 变量 ---------- */
:root {
  --bg: #070b1a;
  --bg2: #0c1228;
  --card: rgba(20, 28, 58, 0.72);
  --card-solid: #141c3a;
  --card-hover: rgba(30, 40, 78, 0.85);
  --line: rgba(90, 130, 220, 0.14);
  --line-strong: rgba(90, 130, 220, 0.28);
  --text: #e8edff;
  --text2: #8b9cc8;
  --text3: #5c6b96;
  --primary: #4da3ff;
  --primary2: #7c5cfc;
  --gradient: linear-gradient(135deg, #4da3ff 0%, #7c5cfc 100%);
  --gradient-gold: linear-gradient(135deg, #ffc96b 0%, #ff9d5c 100%);
  --success: #5ee8a8;
  --warning: #ffc96b;
  --danger: #ff6b81;
  --info: #5cc8ff;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 24px rgba(77, 163, 255, 0.25);
  --tab-h: 58px;
  --header-h: 52px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 320px;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(77, 163, 255, 0.12) 0%, transparent 70%),
              radial-gradient(ellipse 60% 50% at 80% 0%, rgba(124, 92, 252, 0.1) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 14px; }
ul, ol { list-style: none; }
svg { width: 1em; height: 1em; vertical-align: -0.125em; }

/* ---------- App 容器 ---------- */
.h5-app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 12px);
}
.h5-app.no-tab { padding-bottom: calc(var(--safe-bottom) + 16px); }

/* ---------- 顶部 Header ---------- */
.h5-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: 8px;
  padding-right: 14px;
  background: rgba(7, 11, 26, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.h5-header .back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--text2);
  font-size: 20px;
  flex-shrink: 0;
  transition: background .2s;
}
.h5-header .back:active { background: rgba(255,255,255,.08); }
.h5-header h1 {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.h5-header .hd-act {
  flex-shrink: 0;
  min-width: 38px;
  text-align: right;
  font-size: 13px;
  color: var(--primary);
}
.h5-header .hd-act a { color: var(--primary); }

/* ---------- 页面内容区 ---------- */
.h5-page {
  padding: 14px 14px 0;
  position: relative;
  z-index: 1;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card + .card { margin-top: 12px; }
.card-pad { padding: 16px; }
.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .dot {
  width: 4px; height: 16px;
  background: var(--gradient);
  border-radius: 2px;
}

/* ---------- 区块标题 ---------- */
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 18px 4px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title .more { font-size: 12px; color: var(--text3); font-weight: normal; }
.section-title:first-child { margin-top: 0; }

/* ---------- 列表 Cell ---------- */
.cell {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  transition: background .15s;
  gap: 12px;
}
.cell:last-child { border-bottom: none; }
.cell:active { background: rgba(255,255,255,.04); }
.cell .ci {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: rgba(77, 163, 255, 0.1);
  color: var(--primary);
}
.cell .cb { flex: 1; min-width: 0; }
.cell .cb .t { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .cb .s { font-size: 12px; color: var(--text3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .cr { flex-shrink: 0; text-align: right; display: flex; align-items: center; gap: 6px; }
.cell .cr .v { font-size: 14px; font-weight: 600; color: var(--text); }
.cell .arrow { color: var(--text3); font-size: 16px; flex-shrink: 0; }
.cell.link { cursor: pointer; }

/* ---------- 标签 / 徽章 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}
.tag.ok { background: rgba(94, 232, 168, 0.12); color: var(--success); border: 1px solid rgba(94,232,168,.3); }
.tag.wait { background: rgba(255, 201, 107, 0.12); color: var(--warning); border: 1px solid rgba(255,201,107,.3); }
.tag.fail { background: rgba(255, 107, 129, 0.12); color: var(--danger); border: 1px solid rgba(255,107,129,.3); }
.tag.info { background: rgba(92, 200, 255, 0.12); color: var(--info); border: 1px solid rgba(92,200,255,.3); }
.tag.brand { background: var(--gradient); color: #fff; border: none; }
.tag.ghost { background: rgba(255,255,255,.06); color: var(--text2); border: 1px solid var(--line); }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all .2s;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 4px 16px rgba(77,163,255,.35); }
.btn-primary:active { box-shadow: 0 2px 8px rgba(77,163,255,.3); }
.btn-gold { background: var(--gradient-gold); color: #5a3a00; box-shadow: 0 4px 16px rgba(255,201,107,.3); }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid rgba(77,163,255,.4); }
.btn-outline:active { background: rgba(77,163,255,.1); }
.btn-ghost { background: rgba(255,255,255,.06); color: var(--text2); border: 1px solid var(--line); }
.btn-danger { background: rgba(255,107,129,.12); color: var(--danger); border: 1px solid rgba(255,107,129,.35); }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: 12px; }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 8px; }
.btn-group { display: flex; gap: 10px; }
.btn-group .btn { flex: 1; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 7px;
  font-weight: 500;
}
.form-label .req { color: var(--danger); margin-left: 2px; }
.input, .textarea, .select {
  width: 100%;
  padding: 12px 14px;
  background: rgba(7, 11, 26, 0.6);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(77,163,255,.15);
}
.input::placeholder, .textarea::placeholder { color: var(--text3); }
.textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b9cc8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.field {
  display: flex;
  align-items: center;
  background: rgba(7, 11, 26, 0.6);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  transition: border-color .2s;
}
.field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(77,163,255,.15); }
.field .input, .field .textarea { border: none; background: transparent; padding: 12px 0; box-shadow: none; }
.field .prefix, .field .suffix { color: var(--text3); font-size: 14px; flex-shrink: 0; }
.field .prefix { margin-right: 8px; }
.field .suffix { margin-left: 8px; }
.form-hint { font-size: 12px; color: var(--text3); margin-top: 6px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 6px; }

/* 表单行（图标+输入） */
.form-row {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.form-row:last-child { border-bottom: none; }
.form-row .lbl { width: 80px; flex-shrink: 0; font-size: 14px; color: var(--text2); }
.form-row .val { flex: 1; text-align: right; color: var(--text); font-size: 14px; }
.form-row .val input, .form-row .val select, .form-row .val textarea {
  text-align: right;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  width: 100%;
}

/* ---------- 余额 Hero 卡片 ---------- */
.balance-hero {
  position: relative;
  background: linear-gradient(135deg, rgba(77,163,255,.18) 0%, rgba(124,92,252,.18) 100%);
  border: 1px solid rgba(77,163,255,.25);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
  overflow: hidden;
}
.balance-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(77,163,255,.2) 0%, transparent 70%);
  border-radius: 50%;
}
.balance-hero .lb { font-size: 12px; color: var(--text2); margin-bottom: 6px; letter-spacing: 0.5px; }
.balance-hero .num {
  font-size: 34px;
  font-weight: 700;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.balance-hero .num small { font-size: 16px; -webkit-text-fill-color: var(--text2); }
.balance-hero .ops {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}
.balance-hero .ops a {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  background: var(--gradient);
  color: #fff;
  transition: opacity .2s;
}
.balance-hero .ops a:active { opacity: 0.85; }
.balance-hero .ops a.secondary {
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(4px);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.15);
}

/* ---------- 宫格菜单 ---------- */
.grid-menu {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.grid-menu a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 4px;
  border-radius: var(--radius-sm);
  transition: background .15s;
  gap: 7px;
}
.grid-menu a:active { background: rgba(255,255,255,.06); }
.grid-menu .gi {
  width: 44px; height: 44px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: linear-gradient(135deg, rgba(77,163,255,.18), rgba(124,92,252,.18));
  color: var(--primary);
  border: 1px solid rgba(77,163,255,.2);
}
.grid-menu .lbl { font-size: 12px; color: var(--text2); text-align: center; }

/* ---------- 统计卡片组 ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  background: var(--card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.stat-card .st-lb { font-size: 12px; color: var(--text3); margin-bottom: 6px; }
.stat-card .st-val { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-card .st-val.gold { background: var(--gradient-gold); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-card .st-val.green { color: var(--success); }
.stat-card .st-val.blue { color: var(--primary); }
.stat-card .st-sub { font-size: 11px; color: var(--text3); margin-top: 4px; }
.stat-card .st-icon {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  opacity: 0.7;
}

/* ---------- 底部 Tab 栏 ---------- */
.h5-tab {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(10, 14, 32, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--line);
}
.h5-tab a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text3);
  font-size: 10px;
  transition: color .2s;
  position: relative;
}
.h5-tab a svg { font-size: 21px; }
.h5-tab a.on { color: var(--primary); }
.h5-tab a.on::before {
  content: '';
  position: absolute;
  top: 0;
  width: 24px; height: 3px;
  background: var(--gradient);
  border-radius: 0 0 3px 3px;
}

/* ---------- 头像 ---------- */
.avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(77,163,255,.3);
}
.avatar.sm { width: 36px; height: 36px; font-size: 15px; }
.avatar.lg { width: 64px; height: 64px; font-size: 26px; }
.avatar.green { background: linear-gradient(135deg, #5ee8a8, #2dc080); }
.avatar.gold { background: var(--gradient-gold); color: #5a3a00; }
.avatar.gray { background: rgba(255,255,255,.1); color: var(--text2); box-shadow: none; }

/* ---------- 个人信息行 ---------- */
.me-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px;
}
.me-row .me-info { flex: 1; min-width: 0; }
.me-row .nm {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.me-row .sub { font-size: 12px; color: var(--text3); margin-top: 3px; }

/* ---------- 聊天界面 ---------- */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h) - var(--safe-top));
  position: relative;
  z-index: 1;
}
.chat-model-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 14px;
  background: rgba(13, 20, 46, 0.6);
  border-bottom: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
  scrollbar-width: none;
}
.chat-model-bar::-webkit-scrollbar { display: none; }
.chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  -webkit-overflow-scrolling: touch;
}
.chat-msg {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  max-width: 100%;
}
.chat-msg.user { flex-direction: row-reverse; }
.chat-msg .bubble {
  max-width: 78%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.7;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-msg.ai .bubble {
  background: var(--card);
  border: 1px solid var(--line);
  border-top-left-radius: 4px;
  color: var(--text);
}
.chat-msg.user .bubble {
  background: var(--gradient);
  color: #fff;
  border-top-right-radius: 4px;
  box-shadow: 0 2px 12px rgba(77,163,255,.25);
}
.chat-msg .bubble code {
  background: rgba(0,0,0,.3);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  font-family: "SF Mono", Consolas, monospace;
}
.chat-msg .bubble pre {
  background: rgba(0,0,0,.4);
  padding: 10px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
  font-size: 12px;
}
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text3);
  animation: typingBounce 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}
.chat-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  background: rgba(10, 14, 32, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.chat-bar .cbtn {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text2);
  background: rgba(255,255,255,.06);
  flex-shrink: 0;
  transition: all .2s;
}
.chat-bar .cbtn:active { background: rgba(77,163,255,.2); color: var(--primary); }
.chat-bar .cbtn.recording { background: rgba(255,107,129,.2); color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.chat-bar textarea {
  flex: 1;
  min-height: 40px;
  max-height: 100px;
  padding: 10px 14px;
  background: rgba(7, 11, 26, 0.7);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
  transition: border-color .2s;
}
.chat-bar textarea:focus { border-color: var(--primary); }
.chat-bar .send {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: all .2s;
  box-shadow: 0 2px 10px rgba(77,163,255,.35);
}
.chat-bar .send:disabled { opacity: 0.4; box-shadow: none; }
.chat-bar .send:active:not(:disabled) { transform: scale(0.92); }

/* ---------- 认证页面 ---------- */
.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 24px;
  position: relative;
  z-index: 1;
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo .logo {
  width: 72px; height: 72px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #fff;
  box-shadow: 0 8px 32px rgba(77,163,255,.4);
}
.auth-logo h1 {
  font-size: 22px;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}
.auth-logo p { font-size: 13px; color: var(--text3); }
.auth-box {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  box-shadow: var(--shadow);
}
.auth-box .field { margin-bottom: 14px; }
.auth-box .btn { margin-top: 6px; }
.auth-link {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
  font-size: 13px;
}
.auth-link a { color: var(--text2); }
.auth-link a:active { color: var(--primary); }
.auth-tip {
  margin-top: 24px;
  font-size: 11px;
  color: var(--text3);
  text-align: center;
  line-height: 1.8;
}
.auth-tabs {
  display: flex;
  margin-bottom: 22px;
  background: rgba(7,11,26,.5);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.auth-tabs a {
  flex: 1;
  text-align: center;
  padding: 9px;
  font-size: 13px;
  color: var(--text3);
  border-radius: 8px;
  transition: all .2s;
  font-weight: 500;
}
.auth-tabs a.on { background: var(--gradient); color: #fff; }

/* ---------- 表格（移动端横向滚动） ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}
table.h5-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 480px;
}
table.h5-table th {
  background: rgba(77,163,255,.08);
  color: var(--text2);
  font-weight: 600;
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
table.h5-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  white-space: nowrap;
}
table.h5-table tr:last-child td { border-bottom: none; }
table.h5-table tr:active td { background: rgba(255,255,255,.03); }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text3);
}
.empty .icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.empty .t { font-size: 14px; margin-bottom: 4px; color: var(--text2); }
.empty .s { font-size: 12px; }

/* ---------- Toast ---------- */
.h5-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 20, 45, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 9999;
  max-width: 80%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
  animation: toastIn .25s ease;
  pointer-events: none;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -45%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ---------- Modal ---------- */
.h5-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.h5-modal {
  width: 100%;
  max-width: 340px;
  background: var(--card-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: modalIn .25s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.h5-modal .m-head {
  padding: 18px 20px 10px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}
.h5-modal .m-body { padding: 8px 20px 18px; font-size: 14px; color: var(--text2); line-height: 1.7; text-align: center; }
.h5-modal .m-foot {
  display: flex;
  border-top: 1px solid var(--line);
}
.h5-modal .m-foot button {
  flex: 1;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text2);
  transition: background .15s;
}
.h5-modal .m-foot button:active { background: rgba(255,255,255,.05); }
.h5-modal .m-foot button.primary { color: var(--primary); }
.h5-modal .m-foot button + button { border-left: 1px solid var(--line); }

/* Action Sheet (底部弹出) */
.h5-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 501;
  background: var(--card-solid);
  border-radius: 20px 20px 0 0;
  padding: 8px 0 calc(12px + var(--safe-bottom));
  animation: sheetUp .28s ease;
  max-height: 75vh;
  overflow-y: auto;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.h5-sheet .s-title {
  padding: 14px 20px 8px;
  font-size: 13px;
  color: var(--text3);
  text-align: center;
}
.h5-sheet .s-item {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  font-size: 15px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  transition: background .15s;
}
.h5-sheet .s-item:last-child { border-bottom: none; }
.h5-sheet .s-item:active { background: rgba(255,255,255,.05); }
.h5-sheet .s-item .si-icon { font-size: 20px; width: 28px; text-align: center; }
.h5-sheet .s-cancel {
  margin: 8px 12px 0;
  padding: 14px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text2);
  background: rgba(255,255,255,.05);
  border-radius: 12px;
}

/* ---------- 骨架屏 ---------- */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.04) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes skeletonShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- 进度条 ---------- */
.progress {
  height: 6px;
  background: rgba(255,255,255,.06);
  border-radius: 3px;
  overflow: hidden;
}
.progress .bar {
  height: 100%;
  background: var(--gradient);
  border-radius: 3px;
  transition: width .3s;
}

/* ---------- 开关 ---------- */
.switch {
  position: relative;
  width: 46px;
  height: 26px;
  background: rgba(255,255,255,.1);
  border-radius: 13px;
  cursor: pointer;
  transition: background .25s;
  flex-shrink: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform .25s;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.switch.on { background: var(--gradient); }
.switch.on::after { transform: translateX(20px); }

/* ---------- 金额 / 数字 ---------- */
.mono { font-family: "SF Mono", "Roboto Mono", Consolas, monospace; font-size: 12px; }
.amount { font-weight: 600; }
.amount.gold { color: var(--warning); }
.amount.green { color: var(--success); }
.amount.red { color: var(--danger); }

/* ---------- 分段控制器 ---------- */
.segment {
  display: flex;
  background: rgba(7,11,26,.6);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 14px;
}
.segment a {
  flex: 1;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  color: var(--text3);
  border-radius: 7px;
  transition: all .2s;
  font-weight: 500;
}
.segment a.on { background: var(--gradient); color: #fff; }

/* ---------- 搜索框 ---------- */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: rgba(7,11,26,.6);
  border: 1px solid var(--line);
  border-radius: 20px;
  margin-bottom: 12px;
}
.search-bar svg { color: var(--text3); font-size: 16px; flex-shrink: 0; }
.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
}
.search-bar input::placeholder { color: var(--text3); }

/* ---------- 图片画廊 ---------- */
.img-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.img-grid .img-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--card);
  border: 1px solid var(--line);
}
.img-grid .img-item img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 视频卡片 ---------- */
.video-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.video-card video { width: 100%; display: block; }

/* ---------- 公告横幅 ---------- */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 201, 107, 0.08);
  border: 1px solid rgba(255, 201, 107, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--warning);
}
.notice-bar .scroll-text {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------- 详情页大字段 ---------- */
.detail-hero {
  text-align: center;
  padding: 24px 20px;
}
.detail-hero .big-num {
  font-size: 32px;
  font-weight: 700;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.detail-hero .big-lb { font-size: 13px; color: var(--text3); margin-top: 4px; }

/* ---------- 步骤条 ---------- */
.steps {
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
  position: relative;
}
.steps::before {
  content: '';
  position: absolute;
  top: 28px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--line);
  z-index: 0;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}
.step .dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--card-solid);
  border: 2px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text3);
  font-weight: 600;
}
.step.done .dot { background: var(--gradient); border-color: transparent; color: #fff; }
.step.active .dot { background: var(--gradient); border-color: transparent; color: #fff; box-shadow: 0 0 0 4px rgba(77,163,255,.2); }
.step .lb { font-size: 11px; color: var(--text3); }
.step.done .lb, .step.active .lb { color: var(--text); }

/* ---------- 工具类 ---------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-gold { color: var(--warning); }
.text-green { color: var(--success); }
.text-red { color: var(--danger); }
.text-blue { color: var(--primary); }
.text-muted { color: var(--text3); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-15 { font-size: 15px; }
.fs-16 { font-size: 16px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }

/* ---------- 打印/特殊 ---------- */
@media print {
  .h5-header, .h5-tab { display: none; }
  body { background: #fff; color: #000; }
}
