/* 全站基础样式:移动优先,电脑/手机自适应(硬性要求)。 */
* { box-sizing: border-box; }
:root {
  --bg: #f3f6fb; --card: #ffffff; --ink: #1f2937; --muted: #6b7280;
  --line: #e5e7eb; --brand: #2563eb; --brand-d: #1d4ed8;
  --ok: #16a34a; --err: #dc2626; --warn: #b45309;
  --radius: 14px; --shadow: 0 10px 30px rgba(17,24,39,.08);
}
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* —— 居中卡片(登录/MFA/enroll)—— */
.auth-wrap { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.card {
  width: 100%; max-width: 420px; background: var(--card);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; margin-bottom: 6px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); display: inline-block; }
h1.title { font-size: 22px; margin: 6px 0 2px; }
.subtitle { color: var(--muted); margin: 0 0 20px; font-size: 14px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=email] {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 16px; /* 16px 防 iOS 聚焦缩放 */ font-family: inherit; background: #fff; color: var(--ink);
}
input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

.btn {
  width: 100%; padding: 12px 16px; border: 0; border-radius: 10px; font-size: 16px;
  font-weight: 600; cursor: pointer; background: var(--brand); color: #fff; transition: background .15s;
}
.btn:hover { background: var(--brand-d); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.msg { font-size: 14px; margin: 10px 0 0; min-height: 20px; }
.msg.err { color: var(--err); }
.msg.ok { color: var(--ok); }

.code-input { letter-spacing: .35em; text-align: center; font-size: 22px !important; }

.qr { display: block; margin: 10px auto; width: 200px; height: 200px; image-rendering: pixelated; }
.secret { word-break: break-all; background: #f8fafc; border: 1px dashed var(--line); border-radius: 8px;
  padding: 8px 10px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; text-align: center; }
.recovery { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 14px; margin-top: 14px; }
.recovery code { display: inline-block; margin: 3px 6px; font-size: 14px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 14px; }

/* —— 内页(dashboard)—— */
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.container { max-width: 960px; margin: 0 auto; padding: 20px 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.tile h3 { margin: 0 0 6px; font-size: 16px; }
.tile p { margin: 0; color: var(--muted); font-size: 13px; }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #eef2ff; color: var(--brand-d); }
.linkbtn { background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 8px;
  padding: 8px 12px; font-size: 14px; cursor: pointer; width: auto; }

/* —— 业务页:卡片区块、表格、表单栅格 —— */
.section { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 18px; }
.section h2 { font-size: 16px; margin: 0 0 14px; }
.formgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.formgrid .field { margin: 0; }
.formgrid .field.full { grid-column: 1 / -1; }
.formgrid label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.formgrid input, .formgrid select { width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 16px; /* 16px 防 iOS 聚焦缩放 */ font-family: inherit; background: #fff; }
.btn.inline { width: auto; padding: 10px 18px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
table.data th, table.data td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { color: var(--muted); font-weight: 600; font-size: 12px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.tag.ok { background: #dcfce7; color: #166534; }
.tag.bad { background: #fee2e2; color: #991b1b; }
.tag.pending { background: #fef3c7; color: #92400e; }
.amount { font-variant-numeric: tabular-nums; text-align: right; }
.empty { color: var(--muted); font-size: 13px; padding: 10px 0; }
.note-line { color: var(--muted); font-size: 12px; margin: 0 0 10px; }

/* —— 锁定页 —— */
.locked { text-align: center; }
.locked .big { font-size: 40px; }
