: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[type=text], input[type=password], input[type=tel] {
  width: 100%;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 18px;
  border: 2px solid #d8d2e4;
  border-radius: 14px;
  outline: none;
  background: #fbfaff;
  transition: border-color .15s, box-shadow .15s;
}
input[type=tel] { text-align: center; }
input:focus {
  border-color: var(--three-purple);
  box-shadow: 0 0 0 4px rgba(90,45,140,.12);
  background: #fff;
}

.btn {
  display: inline-block;
  width: 100%;
  margin-top: 18px;
  font-size: 20px;
  font-weight: 700;
  padding: 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}
.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;
}
