/* ============================================================
   谷立管理后台 · 统一视觉
   ============================================================ */

:root {
  --bg: #f6f8fc;
  --card: #ffffff;
  --text: #16202f;
  --text-2: #3d4a5c;
  --muted: #7c8798;
  --faint: #a8b2c1;
  --primary: #2563eb;
  --primary-soft: #eff5ff;
  --primary-dark: #1d4ed8;
  --border: #e8ecf3;
  --border-strong: #d8dfea;
  --green: #0f9d6e;
  --green-soft: #e9f9f2;
  --red: #e04848;
  --red-soft: #fdf0f0;
  --sidebar-bg: #0e1726;
  --radius: 14px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 6px 20px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ============================================================
   布局：侧栏 + 主区
   ============================================================ */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 228px;
  flex: 0 0 228px;
  background: linear-gradient(180deg, #101b2d 0%, #0c1523 100%);
  color: #93a2b8;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 20;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 18px;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.side-brand-text { min-width: 0; }
.side-title {
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.25;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.side-sub {
  color: #5b6b85;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  margin-top: 3px;
}

.side-nav { flex: 1; padding: 4px 12px 12px; }

.side-group {
  color: #4d5c74;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 16px 12px 8px;
  white-space: nowrap;
  text-transform: uppercase;
}

.side-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: 9px;
  color: #93a2b8;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.16s ease, color 0.16s ease;
}

.side-link:hover { background: rgba(255, 255, 255, 0.055); color: #e6edf7; }

.side-link.active {
  background: rgba(59, 130, 246, 0.14);
  color: #fff;
  font-weight: 600;
}

.side-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #4f8dfd;
  box-shadow: 0 0 10px rgba(79, 141, 253, 0.7);
}

.ico {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  opacity: 0.75;
}
.side-link.active .ico { opacity: 1; }

.side-foot {
  padding: 14px 18px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: #46536b;
  font-size: 11px;
  white-space: nowrap;
}

.main-shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* 顶栏 */
.topbar {
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.crumb {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-2);
  letter-spacing: 0.01em;
}

.userbox { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.user-name { color: var(--text-2); font-size: 13.5px; }

.logout {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 7px;
  transition: all 0.16s;
}
.logout:hover { color: var(--red); background: var(--red-soft); }

.container {
  width: 100%;
  max-width: 1320px;
  margin: 26px auto 48px;
  padding: 0 32px;
  flex: 1;
}

.guest-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

/* ============================================================
   页头
   ============================================================ */

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

.page-title {
  margin: 0;
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.page-desc {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.muted { color: var(--muted); margin: 0 0 18px; }

/* ============================================================
   卡片
   ============================================================ */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card.pad { padding: 22px 24px; }
.card-title { margin: 0 0 16px; font-size: 15px; font-weight: 650; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(186px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  padding: 18px 20px 20px;
  position: relative;
}

.stat-label {
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat::after {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
  opacity: 0.75;
}

/* ============================================================
   表格
   ============================================================ */

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #8b95a7;
  letter-spacing: 0.04em;
  background: #fbfcfe;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f2f5f9;
  vertical-align: middle;
  color: var(--text-2);
}

.table tbody tr { transition: background 0.14s ease; }
.table tbody tr:hover { background: #f9fbfe; }
.table tbody tr:last-child td { border-bottom: none; }

/* 账号单元格：头像 + 双行 */
.user-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }

.avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.12);
}

.user-main { min-width: 0; }
.user-account {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-sub {
  color: var(--faint);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 状态胶囊 */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: block;
  background: currentColor;
}
.pill.on { background: var(--green-soft); color: var(--green); }
.pill.off { background: #f2f4f8; color: #8b95a7; }

/* 唯一 ID */
.code-pill {
  display: inline-block;
  max-width: 190px;
  padding: 3px 9px;
  border-radius: 7px;
  background: #f4f7fc;
  border: 1px solid #e9eff8;
  color: #5a6b85;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 12.5px;
  color: #5a6b85;
}

.dim { color: var(--faint); }
.nowrap { white-space: nowrap; }

/* ============================================================
   工具栏
   ============================================================ */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-form { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

.search-box { position: relative; display: flex; align-items: center; }

.search-box .search-ico {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #a9b4c5;
  pointer-events: none;
}

.search-box input {
  height: 38px;
  width: 300px;
  padding: 0 14px 0 36px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.search-box input::placeholder { color: #b4bdcc; }
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ============================================================
   按钮
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s, border-color 0.16s, box-shadow 0.16s, color 0.16s;
}

.btn .ico-btn { width: 15px; height: 15px; }

.btn.primary {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.btn.primary:hover {
  background: linear-gradient(180deg, #2f76ee, #1d4ed8);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.32);
}
.btn.primary:active { transform: translateY(0.5px); }

.btn.ghost {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--text-2);
}
.btn.ghost:hover { background: #f7f9fd; border-color: #c8d2e2; color: var(--text); }

.btn.danger {
  background: #fff;
  border-color: #f4d4d4;
  color: var(--red);
}
.btn.danger:hover { background: var(--red-soft); border-color: #efc0c0; }

.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled, .btn.disabled { opacity: 0.5; pointer-events: none; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ============================================================
   提示 / 空状态
   ============================================================ */

.flash {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--green-soft);
  color: #0b7d59;
  border: 1px solid #bfe9d8;
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 16px;
  font-size: 13px;
}

.alert {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--red-soft);
  color: #b73737;
  border: 1px solid #f3cdcd;
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 18px;
  font-size: 13px;
}

.empty-state {
  text-align: center;
  padding: 56px 20px 60px;
  color: var(--muted);
}
.empty-state .empty-ico {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  color: #cfd8e5;
  display: block;
}
.empty-title { font-size: 14.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-desc { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; margin: 0; }

/* ============================================================
   分页
   ============================================================ */

.pager-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid #f2f5f9;
  background: #fcfdfe;
  flex-wrap: wrap;
}

.pager-info { color: var(--muted); font-size: 12.5px; }

.pager { display: flex; gap: 5px; flex-wrap: wrap; }

.pager-link {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-2);
  text-decoration: none;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  transition: all 0.14s;
}
.pager-link:hover { border-color: #c8d2e2; background: #f7f9fd; }
.pager-link.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.pager-link.disabled { opacity: 0.42; pointer-events: none; }

/* ============================================================
   表单
   ============================================================ */

.form-card { max-width: 880px; }
.form-card .card-title { margin-bottom: 4px; }

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

.field { display: block; margin-bottom: 18px; }

.field > span {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: #5c6b80;
  letter-spacing: 0.01em;
}

.field input,
.field select {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.field input::placeholder { color: #b4bdcc; }

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.field input.readonly,
.field input:read-only {
  background: #f6f8fc;
  color: var(--muted);
  cursor: not-allowed;
}

.hint { display: block; color: var(--faint); font-size: 11.5px; margin-top: 6px; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.form-section {
  margin: 8px 0 20px;
  padding: 14px 16px;
  background: #fbfcfe;
  border: 1px solid #eef2f8;
  border-radius: 10px;
}

.form-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #8b95a7;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.kv-row {
  display: flex;
  gap: 14px;
  padding: 9px 0;
  border-top: 1px dashed #eef2f8;
  font-size: 13px;
  align-items: center;
}
.kv-row:first-of-type { border-top: 0; }
.kv-label { color: var(--muted); min-width: 74px; font-size: 12.5px; }

/* ============================================================
   登录页
   ============================================================ */

.login-wrap { width: 100%; max-width: 392px; }

.login-card {
  width: 100%;
  padding: 34px 32px 30px;
  border-radius: 18px;
  box-shadow: var(--shadow-md);
}

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

.login-card h1 { margin: 0 0 6px; font-size: 21px; font-weight: 650; letter-spacing: -0.01em; }
.login-card .muted { margin: 0 0 24px; font-size: 13px; }

.footer {
  text-align: center;
  color: #a8b2c1;
  font-size: 11.5px;
  padding: 0 0 22px;
  letter-spacing: 0.01em;
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 900px) {
  .sidebar { width: 64px; flex-basis: 64px; }
  .side-brand-text, .side-group, .side-foot, .side-link span { display: none; }
  .side-brand { padding: 18px 0 14px; justify-content: center; }
  .side-nav { padding: 8px 6px 0; }
  .side-link { justify-content: center; padding: 12px 0; }
  .side-link.active::before { display: none; }
  .topbar { padding: 0 18px; }
  .container { padding: 0 18px; }
}

@media (max-width: 720px) {
  .container { padding: 0 14px; margin-top: 18px; }
  .page-title { font-size: 21px; }
  .topbar { height: 54px; padding: 0 14px; }
  .user-name { display: none; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .table th, .table td { padding: 12px 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .search-box input { width: 100%; min-width: 0; }
  .toolbar { gap: 10px; }
  .search-form { flex: 1 1 100%; }
  .search-box { flex: 1; }
  .pager-bar { justify-content: center; }
}

/* ============================================================
   角色权限
   ============================================================ */

.perm-count {
  margin-left: 8px;
  font-weight: 500;
  color: var(--faint);
  letter-spacing: 0;
}

.perm-group { margin-bottom: 14px; }
.perm-group:last-of-type { margin-bottom: 4px; }

.perm-group-title {
  font-size: 11.5px;
  font-weight: 600;
  color: #9aa5b6;
  letter-spacing: 0.06em;
  margin-bottom: 9px;
  padding-left: 2px;
}

.perm-grid { display: flex; flex-wrap: wrap; gap: 7px; }

.perm-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s, opacity 0.16s;
}

.perm-check:hover { border-color: #c8d2e2; background: #fbfcfe; }

.perm-check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.perm-check .box {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: #fff;
  transition: background 0.14s, border-color 0.14s, box-shadow 0.14s;
}

.perm-check .box::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(38deg) scale(0);
  opacity: 0;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.12s;
}

.perm-check input:checked ~ .box {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.perm-check input:checked ~ .box::after {
  transform: rotate(38deg) scale(1);
  opacity: 1;
}

.perm-check input:checked ~ .txt { color: var(--primary-dark); font-weight: 600; }

.perm-check.parent .txt { font-weight: 600; }

.perm-check.child {
  height: 32px;
  padding: 0 10px;
  background: #fbfcfe;
  font-size: 12.5px;
}

.perm-check.child input:checked ~ .txt { font-weight: 500; }

.perm-check.wild {
  height: 38px;
  border-color: #ddc9fb;
  background: #faf7ff;
}

.perm-check.wild .txt { color: #7c3aed; font-weight: 600; }
.perm-check.wild .box { border-color: #d9c9f7; }
.perm-check.wild input:checked ~ .box {
  background: #7c3aed;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.perm-check.wild input:checked ~ .txt { color: #6d28d9; }

.perm-check.dimmed { opacity: 0.45; }

.perm-check.pulse { animation: perm-pulse 0.55s ease; }

@keyframes perm-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35); border-color: var(--primary); }
  100% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); border-color: var(--border-strong); }
}

.perm-tag {
  font-size: 10.5px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 5px;
  background: #eef3fb;
  color: #8494aa;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.perm-check.wild .perm-tag { background: #f0e8ff; color: #8b5cf6; }

/* 权限标签（列表页） */
.chips { display: flex; flex-wrap: wrap; gap: 5px; max-width: 560px; }

.chip {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 8px;
  border-radius: 6px;
  background: #f4f7fc;
  border: 1px solid #e9eff8;
  color: #5a6b85;
  font-size: 11.5px;
  white-space: nowrap;
}

.chip.wild {
  background: #f6f0ff;
  border-color: #e4d5fb;
  color: #7c3aed;
  font-weight: 600;
}

.hint a { color: var(--primary); text-decoration: none; }
.hint a:hover { text-decoration: underline; }

/* 菜单清单为空时的占位说明 */
.perm-empty {
  margin-top: 4px;
  padding: 18px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: #fafbfe;
}
.perm-empty-title {
  margin-bottom: 8px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
}
.perm-empty-desc {
  margin: 0 0 6px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted);
}
.perm-empty-desc:last-child { margin-bottom: 0; }
.perm-empty code {
  padding: 1px 6px;
  border-radius: 5px;
  background: #eef2f9;
  color: var(--text-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

/* ---------------------------------------------------------- 接口管理页 */
.iface-hint { font-size: 12px; color: var(--muted); }
.iface-hint code {
  padding: 1px 6px;
  border-radius: 5px;
  background: #eef2f9;
  color: var(--text-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.iface-group { margin-bottom: 18px; padding: 0; overflow: hidden; }

.iface-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 22px;
  background: #fafbfe;
  border-bottom: 1px solid var(--border);
}
.iface-group-title { font-size: 13.5px; font-weight: 650; color: var(--text); }
.iface-group-count { font-size: 12px; color: var(--muted); }

.iface { border-bottom: 1px solid var(--border); }
.iface:last-child { border-bottom: none; }

.iface > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  cursor: pointer;
  list-style: none;
  transition: background 0.14s ease;
}
.iface > summary::-webkit-details-marker { display: none; }
.iface > summary:hover { background: #f9fbfe; }
.iface > summary::after {
  content: '▾';
  margin-left: auto;
  font-size: 12px;
  color: var(--faint);
  transition: transform 0.15s ease;
}
.iface[open] > summary::after { transform: rotate(180deg); }

.method {
  flex: none;
  width: 58px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 0;
  border-radius: 6px;
  background: #eef2f9;
  color: var(--text-2);
}
.method.get { background: var(--green-soft); color: var(--green); }
.method.post { background: var(--primary-soft); color: var(--primary); }
.method.put, .method.patch { background: #fff5e8; color: #d97706; }
.method.delete { background: #fff0f0; color: var(--red); }

.iface-path {
  padding: 2px 8px;
  border-radius: 6px;
  background: #f2f5fa;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  white-space: nowrap;
}
.iface-sum { font-size: 12.5px; color: var(--muted); }
.iface-auth {
  flex: none;
  padding: 1px 8px;
  border: 1px solid #e4d5fb;
  border-radius: 999px;
  background: #f6f0ff;
  color: #7c3aed;
  font-size: 11px;
}

.iface-body { padding: 2px 22px 20px; background: #fcfdff; }
.iface-sub {
  margin: 14px 0 8px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-2);
}

.mini-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mini-table th {
  padding: 6px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  background: #f7f9fd;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.mini-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f0f3f9;
  vertical-align: top;
}
.mini-table code {
  padding: 1px 6px;
  border-radius: 5px;
  background: #eef2f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.code-block {
  position: relative;
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #0f1726;
  color: #d7e3f4;
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
}
.code-block code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre;
}
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #cfdcf0;
  font-size: 11.5px;
  cursor: pointer;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.18); }

.iface-note {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.iface-note code {
  padding: 1px 6px;
  border-radius: 5px;
  background: #eef2f9;
  color: var(--text-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (max-width: 720px) {
  .perm-check { height: 34px; }
  .perm-check.child { height: 32px; }
  .chips { max-width: none; }
}
