:root {
  --primary: #2b6ef2;
  --primary-dark: #1d55c8;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #171a1f;
  --sub: #78818f;
  --line: #e9ecf1;
  --ok: #12a150;
  --ok-bg: #e9f9f0;
  --err: #d92d20;
  --err-bg: #fef1f0;
  --warn: #b54708;
  --warn-bg: #fff6e8;
  --radius: 14px;
  --shadow: 0 6px 22px rgba(17, 24, 39, .06);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.62 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; }
.main { padding: 16px 16px 40px; }
.main.with-nav { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
  background: rgba(244, 246, 249, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: 0 0 auto; }
.brand-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-link { font-size: 13px; color: var(--sub); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 卡片 */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 16px; margin-bottom: 14px;
  border: 1px solid rgba(233, 236, 241, .8);
}
.card-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.card-title h2 { margin: 0; font-size: 16px; font-weight: 700; }
.muted { color: var(--sub); font-size: 13px; }
.small { font-size: 13px; }
.tiny { font-size: 12px; color: var(--sub); }

/* 表单 */
label.field { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--sub); }
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 12px 13px; font-size: 15px; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 10px; outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(43, 110, 242, .12); }
textarea { min-height: 96px; resize: vertical; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 13px 16px; margin-top: 16px;
  border: 0; border-radius: 11px; background: var(--primary); color: #fff;
  font-size: 16px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #eef2fb; color: var(--primary); }
.btn.danger { background: #fdecea; color: var(--err); }
.btn.sm { width: auto; padding: 8px 14px; font-size: 14px; margin-top: 0; border-radius: 9px; }

/* 提示 */
.alert { padding: 11px 13px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.err { background: var(--err-bg); color: var(--err); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }

/* 二维码 */
.qr-wrap {
  width: 100%; aspect-ratio: 1 / 1; max-height: 320px;
  border-radius: 12px; border: 1px dashed var(--line); background: #fafbfc;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; margin: 6px 0 4px;
}
.qr-wrap img { width: 100%; height: 100%; object-fit: contain; }
.qr-empty { color: #9aa3b2; font-size: 13px; text-align: center; padding: 16px; }

/* 步骤 */
.steps { display: flex; gap: 8px; margin: 2px 0 10px; }
.step-pill { flex: 1; text-align: center; font-size: 12px; padding: 7px 4px; border-radius: 9px; background: #eef2fb; color: var(--primary); font-weight: 600; }
.step-pill.off { background: #f1f3f6; color: #98a1b0; font-weight: 400; }

/* 底部导航 */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: stretch;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px 7px; color: #8b94a3; font-size: 11px;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--primary); font-weight: 600; }

/* 列表/徽标 */
.list { display: flex; flex-direction: column; }
.list-item { padding: 13px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.list-item:last-child { border-bottom: 0; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; word-break: break-all; }
.list-sub { color: var(--sub); font-size: 12px; word-break: break-all; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge.pending { background: #fff4e5; color: #b25b00; }
.badge.doing { background: #e8f1ff; color: #1f5fd0; }
.badge.done { background: #e9f9f0; color: #0f8b45; }
.badge.reject { background: #fdecea; color: #c22a1e; }
.badge.gray { background: #f1f3f6; color: #6b7280; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; }
.kv .k { color: var(--sub); }
.kv .v { font-weight: 600; word-break: break-all; text-align: right; }

.hero { text-align: center; padding: 6px 0 2px; }
.hero h1 { font-size: 21px; margin: 4px 0 6px; }
.hero p { margin: 0; color: var(--sub); font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 20px; }
.stat span { color: var(--sub); font-size: 12px; }

.secret-box { background: #f7f9fc; border: 1px dashed #cfd8e6; border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.secret-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; }
.secret-row code { font-size: 18px; letter-spacing: 1px; font-weight: 700; color: #0f172a; }
.copy { border: 0; background: #eef2fb; color: var(--primary); border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; }

.footer-note { text-align: center; color: #9aa3b2; font-size: 12px; margin-top: 18px; }

/* 表格（后台） */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--sub); font-weight: 600; background: #fafbfc; }
.table-wrap { overflow-x: auto; }

/* 后台外框 */
.admin-top { display: flex; align-items: center; gap: 16px; padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.admin-top b { font-size: 15px; }
.admin-top nav { display: flex; gap: 14px; flex-wrap: wrap; }
.admin-top nav a { color: var(--sub); font-size: 14px; }
.admin-top nav a.on { color: var(--primary); font-weight: 600; }
.admin-body { padding: 18px; max-width: 1100px; margin: 0 auto; }
.admin-body h1 { font-size: 18px; margin: 0 0 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }