:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #667085;
  --line: #d7dde7;
  --bg: #eef3f8;
  --panel: #ffffff;
  --primary: #176b87;
  --primary-dark: #0f5166;
  --accent: #d96c3f;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: #176b87;
  color: #fff;
  border-radius: 8px;
  padding: 12px 20px;
  box-shadow: 0 12px 32px rgba(23, 32, 42, 0.18);
  font-weight: 700;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.topNav {
  width: min(1120px, calc(100% - 32px));
  margin: 18px auto 0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.topNav a {
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
}

.topNav a:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.adminTabs {
  position: sticky;
  top: 0;
  z-index: 9;
  display: flex;
  gap: 10px;
  padding: 12px 0;
  background: var(--bg);
}

.adminTabs .tab {
  min-height: 40px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.adminTabs .tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.stickyStats {
  position: sticky;
  top: 64px;
  z-index: 8;
  margin-bottom: 18px;
}

.tabPage {
  display: grid;
  gap: 18px;
}

#tab-sms, #tab-phone, #tab-virtual-list, #tab-virtual-edit, #tab-settings {
  display: grid;
  gap: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.stats div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.stats strong {
  display: block;
  font-size: 24px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.toolbarActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbarActions button,
.toolbarActions select {
  min-width: 0;
}

.tableWrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px 8px;
  vertical-align: top;
}

code {
  word-break: break-all;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.hidden { display: none !important; }

.docsBody {
  background:
    radial-gradient(circle at top left, rgba(23, 107, 135, 0.18), transparent 34rem),
    linear-gradient(180deg, #f7fbff 0%, var(--bg) 48%, #edf3f8 100%);
}

.docsNav { margin-top: 22px; }

.docsShell {
  width: min(1180px, calc(100% - 32px));
  padding-top: 28px;
}

.docsHero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.docsHero > div:first-child,
.heroCard,
.docCard {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(215, 221, 231, 0.9);
  border-radius: 18px;
  box-shadow: 0 22px 50px rgba(23, 32, 42, 0.08);
}

.docsHero > div:first-child {
  padding: 34px;
}

.docsHero h1 {
  margin-bottom: 12px;
  font-size: clamp(32px, 5vw, 54px);
  letter-spacing: -1.6px;
}

.docsHero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.heroCard {
  padding: 28px;
  display: grid;
  align-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #176b87 0%, #0f5166 100%);
  color: #fff;
}

.heroCard span,
.heroCard small {
  color: rgba(255, 255, 255, 0.78);
}

.heroCard strong {
  display: block;
  font-family: Consolas, Monaco, monospace;
  font-size: 20px;
  word-break: break-all;
}

.docsGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.docCard {
  padding: 24px;
}

.docCardHead {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.docCardHead h2,
.docCard h3 {
  margin: 0;
}

.docCard h3 {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}

.docCard p {
  margin: 0 0 16px;
  line-height: 1.75;
}

.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 30px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.method.post { background: #e7f8ef; color: #067647; }
.method.auth { background: #fff4e5; color: #b54708; }
.method.info { background: #eaf3ff; color: #175cd3; }

.endpoint {
  display: inline-flex;
  max-width: 100%;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f2f6fa;
  color: #0f5166;
  font-family: Consolas, Monaco, monospace;
  font-weight: 700;
  word-break: break-all;
}

.sampleGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.docCard pre {
  min-height: 0;
  margin: 0;
  border: 1px solid #1f3445;
  background: #0b1220;
  color: #d9f99d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.docCard code {
  font-family: Consolas, Monaco, monospace;
}

.hint {
  margin-top: 12px !important;
  color: #667085;
  font-size: 14px;
}

.statusList {
  display: grid;
  gap: 10px;
}

.statusList div {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.statusList strong {
  color: var(--primary);
  font-size: 18px;
}

.statusList span {
  color: var(--muted);
}

@media (max-width: 900px) {
  .docsHero,
  .sampleGrid {
    grid-template-columns: 1fr;
  }
}

.docs .panel { max-width: 920px; margin: 0 auto; }
.docs pre { background: #101820; color: #e9f7ef; }

.customer {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.customer.dual {
  align-items: start;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.notice {
  grid-column: 1 / -1;
  width: 100%;
  border: 1px solid #f2c94c;
  background: #fff8db;
  color: #7a4d00;
  border-radius: 8px;
  padding: 14px 18px;
  white-space: pre-wrap;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(23, 32, 42, 0.08);
}

.customer .panel { width: min(560px, 100%); }
.customer.dual .panel { width: 100%; }

.brand {
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 8px;
}

h1, h2 { margin: 0 0 18px; line-height: 1.2; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }

label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  padding: 0;
  margin: 0;
  accent-color: var(--primary);
}

.selectCol {
  width: 44px;
  min-width: 44px;
  text-align: center;
}

.codeCol {
  min-width: 180px;
  white-space: nowrap;
}

textarea { resize: vertical; }

.actions, .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.actions.single { grid-template-columns: 1fr; }

button, .buttonLink {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

button:hover, .buttonLink:hover { background: var(--primary-dark); }
button:disabled { cursor: not-allowed; opacity: 0.55; }
button.secondary, .secondaryLink { background: #e8edf3; color: var(--ink); }
button.secondary:hover, .secondaryLink:hover { background: #dce4ee; }
button.danger { background: #b42318; color: #fff; }
button.danger:hover { background: #8f1c13; }
button.confirm { width: 100%; margin-top: 10px; background: #2f7d59; }
button.confirm:hover { background: #246445; }

.installShell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.installPanel { width: min(620px, 100%); }
.installForm { display: grid; gap: 12px; }
.mutedText { color: var(--muted); line-height: 1.7; }
.installMsg {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-weight: 700;
}
.installMsg.success { background: #ecfdf3; color: #027a48; border: 1px solid #abefc6; }
.installMsg.error { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }

.installModeBox {
  display: grid;
  gap: 10px;
  margin: 8px 0 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.installModeBox > strong,
.installSummary > strong {
  color: var(--ink);
}

.radioCard {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.radioCard input {
  margin-top: 3px;
}

.radioCard b,
.radioCard small {
  display: block;
}

.radioCard small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.6;
}

.radioCard:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.12);
}

.dangerRadio:has(input:checked) {
  border-color: #b42318;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.1);
}

.confirmReset {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 2px 0 0;
  color: #b42318;
  line-height: 1.6;
}

.confirmReset input {
  margin-top: 4px;
  flex: 0 0 auto;
}

.installSummary {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.installSummary ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 8px;
}

.installSummary li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
}

.installSummary span {
  font-family: Consolas, Monaco, monospace;
  color: var(--ink);
}

.installSummary em {
  color: var(--muted);
  font-style: normal;
}

.result {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.result span, p { color: var(--muted); }

.virtualCountdown {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.virtualCountdown strong {
  color: var(--primary);
}

pre {
  min-height: 116px;
  white-space: pre-wrap;
  word-break: break-word;
  background: #101820;
  color: #e9f7ef;
  border-radius: 8px;
  padding: 16px;
}

.cardInfo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.infoBox {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-height: 74px;
  background: #fff;
}

.infoBox span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.infoBox strong {
  display: block;
  word-break: break-word;
}

.wideInfo { grid-column: 1 / -1; }

.copyable {
  cursor: context-menu;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.copyable:hover {
  color: #0b63ce;
  background: #eaf3ff;
  border-color: #8bbcff;
}

.copyable:hover strong { color: #0b63ce; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.wide { grid-column: 1 / -1; }
.hidden { display: none; }

.tableWrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
th { color: var(--muted); font-weight: 700; }
td code { font-family: Consolas, monospace; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar h2 { margin: 0; }
.toolbarActions { display: flex; gap: 10px; align-items: center; }
.toolbar select, .toolbarActions select { width: auto; min-width: 120px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
}

.pager button { min-height: 36px; }

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
}

.stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.stats strong {
  display: block;
  font-size: 26px;
  line-height: 1;
  margin-bottom: 8px;
}

.stats span {
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 760px) {
  .grid, .actions, .row { grid-template-columns: 1fr; }
  .customer.dual, .cardInfo { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .toolbar, .toolbarActions, .pager { align-items: stretch; flex-direction: column; }
  .toolbar select, .toolbarActions select { width: 100%; }
  header { align-items: flex-start; gap: 12px; }
  h1 { font-size: 24px; }
}

.dangerNotice {
  margin: -6px 0 16px;
  padding: 14px 16px;
  border: 2px solid #d92d20;
  border-radius: 10px;
  background: #fef3f2;
  color: #b42318;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.6;
  box-shadow: 0 10px 24px rgba(180, 35, 24, 0.12);
}

.dangerText {
  padding: 12px 14px;
  border: 2px solid #d92d20;
  border-radius: 10px;
  background: #fef3f2;
  color: #b42318 !important;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.6;
}
