:root {
  --gold: #c9a24b;
  --gold-2: #e8c878;
  --navy: #0f2742;
  --navy-2: #16365c;
  --ink: #1f2a37;
  --muted: #7c8aa0;
  --bg: #f4f1ea;
  --card: #ffffff;
  --line: #e6e1d6;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1200px 400px at 50% -120px, rgba(201,162,75,.18), transparent),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
.page { max-width: 480px; margin: 0 auto; padding: 18px 16px 40px; }

/* Hero */
.hero { text-align: center; padding: 26px 10px 18px; }
.badge {
  display: inline-block; letter-spacing: 4px; font-size: 11px; font-weight: 700;
  color: var(--gold); border: 1px solid var(--gold); border-radius: 999px;
  padding: 4px 12px; margin-bottom: 12px;
}
.hero h1 {
  margin: 0; font-size: 26px; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

/* Card */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 16px; box-shadow: 0 10px 30px rgba(15,39,66,.06);
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--navy); }
.req { color: #d9534f; }
.field input {
  width: 100%; height: 46px; padding: 0 14px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; background: #fbfaf7; color: var(--ink);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,75,.15); }
.field.readonly .ro-value {
  height: 46px; display: flex; align-items: center; padding: 0 14px;
  background: #f1eee6; border: 1px dashed var(--line); border-radius: 10px;
  color: var(--muted); font-size: 14px;
}
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.btn-code {
  flex: 0 0 116px; border: none; border-radius: 10px; font-size: 14px; font-weight: 700;
  color: #fff; cursor: pointer;
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
}
.btn-code:disabled { background: #b9c2cf; cursor: not-allowed; }
.code-tip { margin: 8px 2px 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.code-tip b { color: var(--gold); font-weight: 700; }

.btn-submit {
  width: 100%; height: 50px; margin-top: 6px; border: none; border-radius: 12px;
  font-size: 17px; font-weight: 800; letter-spacing: 2px; color: #2a1d05; cursor: pointer;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  box-shadow: 0 8px 20px rgba(201,162,75,.35);
}
.btn-submit:active { transform: translateY(1px); }

.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }

/* 导出登记信息按钮（隐蔽低调）*/
.export-bar { text-align: center; margin-top: 18px; }
.btn-export {
  border: none; background: transparent; padding: 4px 8px;
  color: #b9b2a3; font-size: 11px; letter-spacing: .5px; cursor: pointer;
  opacity: .45; transition: opacity .2s, color .2s;
}
.btn-export:hover, .btn-export:active { opacity: 1; color: var(--gold); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: rgba(15,39,66,.94); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; max-width: 86%;
  text-align: center; z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: rgba(22,101,52,.95); }
.toast.err { background: rgba(160,40,40,.95); }

/* Success overlay */
.success-mask {
  position: fixed; inset: 0; background: rgba(15,39,66,.45); display: none;
  align-items: center; justify-content: center; z-index: 100; padding: 24px;
}
.success-mask.show { display: flex; }
.success-box {
  background: #fff; border-radius: 18px; padding: 30px 26px; text-align: center; max-width: 320px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25); animation: pop .35s ease;
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-box .check {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  display: flex; align-items: center; justify-content: center; color: #2a1d05; font-size: 34px; font-weight: 900;
}
.success-box h2 { margin: 0 0 8px; color: var(--navy); font-size: 20px; }
.success-box p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.success-box button {
  border: none; background: var(--navy); color: #fff; padding: 11px 26px; border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer;
}

/* ===== 隐藏配置触发（极低存在感，平时隐藏）===== */
.cfg-trigger {
  position: fixed; right: 10px; bottom: 10px; width: 34px; height: 34px;
  border: none; border-radius: 50%; background: rgba(15,39,66,.25); color: #fff;
  font-size: 16px; opacity: .12; z-index: 40; cursor: pointer; transition: opacity .2s;
}
.cfg-trigger:active { opacity: .6; }

/* ===== 密码弹层 ===== */
.pw-modal {
  position: fixed; inset: 0; background: rgba(15,39,66,.5); display: none;
  align-items: center; justify-content: center; z-index: 60; padding: 24px;
}
.pw-modal.show { display: flex; }
.pw-box {
  background: #fff; border-radius: 16px; padding: 22px 20px; width: 100%; max-width: 300px;
  box-shadow: 0 20px 50px rgba(0,0,0,.3); animation: pop .3s ease;
}
.pw-title { font-size: 16px; font-weight: 800; color: var(--navy); margin-bottom: 14px; text-align: center; }
.pw-box input {
  width: 100%; height: 44px; padding: 0 12px; font-size: 15px; border: 1px solid var(--line);
  border-radius: 10px; outline: none; text-align: center; letter-spacing: 2px;
}
.pw-box input:focus { border-color: var(--gold); }
.pw-err { color: #d9534f; font-size: 12px; min-height: 16px; margin-top: 8px; text-align: center; }
.pw-actions { display: flex; gap: 10px; margin-top: 12px; }
.pw-btn { flex: 1; height: 42px; border: none; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; }
.pw-btn.cancel { background: #eef0f3; color: #64748b; }
.pw-btn.ok { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1d05; }

/* ===== 短信网关配置面板 ===== */
.cfg-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: #fff;
  border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(15,39,66,.25);
  transform: translateY(110%); transition: transform .3s ease; max-height: 88vh; overflow-y: auto;
}
.cfg-panel.show { transform: translateY(0); }
.cfg-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff;
  font-size: 16px; font-weight: 800; color: var(--navy);
}
.cfg-close { border: none; background: #eef0f3; color: #64748b; padding: 6px 14px; border-radius: 999px; font-size: 13px; cursor: pointer; }
.cfg-body { padding: 16px; }
.cfg-mode { display: flex; gap: 10px; margin-bottom: 10px; }
.mode-btn {
  flex: 1; height: 44px; border: 1.5px solid var(--line); background: #fbfaf7; border-radius: 10px;
  font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.mode-btn.active { border-color: var(--gold); background: #fff7e9; color: var(--navy); }
.cfg-hint { font-size: 12.5px; color: var(--muted); background: #f6f4ee; border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; line-height: 1.5; }
.cfg-fields { display: flex; flex-direction: column; gap: 6px; }
.cfg-fields label { font-size: 13px; font-weight: 600; color: var(--navy); margin-top: 6px; }
.cfg-fields input, .cfg-fields select {
  height: 42px; padding: 0 12px; font-size: 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fbfaf7; outline: none;
}
.cfg-fields input:focus, .cfg-fields select:focus { border-color: var(--gold); }
.cfg-fields.disabled { opacity: .5; pointer-events: none; }
.cfg-actions { display: flex; gap: 10px; margin-top: 16px; }
.cfg-btn { flex: 1; height: 46px; border: none; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; }
.cfg-btn.ghost { background: #eef0f3; color: #64748b; }
.cfg-btn.primary { background: linear-gradient(180deg, var(--navy-2), var(--navy)); color: #fff; }
