:root {
  --three-purple: #5a2d8c;
  --three-purple-dark: #46236e;
  --three-gray: #f3f1f6;
  --ok: #1a7f37;
  --warn: #b42318;
  --ink: #1c1c1c;
  --muted: #6b6b6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  background: var(--three-gray);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.6;
}

.topbar {
  background: var(--three-purple);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.logo span { opacity: .85; font-weight: 500; }

.pill {
  font-size: 15px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
}
.pill-on { background: #2e9e4f; }
.pill-off { background: rgba(255,255,255,.18); }

.wrap {
  max-width: 640px;
  margin: 22px auto;
  padding: 0 16px;
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 24px 22px;
  box-shadow: 0 2px 10px rgba(70,35,110,.08);
  margin-bottom: 18px;
}
.hidden { display: none !important; }

h1 { font-size: 24px; margin: 0 0 8px; color: var(--three-purple-dark); }
.hint { color: var(--muted); margin: 0 0 16px; font-size: 16px; }

label { display: block; font-weight: 600; margin: 14px 0 6px; }

/* ===== 全站统一的表单控件尺寸（适中） ===== */
input, select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: normal;
  padding: 11px 12px;
  border: 2px solid #d8d2e4;
  border-radius: 12px;
  outline: none;
  background: #fbfaff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--three-purple);
  box-shadow: 0 0 0 4px rgba(90,45,140,.12);
  background: #fff;
}
input::placeholder, select:invalid, textarea::placeholder { color: #b3aec2; font-weight: 400; }
/* 占位提示居中：输入内容后恢复左对齐 */
input:placeholder-shown { text-align: center; }
textarea { resize: vertical; font-weight: 500; line-height: 1.6; }
.ofield { margin-bottom: 14px; }
.ofield label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }

/* 首页查询手机号：唯一的大号输入框 */
#msisdn {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 18px;
  border-radius: 14px;
  text-align: center;
}

.btn {
  display: inline-block;
  width: 100%;
  margin-top: 18px;
  font-size: 20px;
  font-weight: 700;
  padding: 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn-primary { background: var(--three-purple); color: #fff; }
.btn-primary:active { background: var(--three-purple-dark); }
.btn-ghost {
  width: auto;
  margin-top: 0;
  background: #efeaf6;
  color: var(--three-purple-dark);
  font-size: 16px;
  padding: 10px 16px;
}

.msg { margin-top: 14px; font-size: 16px; min-height: 22px; }
.msg.err { color: var(--warn); }
.msg.ok { color: var(--ok); }

/* OTP */
.otp-row { display: flex; gap: 10px; justify-content: center; margin: 18px 0; }
.otp-box {
  width: 52px; height: 64px;
  font-size: 30px; text-align: center;
  border: 2px solid #d8d2e4; border-radius: 12px;
}
.otp-box:focus { border-color: var(--three-purple); }

/* dashboard */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input { flex: 1 1 200px; margin: 0; }
.toolbar .btn { width: auto; margin: 0; }

.cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
.numcard {
  border: 2px solid #e7e0f2;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.numcard .num { font-size: 20px; font-weight: 700; }
.numcard .data { font-size: 26px; font-weight: 800; color: var(--three-purple); text-align: right; }
.numcard .sub { font-size: 14px; color: var(--muted); }

.refine { margin-top: 22px; border-top: 1px dashed #ccc; padding-top: 16px; }
.raw-actions { display: flex; gap: 10px; margin: 10px 0; }
.raw {
  max-height: 320px; overflow: auto;
  background: #1e1e1e; color: #d6d6d6;
  font-size: 12px; padding: 12px; border-radius: 10px;
  white-space: pre-wrap; word-break: break-word;
}

.foot { text-align: center; margin-top: 18px; font-size: 14px; }
.foot a { color: var(--three-purple); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.rows { margin-top: 14px; border-top: 1px solid rgba(0,0,0,.08); }
.rows .row { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px; font-size: 18px; border-bottom: 1px solid rgba(0,0,0,.06); }
.rows .row span { color: #555; }
.rows .row b { font-size: 20px; }
.numcard .numlabel { font-size: 15px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.rows .row.warn {
  display: block;
  text-align: center;
  color: var(--warn);
  font-weight: 700;
  background: #fdf0ef;
  border-radius: 10px;
  margin-top: 12px;
  padding: 12px 10px;
  border-bottom: none;
}

/* ===== 通用 ===== */
.topbar a.back { color: #fff; text-decoration: none; font-size: 15px; opacity: .9; }
.sec-title { font-weight: 700; font-size: 17px; margin: 18px 0 10px; color: var(--three-purple-dark); }
.red { color: var(--warn); }
.mono { font-family: ui-monospace, Consolas, Menlo, monospace; letter-spacing: .5px; }
.money { color: var(--warn); font-size: 20px; }
.field { margin: 6px 0 4px; }
.field label { margin-top: 8px; }
.tips { margin: 0; padding-left: 22px; line-height: 1.9; font-size: 16px; color: #444; }
.tips li { margin-bottom: 2px; }
.tips-ok li { list-style: none; margin-left: -14px; }
.tips-ok li::before { content: "•"; color: var(--three-purple); font-weight: 800; display: inline-block; width: 14px; margin-left: -14px; }
.alert {
  background: #fdf0ef; border: 1px solid #f5c6c2; color: #8a1f16;
  border-radius: 12px; padding: 12px 14px; font-size: 16px; margin-top: 12px; line-height: 1.7;
}
.btn-wide { width: 100%; margin-top: 14px; }
.btn:disabled { opacity: .6; cursor: default; }

/* ===== 立即充值按钮（实心底色） ===== */
.btn-pay { background: var(--three-purple); color: #fff; margin-top: 16px; }
.btn-pay:active { background: var(--three-purple-dark); }

/* ===== 顶部按钮组 / 返回上一页 ===== */
.topbtns { display: flex; gap: 14px; align-items: center; }
.topbtns .back { font-size: 15px; }

/* ===== 扫码区上方的备注提示（醒目红底） ===== */
.qrnudge {
  background: linear-gradient(135deg, #d92b1f, #ff5a3c); color: #fff; font-weight: 800; font-size: 16px;
  text-align: center; padding: 12px; border-radius: 12px; margin-bottom: 10px;
  border: 2px dashed rgba(255, 255, 255, .75);
  box-shadow: 0 4px 14px rgba(217, 43, 31, .35);
}

/* ===== 卡片形式选择（实体卡 / eSIM） ===== */
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  font-family: inherit; font-size: 16px; padding: 10px 20px;
  border-radius: 999px; border: 2px solid #d8d2e4; background: #fbfaff; color: #333; cursor: pointer;
}
.chip.on { background: var(--three-purple); color: #fff; border-color: var(--three-purple); font-weight: 700; }

/* ===== 收货地址（级联下拉） ===== */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 .field { margin: 0; }
@media (max-width: 420px) { .row2 { grid-template-columns: 1fr; } }

/* ===== 首页最近查询号码 ===== */
.recent { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.recent-l { font-size: 13px; color: var(--muted); }
.rchip {
  font-family: inherit; font-size: 16px; font-weight: 700; letter-spacing: 1px;
  padding: 7px 14px; border-radius: 999px; border: 2px solid #d8d2e4;
  background: #fff; color: var(--three-purple-dark); cursor: pointer;
}
.rchip:active { background: #f3ecff; }
.rclear { border-style: dashed; color: var(--muted); font-weight: 400; }

/* ===== 后台 ===== */
.mgt-tiles .tile { font-family: inherit; cursor: pointer; width: 100%; }
.ocard.olow { background: #fff8e6; border-color: #f0d69a; }

/* ===== 首页入口按钮 ===== */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile {
  display: block; text-decoration: none; color: var(--ink);
  background: #fbfaff; border: 2px solid #e2dcf0; border-radius: 14px;
  padding: 16px 12px; text-align: center;
}
.tile:active { transform: translateY(1px); }
.tile-ico {
  width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.tile-ico svg { width: 24px; height: 24px; display: block; }
.tile-ico .emoji { font-size: 24px; line-height: 1; display: block; }
.tile-ico img { width: 30px; height: 30px; object-fit: contain; display: block; border-radius: 6px; }
.tile-t { font-size: 18px; font-weight: 800; }
.tile-d { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.tile-a { border-color: #d9cff0; } .tile-a .tile-ico { background: var(--three-purple); }
.tile-b { border-color: #cfe0f5; } .tile-b .tile-ico { background: #185fa5; }
.tile-c { border-color: #c6e7db; } .tile-c .tile-ico { background: #0f6e56; }
.tile-d { border-color: #f0dfc0; } .tile-d .tile-ico { background: #a06a00; }
.tile-e { border-color: #d8ecd0; } .tile-e .tile-ico { background: #2e7d32; }
.tile-f { border-color: #cfe8ec; } .tile-f .tile-ico { background: #00697b; }

/* ===== 购卡三套餐并排 ===== */
.plan3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.p3 {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink); position: relative;
  background: #fbfaff; border: 2px solid #e2dcf0; border-radius: 16px; padding: 18px 14px 14px;
  text-align: center;
}
.p3:active { transform: translateY(1px); }
.p3-tag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--three-purple); color: #fff; font-size: 12px;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
/* 推荐套餐右上角皇冠角标 */
.p3-rec {
  position: absolute; top: -14px; right: -8px; z-index: 2;
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #ffd257, #e8940c);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(232, 148, 12, .45);
  border: 2px solid #fff;
}
.p3-rec svg { width: 22px; height: 22px; fill: #fff; }
.p3-title { font-size: 17px; font-weight: 800; line-height: 1.4; margin-top: 6px; }
.p3-sum { font-size: 15px; color: var(--three-purple); font-weight: 700; margin-top: 6px; }
.p3-desc { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.6; flex: 1; }
.p3-price { font-size: 16px; color: var(--three-purple); font-weight: 700; margin-top: 10px; }
.p3-price b { font-size: 30px; }
.p3-more {
  margin-top: 10px; background: var(--three-purple); color: #fff;
  border-radius: 10px; padding: 9px; font-size: 15px; font-weight: 700;
}

/* ===== 套餐详情 ===== */
.pd-head { text-align: center; padding: 4px 0 10px; border-bottom: 1px dashed #ddd; }
.pd-title { font-size: 21px; font-weight: 800; line-height: 1.4; }
.pd-sum { font-size: 16px; color: var(--three-purple); font-weight: 700; margin-top: 6px; }
.pd-price { font-size: 18px; color: var(--three-purple); font-weight: 700; margin-top: 8px; }
.pd-price b { font-size: 36px; }
.pd-desc { font-size: 16px; color: #444; margin-top: 14px; line-height: 1.8; }

/* ===== 查询结果里的订单记录 ===== */
.o-row { align-items: flex-start; }
.o-l { display: flex; flex-direction: column; gap: 2px; }
.o-l i { font-style: normal; font-size: 13px; color: var(--muted); line-height: 1.5; }
.o-r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.o-r .money { font-size: 18px; }
.t-done { background: #0f6e56; }
.field-hint { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.6; }

/* ===== 护照照片上传预览 ===== */
.upprev { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.upitem { width: 96px; text-align: center; }
.upitem img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 2px solid #d8d2e4; display: block; }
.upitem span { font-size: 11px; color: var(--muted); word-break: break-all; display: block; margin-top: 4px; }
input[type="file"] { padding: 8px; background: #fff; }

/* ===== 付款页 ===== */
.btn-paybig { background: #d92b1f; color: #fff; font-size: 21px; margin-top: 18px; }
.btn-paybig:active { background: #b32218; }
.memo {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #fbfaff; border: 2px dashed var(--three-purple); border-radius: 12px;
  padding: 14px 16px; margin-top: 4px;
}
.memo span { font-size: 22px; font-weight: 800; letter-spacing: 1px; font-family: ui-monospace, Consolas, Menlo, monospace; }
.btn-copy {
  background: var(--three-purple); color: #fff; border: none; border-radius: 10px;
  padding: 10px 16px; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap;
}

/* ===== 管理后台 ===== */
.mgt-head { display: flex; align-items: center; justify-content: space-between; }
.mgt-head h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.stat { background: #fbfaff; border: 1px solid #e7e0f2; border-radius: 12px; padding: 12px 8px; text-align: center; }
.s-n { font-size: 20px; font-weight: 800; color: var(--three-purple); }
.s-l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input {
  font-size: 15px; padding: 9px 10px; border: 2px solid #d8d2e4; border-radius: 10px; background: #fbfaff;
}
.filters input { flex: 1 1 160px; }
.filters .btn { width: auto; margin: 0; padding: 9px 14px; font-size: 15px; }
.olist { display: grid; gap: 12px; }
.ocard { border: 2px solid #e7e0f2; border-radius: 14px; padding: 14px 16px; background: #fff; }
.ocard.odone { background: #f4faf6; border-color: #c6e7db; }
.o-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 17px; }
.tag { font-size: 12px; padding: 2px 9px; border-radius: 999px; color: #fff; font-weight: 600; }
.t-card { background: var(--three-purple); }
.t-rec { background: #185fa5; }
.t-paid { background: #1a7f37; }
.t-wait { background: #f5a623; color: #3d2b00; }
.o-line { font-size: 15px; margin-top: 6px; line-height: 1.6; }
.o-dim { color: var(--muted); font-size: 13px; }
.o-err { color: var(--warn); font-size: 13px; }
.o-act { margin-top: 10px; border-top: 1px dashed #e0e0e0; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; }
.o-act label { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin: 0; }
.o-act input { width: 20px; height: 20px; }
.o-act .btn-ghost { width: auto; }

@media (max-width: 720px) {
  .plan3, .stats { grid-template-columns: 1fr; }
  .p3-desc { min-height: 0; }
}

/* ===== 充值弹层 ===== */
.modal {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(28, 28, 28, .55);
  display: flex;
  padding: 18px;
  overflow-y: auto;
  z-index: 50;
}
.modal-box {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  margin: auto;
  padding: 18px 20px 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 22px; font-weight: 800; color: var(--three-purple-dark); }
.modal-x {
  background: none; border: none; color: #888;
  font-size: 32px; line-height: 1; cursor: pointer; padding: 0 6px;
}
.modal-box label { margin-top: 12px; }

.sec-label { font-weight: 700; font-size: 17px; margin: 20px 0 10px; color: var(--three-purple-dark); }

.plans { display: grid; gap: 12px; }
.plan {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; font-family: inherit;
  background: #fbfaff; border: 2px solid #e2dcf0; border-radius: 14px;
  padding: 14px 16px; cursor: pointer;
}
.plan.on { border-color: var(--three-purple); background: #f3ecff; box-shadow: 0 0 0 3px rgba(90, 45, 140, .1); }
.plan-title { font-size: 19px; font-weight: 800; }
.plan-sum { font-size: 15px; color: var(--muted); margin-top: 2px; }
.plan-desc { font-size: 14px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.plan-price { font-size: 16px; font-weight: 700; color: var(--three-purple); white-space: nowrap; }
.plan-price b { font-size: 28px; }
.plan-empty { color: var(--muted); font-size: 16px; padding: 8px 0; }

.qr-sec { margin-top: 6px; border-top: 1px dashed #ddd; }
.qrbox {
  display: flex; align-items: center; justify-content: center;
  background: #fafafa; border: 1px solid #eee; border-radius: 14px; padding: 16px;
}
.qrbox img { width: 300px; height: 300px; object-fit: contain; }
.pm-item { margin-bottom: 16px; }
.pm-name { font-weight: 600; margin-bottom: 8px; text-align: center; }
.pm-thumb { width: 56px; height: 56px; object-fit: contain; border-radius: 6px; border: 1px solid var(--border); background: #fff; }
.qr-dl { text-align: center; }
.qr-fallback { text-align: center; color: var(--muted); font-size: 15px; padding: 40px 10px; line-height: 1.9; }
.pay-amount { text-align: center; font-size: 17px; margin-top: 14px; color: var(--muted); }
.pay-amount b { font-size: 32px; color: var(--three-purple); margin-left: 4px; }
.pay-notice {
  background: #fff8e6; border: 1px solid #ffe2a8; color: #7a5200;
  border-radius: 12px; padding: 12px 14px; font-size: 15px; margin-top: 12px; line-height: 1.75;
}
.pay-support { margin-top: 12px; text-align: center; font-size: 15px; color: var(--muted); line-height: 1.7; }

.done-badge {
  width: 56px; height: 56px; border-radius: 50%;
  background: #e6f6ec; color: var(--ok);
  font-size: 30px; display: flex; align-items: center; justify-content: center;
  margin: 4px auto 10px;
}
.done-title { text-align: center; font-size: 21px; font-weight: 800; color: var(--ok); }
.done-tip { text-align: center; margin-top: 12px; font-size: 15px; color: var(--muted); border-bottom: none; padding-top: 0; }

@media (max-width: 420px) {
  .qrbox img { width: 240px; height: 240px; }
  .modal-box { padding: 16px 14px 20px; }
}
