:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fafafb;
  --surface-3: #f1f2f5;
  --text: #1f2329;
  --text-2: #4b5563;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --primary: #5741a4;
  --primary-hover: #48358c;
  --primary-weak: #eeeafc;
  --primary-border: #d7cef5;
  --success: #15803d;
  --success-weak: #e8f5ee;
  --warning: #b45309;
  --warning-weak: #fdf3e3;
  --danger: #b91c1c;
  --danger-weak: #fdecec;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.12);
  --radius: 8px;
  --radius-sm: 6px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sidebar-width: 246px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

/* 通用控件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-weight: 500;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn:active {
  transform: translateY(1px);
}

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

.btn.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

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

.btn.danger:hover {
  background: var(--danger-weak);
  border-color: var(--danger);
  color: var(--danger);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
}

.btn.icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  min-height: 32px;
}

.btn.small {
  min-height: 28px;
  padding: 0 9px;
  font-size: 13px;
}

.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.input, .select, .textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}

.textarea {
  min-height: 84px;
  resize: vertical;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(87, 65, 164, 0.14);
}

.field {
  display: grid;
  gap: 6px;
}

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

.field .hint {
  color: var(--muted);
  font-size: 12px;
}

/* 页面骨架 */
.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transition: transform 240ms var(--ease);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.brand-name {
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand-name small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-group {
  margin-bottom: 18px;
}

.nav-label {
  padding: 0 10px 6px;
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  margin-bottom: 2px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  text-align: left;
  font-weight: 500;
  transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease);
}

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

.nav-item.active {
  background: var(--primary-weak);
  border-color: var(--primary-border);
  color: var(--primary);
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.sidebar-user {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-weak);
  color: var(--primary);
  display: inline-grid;
  place-items: center;
  font-weight: 650;
  overflow: hidden;
  flex: 0 0 auto;
}

.avatar.small {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

.avatar.large {
  width: 52px;
  height: 52px;
  font-size: 18px;
}

.sidebar-user-info {
  min-width: 0;
  flex: 1;
}

.sidebar-user-info strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.sidebar-user-info span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.topbar {
  height: 58px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 12px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
}

.breadcrumb strong {
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.mobile-menu-btn {
  display: none;
}

.content {
  padding: 22px 24px 40px;
  max-width: 1440px;
  margin: 0 auto;
}

/* 进入动画 */
.view {
  animation: view-in 260ms var(--ease) both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.stagger > * {
  animation: card-in 300ms var(--ease) both;
}

.stagger > *:nth-child(1) { animation-delay: 20ms; }
.stagger > *:nth-child(2) { animation-delay: 55ms; }
.stagger > *:nth-child(3) { animation-delay: 90ms; }
.stagger > *:nth-child(4) { animation-delay: 125ms; }
.stagger > *:nth-child(5) { animation-delay: 160ms; }
.stagger > *:nth-child(6) { animation-delay: 195ms; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(6px) scale(0.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-head h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.015em;
}

.page-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* 指标卡 */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.metric .label {
  color: var(--muted);
  font-size: 12px;
}

.metric .value {
  margin-top: 4px;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.metric .sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

/* 卡片和面板 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card + .card {
  margin-top: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.card-head h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.card-head .desc {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.card-body {
  padding: 16px;
}

.card-body.flush {
  padding: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar .spacer {
  flex: 1;
}

.search {
  position: relative;
  min-width: 220px;
}

.search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.search .input {
  padding-left: 32px;
}

/* 表格 */
.table-wrap {
  overflow-x: auto;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.checkbox-cell {
  width: 40px;
  text-align: center;
}

.checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

th {
  color: var(--muted);
  font-weight: 550;
  font-size: 12px;
  background: var(--surface-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr {
  transition: background 140ms var(--ease);
}

tbody tr:hover {
  background: var(--surface-2);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.cell-main {
  font-weight: 550;
  color: var(--text);
}

.cell-sub {
  color: var(--muted);
  font-size: 12px;
}

.text-clip {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multiline {
  white-space: pre-wrap;
  max-width: 460px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
  white-space: nowrap;
}

/* 徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

.badge.neutral { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.badge.primary { background: var(--primary-weak); color: var(--primary); border-color: var(--primary-border); }
.badge.success { background: var(--success-weak); color: var(--success); border-color: #bfe3cb; }
.badge.warning { background: var(--warning-weak); color: var(--warning); border-color: #f3d5a6; }
.badge.danger { background: var(--danger-weak); color: var(--danger); border-color: #f3c3c3; }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
}

/* 差异 */
.diff-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.diff-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.diff-row {
  animation: diff-highlight 420ms var(--ease) both;
}

@keyframes diff-highlight {
  0% { background: var(--primary-weak); opacity: 0.45; transform: translateY(3px); }
  100% { background: transparent; opacity: 1; transform: translateY(0); }
}

.diff-old {
  color: var(--danger);
  text-decoration: line-through;
  text-decoration-color: rgba(185, 28, 28, 0.45);
}

.diff-new {
  color: var(--success);
}

.change-tag {
  display: inline-block;
  min-width: 24px;
  text-align: center;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px;
  margin-right: 5px;
}

.empty {
  padding: 42px 18px;
  text-align: center;
  color: var(--muted);
}

.empty svg {
  width: 34px;
  height: 34px;
  color: var(--muted-2);
  margin-bottom: 8px;
}

.empty h3 {
  margin: 0 0 4px;
  color: var(--text-2);
  font-size: 15px;
}

.empty p {
  margin: 0 0 14px;
  font-size: 13px;
}

/* 项目网格和列表 */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.project-card:hover {
  border-color: var(--primary-border);
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.10);
  transform: translateY(-2px);
}

.project-card-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.project-card-info {
  min-width: 0;
}

.project-card-info h3 {
  margin: 0;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-info p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  min-height: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-meta {
  margin-top: 13px;
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

/* 弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
  animation: fade-in 180ms var(--ease) both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  animation: modal-in 220ms var(--ease) both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  margin: 0;
  font-size: 16px;
}

.modal-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-body {
  padding: 16px 18px;
  display: grid;
  gap: 14px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

/* 抽屉 */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
  z-index: 48;
  animation: fade-in 180ms var(--ease) both;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 94vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 49;
  display: flex;
  flex-direction: column;
  animation: drawer-in 260ms var(--ease) both;
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.drawer-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
  display: grid;
  gap: 14px;
  align-content: start;
}

.drawer-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Toast */
.toast-wrap {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(420px, calc(100vw - 24px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  animation: toast-in 300ms var(--ease) both;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast.leaving {
  animation: toast-out 220ms var(--ease) both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.97); }
}

/* 登录/初始化 */
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.auth-card {
  width: min(480px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 28px;
  animation: modal-in 280ms var(--ease) both;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.auth-brand .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 20px;
}

.auth-brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-alert {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: var(--danger-weak);
  border: 1px solid #f3c3c3;
  color: var(--danger);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
}

.fuzzy-alert {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 11px 12px;
  background: var(--warning-weak);
  border: 1px solid #f3d5a6;
  color: var(--warning);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
}

.fuzzy-alert svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.draft-alert {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 11px 12px;
  background: var(--primary-weak);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
}

.draft-alert svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.draft-alert > div {
  flex: 1 1 auto;
  min-width: 0;
}

.draft-alert .cell-sub {
  margin-top: 3px;
}

.fuzzy-list {
  display: grid;
  gap: 4px;
  margin-top: 5px;
}

.fuzzy-hits {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  color: var(--warning);
}

.fuzzy-hits svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.auth-help {
  margin-top: 18px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-3);
  border-radius: 6px;
  min-height: 16px;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* 项目详情头 */
.project-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.project-hero-info {
  min-width: 0;
  flex: 1;
}

.project-hero-info h1 {
  margin: 0;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.project-hero-info p {
  margin: 4px 0 0;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  color: var(--muted);
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  font-weight: 500;
  white-space: nowrap;
  transition: color 160ms var(--ease), background 160ms var(--ease);
}

.tab:hover {
  color: var(--text);
  background: var(--surface-2);
}

.tab.active {
  color: var(--primary);
  border-color: var(--border);
  background: var(--surface);
  border-radius: 6px 6px 0 0;
  position: relative;
}

.tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--primary);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  justify-content: flex-end;
}

.pagination .info {
  color: var(--muted);
  font-size: 12px;
  margin-right: auto;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 11px;
}

.role-select {
  min-width: 110px;
}

.code-block {
  font-family: var(--font-mono);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  overflow: auto;
  font-size: 12px;
}

.inline-icon {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318;
    --surface: #181a21;
    --surface-2: #1e2028;
    --surface-3: #262932;
    --text: #e7e9ee;
    --text-2: #c3c7d1;
    --muted: #9297a5;
    --muted-2: #6d7280;
    --border: #2b2e38;
    --border-strong: #3a3e4a;
    --primary-weak: rgba(87, 65, 164, 0.18);
    --primary-border: rgba(150, 128, 220, 0.45);
    --success-weak: rgba(21, 128, 61, 0.18);
    --warning-weak: rgba(180, 83, 9, 0.18);
    --danger-weak: rgba(185, 28, 28, 0.18);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.45);
  }

  .topbar {
    background: rgba(24, 26, 33, 0.86);
  }
}

/* 响应式 */
@media (max-width: 960px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-md);
  }

  .main {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .content {
    padding: 16px 14px 32px;
  }

  .topbar {
    padding: 0 14px;
  }

  .page-head {
    flex-direction: column;
  }

  .page-head-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .metrics {
    grid-template-columns: 1fr 1fr;
  }

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

  .form-grid .full {
    grid-column: auto;
  }
}
