/* ==========================================================================
   个人工作台 · 设计系统
   风格参考 Filament v3（primary = amber，gray = zinc，Inter 字体，12px 圆角）
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  color-scheme: light;          /* 让原生控件（日期选择器、滚动条）跟随浅色 */
  --primary-50:  #fffbeb;
  --primary-100: #fef3c7;
  --primary-200: #fde68a;
  --primary-300: #fcd34d;
  --primary-400: #fbbf24;
  --primary-500: #f59e0b;
  --primary-600: #d97706;
  --primary-700: #b45309;
  --primary-800: #92400e;
  --primary-900: #78350f;
  --primary-950: #451a03;

  --gray-50:  #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-300: #d4d4d8;
  --gray-400: #a1a1aa;
  --gray-500: #71717a;
  --gray-600: #52525b;
  --gray-700: #3f3f46;
  --gray-800: #27272a;
  --gray-900: #18181b;
  --gray-950: #09090b;

  --success-50:  #ecfdf5; --success-100: #d1fae5; --success-300: #6ee7b7;
  --success-500: #10b981; --success-600: #059669; --success-700: #047857;
  --success-800: #065f46;

  --warning-50:  #fffbeb; --warning-100: #fef3c7; --warning-300: #fcd34d;
  --warning-500: #f59e0b; --warning-600: #d97706; --warning-700: #b45309;
  --warning-800: #92400e;

  --danger-50:  #fff1f2; --danger-100: #ffe4e6; --danger-300: #fda4af;
  --danger-500: #f43f5e; --danger-600: #e11d48; --danger-700: #be123c;
  --danger-800: #9f1239;

  --info-50:  #eff6ff; --info-100: #dbeafe; --info-300: #93c5fd;
  --info-500: #3b82f6; --info-600: #2563eb; --info-700: #1d4ed8;
  --info-800: #1e40af;

  --bg:          #fafafa;
  --surface:     #ffffff;
  --surface-2:   #fafafa;
  --surface-3:   #f4f4f5;
  --border:      rgba(9, 9, 11, 0.08);
  --border-soft: rgba(9, 9, 11, 0.06);
  --border-strong: rgba(9, 9, 11, 0.14);
  --text:        #09090b;
  --text-soft:   #3f3f46;
  --text-muted:  #71717a;
  --text-faint:  #a1a1aa;
  --hover:       rgba(9, 9, 11, 0.04);
  --row-hover:   rgba(9, 9, 11, 0.02);
  --focus-ring:  rgba(245, 158, 11, 0.35);

  --shadow-xs: 0 1px 2px 0 rgba(9, 9, 11, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(9, 9, 11, 0.06), 0 1px 2px -1px rgba(9, 9, 11, 0.06);
  --shadow-md: 0 4px 12px -2px rgba(9, 9, 11, 0.10), 0 2px 6px -2px rgba(9, 9, 11, 0.06);
  --shadow-lg: 0 20px 40px -12px rgba(9, 9, 11, 0.25), 0 8px 16px -8px rgba(9, 9, 11, 0.12);

  --sidebar-w: 288px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 64px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
          'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme='dark'] {
  color-scheme: dark;           /* 让原生控件（日期选择器、滚动条）跟随深色 */
  --bg:          #09090b;
  --surface:     #131316;
  --surface-2:   #18181b;
  --surface-3:   #27272a;
  --border:      rgba(255, 255, 255, 0.10);
  --border-soft: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text:        #fafafa;
  --text-soft:   #d4d4d8;
  --text-muted:  #a1a1aa;
  --text-faint:  #71717a;
  --hover:       rgba(255, 255, 255, 0.06);
  --row-hover:   rgba(255, 255, 255, 0.03);
  --focus-ring:  rgba(245, 158, 11, 0.30);
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.75);
}

/* ---------- 2. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* 关键：作者样式会覆盖浏览器对 [hidden] 的默认 display:none，
   所以必须显式声明一次，否则弹窗/确认框会在打开页面时就显示出来。 */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .22s var(--ease), color .22s var(--ease);
}

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
svg { width: 100%; height: 100%; display: block; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; border: 3px solid var(--bg); }
[data-theme='dark'] ::-webkit-scrollbar-thumb { background: var(--gray-700); border-color: var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ---------- 3. 布局骨架 ---------- */
.app-shell { display: flex; min-height: 100vh; }

.main-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-w);
  transition: margin-left .25s var(--ease);
}

body.sidebar-collapsed .main-col { margin-left: var(--sidebar-w-collapsed); }

/* ---------- 4. 侧边栏 ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: width .25s var(--ease), transform .25s var(--ease);
}

/* 收起态：宽度过渡动画 */
.brand-text, .nav-label, .nav-group-label {
  transition: opacity .18s var(--ease), width .25s var(--ease);
}

body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }

.sidebar-header {
  height: var(--topbar-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-soft);
  overflow: hidden;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 10px -2px rgba(217, 119, 6, .5);
}
.brand-mark svg { width: 20px; height: 20px; }

.brand-text { display: flex; flex-direction: column; min-width: 0; white-space: nowrap; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; color: var(--text-faint); letter-spacing: .04em; text-transform: uppercase; }

.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 12px 24px;
}

.nav-group { margin-top: 20px; }
.nav-group:first-child { margin-top: 0; }

.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 12px 8px;
  white-space: nowrap;
}

.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .16s var(--ease), color .16s var(--ease);
}
.nav-item:hover { background: var(--hover); color: var(--text); }

.nav-icon { flex: 0 0 auto; width: 20px; height: 20px; color: var(--text-muted); transition: color .16s var(--ease); }
.nav-item:hover .nav-icon { color: var(--text-soft); }

.nav-item.is-active {
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: 600;
}
.nav-item.is-active .nav-icon { color: var(--primary-600); }
.nav-item.is-active::before {
  content: '';
  position: absolute;
  left: -12px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--primary-600);
}
[data-theme='dark'] .nav-item.is-active { background: rgba(245, 158, 11, .13); color: var(--primary-300); }
[data-theme='dark'] .nav-item.is-active .nav-icon { color: var(--primary-400); }
[data-theme='dark'] .nav-item.is-active::before { background: var(--primary-400); }

.sidebar-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border-soft); }

/* ---------- 收起态 ----------
   关键：文字必须用 width:0 + overflow:hidden 真正「移出布局」，
   只用 opacity:0 的话文字仍占宽度，会把图标挤出容器边缘。 */
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}
body.sidebar-collapsed .nav-group-label {
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  height: 14px;
  padding-bottom: 0;
}
body.sidebar-collapsed .brand { gap: 0; justify-content: center; }
body.sidebar-collapsed .sidebar-header { padding: 0 8px; justify-content: center; }
body.sidebar-collapsed .sidebar-nav { padding: 16px 8px 24px; }
body.sidebar-collapsed .nav-group { margin-top: 10px; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 0; gap: 0; }
body.sidebar-collapsed .nav-icon { width: 22px; height: 22px; }
body.sidebar-collapsed .nav-item.is-active::before { left: -8px; }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(9, 9, 11, .5);
  backdrop-filter: blur(2px);
  z-index: 45;
}

/* ---------- 5. 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 0 16px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.icon-btn {
  position: relative;
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color .16s var(--ease), color .16s var(--ease);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--hover); color: var(--text); }

.notif-dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger-500);
  box-shadow: 0 0 0 2px var(--surface);
}

/* 全局搜索 */
.global-search {
  position: relative;
  flex: 1 1 auto;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.global-search:focus-within { border-color: var(--primary-400); box-shadow: 0 0 0 3px var(--focus-ring); background: var(--surface); }
.gs-icon { flex: 0 0 auto; width: 18px; height: 18px; color: var(--text-faint); }
.global-search input {
  flex: 1 1 auto;
  border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 14px; color: var(--text);
}
.global-search input::placeholder { color: var(--text-faint); }
.gs-kbd {
  flex: 0 0 auto;
  font-family: inherit; font-size: 11px; font-weight: 600;
  color: var(--text-faint);
  padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
}

.gs-results {
  position: absolute;
  top: calc(100% + 8px); left: 0; right: 0;
  max-height: 400px; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 60;
}
.gs-results.is-open { display: block; }
.gs-group { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); padding: 8px 10px 4px; }
.gs-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  cursor: pointer;
}
.gs-item:hover { background: var(--hover); }
.gs-item-title { font-size: 13.5px; font-weight: 500; }
.gs-item-sub { font-size: 12px; color: var(--text-muted); }
.gs-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

.topbar-right { display: flex; align-items: center; gap: 4px; margin-left: auto; }

.theme-icon-moon { display: none; }
[data-theme='dark'] .theme-icon-sun { display: none; }
[data-theme='dark'] .theme-icon-moon { display: block; }
.theme-icon-sun, .theme-icon-moon { width: 20px; height: 20px; }

/* 用户菜单 */
.user-menu { position: relative; margin-left: 4px; }
.user-btn {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 8px 0 6px;
  border: none; border-radius: 10px;
  background: transparent; cursor: pointer;
  color: var(--text-soft);
  transition: background-color .16s var(--ease);
}
.user-btn:hover { background: var(--hover); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
  color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}
.user-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.chev { width: 16px; height: 16px; color: var(--text-faint); }

.dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 232px; padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all .16s var(--ease);
  z-index: 60;
}
.dropdown.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.dropdown-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
  color: #fff; font-size: 13px; font-weight: 700;
  display: grid; place-items: center;
}
.dropdown-name { font-size: 13.5px; font-weight: 600; }
.dropdown-mail { font-size: 12px; color: var(--text-muted); }
.dropdown-sep { height: 1px; background: var(--border-soft); margin: 6px 0; }
.dropdown-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); padding: 6px 10px 4px; }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px;
  border: none; border-radius: var(--radius);
  background: transparent; cursor: pointer;
  font-size: 13.5px; color: var(--text-soft); text-align: left;
}
.dropdown-item:hover { background: var(--hover); color: var(--text); }

/* ---------- 6. 内容区 ---------- */
.content {
  flex: 1 1 auto;
  padding: 28px 32px 56px;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
}

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head-left { display: flex; align-items: center; gap: 14px; }
.page-icon {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--primary-50);
  color: var(--primary-600);
  border: 1px solid rgba(217, 119, 6, .18);
}
.page-icon svg { width: 24px; height: 24px; }
[data-theme='dark'] .page-icon { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .22); color: var(--primary-400); }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.page-subtitle { font-size: 13.5px; color: var(--text-muted); margin-top: 2px; }
.page-head-right { display: flex; align-items: center; gap: 10px; }

/* ---------- 7. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; letter-spacing: -.005em;
  cursor: pointer; white-space: nowrap;
  transition: background-color .16s var(--ease), box-shadow .16s var(--ease), transform .1s var(--ease), color .16s var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary-600);
  color: #fff;
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover { background: var(--primary-500); }
.btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }

.btn-ghost {
  background: var(--surface);
  color: var(--text-soft);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-danger { background: var(--danger-600); color: #fff; box-shadow: var(--shadow-xs); }
.btn-danger:hover { background: var(--danger-500); }

.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-sm svg { width: 16px; height: 16px; }

/* ---------- 8. 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card + .card, .grid-2 + .card, .stats-grid + .grid-2, .grid-2 + .grid-2 { margin-top: 20px; }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.card-title { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.card-link { font-size: 13px; font-weight: 500; color: var(--primary-600); }
.card-link:hover { color: var(--primary-500); }
[data-theme='dark'] .card-link { color: var(--primary-400); }
.card-body { padding: 16px 20px; }

.card-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.toolbar-search {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  flex: 0 1 300px;
  height: 38px; padding: 0 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.toolbar-search:focus-within { border-color: var(--primary-400); box-shadow: 0 0 0 3px var(--focus-ring); background: var(--surface); }
.toolbar-search svg { flex: 0 0 auto; width: 17px; height: 17px; color: var(--text-faint); }
.toolbar-search input {
  flex: 1 1 auto; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 13.5px; color: var(--text);
}
.toolbar-search input::placeholder { color: var(--text-faint); }
.toolbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.toolbar-count { font-size: 13px; color: var(--text-muted); }

/* ---------- 9. 表格 ---------- */
.crud-root { position: relative; }
.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }

.table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2);
  text-align: left;
  font-size: 11px; font-weight: 650;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted);
  padding: 11px 20px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table thead th.is-sortable { cursor: pointer; user-select: none; }
.table thead th.is-sortable:hover { color: var(--text); }
.th-inner { display: inline-flex; align-items: center; gap: 6px; }
.sort-ico { width: 13px; height: 13px; opacity: .35; }
.table thead th.sorted .sort-ico { opacity: 1; color: var(--primary-600); }
[data-theme='dark'] .table thead th.sorted .sort-ico { color: var(--primary-400); }

.table tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background-color .14s var(--ease); }
.table tbody tr:hover { background: var(--row-hover); }

.cell-strong { font-weight: 600; letter-spacing: -.005em; }
.cell-sub { font-size: 12.5px; color: var(--text-muted); }
.cell-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.cell-num { font-variant-numeric: tabular-nums; font-weight: 600; }

.cell-stack { display: flex; flex-direction: column; gap: 3px; }
/* 备注列：表格里最多两行，超出省略号，鼠标悬停看全文（title） */
.cell-remark {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 320px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.row-actions { display: inline-flex; gap: 4px; opacity: .55; transition: opacity .16s var(--ease); }
.table tbody tr:hover .row-actions { opacity: 1; }

.icon-action {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: none; border-radius: var(--radius);
  background: transparent; color: var(--text-muted);
  cursor: pointer;
  transition: background-color .14s var(--ease), color .14s var(--ease);
}
.icon-action svg { width: 17px; height: 17px; }
.icon-action:hover { background: var(--hover); color: var(--text); }
.icon-action.danger:hover { background: var(--danger-50); color: var(--danger-600); }
[data-theme='dark'] .icon-action.danger:hover { background: rgba(244, 63, 94, .15); color: var(--danger-300); }

.table-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 12px 20px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px; color: var(--text-muted);
}
.pager { display: flex; align-items: center; gap: 6px; }
.pager-btn {
  min-width: 32px; height: 32px; padding: 0 9px;
  display: grid; place-items: center;
  border: none; border-radius: var(--radius);
  background: transparent; color: var(--text-soft);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background-color .14s var(--ease);
}
.pager-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.pager-btn.is-active { background: var(--primary-600); color: #fff; }
.pager-btn:disabled { opacity: .4; cursor: not-allowed; }
.pager-perpage {
  height: 32px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-soft); font-size: 13px; padding: 0 6px; cursor: pointer;
  font-family: inherit;
}

/* ---------- 10. 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; line-height: 1.4;
  white-space: nowrap;
  background: var(--gray-100);
  color: var(--gray-700);
  box-shadow: inset 0 0 0 1px var(--border);
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }

.badge-primary { background: var(--primary-50); color: var(--primary-700); box-shadow: inset 0 0 0 1px rgba(217,119,6,.2); }
.badge-success { background: var(--success-50); color: var(--success-700); box-shadow: inset 0 0 0 1px rgba(5,150,105,.2); }
.badge-warning { background: var(--warning-50); color: var(--warning-700); box-shadow: inset 0 0 0 1px rgba(217,119,6,.22); }
.badge-danger  { background: var(--danger-50);  color: var(--danger-700);  box-shadow: inset 0 0 0 1px rgba(225,29,72,.2); }
.badge-info    { background: var(--info-50);    color: var(--info-700);    box-shadow: inset 0 0 0 1px rgba(37,99,235,.2); }
.badge-gray    { background: var(--gray-100);   color: var(--gray-600);   box-shadow: inset 0 0 0 1px var(--border); }

[data-theme='dark'] .badge-primary { background: rgba(245,158,11,.14); color: #fcd34d; box-shadow: inset 0 0 0 1px rgba(245,158,11,.25); }
[data-theme='dark'] .badge-success { background: rgba(16,185,129,.14); color: #6ee7b7; box-shadow: inset 0 0 0 1px rgba(16,185,129,.25); }
[data-theme='dark'] .badge-warning { background: rgba(245,158,11,.14); color: #fcd34d; box-shadow: inset 0 0 0 1px rgba(245,158,11,.25); }
[data-theme='dark'] .badge-danger  { background: rgba(244,63,94,.15);  color: #fda4af; box-shadow: inset 0 0 0 1px rgba(244,63,94,.28); }
[data-theme='dark'] .badge-info    { background: rgba(59,130,246,.15); color: #93c5fd; box-shadow: inset 0 0 0 1px rgba(59,130,246,.28); }
[data-theme='dark'] .badge-gray    { background: rgba(255,255,255,.06); color: var(--gray-300); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }

/* 到期提醒文字 */
.expire-note { font-size: 12px; font-weight: 600; }
.expire-ok       { color: var(--text-muted); }
.expire-warning  { color: var(--warning-600); }
.expire-danger   { color: var(--danger-600); }
.expire-expired  { color: var(--danger-600); }
[data-theme='dark'] .expire-warning { color: var(--warning-300); }
[data-theme='dark'] .expire-danger,
[data-theme='dark'] .expire-expired { color: #fda4af; }

/* ---------- 11. 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; padding: 20px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field.span-2 { grid-column: 1 / -1; }

.field-label { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.field-label .req { color: var(--danger-500); margin-left: 2px; }
.field-hint { font-size: 12px; color: var(--text-faint); }
.field-error { font-size: 12px; color: var(--danger-600); font-weight: 500; }

.input, .select, .textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background-color .16s var(--ease);
}
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.select { appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px;
}
.input-affix { position: relative; display: flex; align-items: center; }
.input-affix .affix {
  position: absolute; left: 12px;
  font-size: 14px; font-weight: 600; color: var(--text-muted);
  pointer-events: none;
}
.input-affix .input { padding-left: 28px; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  position: relative;
  width: 40px; height: 23px; flex: 0 0 auto;
  border-radius: 99px;
  background: var(--gray-300);
  transition: background-color .2s var(--ease);
}
[data-theme='dark'] .switch-track { background: var(--gray-700); }
.switch-track::after {
  content: '';
  position: absolute; top: 2.5px; left: 2.5px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .2s var(--ease);
}
.switch input:checked + .switch-track { background: var(--primary-600); }
.switch input:checked + .switch-track::after { transform: translateX(17px); }
.switch-label { font-size: 13.5px; color: var(--text-soft); }

/* ---------- 12. 模态框 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 20px 40px;
  background: rgba(9, 9, 11, .45);
  backdrop-filter: blur(3px);
  overflow-y: auto;
  animation: fadeIn .16s var(--ease);
}
[data-theme='dark'] .modal-backdrop { background: rgba(0, 0, 0, .62); }

.modal {
  width: 100%; max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn .2s var(--ease);
}
.modal-sm { max-width: 430px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(-10px) scale(.985); } to { opacity: 1; transform: none; } }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.modal-title { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.modal-body { max-height: calc(100vh - 260px); overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
}

.confirm-body { padding: 28px 24px 8px; text-align: center; }
.confirm-icon {
  width: 52px; height: 52px; margin: 0 auto 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--danger-50); color: var(--danger-600);
}
.confirm-icon svg { width: 26px; height: 26px; }
[data-theme='dark'] .confirm-icon { background: rgba(244,63,94,.15); color: var(--danger-300); }
.confirm-title { font-size: 17px; font-weight: 650; margin-bottom: 6px; }
.confirm-text { font-size: 13.5px; color: var(--text-muted); }

/* ---------- 13. 提示条 ---------- */
.toast-stack {
  position: fixed; top: 20px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 380px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  font-size: 13.5px; font-weight: 500;
  animation: toastIn .22s var(--ease);
  pointer-events: auto;
}
.toast.is-out { animation: toastOut .18s var(--ease) forwards; }
.toast-ico { width: 18px; height: 18px; flex: 0 0 auto; }
.toast-success .toast-ico { color: var(--success-600); }
.toast-error .toast-ico { color: var(--danger-600); }
.toast-info .toast-ico { color: var(--info-600); }

@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }

/* ---------- 14. 仪表盘 ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.stat-card {
  position: relative;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stat-label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.stat-ico {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--primary-50); color: var(--primary-600);
}
.stat-ico svg { width: 20px; height: 20px; }
.stat-card.c-success .stat-ico { background: var(--success-50); color: var(--success-600); }
.stat-card.c-danger  .stat-ico { background: var(--danger-50);  color: var(--danger-600); }
.stat-card.c-info    .stat-ico { background: var(--info-50);    color: var(--info-600); }
.stat-card.c-purple  .stat-ico { background: #f5f3ff;          color: #7c3aed; }
[data-theme='dark'] .stat-ico { background: rgba(245,158,11,.13); color: var(--primary-400); }
[data-theme='dark'] .stat-card.c-success .stat-ico { background: rgba(16,185,129,.14); color: #6ee7b7; }
[data-theme='dark'] .stat-card.c-danger  .stat-ico { background: rgba(244,63,94,.15);  color: #fda4af; }
[data-theme='dark'] .stat-card.c-info    .stat-ico { background: rgba(59,130,246,.15); color: #93c5fd; }
[data-theme='dark'] .stat-card.c-purple  .stat-ico { background: rgba(124,58,237,.16); color: #c4b5fd; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-foot { margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2 > .card { margin-top: 0; }

.mini-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
}
.mini-row:last-child { border-bottom: none; }
.mini-main { flex: 1 1 auto; min-width: 0; }
.mini-title { font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.mini-ico {
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 9px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-muted);
}
.mini-ico svg { width: 17px; height: 17px; }

/* ---------- 15. 待办 ---------- */
.todo-list { display: flex; flex-direction: column; }
.todo-item {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-soft);
  transition: background-color .14s var(--ease);
}
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { background: var(--row-hover); }
.todo-check {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .16s var(--ease);
}
.todo-check svg { width: 13px; height: 13px; color: #fff; opacity: 0; transition: opacity .12s var(--ease); }
.todo-check:hover { border-color: var(--primary-500); }
.todo-check.is-done { background: var(--primary-600); border-color: var(--primary-600); }
.todo-check.is-done svg { opacity: 1; }
.todo-main { flex: 1 1 auto; min-width: 0; }
.todo-title { font-size: 14px; font-weight: 550; }
.todo-item.is-done .todo-title { text-decoration: line-through; color: var(--text-faint); }
.todo-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.todo-right { display: flex; align-items: center; gap: 6px; }
.todo-time { font-size: 12px; color: var(--text-faint); }
.todo-remark { margin-top: 4px; font-size: 12.5px; color: var(--text-muted); overflow-wrap: anywhere; }
.todo-item.is-done .todo-remark { color: var(--text-faint); }
.todo-edit { height: 34px; font-size: 14px; font-weight: 550; padding: 0 10px; }

/* 今日日期小标签 */
.today-chip {
  display: inline-flex; align-items: center;
  height: 34px; padding: 0 14px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 13px; font-weight: 500;
}

/* 快速添加区 */
.todo-composer {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px 14px;
  flex-wrap: wrap;
}
.composer-input { flex: 1 1 260px; min-width: 180px; }
.composer-input .input { height: 42px; font-size: 14.5px; }
.todo-composer .btn { height: 42px; flex: 0 0 auto; }

/* 分段控件（每日 / 临时） */
.segmented {
  display: inline-flex; gap: 3px; flex: 0 0 auto;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-3);
}
.seg-btn {
  border: none; background: transparent;
  height: 36px; padding: 0 14px;
  border-radius: 8px;
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer; white-space: nowrap;
  transition: background-color .16s var(--ease), color .16s var(--ease);
}
.seg-btn:hover { color: var(--text); }
.seg-btn[data-type='1'].is-active { background: var(--primary-600); color: #fff; }
.seg-btn[data-type='2'].is-active { background: var(--info-600); color: #fff; }

/* 完成进度条 */
.todo-progress { padding: 0 20px 16px; }
.tp-head {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 12.5px; color: var(--text-muted);
  margin-bottom: 7px;
}
.tp-head b { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.tp-track { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.tp-fill {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
  transition: width .45s var(--ease);
}

/* 筛选标签页 */
.tabs {
  display: inline-flex; gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-3);
}
.tab {
  border: none; background: transparent;
  height: 32px; padding: 0 15px;
  border-radius: 8px;
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer; white-space: nowrap;
  transition: background-color .16s var(--ease), color .16s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.is-active {
  background: var(--surface); color: var(--text); font-weight: 600;
  box-shadow: var(--shadow-xs);
}
[data-theme='dark'] .tabs, [data-theme='dark'] .segmented { background: rgba(255, 255, 255, .05); }
[data-theme='dark'] .tab.is-active { background: rgba(255, 255, 255, .13); box-shadow: none; }

/* 紧凑下拉框 */
.field-compact {
  height: 34px; padding: 0 28px 0 11px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text-soft);
  font-family: inherit; font-size: 13px; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 13px;
}
.field-compact:focus { outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 3px var(--focus-ring); }

.page-tip { margin-top: 14px; font-size: 12.5px; color: var(--text-faint); text-align: center; }

/* ---------- 16. 常用链接卡片 ---------- */.link-group-label {
  font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 4px 12px;
}
.link-group + .link-group { margin-top: 26px; }
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.link-card {
  position: relative;
  display: flex; align-items: center; gap: 13px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.link-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.link-card[data-url] { cursor: pointer; }
.link-actions { z-index: 1; }
.link-ico {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 20px;
  background: var(--surface-3);
}
.link-main { flex: 1 1 auto; min-width: 0; }
.link-name { font-size: 14px; font-weight: 600; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-url { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.link-remark { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.link-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .16s var(--ease); }
.link-card:hover .link-actions { opacity: 1; }
.link-card-stretch { position: absolute; inset: 0; border-radius: inherit; }

/* ---------- 17. 空状态 / 骨架 ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  padding: 64px 24px;
  text-align: center;
}
.empty-ico {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-faint);
  margin-bottom: 8px;
}
.empty-ico svg { width: 26px; height: 26px; }
.empty-title { font-size: 15px; font-weight: 600; }
.empty-desc { font-size: 13px; color: var(--text-muted); max-width: 340px; }
.empty .btn { margin-top: 12px; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--border-soft) 37%, var(--surface-3) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius);
}
.skeleton-row { height: 42px; margin-bottom: 10px; }
.skeleton-row:last-child { margin-bottom: 0; }
.skeleton.stat-card { height: 122px; border: none; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- 18. 状态页 ---------- */
.state-page {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; text-align: center; gap: 10px;
}
.state-code {
  font-size: 76px; font-weight: 800; letter-spacing: -.05em;
  background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.state-title { font-size: 22px; font-weight: 700; }
.state-desc { font-size: 14px; color: var(--text-muted); max-width: 460px; }
.state-pre {
  margin-top: 8px; padding: 14px 18px; max-width: 620px; width: 100%;
  background: var(--surface-3); border-radius: var(--radius);
  font-size: 12.5px; color: var(--text-soft); text-align: left;
  overflow-x: auto; white-space: pre-wrap;
}
.state-page .btn { margin-top: 12px; }

/* ---------- 19. 菜单管理 ---------- */
.notice {
  display: flex; gap: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  background: var(--info-50);
  border: 1px solid rgba(37, 99, 235, .18);
  color: var(--info-800);
  font-size: 13px; line-height: 1.7;
}
[data-theme='dark'] .notice {
  background: rgba(59, 130, 246, .1);
  border-color: rgba(59, 130, 246, .22);
  color: #bfdbfe;
}
.notice-ico { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 3px; }
.notice-text code {
  background: rgba(9, 9, 11, .07);
  padding: 1px 5px; border-radius: 4px;
  font-size: 12px;
}
[data-theme='dark'] .notice-text code { background: rgba(255, 255, 255, .12); }

.menu-group-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 13px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
}
.mg-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mg-grip { flex: 0 0 auto; width: 16px; height: 16px; color: var(--text-faint); }
.mg-label { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.mg-count { font-size: 12px; color: var(--text-muted); }
.mg-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.menu-items { padding: 6px 0; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  transition: background-color .14s var(--ease);
}
.menu-item:hover { background: var(--row-hover); }
.mi-icon {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-muted);
}
.mi-icon svg { width: 16px; height: 16px; }
.mi-title { font-size: 13.5px; font-weight: 550; min-width: 88px; }
.mi-url {
  flex: 1 1 auto; min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; color: var(--text-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mi-actions { display: flex; gap: 2px; opacity: .5; transition: opacity .16s var(--ease); }
.menu-item:hover .mi-actions { opacity: 1; }
.menu-empty { padding: 18px; text-align: center; font-size: 13px; color: var(--text-faint); }

.icon-action:disabled { opacity: .28; cursor: not-allowed; }
.icon-action:disabled:hover { background: transparent; color: var(--text-muted); }
.icon-action.danger:disabled:hover { background: transparent; color: var(--text-muted); }

.icon-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 8px;
  max-height: 216px; overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.icon-pick {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 4px;
  border: 1px solid transparent; border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .14s var(--ease), background-color .14s var(--ease), color .14s var(--ease);
}
.icon-pick svg { width: 20px; height: 20px; }
.icon-pick-name { font-size: 10.5px; color: var(--text-faint); }
.icon-pick:hover { border-color: var(--border-strong); color: var(--text); }
.icon-pick.is-active {
  border-color: var(--primary-500);
  background: var(--primary-50);
  color: var(--primary-700);
}
.icon-pick.is-active .icon-pick-name { color: var(--primary-600); }
[data-theme='dark'] .icon-pick.is-active { background: rgba(245, 158, 11, .14); color: var(--primary-300); }
[data-theme='dark'] .icon-pick.is-active .icon-pick-name { color: var(--primary-400); }

/* 侧边栏里的外链小箭头 */
.nav-ext { margin-left: auto; font-size: 11px; color: var(--text-faint); }
body.sidebar-collapsed .nav-ext { display: none; }

/* ---------- 20. 登录页 ---------- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(1100px 520px at 50% -12%, rgba(245, 158, 11, .13), transparent 62%),
    radial-gradient(760px 420px at 88% 108%, rgba(59, 130, 246, .09), transparent 60%),
    var(--bg);
}

.login-theme-btn {
  position: fixed; top: 18px; right: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.login-theme-btn:hover { background: var(--surface-3); }

.login-wrap {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.login-card {
  width: 100%;
  padding: 34px 32px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.login-head { text-align: center; margin-bottom: 22px; }

.login-mark {
  width: 54px; height: 54px;
  margin: 0 auto 14px;
  border-radius: 15px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
  color: #fff;
  box-shadow: 0 10px 22px -8px rgba(217, 119, 6, .7);
}
.login-mark svg { width: 27px; height: 27px; }

.login-title { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.login-sub { font-size: 12.5px; color: var(--text-faint); margin-top: 3px; letter-spacing: .05em; text-transform: uppercase; }

.login-alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  font-size: 13px; line-height: 1.6;
}
.login-alert svg { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 2px; }
.login-alert b { font-weight: 650; }
.login-alert-danger {
  background: var(--danger-50);
  color: var(--danger-700);
  border: 1px solid rgba(225, 29, 72, .18);
}
[data-theme='dark'] .login-alert-danger {
  background: rgba(244, 63, 94, .12);
  color: #fda4af;
  border-color: rgba(244, 63, 94, .25);
}

.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-submit { height: 44px; width: 100%; font-size: 15px; letter-spacing: .25em; margin-top: 4px; }
.login-submit:disabled { opacity: .5; cursor: not-allowed; }

.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 42px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: none; border-radius: 7px;
  background: transparent; color: var(--text-faint);
  cursor: pointer;
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.pw-toggle svg { width: 17px; height: 17px; }
.pw-toggle:hover { color: var(--text); background: var(--hover); }

.login-hint {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
}

.login-copy { font-size: 12px; color: var(--text-faint); text-align: center; }

.dropdown-item-danger { color: var(--danger-600); }
.dropdown-item-danger:hover { background: var(--danger-50); color: var(--danger-700); }
[data-theme='dark'] .dropdown-item-danger { color: #fda4af; }
[data-theme='dark'] .dropdown-item-danger:hover { background: rgba(244, 63, 94, .14); color: #fda4af; }

/* ---------- 21. 响应式 ---------- */
@media (max-width: 1180px) {
  .content { padding: 24px 20px 48px; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w);
    box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; }
  body.sidebar-collapsed .sidebar { width: var(--sidebar-w); }
  body.sidebar-collapsed .sidebar-header { padding: 0 16px; justify-content: flex-start; }
  body.sidebar-collapsed .sidebar-nav { padding: 16px 12px 24px; }
  body.sidebar-collapsed .brand { gap: 12px; justify-content: flex-start; }
  body.sidebar-collapsed .brand-text,
  body.sidebar-collapsed .nav-label {
    opacity: 1; width: auto; overflow: visible; pointer-events: auto;
  }
  body.sidebar-collapsed .nav-group-label { opacity: 1; height: auto; padding-bottom: 8px; }
  body.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 0 12px; gap: 12px; }
  .main-col, body.sidebar-collapsed .main-col { margin-left: 0; }
  .user-name { display: none; }
  .global-search { max-width: none; }
  .gs-kbd { display: none; }
}

@media (max-width: 680px) {
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head-right .btn { width: 100%; }
  .form-grid { grid-template-columns: 1fr; padding: 16px; }
  .table thead th, .table tbody td { padding-left: 14px; padding-right: 14px; }
  .content { padding: 18px 14px 40px; }
  .modal-backdrop { padding: 20px 12px; }
  .toast-stack { left: 12px; right: 12px; top: 12px; }
  .toast { min-width: 0; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
