:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #0c0d0f;
  color: #f3f4f6;
  --bg: #0c0d0f;
  --panel: #131519;
  --panel-2: #181b20;
  --border: #292d34;
  --border-strong: #3a404a;
  --text: #f3f4f6;
  --muted: #9299a5;
  --primary: #2f6feb;
  --primary-hover: #3979f2;
  --danger: #ef5b63;
  --success: #35b779;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; background: var(--bg); }
button, input, select { font: inherit; letter-spacing: 0; }
button { color: inherit; }
[hidden] { display: none !important; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, 38%) 1fr; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 18px; border-right: 1px solid var(--border); background: #0a0b0d; }
.auth-brand h1 { margin: 0; font-size: 30px; }
.auth-brand p { margin: 5px 0 0; color: var(--muted); }
.brand-mark { display: block; width: 76px; height: 76px; object-fit: contain; }
.logo-letter { display: inline-grid; place-items: center; color: var(--primary); border: 1px solid rgba(84, 199, 195, .5); border-radius: 50%; font-weight: 800; font-family: Inter, ui-sans-serif, system-ui, sans-serif; background: rgba(84, 199, 195, .08); }
.brand-mark.small { width: 34px; height: 34px; }
.auth-main { min-width: 0; display: grid; place-items: center; padding: 40px; }
.auth-form { width: 100%; max-width: 380px; min-width: 0; display: grid; gap: 18px; }
.form-heading { margin-bottom: 8px; }
.form-heading h2 { margin: 0; font-size: 24px; }
.form-heading p, .page-header p, .dialog-form header p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
label { display: grid; gap: 7px; color: #c7cbd2; font-size: 13px; }
input, select { width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 6px; background: #101216; color: var(--text); padding: 0 11px; outline: none; }
input:focus, select:focus { border-color: #4c82ee; box-shadow: 0 0 0 2px rgba(47, 111, 235, .16); }
input:disabled { color: var(--muted); background: #0d0f12; }

.button { min-height: 36px; border: 1px solid transparent; border-radius: 6px; padding: 0 14px; cursor: pointer; font-weight: 600; font-size: 13px; }
.button.primary { background: var(--primary); color: white; }
.button.primary:hover { background: var(--primary-hover); }
.button.secondary { background: var(--panel-2); border-color: var(--border); }
.button.secondary:hover, .button.ghost:hover { border-color: var(--border-strong); background: #20242a; }
.button.ghost { background: transparent; border-color: var(--border); color: #c5cad3; }
.button.full { width: 100%; }
.form-error { min-height: 18px; margin: 0; color: #ff7b82; font-size: 12px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: #101216; padding: 16px 12px; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 22px; }
.sidebar nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 0 10px; text-align: left; cursor: pointer; }
.nav-item.active { background: #1b2230; color: #e9efff; }
.nav-icon { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid #4d5c76; border-radius: 4px; font-size: 10px; }
.sidebar-footer { margin-top: auto; display: grid; gap: 12px; }
.current-user { display: grid; gap: 3px; padding: 10px; border-top: 1px solid var(--border); }
.current-user span { font-size: 13px; font-weight: 650; }
.current-user small { color: var(--muted); }

.workspace { min-width: 0; padding: 28px 32px 40px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-header h1 { margin: 0; font-size: 22px; }
.toolbar { min-height: 56px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-bottom: 0; background: var(--panel); padding: 8px 10px; }
.search-field { position: relative; width: min(340px, 45vw); }
.search-field span { position: absolute; left: 11px; top: 9px; color: var(--muted); }
.search-field input { padding-left: 32px; }
.toolbar select { width: 132px; }
.record-count { margin-left: auto; padding-right: 8px; color: var(--muted); font-size: 12px; }
.table-region { position: relative; min-height: 300px; border: 1px solid var(--border); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #111317; font-size: 13px; }
th, td { height: 52px; border-bottom: 1px solid var(--border); padding: 0 14px; text-align: left; white-space: nowrap; }
th { height: 42px; color: var(--muted); font-size: 11px; font-weight: 600; background: #15181d; }
tbody tr:hover { background: #15181d; }
tbody tr:last-child td { border-bottom: 0; }
.account-cell { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: #25324a; color: #a9c4ff; font-size: 12px; }
.badge { display: inline-flex; align-items: center; min-height: 24px; border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; color: #cbd0d8; font-size: 11px; }
.status { display: inline-flex; align-items: center; gap: 7px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.status.inactive { color: var(--muted); }
.status.inactive::before { background: #666d78; }
.actions-column { width: 170px; }
.row-actions { display: flex; gap: 6px; }
.table-button { border: 0; background: transparent; color: #94b7ff; padding: 5px 7px; cursor: pointer; font-size: 12px; }
.table-button:hover { color: white; text-decoration: underline; }
.empty-state { display: grid; place-items: center; min-height: 260px; color: var(--muted); font-size: 13px; }

dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--panel); color: var(--text); box-shadow: 0 24px 80px rgba(0, 0, 0, .55); }
dialog::backdrop { background: rgba(0, 0, 0, .65); }
.dialog-form header, .dialog-form footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; }
.dialog-form header { border-bottom: 1px solid var(--border); }
.dialog-form footer { justify-content: flex-end; border-top: 1px solid var(--border); }
.dialog-form h2 { margin: 0; font-size: 17px; }
.dialog-body { display: grid; gap: 16px; padding: 18px; }
.icon-button { width: 30px; height: 30px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; font-size: 22px; }
.icon-button:hover { background: #23272e; color: white; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid var(--border); border-radius: 6px; padding: 12px; }
.switch-row span { display: grid; gap: 3px; }
.switch-row small { color: var(--muted); }
.switch-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: 360px; border: 1px solid #3a485c; border-radius: 6px; background: #19202a; padding: 11px 14px; color: #edf3ff; font-size: 13px; box-shadow: 0 12px 40px rgba(0,0,0,.38); }

@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: 150px; border-right: 0; border-bottom: 1px solid var(--border); }
  .auth-main { padding: 30px 20px; }
  .app-shell { grid-template-columns: 64px minmax(0, 1fr); }
  .sidebar { padding: 14px 8px; }
  .sidebar-brand strong, .nav-item:not(.active) span + *, .nav-item { font-size: 0; }
  .sidebar-brand { justify-content: center; padding-inline: 0; }
  .nav-item { justify-content: center; padding: 0; }
  .sidebar-footer .current-user { display: none; }
  .sidebar-footer .button { padding: 0; font-size: 0; }
  .sidebar-footer .button::after { content: "退出"; font-size: 11px; }
  .workspace { padding: 22px 16px 30px; }
  .page-header { align-items: flex-start; }
  .toolbar { flex-wrap: wrap; }
  .search-field { width: 100%; }
  .record-count { margin-left: 0; }
}



