/* =========================================================
   Aster 企业账号管理平台 · 企业控制台视觉层
   在基础样式之后加载，统一为企业后台视觉规范
   ========================================================= */

/* ---------- 设计令牌 ---------- */
:root {
  --font-sans: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
    "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, sans-serif;

  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-subtle: #f7f8fa;
  --surface-hover: #f2f3f5;
  --border: #e5e6eb;
  --border-strong: #c9cdd4;
  --text: #1d2129;
  --text-secondary: #4e5969;
  --muted: #86909c;

  --primary: #165dff;
  --primary-hover: #0e42d2;
  --primary-soft: #e8f3ff;
  --primary-contrast: #ffffff;
  --primary-solid: #165dff;
  --primary-solid-hover: #0e42d2;

  --success: #00a870;
  --success-soft: #e8f7f1;
  --warning: #c96a0a;
  --warning-soft: #fff4e8;
  --danger: #d93026;
  --danger-soft: #fff0ee;
  --violet: #722ed1;
  --violet-soft: #f5efff;

  --sidebar-bg: #ffffff;
  --sidebar-panel: #f7f8fa;
  --sidebar-border: #e5e6eb;
  --sidebar-text: #4e5969;
  --sidebar-muted: #86909c;

  --shadow-xs: 0 1px 2px rgba(29, 33, 41, 0.03);
  --shadow-sm: 0 1px 3px rgba(29, 33, 41, 0.05);
  --shadow-md: 0 3px 10px rgba(29, 33, 41, 0.08);
  --shadow-lg: 0 8px 28px rgba(29, 33, 41, 0.14);
  --ring: 0 0 0 3px rgba(22, 93, 255, 0.14);

  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-xl: 4px;
  --radius-2xl: 6px;

  --sidebar-width: 232px;
  --topbar-height: 56px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #17191f;
  --surface-subtle: #1e2128;
  --surface-hover: #24272f;
  --border: #2a2d35;
  --border-strong: #3a3e48;
  --text: #e8eaed;
  --text-secondary: #c2c7d0;
  --muted: #8d939f;

  --primary: #4b87ff;
  --primary-hover: #6b9bff;
  --primary-soft: rgba(75, 135, 255, 0.14);
  --primary-contrast: #ffffff;
  --primary-solid: #2f6bdb;
  --primary-solid-hover: #3f7cea;

  --success: #3dd68c;
  --success-soft: rgba(61, 214, 140, 0.12);
  --warning: #f0a54a;
  --warning-soft: rgba(240, 165, 74, 0.12);
  --danger: #ff7272;
  --danger-soft: rgba(255, 114, 114, 0.12);
  --violet: #b18cff;
  --violet-soft: rgba(177, 140, 255, 0.12);

  --sidebar-bg: #17191f;
  --sidebar-panel: #1e2128;
  --sidebar-border: #2a2d35;
  --sidebar-text: #c2c7d0;
  --sidebar-muted: #8d939f;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.18);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 3px 12px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 10px 32px rgba(0, 0, 0, 0.38);
  --ring: 0 0 0 3px rgba(75, 135, 255, 0.22);

  color-scheme: dark;
}

/* ---------- 基础控件 ---------- */
body {
  font-size: 14px;
  line-height: 1.5715;
  background: var(--bg);
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

::selection {
  color: #fff;
  background: rgba(22, 93, 255, 0.75);
}

.icon {
  stroke-width: 1.7;
}

.brand-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 18px;
  font-weight: 650;
  line-height: 1;
  color: #fff;
  background: var(--primary-solid);
  border-radius: var(--radius-md);
  box-shadow: none;
  flex: 0 0 auto;
}

.brand-symbol .icon {
  width: 16px;
  height: 16px;
}

.btn {
  height: 32px;
  padding: 0 14px;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.btn .icon {
  width: 14px;
  height: 14px;
}

.btn:active {
  transform: none;
}

.btn-primary {
  color: #fff;
  background: var(--primary-solid);
  border-color: var(--primary-solid);
  box-shadow: none;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-solid-hover);
  border-color: var(--primary-solid-hover);
  box-shadow: none;
}

.btn-secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow: none;
}

.btn-secondary:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-subtle);
  border-color: var(--border-strong);
}

.btn-danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
  box-shadow: none;
}

.btn-danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger) 88%, #000);
  border-color: color-mix(in srgb, var(--danger) 88%, #000);
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-sm .icon {
  width: 13px;
  height: 13px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.icon-btn-sm {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

.icon-btn-sm .icon {
  width: 15px;
  height: 15px;
}

.text-button {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--primary);
}

.text-link {
  gap: 3px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--primary);
}

.text-link .icon {
  width: 13px;
  height: 13px;
}

.avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
  font-weight: 500;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.avatar-md {
  width: 38px;
  height: 38px;
  font-size: 13px;
}

.avatar-xl {
  width: 64px;
  height: 64px;
  font-size: 21px;
  border-radius: 50%;
}

/* ---------- 表单 ---------- */
.field {
  gap: 6px;
}

.field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.input {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
  border-radius: var(--radius-sm);
}

.input:hover {
  border-color: var(--border-strong);
}

.input:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.input.is-readonly {
  color: var(--muted);
  background: var(--surface-subtle);
}

textarea.input {
  min-height: 82px;
}

.input.select {
  padding-right: 32px;
  background-position: right 10px center;
}

.input-with-icon > .icon {
  left: 11px;
  width: 15px;
  height: 15px;
}

.input-with-icon .input {
  padding-left: 34px;
}

.field-error {
  font-size: 12px;
}

.field-hint {
  font-size: 11.5px;
}

.field.has-error .input,
.input.has-error {
  box-shadow: 0 0 0 3px rgba(217, 48, 38, 0.08);
}

.form-actions {
  gap: 8px;
  padding-top: 16px;
  margin-top: 20px;
}

.check-label {
  font-size: 12.5px;
}

.switch {
  width: 32px;
  height: 18px;
}

.switch-thumb {
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
}

.switch[aria-checked="true"] .switch-thumb {
  transform: translateX(14px);
}

.switch:active .switch-thumb {
  width: 15px;
}

.switch[aria-checked="true"]:active .switch-thumb {
  transform: translateX(13px);
}

/* =========================================================
   登录页
   ========================================================= */
.login-view {
  display: block;
  min-height: 100vh;
  background: var(--bg);
}

.login-visual {
  padding: 32px clamp(36px, 4.5vw, 64px) 26px;
  color: #fff;
  background: #0b1f33;
}

.visual-glow {
  display: none;
}

.visual-grid {
  opacity: 0.36;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.7) 72%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.7) 72%, transparent 100%);
}

.login-brand {
  gap: 10px;
}

.login-brand .brand-symbol {
  width: 30px;
  height: 30px;
  font-size: 17px;
  border-radius: var(--radius-sm);
}

.login-brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  color: #f7f9fc;
}

.login-brand-name em {
  margin-left: 7px;
  font-size: 12.5px;
  font-style: normal;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.52);
}

.login-visual-content {
  max-width: 560px;
  padding: 52px 0 36px;
}

.visual-overline {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #82aaff;
}

.visual-overline::before {
  width: 18px;
  height: 1px;
  background: #82aaff;
  content: "";
}

.login-visual h1 {
  font-size: clamp(32px, 3.4vw, 46px);
  font-weight: 500;
  line-height: 1.42;
  letter-spacing: 0;
  color: #f7f9fc;
}

.login-visual h1 span {
  color: inherit;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
}

.visual-description {
  max-width: 500px;
  margin-top: 20px;
  font-size: 14px;
  line-height: 1.9;
  color: rgba(235, 242, 250, 0.64);
}

.login-capabilities {
  max-width: 500px;
  margin-top: 38px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.login-capabilities li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.capability-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #a9c4ff;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-sm);
  flex: 0 0 auto;
}

.capability-icon .icon {
  width: 16px;
  height: 16px;
}

.login-capabilities li > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.login-capabilities strong {
  font-size: 13px;
  font-weight: 500;
  color: #e9eef7;
}

.login-capabilities span {
  font-size: 12px;
  color: rgba(235, 242, 250, 0.5);
}

.login-visual-footer {
  padding-top: 20px;
  gap: 11px;
  font-size: 11.5px;
  color: rgba(235, 242, 250, 0.4);
}

.visual-footer-divider {
  height: 10px;
  background: rgba(255, 255, 255, 0.14);
}

.login-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 24px;
  background: var(--bg);
}

.login-topbar {
  gap: 5px;
  min-height: 28px;
  font-size: 12px;
  color: var(--muted);
}

.login-topbar a {
  gap: 1px;
  font-weight: 400;
  color: var(--primary);
}

.login-topbar a .icon {
  width: 12px;
  height: 12px;
}

.auth-panel {
  width: min(400px, 100%);
  padding: 34px 34px 30px;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(29, 33, 41, 0.05);
}

.auth-mobile-brand {
  display: none;
}

.auth-kicker {
  display: none;
}

.auth-panel h2 {
  margin-bottom: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--text);
}

.auth-subtitle {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.auth-form {
  gap: 16px;
  margin-top: 26px;
}

.auth-field {
  gap: 6px;
}

.auth-field > label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.auth-input-wrap {
  height: 40px;
  background: var(--surface);
  border-color: var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.auth-input-wrap:hover {
  border-color: var(--border-strong);
}

.auth-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.auth-input-wrap > .icon {
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.auth-input-wrap input {
  padding: 0 42px 0 36px;
  font-size: 13px;
  color: var(--text);
  border-radius: var(--radius-sm);
}

.auth-input-wrap input::placeholder {
  color: var(--muted);
}

.auth-input-wrap.has-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(217, 48, 38, 0.08);
}

.password-visibility {
  right: 5px;
  width: 30px;
  height: 30px;
  color: var(--muted);
  border-radius: var(--radius-sm);
}

.password-visibility:hover {
  color: var(--text-secondary);
  background: var(--surface-subtle);
}

.password-visibility .icon {
  width: 16px;
  height: 16px;
}

.auth-options {
  margin-top: 0;
}

.auth-options .text-button {
  font-size: 12.5px;
}

.form-alert {
  padding: 9px 11px;
  margin-top: -2px;
  font-size: 12px;
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 20%, transparent);
  border-radius: var(--radius-sm);
}

.form-alert .icon {
  width: 14px;
  height: 14px;
}

.login-submit {
  height: 40px;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.login-submit:hover {
  transform: none;
}

.login-submit-arrow {
  display: none;
}

.login-spinner {
  width: 15px;
  height: 15px;
}

.demo-credentials {
  gap: 10px;
  padding: 10px 12px;
  margin-top: 22px;
  background: var(--surface-subtle);
  border-color: var(--border);
  border-radius: var(--radius-sm);
}

.demo-icon {
  width: 30px;
  height: 30px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
}

.demo-icon .icon {
  width: 15px;
  height: 15px;
}

.demo-copy {
  gap: 1px;
}

.demo-copy > span {
  font-size: 11px;
  color: var(--muted);
}

.demo-copy > div {
  font-size: 12px;
  color: var(--text-secondary);
}

.demo-copy code {
  padding: 0 4px;
  font-size: 11px;
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  border-radius: 2px;
}

.demo-copy .dot-sep {
  color: var(--border-strong);
}

.demo-fill {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 400;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
}

.demo-fill:hover {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
}

.demo-note {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}

.login-footer {
  font-size: 11.5px;
  color: var(--muted);
}

.login-footer a:hover {
  color: var(--text-secondary);
}

/* =========================================================
   应用框架与导航
   ========================================================= */
.app-shell {
  background: var(--bg);
}

.sidebar {
  padding: 0;
  color: var(--sidebar-text);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  box-shadow: none;
}

.sidebar::after {
  display: none;
}

.sidebar-brand {
  gap: 9px;
  min-height: var(--topbar-height);
  padding: 0 16px;
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand .brand-symbol {
  width: 28px;
  height: 28px;
  font-size: 16px;
  border-radius: var(--radius-sm);
}

.sidebar-brand-copy {
  gap: 0;
}

.sidebar-brand-copy strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
}

.sidebar-brand-copy small {
  font-size: 10.5px;
  letter-spacing: 0;
  color: var(--muted);
}

.sidebar-brand-version {
  display: none;
}

.workspace-card {
  gap: 9px;
  padding: 9px 10px;
  margin: 14px 12px 16px;
  background: var(--surface-subtle);
  border-color: var(--border);
  border-radius: var(--radius-sm);
}

.workspace-avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-soft);
  border: 0;
  border-radius: var(--radius-sm);
}

.workspace-copy {
  gap: 1px;
}

.workspace-copy strong {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}

.workspace-copy span {
  font-size: 10.5px;
  color: var(--muted);
}

.workspace-plan {
  padding: 1px 4px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--primary);
  background: var(--primary-soft);
  border: 0;
  border-radius: 2px;
}

.side-nav {
  padding: 0 10px;
  scrollbar-color: var(--border-strong) transparent;
}

.side-nav::-webkit-scrollbar-thumb {
  background: var(--border-strong);
}

.nav-label {
  padding: 0 10px;
  margin: 8px 0 4px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

.nav-label-spaced {
  margin-top: 20px;
}

.nav-item {
  gap: 9px;
  min-height: 36px;
  padding: 0 10px;
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  border: 0;
  border-radius: var(--radius-sm);
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface-subtle);
}

.nav-item.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  border: 0;
  font-weight: 500;
}

.nav-item.is-active::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 2px;
  background: var(--primary);
  border-radius: 2px;
  content: "";
}

.nav-icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.nav-item.is-active .nav-icon,
.nav-group.has-active .nav-group-toggle .nav-icon {
  color: var(--primary);
}

.nav-active-bar {
  display: none;
}

.nav-group.has-active .nav-group-toggle {
  color: var(--text);
}

.nav-chevron {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.nav-subitem {
  gap: 0;
  min-height: 32px;
  padding: 0 10px 0 35px;
  margin: 0 0 2px;
  font-size: 12.5px;
  color: var(--text-secondary);
  border: 0;
  border-radius: var(--radius-sm);
}

.nav-subitem:hover {
  color: var(--text);
  background: var(--surface-subtle);
}

.nav-subitem.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 500;
}

.subitem-marker {
  display: none;
}

.sidebar-footer {
  padding: 12px 14px 14px;
  margin-top: 0;
  border-top: 1px solid var(--border);
}

.system-status {
  gap: 8px;
  padding: 7px 2px;
}

.status-pulse {
  width: 6px;
  height: 6px;
  background: var(--success);
}

.status-pulse::after {
  display: none;
}

.system-status strong {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.system-status span:not(.status-pulse):not(.status-uptime) {
  font-size: 10.5px;
  color: var(--muted);
}

.status-uptime {
  display: none;
}

.sidebar-help {
  gap: 8px;
  padding: 7px 2px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  border-radius: var(--radius-sm);
}

.sidebar-help:hover {
  color: var(--primary);
  background: transparent;
}

.sidebar-help .icon {
  width: 14px;
  height: 14px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  height: var(--topbar-height);
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.topbar-left {
  gap: 6px;
}

.breadcrumb {
  font-size: 13px;
}

.breadcrumb-current {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.breadcrumb-parent {
  color: var(--muted);
}

.breadcrumb-sep {
  width: 12px;
  height: 12px;
  margin: 0 5px;
  color: var(--border-strong);
}

.topbar-right {
  gap: 2px;
}

.global-search {
  width: 240px;
  height: 32px;
  padding: 0 8px 0 10px;
  margin-right: 8px;
  background: var(--surface-subtle);
  border-color: transparent;
  border-radius: var(--radius-sm);
}

.global-search:hover {
  border-color: var(--border);
}

.global-search:focus-within {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.global-search .icon {
  width: 15px;
  height: 15px;
}

.global-search input {
  padding: 0 7px;
  font-size: 12.5px;
}

.global-search kbd {
  padding: 1px 4px;
  font-size: 10px;
  background: var(--surface);
  border-color: var(--border);
  border-radius: 2px;
  box-shadow: none;
}

.notification-dot {
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
}

.topbar-divider {
  height: 20px;
  margin: 0 8px;
}

.profile-trigger {
  gap: 8px;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
}

.profile-trigger:hover {
  background: var(--surface-subtle);
  border-color: transparent;
}

.profile-trigger .avatar-sm {
  width: 28px;
  height: 28px;
}

.profile-trigger-copy {
  min-width: 64px;
  line-height: 1.35;
}

.profile-trigger-copy strong {
  font-size: 12.5px;
  font-weight: 500;
}

.profile-trigger-copy small {
  font-size: 10.5px;
}

.profile-chevron {
  width: 12px;
  height: 12px;
}

/* ---------- 弹出层 ---------- */
.popover {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.notification-popover {
  width: 360px;
}

.popover-header {
  padding: 15px 16px 11px;
}

.popover-header h3 {
  margin-bottom: 1px;
  font-size: 14px;
  font-weight: 600;
}

.popover-header span {
  font-size: 11.5px;
}

.notification-item {
  gap: 10px;
  padding: 11px 16px;
}

.notification-item-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

.notification-item-copy strong {
  font-size: 12px;
  font-weight: 500;
}

.notification-item-copy span {
  font-size: 11.5px;
}

.notification-item-time {
  font-size: 10px;
}

.notification-empty {
  font-size: 12px;
}

.profile-popover {
  width: 252px;
  padding: 6px;
}

.profile-popover-head {
  padding: 9px;
  border-radius: var(--radius-sm);
}

.profile-popover-head strong {
  font-size: 13px;
  font-weight: 500;
}

.profile-popover-head span {
  font-size: 11px;
}

.popover-menu {
  padding: 2px 0;
}

.popover-menu-item {
  gap: 8px;
  padding: 8px 9px;
  font-size: 12.5px;
  font-weight: 400;
  border-radius: var(--radius-sm);
}

.popover-menu-item .icon {
  width: 15px;
  height: 15px;
}

.popover-version {
  padding: 7px 9px 3px;
  font-size: 10px;
}

/* =========================================================
   页面骨架与卡片
   ========================================================= */
.main-content {
  max-width: 1600px;
  padding: 20px 24px 32px;
}

.page.is-active {
  animation: none;
}

.page-head {
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.page-kicker {
  display: none;
}

.page-title-group h1 {
  margin-bottom: 4px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
}

.page-subtitle {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.page-actions {
  gap: 8px;
}

.card {
  background: var(--surface);
  border-color: var(--border);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.card-head {
  align-items: center;
  gap: 16px;
}

.card-heading h2 {
  margin-bottom: 3px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.card-heading p {
  font-size: 11.5px;
  line-height: 1.55;
}

.count-badge {
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  margin-left: 4px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 2px;
  vertical-align: 1px;
}

.muted-badge {
  gap: 4px;
  padding: 3px 7px;
  font-size: 11px;
  border-radius: 2px;
}

.muted-badge .icon {
  width: 11px;
  height: 11px;
}

/* =========================================================
   工作台
   ========================================================= */
.kpi-grid {
  gap: 12px;
}

.kpi-card {
  min-height: 118px;
  padding: 16px 18px;
  overflow: visible;
  transition: border-color 0.16s ease;
}

.kpi-card:hover {
  border-color: var(--border-strong);
  box-shadow: none;
  transform: none;
}

.kpi-top {
  align-items: center;
  margin-bottom: 8px;
}

.kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

.kpi-icon .icon {
  width: 14px;
  height: 14px;
}

.delta-pill {
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 400;
  border-radius: 2px;
}

.delta-pill.neutral {
  color: var(--muted);
  background: var(--surface-subtle);
}

.delta-pill.up {
  background: var(--success-soft);
}

.delta-pill.warning {
  background: var(--warning-soft);
}

.kpi-label {
  margin-bottom: 3px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.kpi-value {
  gap: 4px;
  margin-bottom: 4px;
}

.kpi-value strong {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.kpi-value span {
  font-size: 11px;
}

.kpi-foot {
  font-size: 11.5px;
}

.kpi-spark {
  display: none;
}

.dashboard-grid,
.dashboard-bottom {
  gap: 12px;
  margin-top: 12px;
}

.chart-card {
  padding: 18px 20px 10px;
}

.segmented-control {
  gap: 0;
  padding: 2px;
  border-radius: var(--radius-sm);
}

.segmented-control button {
  height: 24px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 400;
  border-radius: 2px;
}

.segmented-control button.is-active {
  font-weight: 500;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}

.chart-summary-row {
  gap: 9px;
  margin: 16px 0 4px;
}

.chart-average {
  gap: 4px;
}

.chart-average span:first-child {
  font-size: 11.5px;
}

.chart-average strong {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.chart-average span:last-child {
  font-size: 11px;
}

.trend-badge {
  gap: 2px;
  padding: 1px 5px;
  font-size: 11px;
  font-weight: 400;
  border-radius: 2px;
}

.trend-badge small {
  font-size: 10px;
}

.chart-legend {
  gap: 5px;
  font-size: 11px;
}

.chart-legend i {
  width: 12px;
  height: 2px;
}

.chart-canvas {
  min-height: 200px;
}

.chart-grid-line {
  stroke: var(--border);
  stroke-dasharray: none;
}

.chart-axis-text {
  font-size: 11px;
  fill: var(--muted);
}

.chart-line {
  stroke-width: 2;
  filter: none;
}

.chart-dot {
  stroke-width: 2;
}

.security-card {
  padding: 18px 20px 14px;
}

.score-wrap {
  gap: 8px;
  padding: 10px 0 14px;
}

.score-ring {
  width: 100px;
  height: 100px;
  padding: 7px;
}

.score-ring-inner {
  box-shadow: inset 0 0 0 1px var(--border);
}

.score-ring-inner strong {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.score-ring-inner span {
  font-size: 10.5px;
}

.score-state {
  gap: 5px;
  font-size: 11.5px;
  font-weight: 400;
}

.score-state i {
  width: 4px;
  height: 4px;
}

.security-list li {
  gap: 9px;
  padding: 9px 0;
}

.security-item-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
}

.security-item-icon .icon {
  width: 13px;
  height: 13px;
}

.security-item-copy strong {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.security-item-copy span {
  font-size: 11px;
}

.mini-status {
  padding: 1px 6px;
  font-size: 10.5px;
  border-radius: 2px;
}

.security-review-btn {
  gap: 4px;
  padding: 7px;
  font-size: 12px;
  font-weight: 400;
  background: var(--surface);
  border-color: var(--border-strong);
  border-radius: var(--radius-sm);
}

.security-review-btn:hover {
  color: var(--primary);
  background: var(--surface-subtle);
  border-color: var(--primary);
}

.security-review-btn .icon {
  width: 12px;
  height: 12px;
}

.recent-logins-card {
  padding: 18px 20px 8px;
}

.recent-logins {
  margin-top: 8px;
}

.login-row {
  gap: 10px;
  min-height: 48px;
  padding: 8px 0;
}

.person-cell {
  gap: 9px;
}

.person-cell .avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.person-copy strong {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}

.person-copy span {
  font-size: 11px;
}

.login-device {
  gap: 4px;
  width: 86px;
  font-size: 11.5px;
}

.login-device .icon {
  width: 12px;
  height: 12px;
}

.login-time {
  width: 72px;
  font-size: 11.5px;
}

.status-pill {
  padding: 1px 6px;
  font-size: 10.5px;
  border-radius: 2px;
}

.quick-card {
  padding: 18px 16px 12px;
}

.quick-list {
  gap: 0;
  margin-top: 8px;
}

.quick-item {
  gap: 9px;
  padding: 9px 6px;
  border-radius: var(--radius-sm);
  transition: background 0.16s ease;
}

.quick-item:hover {
  background: var(--surface-subtle);
  transform: none;
}

.quick-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

.quick-icon .icon {
  width: 14px;
  height: 14px;
}

.quick-copy strong {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}

.quick-copy small {
  font-size: 11px;
}

.quick-arrow {
  width: 12px;
  height: 12px;
}

/* =========================================================
   账号设置
   ========================================================= */
.settings-layout {
  gap: 12px;
}

.profile-editor {
  padding: 20px;
}

.profile-editor .card-head,
.settings-card .card-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.avatar-editor {
  gap: 16px;
  padding: 14px 16px;
  margin: 18px 0 20px;
  background: var(--surface-subtle);
  border-color: var(--border);
  border-radius: var(--radius-sm);
}

.avatar-editor .avatar-xl {
  border: 1px solid var(--border);
  box-shadow: none;
}

.avatar-editor-copy > strong {
  font-size: 13px;
  font-weight: 500;
}

.avatar-editor-copy > p {
  font-size: 11.5px;
}

.avatar-actions {
  gap: 8px;
}

.form-grid {
  gap: 16px 20px;
}

.settings-side {
  gap: 12px;
}

.settings-card {
  padding: 18px 20px;
}

.security-shield {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

.security-shield .icon {
  width: 14px;
  height: 14px;
}

.setting-list {
  margin-top: 8px;
}

.setting-row {
  gap: 10px;
  min-height: 54px;
  padding: 9px 0;
}

.setting-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
}

.setting-icon .icon {
  width: 14px;
  height: 14px;
}

.setting-copy strong {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}

.setting-copy span {
  font-size: 11.5px;
}

.security-note {
  gap: 6px;
  padding: 8px 10px;
  margin-top: 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.security-note .icon {
  width: 12px;
  height: 12px;
}

.security-note p {
  font-size: 11px;
}

/* =========================================================
   账号管理
   ========================================================= */
.account-stats {
  min-height: 68px;
  padding: 12px 20px;
  margin-bottom: 12px;
  background: var(--surface);
  border-color: var(--border);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.account-stat {
  gap: 10px;
}

.account-stat-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
}

.account-stat-icon .icon {
  width: 15px;
  height: 15px;
}

.account-stat > div span {
  font-size: 12px;
}

.account-stat > div strong {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.account-stat-divider {
  height: 24px;
  margin: 0 18px;
}

.accounts-card-head {
  padding: 16px 20px 0;
}

.table-toolbar {
  gap: 8px;
  padding: 12px 20px;
}

.table-search {
  width: 260px;
  height: 32px;
  padding: 0 10px;
  background: var(--surface-subtle);
  border-color: var(--border);
  border-radius: var(--radius-sm);
}

.table-search:focus-within {
  background: var(--surface);
  box-shadow: var(--ring);
}

.table-search .icon {
  width: 14px;
  height: 14px;
}

.table-search input {
  padding: 0 6px;
  font-size: 12.5px;
}

.filter-group {
  gap: 8px;
}

.select-wrap {
  height: 32px;
  background: var(--surface);
  border-color: var(--border-strong);
  border-radius: var(--radius-sm);
}

.select-wrap > .icon:first-child {
  width: 13px;
  height: 13px;
  margin-left: 9px;
}

.select-wrap select {
  padding: 0 25px 0 9px;
  font-size: 12px;
}

.select-wrap .select-chevron {
  right: 7px;
  width: 12px;
  height: 12px;
}

.select-wrap:focus-within {
  box-shadow: var(--ring);
}

.filter-reset {
  font-size: 12px;
  color: var(--muted);
}

.bulk-bar {
  gap: 16px;
  padding: 8px 20px;
  font-size: 12px;
}

.bulk-actions {
  gap: 12px;
}

.bulk-actions .text-button {
  font-size: 12px;
  font-weight: 400;
}

.data-table {
  min-width: 900px;
}

.data-table th {
  height: 38px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-subtle);
}

.data-table th:first-child,
.data-table td:first-child {
  padding-left: 20px;
}

.data-table th:last-child,
.data-table td:last-child {
  padding-right: 18px;
}

.data-table td {
  height: 56px;
  padding: 9px 14px;
  font-size: 12.5px;
}

.data-table tbody tr.is-selected {
  background: var(--primary-soft);
}

.accounts-table .account-cell {
  min-width: 200px;
}

.account-identity {
  gap: 9px;
}

.account-identity > .avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.account-name {
  max-width: 145px;
  font-size: 13px;
  font-weight: 500;
}

.self-tag {
  padding: 0 4px;
  font-size: 10px;
  border-radius: 2px;
}

.account-openid {
  max-width: 190px;
  font-size: 11px;
}

.account-edit-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.account-edit-identity .avatar {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.account-edit-identity > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.account-edit-identity strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-edit-identity span {
  font-size: 10px;
  color: var(--muted);
}

.account-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 550;
  border-radius: 999px;
  white-space: nowrap;
}

.account-status-pill::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.account-status-pill.is-active {
  color: var(--success);
  background: var(--success-soft);
}

.account-status-pill.is-pending {
  color: var(--warning);
  background: var(--warning-soft);
}

.account-status-pill.is-inactive {
  color: var(--muted);
  background: var(--surface-subtle);
}

.keepalive-card {
  padding: 10px 12px;
  margin-bottom: 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.keepalive-card-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text);
}

.keepalive-card-head strong {
  font-weight: 600;
}

.keepalive-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.keepalive-state {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}

.keepalive-meta {
  margin: 6px 0 0;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--muted);
}

.keepalive-check {
  margin-left: 10px;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
}

.keepalive-check:disabled {
  opacity: 0.55;
  cursor: default;
}

.keepalive-card[data-state="on"] .keepalive-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

.keepalive-card[data-state="on"] .keepalive-state {
  color: var(--success);
}

.keepalive-card[data-state="idle"] .keepalive-dot {
  background: var(--warning);
}

.keepalive-card[data-state="idle"] .keepalive-state {
  color: var(--warning);
}

.keepalive-card[data-state="error"] .keepalive-dot {
  background: var(--danger);
}

.keepalive-card[data-state="error"] .keepalive-state {
  color: var(--danger);
}

.role-badge {
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 400;
  border-radius: 2px;
}

.department-text,
.date-text {
  font-size: 12px;
}

.status-toggle {
  gap: 6px;
}

.status-track {
  width: 26px;
  height: 14px;
}

.status-thumb {
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
}

.status-toggle.is-active .status-thumb {
  transform: translateX(12px);
}

.status-label {
  font-size: 11.5px;
}

.row-action-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
}

.row-action-btn .icon {
  width: 14px;
  height: 14px;
}

.table-footer {
  gap: 14px;
  padding: 12px 20px;
}

.table-summary {
  font-size: 12px;
}

.pagination {
  gap: 2px;
}

.page-btn {
  min-width: 27px;
  height: 27px;
  padding: 0 6px;
  font-size: 12px;
  border-radius: 2px;
}

.page-btn.is-active {
  background: var(--primary-solid);
  border-color: var(--primary-solid);
}

.page-btn .icon {
  width: 12px;
  height: 12px;
}

.page-ellipsis {
  min-width: 18px;
  font-size: 12px;
}

.empty-state {
  padding: 44px 20px;
}

.empty-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
}

.empty-icon .icon {
  width: 18px;
  height: 18px;
}

.empty-state h3 {
  font-size: 13px;
  font-weight: 500;
}

.empty-state p {
  font-size: 12px;
}

/* =========================================================
   弹窗、通知与行菜单
   ========================================================= */
.modal-backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.modal-panel {
  border-color: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.2);
  animation: modalIn 0.2s ease;
}

.modal-header {
  padding: 18px 20px 12px;
}

.modal-eyebrow {
  display: none;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
}

.modal-header p {
  margin-top: 3px;
  font-size: 12px;
}

.modal-close {
  width: 28px;
  height: 28px;
}

.modal-body {
  padding: 4px 20px 20px;
}

.modal-footer {
  gap: 8px;
  padding: 12px 20px;
}

.modal-note {
  gap: 7px;
  padding: 8px 10px;
  margin-top: 14px;
  font-size: 11.5px;
  border-radius: var(--radius-sm);
}

.modal-note .icon {
  width: 13px;
  height: 13px;
}

.modal-form-grid {
  gap: 14px 16px;
  padding-top: 6px;
}

.confirm-content {
  gap: 12px;
}

.confirm-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.confirm-icon .icon {
  width: 18px;
  height: 18px;
}

.confirm-copy h3 {
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 500;
}

.confirm-copy p {
  font-size: 12px;
}

.toast-region {
  right: 24px;
  bottom: 24px;
  gap: 8px;
  width: min(340px, calc(100vw - 32px));
}

.toast {
  gap: 9px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  animation: toastIn 0.2s ease;
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
}

.toast-icon .icon {
  width: 13px;
  height: 13px;
}

.toast-copy strong {
  font-size: 12.5px;
  font-weight: 500;
}

.toast-copy p {
  font-size: 11.5px;
}

.toast-close {
  width: 20px;
  height: 20px;
  border-radius: 2px;
}

.row-menu {
  width: 178px;
  padding: 4px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.row-menu-item {
  gap: 8px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 400;
  border-radius: var(--radius-sm);
}

.row-menu-item .icon {
  width: 14px;
  height: 14px;
}

/* 让滚动条也保持企业后台的克制感 */
.table-wrap {
  scrollbar-color: var(--border-strong) transparent;
}

.table-wrap::-webkit-scrollbar {
  height: 8px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 2px solid var(--surface);
  border-radius: 4px;
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1320px) {
  .global-search {
    width: 210px;
  }
}

@media (max-width: 1024px) {
  .dashboard-grid,
  .dashboard-bottom,
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .quick-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .quick-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid var(--border);
  }

  .quick-arrow {
    display: none;
  }

  .settings-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 960px) {
  .sidebar {
    box-shadow: 8px 0 24px rgba(29, 33, 41, 0.16);
  }

  .sidebar-overlay {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .topbar {
    height: var(--topbar-height);
  }

  .login-view {
    grid-template-columns: 1fr;
  }

  .login-main {
    min-height: 100vh;
    padding: 24px;
    background: var(--bg);
  }

  .login-topbar {
    justify-content: flex-end;
  }

  .auth-panel {
    width: min(400px, 100%);
    padding: 32px 28px 26px;
    margin: auto;
  }

  .auth-mobile-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 28px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
  }

  .auth-mobile-brand .brand-symbol {
    width: 28px;
    height: 28px;
    font-size: 16px;
    border-radius: var(--radius-sm);
  }

  .auth-mobile-brand em {
    margin-left: 3px;
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    color: var(--muted);
  }

  .login-footer {
    padding-top: 16px;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 16px;
  }

  .global-search {
    width: 180px;
    margin-right: 1px;
  }

  .global-search kbd {
    display: none;
  }

  .profile-trigger {
    padding: 3px;
  }

  .topbar-divider {
    margin: 0 1px;
  }

  .main-content {
    padding: 16px 16px 28px;
  }

  .page-head {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
  }

  .page-title-group h1 {
    font-size: 19px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
  }

  .kpi-grid {
    gap: 10px;
  }

  .kpi-card {
    min-height: 112px;
    padding: 14px;
  }

  .dashboard-grid,
  .dashboard-bottom {
    gap: 10px;
    margin-top: 10px;
  }

  .chart-card,
  .security-card,
  .recent-logins-card,
  .quick-card {
    padding: 16px 15px 12px;
  }

  .chart-card .card-head {
    align-items: center;
  }

  .chart-summary-row {
    margin-top: 14px;
  }

  .chart-canvas {
    min-height: 190px;
  }

  .quick-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .quick-item {
    flex-direction: row;
    align-items: center;
    padding: 9px 2px;
    border: 0;
  }

  .quick-arrow {
    display: block;
  }

  .settings-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-editor {
    padding: 16px;
  }

  .avatar-editor {
    align-items: flex-start;
    padding: 12px;
    margin: 16px 0 18px;
  }

  .avatar-editor .avatar-xl {
    border-radius: 50%;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .account-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 8px;
    padding: 14px 16px;
  }

  .account-stat-divider {
    display: none;
  }

  .accounts-card-head {
    padding: 14px 16px 0;
  }

  .table-toolbar {
    padding: 12px 16px;
  }

  .table-search {
    width: 100%;
  }

  .filter-group {
    width: 100%;
    flex-wrap: wrap;
  }

  .select-wrap {
    flex: 1;
    min-width: 100px;
  }

  .filter-reset {
    padding: 6px 0;
  }

  .bulk-bar {
    gap: 10px;
    padding: 8px 16px;
  }

  .data-table th:first-child,
  .data-table td:first-child {
    padding-left: 16px;
  }

  .table-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
  }

  .pagination {
    width: 100%;
    justify-content: flex-end;
  }

  .notification-popover {
    position: fixed;
    top: 62px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .modal-layer {
    align-items: flex-end;
    padding: 12px;
  }

  .modal-panel {
    max-height: calc(100vh - 24px);
    border-radius: var(--radius-lg);
  }

  .modal-header {
    padding: 16px 18px 11px;
  }

  .modal-body {
    padding: 4px 18px 18px;
  }

  .modal-footer {
    padding: 11px 18px;
  }

  .toast-region {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 520px) {
  .topbar-right {
    gap: 1px;
  }

  .global-search {
    display: none;
  }

  .theme-toggle {
    display: none;
  }

  .breadcrumb {
    font-size: 12.5px;
  }

  .kpi-grid {
    gap: 8px;
  }

  .kpi-card {
    min-height: 108px;
    padding: 12px;
  }

  .delta-pill {
    display: none;
  }

  .kpi-value strong {
    font-size: 24px;
  }

  .kpi-value span {
    font-size: 10.5px;
  }

  .kpi-foot {
    max-width: 120px;
    font-size: 11px;
    line-height: 1.45;
  }

  .chart-summary-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  .chart-legend {
    margin-left: 0;
  }

  .score-wrap {
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
  }

  .score-state {
    flex-direction: row;
  }

  .avatar-editor {
    flex-direction: column;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
  }

  .form-actions .btn {
    width: 100%;
  }

  .account-stat > div strong {
    font-size: 18px;
  }

  .account-stat-icon {
    width: 28px;
    height: 28px;
  }

  .account-stats {
    min-height: 0;
    padding: 12px 14px;
  }

  .login-main {
    padding: 16px 14px 14px;
  }

  .login-topbar {
    font-size: 11.5px;
  }

  .auth-panel {
    padding: 26px 20px 22px;
  }

  .auth-mobile-brand {
    margin-bottom: 24px;
  }

  .auth-panel h2 {
    font-size: 22px;
  }

  .auth-form {
    gap: 14px;
    margin-top: 24px;
  }

  .auth-input-wrap {
    height: 40px;
  }

  .demo-credentials {
    margin-top: 18px;
  }

  .login-footer {
    flex-direction: column;
    gap: 8px;
  }

  .login-footer > div {
    order: -1;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
  }
}

@media (max-height: 720px) and (min-width: 961px) {
  .login-visual {
    padding-top: 22px;
    padding-bottom: 20px;
  }

  .login-visual-content {
    padding-top: 30px;
    padding-bottom: 22px;
  }

  .login-visual h1 {
    font-size: 34px;
  }

  .visual-description {
    margin-top: 14px;
  }

  .login-capabilities {
    margin-top: 22px;
  }

  .login-capabilities li {
    padding: 10px 0;
  }

  .login-visual-footer {
    padding-top: 14px;
  }

  .auth-panel {
    padding-top: 26px;
    padding-bottom: 22px;
  }
}

/* =========================================================
   账号设置（精简版）
   ========================================================= */

.side-nav {
  padding-top: 14px;
}

.settings-layout-single {
  display: block;
  max-width: 720px;
}

.settings-simple {
  padding: 22px 24px 24px;
}

.settings-simple .card-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.settings-simple .form-grid {
  margin-top: 20px;
}

.settings-simple .field-full + .field-full {
  margin-top: 2px;
}

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.token-status {
  max-width: 430px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}

.token-status strong {
  font-weight: 500;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .side-nav {
    padding-top: 12px;
  }

  .settings-simple {
    padding: 18px 16px 20px;
  }

  .settings-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .settings-actions .btn {
    width: 100%;
  }

  .token-status {
    max-width: none;
  }
}

/* =========================================================
   扫码添加账号
   ========================================================= */

.account-channel-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  font-size: 8px;
  font-weight: 550;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 3px;
  white-space: nowrap;
}

.account-scan-panel {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding-top: 2px;
}

.scan-channel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.scan-channel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 8px;
}

.scan-channel-icon .icon {
  width: 17px;
  height: 17px;
}

.scan-channel-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.scan-channel-copy strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.scan-channel-copy span {
  overflow: hidden;
  font-size: 10.5px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-channel-tag {
  flex: 0 0 auto;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 550;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.scan-proxy {
  padding: 0 2px;
}

.scan-proxy-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.scan-proxy-toggle input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--primary);
}

.scan-proxy-grid {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 10px 12px;
  margin-top: 10px;
  padding: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.scan-proxy-grid .field {
  gap: 4px;
}

.scan-proxy-grid .field label {
  font-size: 10px;
}

.scan-proxy-grid .input {
  height: 34px;
  font-size: 11.5px;
}

.scan-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  padding: 18px 16px;
  text-align: center;
  background: var(--surface-subtle);
  border: 1px dashed var(--border);
  border-radius: 10px;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.scan-stage[data-stage="pending"],
.scan-stage[data-stage="scanned"],
.scan-stage[data-stage="authorized"] {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  border-style: solid;
}

.scan-stage[data-stage="saved"] {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 42%, var(--border));
  border-style: solid;
}

.scan-stage[data-stage="expired"],
.scan-stage[data-stage="error"] {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 38%, var(--border));
  border-style: solid;
}

.scan-qr-wrap {
  position: relative;
  width: 204px;
  height: 204px;
  padding: 8px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.14);
}

.scan-qr-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  image-rendering: pixelated;
}

.scan-qr-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--primary);
  border-style: solid;
  pointer-events: none;
}

.scan-qr-corner-tl {
  top: 2px;
  left: 2px;
  border-width: 2px 0 0 2px;
  border-top-left-radius: 4px;
}

.scan-qr-corner-tr {
  top: 2px;
  right: 2px;
  border-width: 2px 2px 0 0;
  border-top-right-radius: 4px;
}

.scan-qr-corner-bl {
  bottom: 2px;
  left: 2px;
  border-width: 0 0 2px 2px;
  border-bottom-left-radius: 4px;
}

.scan-qr-corner-br {
  right: 2px;
  bottom: 2px;
  border-width: 0 2px 2px 0;
  border-bottom-right-radius: 4px;
}

.scan-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  height: 132px;
  margin: 6px 0;
  color: color-mix(in srgb, var(--muted) 62%, transparent);
  background: var(--surface);
  border: 1px dashed var(--border-strong, var(--border));
  border-radius: 10px;
}

.scan-placeholder .icon {
  width: 42px;
  height: 42px;
}

.scan-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.scan-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--muted);
  border-radius: 50%;
}

.scan-stage[data-stage="pending"] .scan-status-dot,
.scan-stage[data-stage="scanned"] .scan-status-dot {
  background: var(--warning);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 15%, transparent);
  animation: scanPulse 1.6s ease-in-out infinite;
}

.scan-stage[data-stage="authorized"] .scan-status-dot {
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
  animation: scanPulse 1.2s ease-in-out infinite;
}

.scan-stage[data-stage="saved"] .scan-status-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}

.scan-stage[data-stage="expired"] .scan-status-dot,
.scan-stage[data-stage="error"] .scan-status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

@keyframes scanPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.scan-hint {
  max-width: 370px;
  margin-top: 5px;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--muted);
}

.scan-countdown {
  margin-top: 5px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.scan-success,
.scan-error {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 8px;
}

.scan-success {
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid color-mix(in srgb, var(--success) 28%, transparent);
}

.scan-success-icon {
  display: inline-flex;
  flex: 0 0 auto;
  margin-top: 1px;
}

.scan-success-icon .icon {
  width: 17px;
  height: 17px;
}

.scan-success strong {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
}

.scan-success p {
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted);
  word-break: break-all;
}

.scan-error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent);
  font-size: 10.5px;
  line-height: 1.55;
}

.scan-error .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.scan-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.scan-actions .btn {
  min-width: 150px;
}

.scan-actions .btn .icon {
  width: 14px;
  height: 14px;
}

.scan-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scan-steps li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  color: var(--muted);
}

.scan-steps li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  font-size: 8px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 50%;
}

@media (max-width: 640px) {
  .scan-proxy-grid {
    grid-template-columns: 1fr;
  }

  .scan-proxy-protocol {
    max-width: 140px;
  }

  .scan-stage {
    min-height: 224px;
    padding: 14px 12px;
  }

  .scan-qr-wrap {
    width: 180px;
    height: 180px;
  }

  .scan-placeholder {
    width: 118px;
    height: 118px;
  }

  .scan-steps {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-left: 8px;
  }

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

  .scan-actions .btn {
    width: 100%;
  }
}

/* =========================================================
   卡密
   ========================================================= */
.card-generator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
  align-items: start;
}

.card-generator-form,
.card-generator-result {
  padding: 0 0 18px;
}

.card-generator-form .card-head,
.card-generator-result .card-head {
  padding: 16px 20px 0;
}

.card-generator-form form {
  padding: 16px 20px 0;
}

.card-generate-actions {
  margin-top: 18px;
}

.duration-input {
  display: flex;
  align-items: stretch;
}

.duration-input .input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.duration-unit {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.card-code-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 430px;
  padding: 12px 20px 0;
  overflow: auto;
}

.card-code-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto 26px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.card-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 1.2px;
  color: var(--text);
}

.card-code-index {
  font-size: 10px;
  color: var(--muted);
  text-align: right;
}

.card-code-meta {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}

.card-generated-empty {
  padding: 48px 20px;
}

#card-generated-empty[hidden],
#cards-empty[hidden] {
  display: none;
}

.card-code-cell {
  display: flex;
  gap: 8px;
  align-items: center;
}

.card-type-tag {
  display: inline-flex;
  padding: 2px 8px;
  font-size: 10.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.card-edit-identity {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.card-edit-identity .card-code {
  flex: 1;
}

.cards-table {
  min-width: 860px;
}

.cards-card .row-actions {
  justify-content: flex-end;
}

.row-action-btn.danger {
  color: var(--danger);
}

.row-action-btn.danger:hover {
  background: var(--danger-soft);
}

@media (max-width: 960px) {
  .card-generator-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .card-code-item {
    grid-template-columns: 20px minmax(0, 1fr) 26px;
  }

  .card-code-meta {
    display: none;
  }
}
