:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --border: #e9eef7;
  --text: #1f2a44;
  --muted: #73829a;
  --primary: #2563eb;
  --danger: #dc2626;
  --success: #059669;
  --sidebar-bg: #0f172a;
  --sidebar-text: #e5e7eb;
}

body.theme-dark {
  --bg: #0b1220;
  --panel: #111a2b;
  --border: #1e2a41;
  --text: #e2e8f0;
  --muted: #93a4bf;
  --primary: #3b82f6;
  --danger: #ef4444;
  --success: #10b981;
  --sidebar-bg: #020617;
  --sidebar-text: #d1d5db;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 14px;
}
.logo {
  font-size: 17px;
  font-weight: 700;
  margin: 2px 0 14px;
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 10px;
  margin-bottom: 4px;
  font-size: 13px;
  opacity: .92;
}
.nav a:hover, .nav a.active {
  background: rgba(255,255,255,.12);
  opacity: 1;
}
.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .9;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.nav a[data-icon="home"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E"); }
.nav a[data-icon="roles"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.nav a[data-icon="menus"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='21' y2='6'/%3E%3Cline x1='8' y1='12' x2='21' y2='12'/%3E%3Cline x1='8' y1='18' x2='21' y2='18'/%3E%3Cline x1='3' y1='6' x2='3.01' y2='6'/%3E%3Cline x1='3' y1='12' x2='3.01' y2='12'/%3E%3Cline x1='3' y1='18' x2='3.01' y2='18'/%3E%3C/svg%3E"); }
.nav a[data-icon="role-menus"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h6v6H4z'/%3E%3Cpath d='M14 4h6v6h-6z'/%3E%3Cpath d='M4 14h6v6H4z'/%3E%3Cpath d='M14 17a3 3 0 1 0 0-6 3 3 0 0 0 0 6z'/%3E%3C/svg%3E"); }
.nav a[data-icon="user-audit"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-4-4'/%3E%3Cpath d='M16 11l2 2 4-4'/%3E%3C/svg%3E"); }
.nav a[data-icon="dispute-audit"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M16 13H8'/%3E%3Cpath d='M16 17H8'/%3E%3Cpath d='M10 9H8'/%3E%3C/svg%3E"); }
.nav a[data-icon="dispute-records"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpolyline points='16 13 18 15 22 11'/%3E%3Cpolyline points='16 17 18 15 22 19'/%3E%3C/svg%3E"); }
.nav a[data-icon="logs"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='16 18 22 12 16 6'/%3E%3Cpolyline points='8 6 2 12 8 18'/%3E%3C/svg%3E"); }
.nav a[data-icon="stats"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='20' x2='18' y2='10'/%3E%3Cline x1='12' y1='20' x2='12' y2='4'/%3E%3Cline x1='6' y1='20' x2='6' y2='14'/%3E%3C/svg%3E"); }
.nav a[data-icon="menu"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='21' y2='6'/%3E%3Cline x1='8' y1='12' x2='21' y2='12'/%3E%3Cline x1='8' y1='18' x2='21' y2='18'/%3E%3Cline x1='3' y1='6' x2='3.01' y2='6'/%3E%3Cline x1='3' y1='12' x2='3.01' y2='12'/%3E%3Cline x1='3' y1='18' x2='3.01' y2='18'/%3E%3C/svg%3E"); }
body.theme-dark .nav a[data-icon="home"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d1d5db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E"); }
body.theme-dark .nav a[data-icon="roles"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d1d5db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
body.theme-dark .nav a[data-icon="menus"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d1d5db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='21' y2='6'/%3E%3Cline x1='8' y1='12' x2='21' y2='12'/%3E%3Cline x1='8' y1='18' x2='21' y2='18'/%3E%3Cline x1='3' y1='6' x2='3.01' y2='6'/%3E%3Cline x1='3' y1='12' x2='3.01' y2='12'/%3E%3Cline x1='3' y1='18' x2='3.01' y2='18'/%3E%3C/svg%3E"); }
body.theme-dark .nav a[data-icon="role-menus"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d1d5db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h6v6H4z'/%3E%3Cpath d='M14 4h6v6h-6z'/%3E%3Cpath d='M4 14h6v6H4z'/%3E%3Cpath d='M14 17a3 3 0 1 0 0-6 3 3 0 0 0 0 6z'/%3E%3C/svg%3E"); }
body.theme-dark .nav a[data-icon="user-audit"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d1d5db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-4-4'/%3E%3Cpath d='M16 11l2 2 4-4'/%3E%3C/svg%3E"); }
body.theme-dark .nav a[data-icon="dispute-audit"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d1d5db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M16 13H8'/%3E%3Cpath d='M16 17H8'/%3E%3Cpath d='M10 9H8'/%3E%3C/svg%3E"); }
body.theme-dark .nav a[data-icon="dispute-records"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d1d5db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpolyline points='16 13 18 15 22 11'/%3E%3Cpolyline points='16 17 18 15 22 19'/%3E%3C/svg%3E"); }
body.theme-dark .nav a[data-icon="logs"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d1d5db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='16 18 22 12 16 6'/%3E%3Cpolyline points='8 6 2 12 8 18'/%3E%3C/svg%3E"); }
body.theme-dark .nav a[data-icon="stats"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d1d5db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='20' x2='18' y2='10'/%3E%3Cline x1='12' y1='20' x2='12' y2='4'/%3E%3Cline x1='6' y1='20' x2='6' y2='14'/%3E%3C/svg%3E"); }
body.theme-dark .nav a[data-icon="menu"] .nav-icon { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d1d5db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='21' y2='6'/%3E%3Cline x1='8' y1='12' x2='21' y2='12'/%3E%3Cline x1='8' y1='18' x2='21' y2='18'/%3E%3Cline x1='3' y1='6' x2='3.01' y2='6'/%3E%3Cline x1='3' y1='12' x2='3.01' y2='12'/%3E%3Cline x1='3' y1='18' x2='3.01' y2='18'/%3E%3C/svg%3E"); }

.main { padding: 16px; }
.topbar {
  background: var(--panel);
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(15,23,42,.06);
}
.toolbar { display: flex; gap: 8px; align-items: center; }

.view {
  background: var(--panel);
  border: 0;
  border-radius: 16px;
  padding: 16px;
  min-height: calc(100vh - 110px);
  box-shadow: 0 10px 30px rgba(15,23,42,.06);
}

.card {
  background: var(--panel);
  border: 0;
  border-radius: 14px;
  padding: 14px 0;
  margin-bottom: 10px;
}

/* 首页仪表盘 */
.dashboard {
  padding: 8px 0 24px;
}
.dashboard-header {
  margin-bottom: 28px;
}
.dashboard-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}
.dashboard-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  position: relative;
  padding: 20px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,.1);
}
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .08;
  pointer-events: none;
}
.stat-card-primary { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); color: #fff; }
.stat-card-primary::before { background: radial-gradient(circle at top right, #fff, transparent); }
.stat-card-success { background: linear-gradient(135deg, #059669 0%, #047857 100%); color: #fff; }
.stat-card-success::before { background: radial-gradient(circle at top right, #fff, transparent); }
.stat-card-warning { background: linear-gradient(135deg, #d97706 0%, #b45309 100%); color: #fff; }
.stat-card-warning::before { background: radial-gradient(circle at top right, #fff, transparent); }
.stat-card-danger { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); color: #fff; }
.stat-card-danger::before { background: radial-gradient(circle at top right, #fff, transparent); }
.stat-card-info { background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%); color: #fff; }
.stat-card-info::before { background: radial-gradient(circle at top right, #fff, transparent); }
.stat-card-accent { background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%); color: #fff; }
.stat-card-accent::before { background: radial-gradient(circle at top right, #fff, transparent); }
body.theme-dark .stat-card { box-shadow: 0 4px 20px rgba(0,0,0,.2); }
body.theme-dark .stat-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,.3); }
.stat-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  opacity: .9;
}
.stat-icon svg { width: 100%; height: 100%; }
.stat-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.stat-label {
  font-size: 13px;
  opacity: .9;
}
.dashboard-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.dashboard-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.dashboard-link:hover { text-decoration: underline; }

.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.chart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.04);
}
.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
  flex-wrap: wrap;
  gap: 12px;
}
.chart-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.chart-tabs {
  display: flex;
  gap: 4px;
}
.chart-tab {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
}
.chart-tab:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.chart-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.chart-body {
  width: 100%;
  height: 260px;
  padding: 8px;
}

/* 角色菜单分配 - 直观布局 */
.role-menu-card { max-width: 100%; }
.role-menu-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 768px) {
  .role-menu-layout { grid-template-columns: 1fr; }
}
.role-menu-side {
  position: sticky;
  top: 16px;
  padding: 20px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.role-menu-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.role-menu-select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
.role-menu-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.role-menu-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 16px;
}
.role-menu-save {
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: opacity .2s;
}
.role-menu-save:hover:not(:disabled) { opacity: .92; }
.role-menu-save:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.role-menu-msg {
  margin: 12px 0 0;
  font-size: 13px;
  min-height: 20px;
}
.role-menu-msg.ok { color: var(--success); }
.role-menu-main {
  min-width: 0;
  padding: 16px 0;
}
.role-menu-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.role-menu-count { font-size: 13px; color: var(--muted); }
.role-menu-count b { color: var(--text); }
.role-menu-actions { display: flex; gap: 6px; }
.role-menu-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 0;
}
.role-menu-item {
  padding: 8px 12px;
  border-radius: 8px;
  transition: background .15s;
}
.role-menu-item:hover { background: rgba(0,0,0,.03); }
body.theme-dark .role-menu-item:hover { background: rgba(255,255,255,.05); }
.role-menu-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}
.role-menu-cb {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--primary);
}

.title { margin: 0 0 10px; font-size: 20px; font-weight: 700; }
.sub-title { margin: 0 0 8px; font-size: 16px; }
.muted { color: var(--muted); font-size: 12px; }
.ok { color: var(--success); }
.err { color: var(--danger); }

/* 纠纷查询免责提示 - 醒目样式 */
.query-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.14) 0%, rgba(180, 83, 9, 0.08) 100%);
  border: 1px solid rgba(217, 119, 6, 0.45);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
}
body.theme-dark .query-disclaimer {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(217, 119, 6, 0.1) 100%);
  border-color: rgba(251, 191, 36, 0.4);
}
.query-disclaimer-icon {
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1.2;
}

.admin-form label .req,
.reg-form.admin-form label .req {
  color: var(--danger);
  font-weight: 700;
  margin-right: 2px;
}

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row + .row { margin-top: 8px; }
.row > .col { min-width: 200px; flex: 1 1 220px; }
.row.query-line {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}
.row.query-line > .col.query-col {
  min-width: 120px;
  flex: 0 0 140px;
}
.row > .col.col-auto { min-width: auto; flex: 0 0 auto; }

label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  padding: 9px 11px;
  outline: none;
  transition: .18s ease;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
body.theme-dark input:-webkit-autofill,
body.theme-dark input:-webkit-autofill:hover,
body.theme-dark input:-webkit-autofill:focus,
body.theme-dark input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px var(--panel) inset !important;
  box-shadow: 0 0 0 30px var(--panel) inset !important;
  -webkit-text-fill-color: var(--text) !important;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.field-error {
  min-height: 16px;
  margin-top: 3px;
  color: var(--danger);
  font-size: 12px;
}

.image-upload-wrap { margin-top: 4px; }
.image-preview-box {
  margin-bottom: 8px;
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(37,99,235,.04);
  min-height: 40px;
}
.image-preview-box:empty { display: none; }
.image-preview-box img { display: block; border-radius: 6px; }
.image-upload-actions { display: flex; gap: 8px; align-items: center; }

button {
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  font-weight: 600;
  letter-spacing: .2px;
}
button.secondary { background: #475569; }
button.danger { background: var(--danger); }
button:disabled { opacity: .6; cursor: not-allowed; }
.mini-btn { padding: 5px 9px; border-radius: 8px; font-size: 12px; }
.close-icon-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.table-search {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  margin-bottom: 8px;
}
.table-search input { width: auto; min-width: 120px; flex: 0 0 160px; }

.table-area {
  display: flex;
  flex-direction: column;
  min-height: 400px;
  margin-top: 8px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
}

.table-scroll-wrap {
  flex: 1;
  min-height: 280px;
  overflow-y: auto;
  overflow-x: auto;
  margin-bottom: 0;
}
.table-scroll-wrap table {
  margin-bottom: 0;
}

.table-area .pager {
  flex-shrink: 0;
  margin-top: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  justify-content: flex-end;
  align-items: center;
}

th.row-no-th, td.row-no-td {
  width: 60px;
  min-width: 60px;
  text-align: center;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  background: var(--panel);
  border-radius: 12px;
  overflow: hidden;
}
th, td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
}
th {
  background: rgba(37,99,235,.06);
  user-select: none;
  font-weight: 600;
  color: #4b5b76;
}
th.sortable { cursor: pointer; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(37,99,235,.04); }
.table-actions { display: flex; gap: 6px; }

.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  flex-shrink: 0;
}

.loading-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.25);
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 1000;
  font-size: 14px;
}
.loading-mask.show { display: flex; }

.section-title {
  font-size: 14px;
  color: #4f5f79;
  margin: 0 0 10px;
  font-weight: 600;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.section-head .section-title { margin: 0; }

.soft-split {
  border-top: 1px dashed var(--border);
  margin: 10px 0 12px;
}

.modal-mask {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  background: rgba(2, 6, 23, .45);
  padding: 16px;
}
.modal-mask.show { display: flex; }
.modal-card {
  width: min(760px, 100%);
  background: var(--panel);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(15, 23, 42, .24);
  padding: 14px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.modal-head h3 {
  margin: 0;
  font-size: 16px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.pwd-wrap {
  position: relative;
  display: block;
}
.pwd-wrap .modal-pwd-input {
  padding-right: 40px;
}
.pwd-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color .2s, background .2s;
}
.pwd-toggle:hover {
  color: var(--text);
  background: rgba(100, 116, 139, .12);
}
.pwd-toggle svg {
  width: 18px;
  height: 18px;
}
.modal-pwd-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--panel);
  color: var(--text);
}
.modal-card .reg-form {
  width: 100%;
  max-width: 100%;
}
.modal-card .reg-form input,
.modal-card .reg-form textarea,
.modal-card .reg-form select {
  background: var(--panel);
  color: var(--text);
}
.admin-form {
  width: 100%;
  max-width: 100%;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 10px;
}
.admin-field {
  min-width: 0;
}
.admin-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

pre {
  background: rgba(148,163,184,.08);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin: 0;
  max-height: 280px;
  overflow: auto;
  color: var(--text);
}

@media (max-width: 960px) {
  .row.query-line { flex-wrap: wrap; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 10; }
  .modal-card { padding: 12px; }
}

/* login */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: radial-gradient(circle at 20% 20%, rgba(37,99,235,.18), transparent 45%),
              radial-gradient(circle at 80% 80%, rgba(14,165,233,.18), transparent 45%),
              var(--bg);
}
.login-brand {
  padding: 56px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 16px;
}
.login-brand h1 {
  margin: 0 0 12px;
  font-size: 42px;
  line-height: 1.2;
}
.login-brand p {
  margin: 0 0 22px;
  color: var(--muted);
  max-width: 500px;
}
.login-bullets {
  display: grid;
  gap: 8px;
  color: var(--text);
}
.login-panel-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}
.login-panel {
  width: 100%;
  max-width: 520px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(15,23,42,.12);
  padding: 18px;
}
.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin: 8px 0 10px;
}
.login-tabs button {
  width: 100%;
  padding: 7px 8px;
  font-size: 12px;
}
.login-panel.reg-mode {
  max-width: 520px;
}
.reg-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.reg-title {
  font-size: 18px;
  font-weight: 700;
}
.link-btn {
  background: transparent;
  color: var(--muted);
  padding: 0;
  border-radius: 0;
}
.link-btn:hover {
  color: var(--text);
}
.reg-form label {
  margin-top: 4px;
}
.reg-form input {
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  padding: 7px 10px;
  font-size: 12px;
}
.reg-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 0;
}
.reg-field {
  min-width: 0;
}
.reg-field .field-error {
  min-height: 12px;
  margin-top: 2px;
  font-size: 11px;
}
.reg-code-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}
.reg-code-line button {
  white-space: nowrap;
  padding: 7px 10px;
  font-size: 12px;
}
.reg-agree-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}
.reg-agree-line input {
  width: auto;
}
.reg-agree {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 11px;
}
.reg-submit {
  width: 100%;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}
.login-footer-tip {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 980px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { padding: 22px 24px 6px; }
  .login-brand h1 { font-size: 30px; }
  .login-panel-wrap { padding-top: 8px; }
  .reg-grid { grid-template-columns: 1fr; }
}
