/* 仅使用本机/系统字体，不依赖境外 CDN（Google Fonts 等） */
:root {
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
    "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei", sans-serif;
  --font-display: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
    "Noto Sans CJK SC", sans-serif;
  --font-mono: "Sarasa Mono SC", "Cascadia Mono", "Consolas", "Courier New", monospace;
  --ink: #0b1f2a;
  --ink-2: #143443;
  --teal: #1f6f78;
  --teal-2: #2a8f8a;
  --sand: #f3ebe2;
  --paper: #fffaf4;
  --amber: #c9842f;
  --amber-2: #e0a453;
  --line: rgba(11, 31, 42, 0.12);
  --muted: rgba(11, 31, 42, 0.62);
  --danger: #b42318;
  --ok: #1b7a4a;
  --shadow: 0 18px 50px rgba(11, 31, 42, 0.12);
  --radius: 18px;
  --nav-h: 64px;
  --tab-h: 64px;
  --max: 720px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(42, 143, 138, 0.22), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(201, 132, 47, 0.18), transparent 50%),
    linear-gradient(180deg, #f7f1ea 0%, #efe6db 45%, #e7ddd1 100%);
  background-attachment: fixed;
}

a { color: var(--teal); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 16px calc(var(--tab-h) + 24px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(10px);
  background: rgba(247, 241, 234, 0.82);
  border-bottom: 1px solid var(--line);
  margin: 0 -16px;
  padding: 0 16px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 1.35rem;
  color: var(--ink);
}
.brand span { color: var(--teal); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31, 111, 120, 0.1);
  color: var(--teal);
  font-size: 12px;
}

.hero {
  padding: 28px 0 12px;
  animation: rise 0.55s ease both;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  line-height: 1.2;
  margin: 0 0 10px;
  letter-spacing: 0.01em;
  font-weight: 700;
}
.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 36em;
}

.panel {
  background: rgba(255, 250, 244, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-top: 16px;
  animation: rise 0.6s ease both;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.form-grid { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(31, 111, 120, 0.55);
  box-shadow: 0 0 0 3px rgba(31, 111, 120, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 600;
  transition: transform .15s ease, opacity .15s ease, background .2s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  color: #fff;
}
.btn-amber {
  background: linear-gradient(135deg, var(--amber), var(--amber-2));
  color: #1a1208;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-danger {
  background: rgba(180, 35, 24, 0.1);
  color: var(--danger);
  border: 1px solid rgba(180, 35, 24, 0.2);
}
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.muted { color: var(--muted); font-size: 13px; }
.price {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--amber);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.list { display: grid; gap: 10px; }
.list-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform .15s ease, border-color .2s;
}
.list-item:hover { transform: translateY(-1px); border-color: rgba(31,111,120,.35); }
.list-item .title { font-weight: 600; }
.list-item .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }

.badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge-ok { background: rgba(27,122,74,.12); color: var(--ok); }
.badge-warn { background: rgba(201,132,47,.15); color: #8a5a12; }
.badge-muted { background: rgba(11,31,42,.08); color: var(--muted); }
.badge-bad { background: rgba(180,35,24,.12); color: var(--danger); }

.tabs {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(100%, var(--max));
  height: var(--tab-h);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255,250,244,.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  z-index: 30;
}
.tab {
  display: grid;
  place-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  background: none;
  border: none;
  padding: 8px 4px;
}
.tab.active { color: var(--teal); font-weight: 700; }
.tab svg { width: 22px; height: 22px; }

.status-log {
  max-height: 240px;
  overflow: auto;
  background: var(--ink);
  color: #d7e7e4;
  border-radius: 12px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
}

.status-error {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(180, 35, 24, 0.08);
  border: 1px solid rgba(180, 35, 24, 0.25);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.6;
}

.sms-timer {
  background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
  padding: 10px 14px; border-radius: 10px; font-size: 14px; text-align: center;
}

.qr-box {
  display: inline-block; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; margin-top: 12px;
}
.qr-box svg { display: block; width: 220px; height: 220px; }

.wait-card {
  width: 100%;
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
  padding: 22px 16px 6px;
}
.wait-card .wait-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ok);
}
.wait-card .wait-title::before {
  content: "✓";
  display: inline-block;
  margin-right: 8px;
  width: 26px;
  height: 26px;
  line-height: 26px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 15px;
}
.wait-card .wait-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  max-width: 30em;
}
.wait-card .btn { max-width: 320px; }
.progress-list { display: grid; gap: 8px; margin: 12px 0; }
.progress-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line);
}
.dot {
  width: 10px; height: 10px; border-radius: 50%; margin-top: 5px;
  background: var(--teal); box-shadow: 0 0 0 4px rgba(31,111,120,.15);
  animation: pulse 1.6s ease infinite;
}

.toast {
  position: fixed; left: 50%; top: 18px; transform: translateX(-50%) translateY(-200%);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px;
  z-index: 99; font-size: 13px; max-width: 90vw;
  opacity: 0; visibility: hidden;
  transition: transform .25s ease, opacity .25s ease, visibility 0s linear .25s;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1; visibility: visible;
  transition: transform .25s ease, opacity .25s ease;
}

.admin-layout { display: grid; gap: 12px; }
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-nav .btn { padding: 8px 12px; font-size: 13px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; }

.empty {
  text-align: center; color: var(--muted); padding: 36px 12px;
}

.auth-wrap {
  min-height: calc(100vh - 40px);
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 24px 0;
}
.auth-wrap .brand { font-size: 2rem; }

.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .split-2 { grid-template-columns: 1fr; } }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(31,111,120,.15); }
  50% { box-shadow: 0 0 0 8px rgba(31,111,120,.08); }
}

/* ---------- 授权委托书弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(11, 31, 42, 0.48);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: rise 0.2s ease both;
}
body.modal-open { overflow: hidden; }

.modal {
  width: 100%;
  max-width: 560px;
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.modal-x {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  padding: 0 4px;
}
.modal-body { padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-foot {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(243, 235, 226, 0.6);
}
.modal-foot .btn { flex: 1; }

.agreement { font-size: 13px; line-height: 1.85; color: var(--ink-2); }
.agreement-title {
  font-family: var(--font-display);
  text-align: center;
  font-size: 1.02rem;
  margin: 0 0 14px;
}
.agreement p { margin: 0 0 10px; text-align: justify; }
.agreement .agreement-h { font-weight: 700; color: var(--ink); margin-top: 16px; }
.agreement-sign {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 8px;
}
.agreement-sign-row { display: flex; gap: 6px; flex-wrap: wrap; }
.agreement-sign-row b { color: var(--ink); }

/* ---------- 授权勾选行 ---------- */
.agree-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.agree-text { font-size: 13px; line-height: 1.6; }
.agree-check {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 6px;
  border: 1.5px solid rgba(11, 31, 42, 0.3);
  background: #fff;
  position: relative;
  transition: background .2s, border-color .2s;
}
.agree-check.checked {
  background: var(--teal);
  border-color: var(--teal);
}
.agree-check.checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.hidden { display: none !important; }

.admin-search { display: flex; gap: 8px; margin-bottom: 12px; }
.admin-search input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-actions .btn { padding: 6px 10px; font-size: 12px; }
.qr-box { text-align: center; display: grid; gap: 12px; justify-items: center; }
.qr-box img {
  width: 220px;
  height: 220px;
  background: #fff;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.mono { font-family: var(--font-mono); font-size: 12px; word-break: break-all; }
