/* ============================================================
   智觅 · 控制台 / API 页 / 登录弹层
   ============================================================ */
[hidden] { display: none !important; }
body.console-page {
  background: var(--bg);
  background-image:
    radial-gradient(720px 300px at 70% -8%, rgba(188, 210, 252, 0.5), transparent 66%);
}
body.console-page .nav {
  position: fixed;
  z-index: 5;
  background: rgba(245, 247, 252, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(230, 235, 245, 0.7);
}
.console-gate {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #5d6b86;
}
.console-gate .primary {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #4a6cf7 0%, var(--blue-deep) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(60, 91, 240, 0.26);
  transition: transform var(--fast), box-shadow var(--fast);
}
.console-gate .primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(60, 91, 240, 0.34);
}
.console {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100%;
  padding: 62px 0 40px;
}
.console.is-plain {
  display: block;
  max-width: 1100px;
  margin: 0 auto;
  padding: 84px 28px 40px;
}
.center-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.center-bar h1 { margin: 0; font-size: 22px; font-weight: 600; color: var(--ink); }
.console.is-plain .console-main { padding: 20px 0 48px; }
.console.is-plain #center-plan { margin-top: 72px; }
.side {
  position: sticky;
  top: 62px;
  align-self: start;
  height: calc(100vh - 100px);
  padding: 18px 12px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  border-right: 1px solid var(--line);
}
.side-label {
  margin: 16px 12px 8px;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.side a {
  display: block;
  margin: 2px 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: #3c4b68;
  font-size: 14px;
  transition: background var(--fast), color var(--fast);
}
.side a.is-on {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 600;
}
.side a:hover { background: var(--blue-ghost); }
.side a.is-on:hover { background: var(--blue-soft); }
.side-out {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 16px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: #5d6b86;
  transition: border-color var(--fast), color var(--fast);
}
.side-out:hover { border-color: var(--blue); color: var(--blue); }
.console-main { padding: 30px 34px 48px; }
.console-main h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}
.console-lead {
  margin: 0 0 20px;
  color: #6b7690;
  font-size: 14px;
  line-height: 1.7;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 20px;
}
.panel + .panel { margin-top: 14px; }
#invoice-form { max-width: 440px; }
.api-sheet p { margin: 0 0 10px; color: #3c465c; font-size: 14px; line-height: 1.7; }
.api-plan { color: #6b7690 !important; }
.api-doc h2 {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.api-doc h2:first-child { margin-top: 0; }
.api-path {
  display: inline-block;
  margin: 0;
  padding: 7px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f6f8fc;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
}
.api-doc table { width: 100%; border-collapse: collapse; font-size: 13px; }
.api-doc th,
.api-doc td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  color: #3c465c;
  line-height: 1.6;
}
.api-doc th { color: #6b7690; font-weight: 500; }
.api-doc pre {
  margin: 0;
  padding: 13px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f7f9fc;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.6;
}
.api-doc code { font-family: var(--mono); font-size: 12px; }
.api-go {
  display: inline-flex;
  align-items: center;
  height: 36px;
  margin: 2px 0 14px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #4a6cf7 0%, var(--blue-deep) 100%);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(60, 91, 240, 0.26);
  transition: transform var(--fast), box-shadow var(--fast), filter var(--fast);
}
.api-go:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(60, 91, 240, 0.34);
  filter: brightness(1.03);
}
.row-line { display: flex; gap: 10px; align-items: flex-end; }
.row-line label { flex: 1; margin: 0; }
label.field {
  display: block;
  margin-bottom: 14px;
  color: #5d6b86;
  font-size: 13px;
}
label.field input {
  display: block;
  width: 100%;
  height: 40px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid #e3e9f5;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color var(--fast), box-shadow var(--fast);
}
label.field input:hover { border-color: #cdd7ef; }
label.field input:focus { border-color: var(--blue); box-shadow: var(--ring); }
.primary {
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #4a6cf7 0%, var(--blue-deep) 100%);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(60, 91, 240, 0.24);
  transition: transform var(--fast), box-shadow var(--fast), filter var(--fast);
}
.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(60, 91, 240, 0.32);
  filter: brightness(1.03);
}
.ghost {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: #5d6b86;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--fast);
}
.ghost:hover { border-color: var(--blue); color: var(--blue); }
.note {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 13px;
}
.note.is-ok { color: var(--ok); }
.secret {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #dfe7fb;
  border-radius: var(--radius-sm);
  background: var(--blue-ghost);
  color: var(--ink);
  font-family: var(--mono);
  word-break: break-all;
}
.secret code { flex: 1; }
table.keys {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.keys th {
  text-align: left;
  padding: 8px 10px;
  color: var(--faint);
  font-weight: 500;
  border-bottom: 1px solid var(--line-soft);
}
table.keys td {
  padding: 12px 10px;
  border-bottom: 1px solid #f2f5fa;
  vertical-align: middle;
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  background: #f3f5f8;
  color: #7b879c;
  font-size: 12px;
}
.tag.on { background: #e6f6ec; color: var(--ok); }
.perm { color: #5d6b86; font-size: 13px; line-height: 1.6; }
.amounts { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 18px; }
.amount {
  position: relative;
  width: 112px;
  height: 64px;
  border: 1px solid #e6ebf4;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  transition: all var(--fast);
}
.amount:hover { border-color: #c3d0f5; }
.amount.is-on { border-color: var(--blue); color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.amount .badge {
  position: absolute;
  top: -8px;
  right: 8px;
  height: 16px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
}
.channels { display: flex; gap: 16px; margin: 8px 0 16px; color: var(--ink); font-size: 14px; }
.check { display: flex; gap: 8px; align-items: flex-start; color: #5d6b86; font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat strong { display: block; margin-top: 6px; font-size: 22px; font-weight: 600; color: var(--ink); }
.stat span { color: var(--faint); font-size: 13px; }
.empty { margin: 8px 0 0; color: var(--faint); font-size: 13px; }
.rules { margin: 0 0 16px; padding-left: 18px; color: #5d6b86; font-size: 13px; line-height: 1.7; }

.key-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.key-head h1,
.key-head h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--ink); }
.key-new { height: 34px; padding: 0 16px; border-radius: var(--radius-pill); font-size: 14px; }
.key-tip {
  margin-bottom: 16px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: var(--blue-ghost);
  color: #61708f;
  font-size: 13px;
  line-height: 1.7;
}
.key-tip p { margin: 0; }
.key-tools { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.key-tools input {
  width: 240px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #e5e6eb;
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.key-tools input:focus { border-color: var(--blue); box-shadow: var(--ring); }
table.key-grid th { color: var(--faint); font-weight: 400; font-size: 13px; }
table.key-grid td { font-size: 14px; color: var(--ink); }
.key-id { font-family: var(--mono); font-size: 13px; color: #3c465c; }
.key-mask { font-family: var(--mono); color: #5d6b86; }
.key-ops { text-align: right; white-space: nowrap; }
table.key-grid th:last-child { text-align: right; }
.link-edit, .link-del {
  border: 0;
  background: transparent;
  padding: 0 6px;
  font-size: 14px;
  cursor: pointer;
  transition: opacity var(--fast);
}
.link-edit:hover, .link-del:hover { opacity: 0.75; }
.link-edit { color: var(--blue); }
.link-del { color: #e05d5d; }
.compare { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare th, .compare td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.compare th { color: #6b7690; font-weight: 500; }
.compare td:first-child, .compare th:first-child { color: var(--ink); font-weight: 500; }
.compare th.is-on, .compare td.is-on { background: var(--blue-ghost); color: var(--blue); }
.usage-title { margin: 0 0 8px; font-size: 16px; font-weight: 600; color: var(--ink); }
.usage { width: 100%; border-collapse: collapse; }
.usage td { padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; color: var(--ink); }
.usage td:last-child { text-align: right; color: #5d6b86; }
.plans { display: flex; gap: 14px; margin: 8px 0 18px; flex-wrap: wrap; }
.plan {
  width: 220px;
  padding: 18px 18px 16px;
  border: 1px solid #e6ebf4;
  border-radius: var(--radius-md);
  background: #fff;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: all var(--fast);
}
.plan:hover { border-color: #c3d0f5; transform: translateY(-2px); box-shadow: var(--shadow-card); }
.plan strong { display: block; font-size: 18px; }
.plan em { display: block; margin-top: 8px; font-style: normal; font-size: 16px; }
.plan span { display: block; margin-top: 6px; color: #6b7690; font-size: 13px; }
.plan.is-on { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.plan.is-on em { color: var(--blue); }
.kmask {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(24, 34, 56, 0.42);
  backdrop-filter: blur(3px);
}
.kdialog {
  width: min(520px, calc(100% - 32px));
  padding: 24px 26px 20px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-pop);
}
.khead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.khead h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--ink); }
.kx {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #98a2b6;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--fast), color var(--fast);
}
.kx:hover { background: var(--line-soft); color: var(--ink); }
.kfield { display: block; margin-bottom: 16px; color: var(--ink); font-size: 14px; }
.kfield input, .kfield select {
  display: block;
  width: 100%;
  height: 38px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid #e3e9f5;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.kfield input:focus, .kfield select:focus { border-color: var(--blue); box-shadow: var(--ring); }
.kfield select:disabled { background: #f7f8fa; color: var(--faint); }
.kerror { min-height: 18px; margin: 0; color: var(--danger); font-size: 13px; }
.khint { margin: 0 0 12px; color: #5d6b86; font-size: 14px; line-height: 1.6; }
.ksecret {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--blue-ghost);
  word-break: break-all;
  font-family: var(--mono);
  font-size: 13px;
}
.kfoot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.kcancel, .kok, .kdanger {
  height: 34px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--fast);
}
.kcancel { border: 1px solid #e5e6eb; background: #fff; color: #3c4b68; }
.kcancel:hover { border-color: var(--blue); color: var(--blue); }
.kok { border: 0; background: linear-gradient(135deg, #4a6cf7 0%, var(--blue-deep) 100%); color: #fff; }
.kok:hover:not(:disabled) { filter: brightness(1.05); }
.kok:disabled { background: #d9dde6; color: #fff; cursor: default; }
.kdanger { border: 0; background: #e05d5d; color: #fff; }
.kdanger:hover { background: #cf4c4c; }

@media (max-width: 800px) {
  .console { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-out { position: static; width: 100%; margin-top: 12px; }
  .console-main { padding: 22px 18px 40px; }
  .stat-grid { grid-template-columns: 1fr; }
  .row-line { flex-direction: column; align-items: stretch; }
}
