:root {
  --ink: #1f1f1f;
  --muted: #666;
  --paper: #f5f7fa;
  --card: #fff;
  --line: #ebeef5;
  --pine: #409eff;
  --pine-2: #337ecc;
  --coral: #f56c6c;
  --good: #67c23a;
  --warn: #e6a23c;
  --sidebar: #e8f6f8;
  --side-text: #303133;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  text-rendering: optimizeSpeed;
}
a { color: var(--pine); text-decoration: none; }
h1 { font-size: 18px; font-weight: 600; margin: 0; color: #303133; }
h2, h3 { font-size: 15px; font-weight: 600; margin: 0 0 10px; color: #303133; }
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #fff;
}
.auth-card {
  width: min(400px, 92vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px 24px;
}
.brand { font-weight: 700; letter-spacing: .04em; color: #303133; font-size: 15px; }
.auth-card h1 { margin: 8px 0 4px; font-size: 22px; }
.sub { color: var(--muted); margin: 0 0 14px; font-size: 13px; }
label { display: block; font-size: 13px; margin: 10px 0 6px; color: #606266; }
input, select, textarea {
  width: 100%;
  border: 1px solid #dcdfe6;
  background: #fff;
  color: var(--ink);
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--pine);
}
input[readonly], textarea[readonly] { background: #fafafa; color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 4px; padding: 8px 14px; font: inherit; cursor: pointer;
  color: var(--ink);
}
.btn-primary { background: var(--pine); color: #fff; width: 100%; margin-top: 16px; }
.btn-ghost { background: #fff; border: 1px solid #dcdfe6; color: #606266; }
.btn-coral { background: var(--coral); color: #fff; }
.layout { display: grid; grid-template-columns: 300px 1fr; min-height: 100vh; background: #fff; min-width: 0; }
.main { padding: 18px 22px 40px; background: var(--paper); min-width: 0; }
.side {
  background: var(--sidebar);
  color: var(--side-text);
  padding: 18px 0 36px;
  border-right: 1px solid #d7ebee;
  font-size: 21px;
}
.side .brand { padding: 15px 24px 21px; font-size: 23px; }
.side a {
  display: block; color: inherit; padding: 14px 24px; margin: 0; border-left: 5px solid transparent; font-size: 21px;
}
.side a.active, .side a:hover {
  background: #fff;
  color: var(--pine);
  border-left-color: var(--coral);
}
.side .who { padding: 0 24px 18px; color: #606266; font-size: 18px; }
.side .who b { color: var(--ink); font-weight: 650; }
.side .group {
  margin: 0;
  padding: 15px 24px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
  color: #303133;
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.side .group::-webkit-details-marker { display: none; }
.side .group::after { content: "▸"; font-size: 17px; opacity: .55; color: #909399; }
.side details[open] > .group::after { content: "▾"; }
.side .group:hover { background: rgba(255,255,255,.55); }
.side details.nav-group { margin: 0; }
.ops { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.shelf-form { display: inline-flex; margin: 0; }
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex: 0 0 auto;
}
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #dcdfe6; border-radius: 999px; transition: .2s;
}
.slider:before {
  content: ""; position: absolute; height: 16px; width: 16px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--pine); }
.switch input:checked + .slider:before { transform: translateX(18px); }
summary { cursor: pointer; color: var(--ink); }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.pills { display: flex; gap: 10px; flex-wrap: wrap; }
.pill {
  background: #fff; border: 1px solid var(--line); border-radius: 4px;
  padding: 12px 14px; min-width: 140px;
}
.pill b { display: block; font-size: 20px; margin-top: 4px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 14px;
}
.fold-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin: 0 0 14px;
}
.fold-box > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
}
.fold-box > summary::-webkit-details-marker { display: none; }
.fold-box > summary::after { content: "▸"; font-size: 14px; opacity: .55; color: #909399; }
.fold-box[open] > summary::after { content: "▾"; }
.fold-box > .card {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}
.table {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--line); margin-bottom: 16px;
}
.table th, .table td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink);
}
.table th { background: #fafafa; color: #606266; font-weight: 600; }
.table tr.is-picked td { background: #ecf5ff; }
.flash { background:#ecf5ff; border:1px solid #d9ecff; color:#409eff; padding:10px 12px; border-radius:4px; margin:0 0 14px; }
.flash.ok { background:#f0f9eb; border-color:#e1f3d8; color:#67c23a; }
.flash.bad { background:#fef0f0; border-color:#fde2e2; color:#f56c6c; }
.badge { border-radius: 3px; padding: 2px 8px; font-size: 12px; }
.ok { background: #f0f9eb; color: #67c23a; }
.warn { background: #fdf6ec; color: #e6a23c; }
.bad { background: #fef0f0; color: #f56c6c; }
.country-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px;
  margin: 0 0 14px;
}
.country-tabs a {
  padding: 8px 14px;
  border-radius: 4px;
  color: var(--ink);
  font-weight: 500;
}
.country-tabs a.active {
  background: var(--pine);
  color: #fff;
}
.buy-countries .country-tabs {
  padding: 8px;
  margin: 0 0 18px;
}
.buy-countries .country-tabs a {
  font-size: 28px;
  line-height: 1.2;
  padding: 16px 28px;
  font-weight: 600;
}
.muted { color: var(--muted); font-size: 13px; max-width: 480px; }
.badge.avail { background: #f0f9eb; color: #67c23a; font-weight: 600; }
.badge.sold { background: #fef0f0; color: #f56c6c; font-weight: 600; }
.expired-row td { background: #fef0f0 !important; }
.expired-text { color: #f56c6c; font-weight: 600; }
.badge.send { background: #ecf5ff; color: #409eff; font-weight: 600; }
.btn-sm { width: auto; margin: 0; padding: 5px 10px; font-size: 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; align-items: flex-end; }
.filters input, .filters select { width: auto; min-width: 140px; }
.filters label { margin: 0; }
.err { background: #fef0f0; border-color: #fde2e2; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chk { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; font-weight: 400; }
.mode-tabs {
  display: flex;
  width: max-content;
  gap: 0;
  border-bottom: 2px solid #e4e7ed;
  margin: 0 0 16px;
}
.mode-tabs button {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin: 0 0 -2px;
  padding: 10px 28px;
  font-size: 15px;
  font-weight: 600;
  color: #303133;
  cursor: pointer;
  width: auto;
}
.mode-tabs button.active {
  color: var(--pine);
  border-bottom-color: var(--pine);
}
.mode-hint { font-size: 12px; color: var(--muted); margin: 0 0 16px; }
.mode-pane { border: 1px solid var(--line); border-radius: 6px; padding: 16px; background: #fafafa; margin: 0 0 16px; }
.hint-warn { color: #e6a23c; font-size: 12px; margin: 8px 0 0; }
pre.sms { white-space: pre-wrap; margin: 0; font-family: inherit; }
code { background: #f5f7fa; padding: 2px 6px; border-radius: 3px; word-break: break-all; color: var(--ink); }
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 50;
  place-items: center;
  padding: 20px;
}
.modal-bg.show { display: grid; }
.modal {
  background: #fff;
  width: min(640px, 94vw);
  max-height: 90vh;
  overflow: auto;
  border-radius: 6px;
  padding: 18px 20px 22px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.dropzone {
  border: 1px dashed #dcdfe6;
  border-radius: 4px;
  padding: 14px;
  text-align: center;
  color: var(--muted);
  margin: 8px 0 10px;
  cursor: pointer;
  background: #fafafa;
}
.dropzone.on { border-color: var(--pine); background: #ecf5ff; color: var(--pine); }
.pay-qr { text-align: center; margin: 12px 0; }
.pay-qr img {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px;
  width: 240px;
  height: 240px;
}
.modal-bg.renew-confirm {
  z-index: 80;
  background: rgba(0,0,0,.45);
}
.modal-bg.renew-confirm .modal {
  width: min(420px, 90vw);
  background: #fff;
  color: #111;
  text-align: left;
  padding: 28px 28px 22px;
  border: 1px solid #ddd;
}
.renew-confirm h3 {
  color: #111;
  font-size: 18px;
  margin: 0 0 16px;
}
.renew-confirm p,
.renew-confirm .renew-confirm-body {
  color: #111;
  font-size: 15px;
  line-height: 1.8;
  margin: 0 0 8px;
  white-space: pre-wrap;
}
.renew-confirm .row {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.renew-confirm .btn {
  color: #111;
  min-width: 88px;
}
.renew-confirm .btn-primary {
  color: #fff;
}
.pay-center {
  max-width: 560px;
  margin: 56px auto 40px;
  text-align: center;
  padding: 40px 32px 32px;
}
.pay-center label {
  font-size: 18px;
  color: #303133;
  margin: 0 0 14px;
  text-align: center;
}
.pay-amount {
  font-size: 48px;
  font-weight: 700;
  text-align: center;
  height: 84px;
  letter-spacing: .04em;
  border-width: 2px;
}
.pay-center .btn-primary {
  width: 100%;
  margin-top: 22px;
  padding: 14px 16px;
  font-size: 16px;
}
.row-actions { white-space: nowrap; }
.row-actions .btn { display: inline-block; vertical-align: middle; }
.xfer-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 0 8px;
  vertical-align: middle;
}
.xfer-form input {
  width: 132px;
  min-width: 110px;
  padding: 5px 8px;
  font-size: 12px;
}
.xfer-form input[type="number"] {
  width: 64px;
  min-width: 56px;
}
.suggest-wrap { position: relative; display: inline-block; }
.renew-card .row { margin-top: 12px; gap: 8px; flex-wrap: wrap; }
.suggest-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 30;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  max-height: 180px;
  overflow: auto;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}
.suggest-list li { padding: 6px 10px; cursor: pointer; font-size: 12px; }
.suggest-list li:hover { background: #ecf5ff; color: #409eff; }
.api-token code { font-size: 16px; word-break: break-all; }
.api-doc h3 { margin: 22px 0 8px; }
.api-doc p { margin: 0 0 8px; }
.api-ep { display: flex; gap: 8px; align-items: center; margin: 16px 0 8px; flex-wrap: wrap; }
.api-method {
  background: #409eff; color: #fff; border-radius: 3px;
  padding: 2px 8px; font-size: 12px; font-weight: 600;
}
.api-method.post { background: #67c23a; }
.api-doc pre.sms {
  background: #f5f7fa; border: 1px solid var(--line); border-radius: 4px;
  padding: 10px 12px; margin: 0 0 10px; font-family: Consolas, "Courier New", monospace; font-size: 13px;
}
.api-steps { margin: 0 0 8px 18px; padding: 0; color: #606266; }
.api-steps li { margin: 4px 0; }
.seg-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.seg-chip {
  margin: 0;
  border: 1px solid #dcdfe6;
  background: #fff;
  color: #111;
  padding: 6px 12px;
  border-radius: 4px;
}
.seg-chip input { margin-right: 6px; }
.pending-renew-btn { margin-left: auto; margin-right: 150px; }
.modal-bg.renew-confirm .pending-renew-modal {
  width: min(1100px, 92vw);
  max-height: 86vh;
  padding: 32px 36px 28px;
}
.proj-ico {
  width: 26px;
  height: 26px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 6px;
  flex-shrink: 0;
  background: #fff;
}
.lang-switch {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 100;
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px;
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}
.lang-switch a {
  color: #606266;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid transparent;
}
.lang-switch a.active {
  background: var(--paper);
  color: var(--pine);
  font-weight: 600;
  border-color: #d7ebee;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: flex; gap: 0; overflow: auto; }
  .side a { white-space: nowrap; }
}
.captcha-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.28);
  display: grid;
  place-items: center;
  padding: 16px;
}
.captcha-pop {
  width: min(360px, 92vw);
  background: #fff;
  border-radius: 10px;
  padding: 14px 14px 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  position: relative;
}
.captcha-tip {
  font-size: 14px;
  font-weight: 600;
  margin: 0 28px 10px 0;
  color: #303133;
}
.captcha-pic {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #efe6d6;
  line-height: 0;
  user-select: none;
}
.captcha-pic img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
}
.captcha-mark {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  background: #409eff;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 0 0 2px #fff;
}
.captcha-go {
  width: 100%;
  margin-top: 12px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: #f5a623;
  cursor: pointer;
}
.captcha-go:hover { background: #e39412; }
.captcha-tools {
  position: absolute;
  right: 10px;
  top: 10px;
  display: flex;
  gap: 4px;
}
.captcha-tools button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #f5f7fa;
  color: #606266;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
