/* ========== 设计令牌：现代极简 黑/白/灰 + 品牌蓝点缀 ========== */
:root {
  --brand: #2563eb;          /* 品牌色 */
  --brand-dark: #1d4ed8;
  --text: #111827;           /* 主文字 近黑 */
  --text-2: #6b7280;         /* 次要文字 灰 */
  --text-3: #9ca3af;         /* 弱文字 */
  --bg: #f5f6f8;             /* 页面背景 浅灰 */
  --card: #ffffff;
  --border: #e5e7eb;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.08);
  --font: "Inter", "Roboto", -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ========== 布局 ========== */
.page { max-width: 720px; margin: 0 auto; padding: 16px; }
.page-wide { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }

/* ========== 卡片 ========== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }

/* ========== 按钮 ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px;
  border: none; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff;
  font-size: 15px; font-family: var(--font); cursor: pointer;
  transition: background .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { display: flex; width: 100%; }
.btn-outline { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: #f9fafb; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #15803d; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ========== 表单 ========== */
.form-item { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; font-family: var(--font); background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* ========== 顶部导航（客户前台） ========== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 720px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar .logo { font-size: 17px; font-weight: 700; color: var(--text); }

/* ========== 底部导航（客户前台移动端） ========== */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: #fff; border-top: 1px solid var(--border);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; text-align: center; padding: 8px 0 6px;
  color: var(--text-3); font-size: 12px;
}
.tabbar a .ico { font-size: 20px; display: block; line-height: 1.4; }
.tabbar a.active { color: var(--brand); }
.has-tabbar { padding-bottom: 70px; }

/* ========== 后台布局 ========== */
.admin-shell { display: flex; min-height: 100vh; }
.admin-side {
  width: 220px; background: #111827; color: #d1d5db;
  padding: 20px 12px; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-side .logo { color: #fff; font-size: 17px; font-weight: 700; padding: 0 10px 18px; }
.admin-side a {
  display: block; padding: 10px 12px; margin-bottom: 2px;
  color: #9ca3af; border-radius: var(--radius-sm); font-size: 14px;
  transition: background .15s, color .15s;
}
.admin-side a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-side a.active { background: var(--brand); color: #fff; }
.admin-main { flex: 1; padding: 24px; min-width: 0; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.admin-head h1 { font-size: 20px; font-weight: 600; }

/* ========== 统计卡片 ========== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.stat-card .num { font-size: 24px; font-weight: 700; margin-top: 4px; }
.stat-card .label { font-size: 13px; color: var(--text-2); }

/* ========== 表格 ========== */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { color: var(--text-2); font-weight: 500; font-size: 13px; background: #f9fafb; }
.table tr:hover td { background: #fafbfc; }

/* ========== 标签 ========== */
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.tag-gray { background: #f3f4f6; color: var(--text-2); }
.tag-blue { background: #dbeafe; color: var(--brand-dark); }
.tag-green { background: #dcfce7; color: var(--success); }
.tag-red { background: #fee2e2; color: var(--danger); }
.tag-orange { background: #ffedd5; color: var(--warning); }

/* ========== 任务卡片（前台大厅） ========== */
.task-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; display: block; color: var(--text); }
.task-card .t-title { font-size: 16px; font-weight: 600; }
.task-card .t-meta { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 10px; }
.task-card .t-reward { color: var(--danger); font-size: 20px; font-weight: 700; }
.task-card .t-reward small { font-size: 12px; font-weight: 400; }
.task-card .t-info { font-size: 13px; color: var(--text-3); }

/* ========== Toast 轻提示 ========== */
#toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(17, 24, 39, .92); color: #fff;
  padding: 10px 20px; border-radius: 999px; font-size: 14px;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-8px);
  transition: opacity .2s, transform .2s; max-width: 86vw;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: rgba(22, 163, 74, .95); }
.toast.error { background: rgba(220, 38, 38, .95); }

/* ========== 弹层（仅用于表单/确认关键操作，非 alert） ========== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: var(--radius); padding: 24px; width: 100%; max-width: 420px; max-height: 86vh; overflow-y: auto; }
.modal h3 { font-size: 16px; margin-bottom: 16px; }

/* ========== 空状态 / 加载 ========== */
.empty { text-align: center; color: var(--text-3); padding: 48px 0; font-size: 14px; }
.loading { text-align: center; color: var(--text-3); padding: 24px 0; font-size: 14px; }

/* ========== 凭证缩略图 ========== */
.proof-imgs { display: flex; gap: 8px; flex-wrap: wrap; }
.proof-imgs img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: zoom-in; }

/* ========== 二维码 ========== */
.qr-box { text-align: center; padding: 12px; }
.qr-box img { margin: 0 auto; width: 200px; height: 200px; }

/* ========== 响应式：后台侧边栏移动端折叠 ========== */
@media (max-width: 860px) {
  .admin-shell { flex-direction: column; }
  .admin-side {
    width: 100%; height: auto; position: static;
    display: flex; overflow-x: auto; padding: 10px; align-items: center;
  }
  .admin-side .logo { padding: 0 10px; white-space: nowrap; }
  .admin-side a { white-space: nowrap; margin-bottom: 0; }
  .admin-main { padding: 16px; }
}
