@import url("/static/admin/admin.css");
@import url("/static/console/console.css");
@import url("/static/guide/styles.css");

:root {
  --bg: #0b0b0e;
  --paper: #131317;
  --paper-2: #17171c;
  --ink: #ececf1;
  --ink-strong: #f5f5f8;
  --muted: #8d8d99;
  --faint: #686873;
  --line: #24242b;
  --line-soft: #1d1d23;
  --field: #0e0e12;
  --field-line: #2c2c34;
  --accent: #a78bfa;
  --accent-dark: #8b6cf6;
  --accent-ink: #c4b5fd;
  --sage: #1d1b26;
  --green: #b9a6f5;
  --danger: #f2a3b0;
  --radius: 14px;
  --sidebar: 208px;
  --topbar: 60px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  color-scheme: dark;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
}
body[data-surface="panel"] {
  background:
    radial-gradient(
      ellipse 1000px 460px at 85% -200px,
      #6d4dff17,
      transparent 70%
    ),
    var(--bg);
  background-attachment: fixed;
}
button,
input,
select,
textarea {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
button,
input,
select,
textarea {
  outline: none;
}
:is(button, a, input, select, textarea, summary, label):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 600;
}
svg {
  flex-shrink: 0;
}
button svg {
  vertical-align: middle;
}
small {
  color: var(--muted);
}

/* 品牌 */
.initial-loader {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  min-height: 100vh;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.brand-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f2f2f6;
  color: #121216;
  font-family: Georgia, serif;
  font-size: 16px;
  font-style: italic;
  letter-spacing: -1px;
  line-height: 1;
}
.brand-mark span {
  color: inherit;
}
.initial-loader .brand-mark,
.brand-mark.small {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 24px;
}
.brand-word {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 1px;
  color: var(--ink-strong);
}
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.8px;
  color: #a29dbb;
  text-transform: uppercase;
}
.muted {
  color: var(--muted);
}

/* 面板框架 */
.shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.panel-layout {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.sidebar {
  position: sticky;
  top: var(--topbar);
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(100dvh - var(--topbar));
  padding: 32px 0 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 26px;
}
.workspace-label {
  padding: 6px 12px 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.6px;
  color: #5c5c66;
}
.nav {
  display: grid;
  gap: 2px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--muted);
  transition:
    background 0.15s,
    color 0.15s;
}
.nav a:hover {
  background: #ffffff08;
  color: #e6e6ec;
}
.nav a.active {
  background: #ffffff0e;
  color: var(--ink-strong);
  font-weight: 550;
  box-shadow: 0 1px 0 #ffffff0a inset;
}
.nav a.active svg {
  color: var(--accent);
}
.nav a.active:after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--accent);
}
.sidebar-note {
  margin-top: 28px;
  padding: 14px;
  border: 1px solid #222228;
  border-radius: 12px;
  background: var(--paper);
  font-size: 12px;
  line-height: 1.75;
  color: #74747f;
}
.sidebar-note b {
  display: block;
  margin-bottom: 4px;
  font-weight: 550;
  color: #d2d2db;
}
.avatar {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: #2a2638;
  color: #ddd4ff;
  font-size: 13px;
}
.main {
  min-width: 0;
}
.icon-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #a4a4b0;
}
.icon-button:hover {
  background: #ffffff0d;
  color: #f2f2f6;
}
.page {
  padding: 32px 0 40px;
}
.page:focus {
  outline: 0;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
}
.page-heading h1 {
  margin: 10px 0 8px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.6px;
  color: var(--ink-strong);
}
.page-heading p {
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}
.heading-note {
  padding-bottom: 8px;
  font-size: 13px;
  color: var(--faint);
}
.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding: 18px 2px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  letter-spacing: 0.3px;
  color: #50505a;
}

/* 按钮 */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid #2e2e36;
  border-radius: 10px;
  background: var(--paper-2);
  color: #e0e0e8;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s,
    filter 0.15s;
}
.button:hover:not(:disabled) {
  background: #1e1e24;
  border-color: #3a3a44;
}
.button.primary {
  border-color: transparent;
  background: linear-gradient(180deg, #9d80ff, #7a5af0);
  box-shadow:
    0 1px 0 #ffffff33 inset,
    0 8px 22px -12px #7a5af0;
  color: #fff;
  font-weight: 600;
}
.button.primary:hover:not(:disabled) {
  border-color: transparent;
  background: linear-gradient(180deg, #9d80ff, #7a5af0);
  filter: brightness(1.08);
}
.button.dark {
  background: #f2f2f6;
  border-color: #f2f2f6;
  color: #121216;
}
.button.small {
  padding: 7px 12px;
  font-size: 12px;
}
.button.danger {
  border-color: #5a2a35;
  color: var(--danger);
}
.button.danger:hover:not(:disabled) {
  background: #2a1a20;
  border-color: #7a3a48;
}
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--accent-ink);
  font-size: 13px;
}
.text-button:hover {
  color: #e4dcff;
}
.table-action {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font-size: 13px;
  cursor: pointer;
}
.table-action + .table-action {
  margin-left: 10px;
}
.table-action:hover {
  color: #e4dcff;
}

/* 容器 */
.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.panel-body {
  padding: 20px;
}
.stack {
  display: grid;
  gap: 16px;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.toolbar select {
  width: auto;
  padding: 7px 11px;
}
.page-error {
  margin-bottom: 20px;
}

/* 表单 */
.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}
.field label,
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #dcdce4;
}
.field label small {
  font-size: 11px;
  font-weight: 400;
  color: var(--faint);
}
input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--field-line);
  border-radius: 9px;
  background: var(--field);
  color: #e6e6ec;
  font-size: 13px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
:is(input, select, textarea):hover:not(:disabled) {
  border-color: #3a3a44;
}
:is(input, select, textarea):focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px #8b6cf624;
}
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.5;
}
input::placeholder,
textarea::placeholder {
  color: #5f5f6a;
}
textarea {
  min-height: 120px;
  line-height: 1.75;
  resize: vertical;
}
select {
  cursor: pointer;
}
select option {
  background: var(--paper-2);
}
input[type="checkbox"] {
  width: 15px;
  height: 15px;
  padding: 0;
  accent-color: var(--accent-dark);
}

/* 提示与状态 */
.notice {
  padding: 11px 14px;
  border: 1px solid #33303f;
  border-radius: 10px;
  background: #1a1823;
  font-size: 12px;
  line-height: 1.75;
  color: #bdb6d3;
}
.notice.error {
  border-color: #5a2a35;
  background: #2a1a20;
  color: #f2b3bd;
}
.notice.success {
  border-color: #24452f;
  background: #15241b;
  color: #9fcfac;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #24242b;
  color: #b4b4c0;
  font-size: 11px;
  white-space: nowrap;
}
.badge:before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge.green {
  background: #1b2c22;
  color: #9fcfac;
}
.badge.orange {
  background: #33261c;
  color: #e0b48d;
}
.badge.red {
  background: #351d25;
  color: #e7a6b6;
}
.empty-state {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  border: 1px dashed #2e2e36;
  border-radius: var(--radius);
  background: #111115;
  text-align: center;
}
.panel .empty-state {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.empty-icon {
  margin-bottom: 12px;
  font-size: 30px;
  color: #5f5f6a;
}
.empty-state h3 {
  margin-bottom: 6px;
  font-size: 15px;
  color: #dcdce4;
}
.empty-state p {
  max-width: 380px;
  font-size: 13px;
  line-height: 1.75;
  color: #7c7c88;
}
.spinner {
  width: 16px;
  height: 16px;
  display: inline-block;
  border: 2px solid #2c2a3a;
  border-top-color: #b4a3fb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.verification-banner {
  padding: 8px 20px;
  border-bottom: 1px solid #24222e;
  background: #15141c;
  color: #9d97b8;
  font-size: 12px;
  text-align: center;
}

/* 表格与代码 */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
th,
td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--line-soft);
}
th {
  background: var(--paper-2);
  border-bottom-color: var(--line);
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
  white-space: nowrap;
}
td {
  color: #c6c6d0;
  font-variant-numeric: tabular-nums;
}
tbody tr:hover td {
  background: #ffffff04;
}
tbody tr:last-child td {
  border-bottom: 0;
}
td small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--faint);
}
code {
  font:
    12px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  color: var(--accent-ink);
}
.secret {
  display: block;
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px dashed #3d3760;
  border-radius: 10px;
  background: var(--field);
  color: #e6e6ec;
  line-height: 1.8;
  word-break: break-all;
  user-select: all;
}

/* 统计卡片 */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.metric {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.metric-label {
  font-size: 12px;
  color: var(--muted);
}
.metric-value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 650;
  line-height: 1.15;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
}
.metric-value small {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 400;
  color: #76767f;
}
.metric-detail {
  margin-top: 8px;
  font-size: 12px;
  color: var(--faint);
}
.tabs {
  display: flex;
  gap: 22px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.tabs button {
  padding: 0 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  color: var(--muted);
  font-size: 14px;
}
.tabs button:hover {
  color: #dcdce4;
}
.tabs button.active {
  border-color: var(--accent);
  color: var(--ink-strong);
}

/* 弹窗与提示 */
dialog {
  width: min(500px, calc(100vw - 28px));
  max-height: 86vh;
  padding: 24px;
  border: 1px solid #2e2e36;
  border-radius: 16px;
  background: #16161b;
  color: #e6e6ec;
  box-shadow: 0 24px 80px #000c;
}
dialog::backdrop {
  background: #000000a0;
  backdrop-filter: blur(4px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.dialog-head h2 {
  font-size: 17px;
  color: var(--ink-strong);
}
.dialog-head button {
  font-size: 22px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.dialog-feedback {
  margin-top: 12px;
  overflow-wrap: anywhere;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  max-width: 90vw;
  padding: 12px 20px;
  border: 1px solid #3d3560;
  border-radius: 12px;
  background: #1e1b2a;
  box-shadow: 0 16px 40px #0009;
  color: #e4dcff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 15px);
  transition: 0.2s;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 登录页 */
.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  min-height: 100vh;
}
.login-story {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 44px 56px;
  border-right: 1px solid var(--line-soft);
  background:
    radial-gradient(ellipse at 80% 30%, #7a5af040, transparent 55%),
    radial-gradient(ellipse at 10% 100%, #f0abfc1a, transparent 50%), #0e0e12;
}
.login-story .brand {
  padding: 0;
}
.login-story h1 {
  z-index: 1;
  font-size: clamp(34px, 4.2vw, 58px);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -1.5px;
  color: var(--ink-strong);
}
.login-story h1 em {
  display: inline-block;
  margin-top: 14px;
  font-family: Georgia, serif;
  font-size: 0.42em;
  font-weight: normal;
  line-height: 1.5;
  letter-spacing: 0;
  color: #a9a3c4;
}
.login-story p {
  z-index: 1;
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
}
.login-story small {
  z-index: 1;
  font-size: 11px;
  letter-spacing: 1px;
  color: #50505a;
}
.login-orbit {
  position: absolute;
  z-index: -1;
  top: 22%;
  right: -160px;
  width: 500px;
  height: 500px;
  border: 1px solid #a78bfa2e;
  border-radius: 50%;
}
.login-orbit:before,
.login-orbit:after {
  content: "";
  position: absolute;
  border-radius: 50%;
}
.login-orbit:before {
  inset: 40px;
  border: 1px solid #a78bfa22;
}
.login-orbit:after {
  inset: 90px;
  border: 1px solid #a78bfa18;
  background: radial-gradient(circle, #7a5af01f, transparent 70%);
}
.login-form-area {
  display: grid;
  place-items: center;
  padding: 40px;
}
.login-form {
  width: 100%;
  max-width: 360px;
}
.login-form h2 {
  margin: 12px 0 8px;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.4px;
  color: var(--ink-strong);
}
.login-form > p {
  margin-bottom: 28px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}
.login-form .button {
  width: 100%;
  padding: 12px;
}
.login-form > .text-button {
  margin-top: 20px;
}
.login-footer {
  margin-top: 22px;
  font-size: 12px;
  color: var(--faint);
  text-align: center;
}
.auth-dialog-copy {
  margin-bottom: 22px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--muted);
}
.login-modal-form .button {
  width: 100%;
  margin-top: 4px;
}
.login-modal-form .notice {
  margin-bottom: 16px;
}
.login-modal-footer {
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--faint);
  text-align: center;
}

/* 辅助 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}

/* 响应式 */
@media (max-height: 720px) {
  .sidebar-note {
    display: none;
  }
}
@media (max-width: 1100px) {
  :root {
    --sidebar: 184px;
  }
  .panel-layout {
    gap: 28px;
    padding: 0 24px;
  }
  .heading-note {
    display: none;
  }
  .login-story {
    padding: 40px;
  }
}
@media (max-width: 860px) {
  .panel-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .sidebar {
    top: var(--topbar);
    z-index: 20;
    max-height: none;
    margin: 0 -24px;
    padding: 0 24px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line-soft);
    background: #0b0b0ee6;
    backdrop-filter: blur(16px);
  }
  .workspace-label,
  .sidebar-note {
    display: none;
  }
  .sidebar .nav {
    grid-auto-flow: column;
    justify-content: start;
    gap: 4px;
    padding: 8px 0;
  }
  .sidebar .nav a {
    gap: 7px;
    padding: 7px 12px;
    white-space: nowrap;
  }
  .sidebar .nav a.active:after {
    display: none;
  }
}
@media (max-width: 760px) {
  :root {
    --topbar: 56px;
  }
  .panel-layout {
    padding: 0 14px;
  }
  .sidebar {
    margin: 0 -14px;
    padding: 0 14px;
  }
  .page {
    padding: 22px 0 32px;
  }
  .page-heading {
    align-items: flex-start;
    margin-bottom: 22px;
  }
  .page-heading h1 {
    font-size: 24px;
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-value {
    font-size: 24px;
  }
  .panel-header {
    padding: 14px 16px;
  }
  .panel-body {
    padding: 16px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  th,
  td {
    padding: 12px 14px;
  }
  .two-col {
    grid-template-columns: 1fr;
    gap: 0;
  }
  dialog {
    padding: 20px;
  }
  .login-layout {
    grid-template-columns: 1fr;
  }
  .login-story {
    min-height: 260px;
    padding: 26px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .login-story h1 {
    font-size: 30px;
  }
  .login-story > p,
  .login-story > small {
    display: none;
  }
  .login-orbit {
    top: 20px;
    right: -80px;
    width: 300px;
    height: 300px;
  }
  .login-form-area {
    padding: 32px 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.auth-switch {
  justify-content: center;
  width: 100%;
  margin-top: 15px;
}
.auth-register-heading {
  margin: 8px 0 22px;
}
.auth-register-heading h3 {
  color: var(--ink-strong);
  font-size: 19px;
}
.auth-register-heading p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.auth-code-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}
.auth-code-row input {
  min-width: 0;
  flex: 1;
}
.login-modal-form .auth-code-row .button {
  width: auto;
  margin-top: 0;
  flex-shrink: 0;
  font-size: 12px;
}
#register-code-status {
  font-size: 11px;
  line-height: 1.7;
}
@media (max-width: 360px) {
  .auth-code-row {
    flex-wrap: wrap;
  }
  .auth-code-row input {
    flex-basis: 100%;
  }
}
