:root {
  color-scheme: dark;
  --bg: #0c0b18;
  --panel: #171325;
  --line: #ffffff16;
  --text: #eee9f6;
  --muted: #b1a6c3;
  --brand: #ba9bff;
  --danger: #f5a6b7;
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at top right, #34204560, transparent 60%), var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}
a {
  color: #c3acf3;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  color: var(--text);
  border: 1px solid #ffffff24;
  background: #30213f;
  padding: 9px 16px;
  border-radius: 9px;
  min-height: 40px;
}
button:hover {
  background: #49305c;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.primary {
  background: #9f77d4;
  color: #110b1d;
  border-color: transparent;
  font-weight: 700;
}
button.danger {
  color: var(--danger);
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #675773;
  background: #0e0b1a;
  border-radius: 8px;
  color: var(--text);
  padding: 10px;
  min-width: 0;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  accent-color: #b995f2;
}
input:focus-visible,
button:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid #c9a7ff;
  outline-offset: 3px;
}
label {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
label input:not([type="checkbox"]),
label select,
label textarea {
  margin-top: 5px;
}
.field-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
}
h2 {
  font-size: 20px;
}
h3 {
  font-size: 15px;
}
small,
.muted {
  color: var(--muted);
}
.brand {
  font-size: 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
}
.brand img {
  width: 34px;
  height: 34px;
}
.top {
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  background: #0f0b1dee;
  z-index: 20;
}
.top .links {
  display: flex;
  gap: 18px;
  align-items: center;
}
.layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  max-width: 1600px;
  margin: auto;
}
.side {
  padding: 30px 20px;
  position: sticky;
  top: 82px;
  height: calc(100dvh - 82px);
  border-right: 1px solid var(--line);
}
.side button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  margin-bottom: 8px;
  border-color: transparent;
}
.side button.on {
  background: #2c213c;
  border-color: #ad83d344;
}
.content {
  padding: 30px;
  min-width: 0;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-heading h1 {
  margin: 0;
}
.card {
  background: linear-gradient(135deg, #20182eb0, #141020e0);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat {
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #1b142a;
}
.stat b {
  display: block;
  font-size: 30px;
  color: #d9baff;
  font-variant-numeric: tabular-nums;
}
.stat span {
  color: var(--muted);
  font-size: 12px;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar input {
  width: min(320px, 100%);
}
.toolbar select {
  width: auto;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 13px;
}
td,
th {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}
th {
  color: var(--muted);
  background: #1c152b;
  font-weight: 500;
}
td .actions {
  display: flex;
  gap: 6px;
}
td button {
  font-size: 12px;
  padding: 5px 9px;
  min-height: 32px;
}
tr:last-child td {
  border-bottom: 0;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 35px;
}
.badge {
  border: 1px solid #8a6aa65c;
  background: #35224080;
  border-radius: 16px;
  padding: 2px 9px;
  font-size: 12px;
}
.badge.bad {
  color: #f3a1b1;
}
.check-list {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.check-list label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.full {
  grid-column: 1/-1;
}
.actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.notice {
  border: 1px solid #9d71974d;
  background: #3a244480;
  padding: 14px;
  border-radius: 10px;
  color: #dfcdeb;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-bottom: 20px;
}
.error {
  color: #ffb7c5;
}
.success {
  color: #b8e5c4;
}
#feedback {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(520px, 90vw);
  padding: 14px 18px;
  background: #2c1f40;
  border: 1px solid #aa83cd;
  border-radius: 10px;
  box-shadow: 0 16px 50px #0005;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
dialog {
  width: min(760px, 94vw);
  max-height: 90dvh;
  background: #181126;
  border: 1px solid #8b699a;
  border-radius: 18px;
  padding: 26px;
  color: var(--text);
  overflow: auto;
}
dialog::backdrop {
  background: #05040ac9;
}
.login-wrap {
  max-width: 470px;
  margin: 60px auto;
  padding: 0 20px;
}
.login-wrap .card {
  padding: 28px;
}
.login-wrap label {
  margin-bottom: 16px;
}
.login-wrap .brand {
  margin-bottom: 28px;
}
.login-wrap button.primary {
  width: 100%;
}
.login-wrap h1 {
  font-size: 27px;
}
.login-wrap .subtle {
  background: none;
  border-color: transparent;
  color: var(--muted);
}
.security-main {
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 22px;
}
.security-main .grid {
  align-items: start;
}
#qrImage {
  display: block;
  width: 220px;
  height: 220px;
  background: white;
  padding: 10px;
  border-radius: 10px;
  margin: 20px auto;
}
.secret-text {
  overflow-wrap: anywhere;
  font-family: Consolas, monospace;
  background: #100b1c;
  padding: 12px;
  border: 1px dashed #8a6d9b;
  border-radius: 8px;
  user-select: all;
}
.code-box {
  font-family: Consolas, monospace;
  white-space: pre-wrap;
  user-select: all;
  line-height: 2;
}
.progressbar {
  height: 6px;
  background: #362647;
  border-radius: 8px;
  overflow: hidden;
  margin: 10px 0;
}
.progressbar i {
  display: block;
  height: 100%;
  background: #b38adf;
  width: var(--progress, 0);
}
.pagination {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 15px;
  align-items: center;
}
.log-detail {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 45vh;
  overflow: auto;
  padding: 16px;
  background: #0d0a16;
  border-radius: 10px;
}
[hidden] {
  display: none !important;
}
.page-view {
  display: none;
}
.page-view.on {
  display: block;
}
.model-checks {
  max-height: 180px;
  overflow: auto;
}
.model-checks label {
  padding: 4px;
}
.quota-policy {
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .side {
    display: flex;
    position: sticky;
    top: 76px;
    height: auto;
    padding: 8px;
    overflow: auto;
    gap: 6px;
    background: #0f0b1dfa;
    z-index: 19;
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }
  .side button {
    width: auto;
    white-space: nowrap;
    margin: 0;
    padding: 8px 12px;
  }
  .content {
    padding: 20px 14px;
  }
  .top {
    padding: 16px;
  }
  .top .links {
    gap: 10px;
    font-size: 12px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .full {
    grid-column: auto;
  }
  .login-wrap {
    margin-top: 30px;
  }
  .table-wrap {
    max-width: 100%;
  }
}
@media (max-width: 420px) {
  .top .brand {
    font-size: 14px;
  }
  .top .brand img {
    width: 26px;
    height: 26px;
  }
  .stat {
    padding: 14px;
  }
  .stat b {
    font-size: 25px;
  }
  .top .links .optional {
    display: none;
  }
  .card {
    padding: 16px;
  }
  .toolbar > * {
    flex: 1 1 auto;
  }
  .toolbar input {
    width: 100%;
  }
  .check-list {
    gap: 10px;
  }
  dialog {
    padding: 18px;
  }
  .page-heading h1 {
    font-size: 25px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
