:root {
  --bg: #f5f6f8; --card: #fff; --text: #1f2329; --muted: #8a919e;
  --brand: #2563eb; --ok: #16a34a; --warn: #d97706; --err: #dc2626;
  --line: #e7e9ee; --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--brand); text-decoration: none; }
h2 { font-size: 20px; }
.page { max-width: 560px; margin: 0 auto; padding: 14px 14px 56px; }
.page.admin { max-width: 1120px; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 12px; }
.brand { font-size: 19px; font-weight: 700; }
.me { font-size: 12px; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.stats { display: flex; gap: 10px; margin-bottom: 12px; }
.stat { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 8px; text-align: center; }
.stat .num { font-size: 19px; font-weight: 700; color: var(--brand); }
.stat .lbl { font-size: 12px; color: var(--muted); }

.task-title { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.task-meta { font-size: 13px; color: var(--muted); }
.task-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price { color: var(--err); font-weight: 700; font-size: 18px; }
.price small { font-size: 12px; color: var(--muted); font-weight: 400; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 10px; padding: 9px 16px; font-size: 15px;
  cursor: pointer; background: #eef1f6; color: var(--text); font-family: inherit;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: #fff; border: 1px solid var(--line); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; padding: 13px; font-size: 16px; }
.btn-danger { background: #fdecec; color: var(--err); }

.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: #eef1f6; color: var(--muted); }
.badge-ok { background: #e8f7ee; color: var(--ok); }
.badge-warn { background: #fdf3e2; color: var(--warn); }
.badge-err { background: #fdecec; color: var(--err); }
.badge-info { background: #e8f0fe; color: var(--brand); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.empty { text-align: center; color: var(--muted); padding: 36px 0; font-size: 14px; }

.status-hero { text-align: center; padding: 26px 16px; }
.big-ico { font-size: 46px; line-height: 1; }
.count { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 700; }

.overlay { position: fixed; inset: 0; background: rgba(15, 18, 25, .45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.toast { position: fixed; left: 50%; bottom: 56px; transform: translateX(-50%); background: rgba(20, 22, 28, .92); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 99; max-width: 86vw; }

input, select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; background: #fff; font-family: inherit; color: var(--text);
}
input:focus, select:focus { outline: 2px solid #c7d7fe; border-color: var(--brand); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mt { margin-top: 10px; }
.mb { margin-bottom: 10px; }

/* ── 管理台 ── */
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.nav a { padding: 7px 14px; border-radius: 8px; color: var(--text); font-size: 14px; }
.nav a.active { background: var(--brand); color: #fff; }
.nav a#logoutLink { margin-left: auto; color: var(--muted); }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: #fafbfc; color: var(--muted); font-weight: 600; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.wrap { white-space: normal; max-width: 320px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
