/* ==========================================================================
   MoArk 组织控制台 · 组织成员额度管理 静态还原演示
   纯 CSS，无外部依赖。设计语言：浅灰底 / 白色卡片 / 蓝色主色 #1677ff
   ========================================================================== */

/* ---------- 设计变量 ---------- */
:root {
  --primary: #1677ff;
  --primary-hover: #4096ff;
  --primary-active: #0958d9;
  --primary-bg: #e8f3ff;
  --primary-soft: #f5f9ff;
  --primary-border: #bae0ff;

  --success: #52c41a;
  --success-text: #389e0d;
  --success-bg: #f0fbf0;
  --warning: #faad14;
  --warning-text: #d48806;
  --warning-bg: #fff8e6;
  --danger: #ff4d4f;
  --danger-text: #cf1322;
  --danger-bg: #fff1f0;
  --purple: #722ed1;
  --purple-bg: #f9f0ff;

  --text: #1d2129;
  --text-secondary: #4e5969;
  --text-tertiary: #86909c;
  --text-quaternary: #b4bac2;

  --bg: #f2f3f5;
  --card: #ffffff;
  --border: #e5e6eb;
  --border-light: #f0f1f3;
  --border-soft: #f5f6f8;

  --sidebar: #001529;
  --sidebar-deep: #000d1f;
  --sidebar-text: #b9c4d4;
  --sidebar-muted: #6b7a90;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.03), 0 1px 3px rgba(16, 24, 40, 0.04);
  --shadow-pop: 0 12px 32px rgba(15, 23, 42, 0.16);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, p, dl, dd, dt, ul, ol {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

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

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(22, 119, 255, 0.18);
}

:focus-visible {
  outline: 2px solid rgba(22, 119, 255, 0.45);
  outline-offset: 2px;
}

/* ---------- 图标 ---------- */
.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- 整体布局 ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  flex: 0 0 244px;
  width: 244px;
  height: 100vh;
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-deep) 100%);
  color: var(--sidebar-text);
  overflow: hidden;
}

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

.content {
  flex: 1;
  width: 100%;
  padding: 22px 26px 8px;
}

/* ---------- 侧边栏 ---------- */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(135deg, #1677ff 0%, #49a6ff 100%);
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.35);
}

.brand-logo .icon {
  width: 22px;
  height: 22px;
  stroke-width: 2.4;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-text strong {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #fff;
}

.brand-text small {
  margin-top: 1px;
  font-size: 11px;
  color: var(--sidebar-muted);
  white-space: nowrap;
}

.org-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 24px);
  margin: 0 12px 10px;
  padding: 9px 10px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--sidebar-text);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.org-switcher:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.org-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #d6e8ff;
  background: rgba(22, 119, 255, 0.22);
  border: 1px solid rgba(94, 164, 255, 0.3);
}

.org-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.org-meta strong {
  font-size: 12.5px;
  font-weight: 500;
  color: #e8eef6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-meta small {
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--sidebar-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.sidebar-nav {
  flex: 1;
  padding: 4px 12px 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}

.nav-group + .nav-group {
  margin-top: 14px;
}

.nav-group-label {
  padding: 0 10px 6px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--sidebar-muted);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  margin-bottom: 2px;
  border-radius: 7px;
  color: var(--sidebar-text);
  font-size: 13px;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav-item .icon {
  width: 16px;
  height: 16px;
  opacity: 0.75;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.is-active {
  color: #fff;
  background: linear-gradient(90deg, #1677ff 0%, #2f86ff 100%);
  box-shadow: 0 4px 14px rgba(22, 119, 255, 0.32);
}

.nav-item.is-active .icon {
  opacity: 1;
}

.nav-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.nav-item.is-active .nav-badge {
  background: rgba(255, 255, 255, 0.28);
}

.nav-badge-danger {
  background: #ff4d4f;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 4px;
}

.sidebar-user-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.sidebar-user-meta strong {
  font-size: 12.5px;
  font-weight: 500;
  color: #e8eef6;
}

.sidebar-user-meta small {
  font-size: 10.5px;
  color: var(--sidebar-muted);
}

.sidebar-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--sidebar-muted);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.sidebar-logout:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ff7875;
}

.sidebar-note {
  padding: 6px 4px 2px;
  font-size: 10.5px;
  color: #4d5d73;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 62px;
  padding: 0 26px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border-light);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.breadcrumb a {
  color: var(--text-tertiary);
  transition: color 0.16s ease;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.crumb-sep {
  color: #c9ced6;
}

.crumb-current {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.demo-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border: 1px dashed #d5d9e0;
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.demo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(82, 196, 26, 0.14);
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.topbar-link .icon {
  width: 14px;
  height: 14px;
}

.topbar-link:hover {
  color: var(--primary);
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

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

.icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid #fff;
}

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

.topbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border-light);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 4px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  transition: background 0.16s ease;
}

.user-chip:hover {
  background: var(--border-soft);
}

.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
}

.user-meta strong {
  font-size: 12.5px;
  font-weight: 500;
}

.user-meta small {
  font-size: 10.5px;
  color: var(--text-tertiary);
}

.user-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
}

/* ---------- 头像 ---------- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #1677ff, #4096ff);
  user-select: none;
}

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

.avatar-xl {
  width: 58px;
  height: 58px;
  font-size: 22px;
  border: 3px solid #fff;
  box-shadow: 0 6px 18px rgba(22, 119, 255, 0.22);
}

.avatar-blue {
  background: linear-gradient(135deg, #1677ff, #49a6ff);
}

.avatar-tint-0 {
  background: linear-gradient(135deg, #e8f3ff, #d3e8ff);
  color: #1677ff;
}

.avatar-tint-1 {
  background: linear-gradient(135deg, #e6fffb, #ccf5ef);
  color: #08979c;
}

.avatar-tint-2 {
  background: linear-gradient(135deg, #f9f0ff, #efddff);
  color: #722ed1;
}

.avatar-tint-3 {
  background: linear-gradient(135deg, #fff7e6, #ffe7ba);
  color: #d46b08;
}

.avatar-tint-4 {
  background: linear-gradient(135deg, #f6ffed, #d9f7be);
  color: #389e0d;
}

/* ---------- 页面头部 ---------- */
.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: view-in 0.2s ease;
}

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

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

.page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.page-desc {
  max-width: 820px;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-tertiary);
}

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

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
}

.card-head h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.card-head p {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-tertiary);
}

.muted {
  color: var(--text-tertiary);
  font-size: 12.5px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

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

.btn-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 1px 2px rgba(22, 119, 255, 0.28);
}

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

.btn-primary:active {
  background: var(--primary-active);
}

.btn-default {
  color: var(--text);
  background: #fff;
  border-color: #d9dce3;
}

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

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

.btn-danger:hover {
  background: #ff7875;
}

.btn-sm {
  height: 30px;
  padding: 0 11px;
  font-size: 12.5px;
}

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

.btn:disabled,
.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--primary);
  font-size: 12.5px;
  cursor: pointer;
}

.btn-text:hover {
  background: var(--primary-soft);
}

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

.btn-text.is-danger:hover {
  background: var(--danger-bg);
}

.btn-text:disabled {
  color: var(--text-quaternary);
  cursor: not-allowed;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12.5px;
  cursor: pointer;
}

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

.link-btn:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
}

/* ---------- 标签 / 状态 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.tag-blue {
  color: var(--primary);
  background: var(--primary-bg);
}

.tag-green {
  color: var(--success-text);
  background: var(--success-bg);
}

.tag-orange {
  color: var(--warning-text);
  background: var(--warning-bg);
}

.tag-red {
  color: var(--danger-text);
  background: var(--danger-bg);
}

.tag-gray {
  color: #6b7280;
  background: #f2f3f5;
}

.tag-purple {
  color: var(--purple);
  background: var(--purple-bg);
}

.inline-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
}

.team-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f2f3f5;
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.policy-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 12.5px;
  white-space: nowrap;
}

.policy-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.14);
}

.policy-tag.is-monthly .policy-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(82, 196, 26, 0.16);
}

/* ---------- 提示条 ---------- */
.info-banner {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--primary-border);
  border-radius: 9px;
  background: linear-gradient(180deg, #f0f8ff 0%, #e8f4ff 100%);
  color: #1d4e89;
}

.info-banner > .icon {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  color: var(--primary);
}

.info-banner-body strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
  font-weight: 600;
  color: #0e4a8f;
}

.info-banner-body p {
  font-size: 12.5px;
  line-height: 1.75;
  color: #31618f;
}

.info-banner-soft {
  background: #fffdf5;
  border-color: #ffe7a8;
  color: #8a5a00;
}

.info-banner-soft > .icon {
  color: var(--warning);
}

.info-banner-soft .info-banner-body strong {
  color: #8a5a00;
}

.info-banner-soft .info-banner-body p {
  color: #997226;
}

/* ---------- 表单基础 ---------- */
.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

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

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid #d9dce3;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.input,
.select {
  height: 36px;
  padding: 0 11px;
}

.select {
  padding-right: 30px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2386909c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  cursor: pointer;
}

.textarea {
  min-height: 88px;
  padding: 9px 11px;
  line-height: 1.65;
  resize: vertical;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #b9c0cb;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.input::placeholder,
.textarea::placeholder {
  color: #b4bac2;
}

.input.is-error,
.textarea.is-error {
  border-color: var(--danger);
}

.input.is-error:focus,
.textarea.is-error:focus {
  box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.12);
}

.input-affix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-affix .input {
  padding-right: 58px;
}

.input-affix .affix {
  position: absolute;
  right: 12px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.field-hint {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-tertiary);
}

.field-error {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--danger);
}

.form-field {
  margin-bottom: 18px;
}

.form-field:last-child {
  margin-bottom: 0;
}

.textarea-wrap {
  position: relative;
}

.textarea-wrap .textarea {
  padding-bottom: 24px;
}

.char-count {
  position: absolute;
  right: 10px;
  bottom: 7px;
  padding-left: 6px;
  background: #fff;
  font-size: 11px;
  color: var(--text-quaternary);
}

/* ---------- 开关 ---------- */
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d5d9e0;
  cursor: pointer;
  transition: background 0.18s ease;
}

.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.18s ease;
}

.switch.is-on {
  background: var(--primary);
}

.switch.is-on .switch-knob {
  transform: translateX(20px);
}

.switch:disabled,
.switch.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.switch-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: 9px;
  background: #fafbfc;
}

.switch-copy {
  min-width: 0;
}

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

.switch-desc {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-tertiary);
}

/* ---------- 额度设置页 ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  gap: 16px;
  margin-bottom: 16px;
}

.settings-card .policy-options {
  padding: 4px 20px 0;
}

.policy-options {
  display: grid;
  gap: 10px;
}

.policy-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.policy-option:hover {
  border-color: var(--primary-border);
  background: #fbfdff;
}

.policy-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.radio-indicator {
  position: relative;
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
  border: 1.5px solid #c9ced6;
  border-radius: 50%;
  background: #fff;
  transition: border-color 0.16s ease;
}

.policy-option input:checked ~ .radio-indicator {
  border-color: var(--primary);
}

.policy-option input:checked ~ .radio-indicator::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--primary);
}

.policy-option input:focus-visible ~ .radio-indicator {
  outline: 2px solid rgba(22, 119, 255, 0.4);
  outline-offset: 2px;
}

.policy-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.07);
}

.policy-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.policy-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.policy-desc {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-tertiary);
}

.monthly-config {
  margin: 18px 20px 0;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  animation: reveal 0.22s ease;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.monthly-config .form-field {
  max-width: 360px;
}

.monthly-config .switch-row {
  margin-top: 18px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  background: #fcfcfd;
  border-radius: 0 0 var(--radius) var(--radius);
}

.form-actions-btns {
  display: flex;
  gap: 10px;
}

.dirty-hint {
  font-size: 12px;
  color: var(--warning-text);
}

.dirty-hint::before {
  content: "●";
  margin-right: 5px;
  font-size: 8px;
  vertical-align: 1px;
}

.settings-aside {
  display: grid;
  gap: 16px;
}

.kv-list {
  padding: 0 20px 10px;
}

.kv-list > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-light);
  font-size: 12.5px;
}

.kv-list > div:last-child {
  border-bottom: 0;
}

.kv-list dt {
  color: var(--text-tertiary);
  white-space: nowrap;
}

.kv-list dd {
  font-weight: 500;
  text-align: right;
  color: var(--text);
  line-height: 1.6;
}

.rule-list {
  padding: 0 20px 18px;
}

.rule-list li {
  position: relative;
  padding-left: 14px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.rule-list li + li {
  margin-top: 6px;
}

.rule-list li::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.7;
}

.rule-list strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- 操作留痕 ---------- */
.audit-card .audit-list {
  padding: 0 20px 6px;
}

.audit-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border-light);
}

.audit-list li:last-child {
  border-bottom: 0;
}

.audit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
}

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

.audit-content {
  flex: 1;
  min-width: 0;
}

.audit-content p {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  word-break: break-word;
}

.audit-content time,
.audit-time {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-quaternary);
}

/* ---------- 工作台 ---------- */
.member-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 20px 24px;
  background:
    radial-gradient(120% 180% at 0% 0%, rgba(22, 119, 255, 0.08) 0%, rgba(22, 119, 255, 0) 58%),
    linear-gradient(120deg, #ffffff 0%, #f8fbff 100%);
  border-color: #e8f1ff;
}

.member-hero-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.member-hero-info {
  min-width: 0;
}

.member-hero-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.member-hero-name h2 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.member-hero-email {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-tertiary);
}

.member-hero-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-quaternary);
}

.dot-sep {
  margin: 0 7px;
  color: #d5d9e0;
}

.member-hero-side {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 1px solid #e8f1ff;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
}

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

.apply-switch-state {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

.apply-switch-state.is-off {
  color: var(--text-tertiary);
}

/* ---------- 数据卡片 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat-card {
  position: relative;
  padding: 18px 20px 17px;
  overflow: hidden;
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-tertiary);
}

.stat-icon {
  width: 18px;
  height: 18px;
  color: #c2ccda;
  stroke-width: 1.6;
}

.stat-value {
  margin-top: 10px;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-value-md {
  font-size: 23px;
  letter-spacing: -0.01em;
}

.stat-sub {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-tertiary);
}

.stat-card .link-btn {
  margin-top: 8px;
}

.progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #f0f1f3;
  overflow: hidden;
}

.progress-lg {
  height: 8px;
  margin-top: 12px;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #1677ff, #49a6ff);
  transition: width 0.4s ease;
}

.progress-bar.is-warning {
  background: linear-gradient(90deg, #faad14, #ffd666);
}

.progress-bar.is-danger {
  background: linear-gradient(90deg, #ff4d4f, #ff7875);
}

.progress-bar.is-unlimited {
  background: repeating-linear-gradient(
    -45deg,
    #d3e8ff,
    #d3e8ff 6px,
    #e8f3ff 6px,
    #e8f3ff 12px
  );
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
}

/* ---------- 最近申请（工作台） ---------- */
.mini-app-list {
  padding: 0 20px 8px;
}

.mini-app-list li {
  padding: 11px 0;
  border-bottom: 1px dashed var(--border-light);
}

.mini-app-list li:last-child {
  border-bottom: 0;
}

.mini-app-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mini-app-amount {
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mini-app-reason {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-app-time {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-quaternary);
}

.mini-empty {
  padding: 20px 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-tertiary);
}

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

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

.data-table thead th {
  padding: 11px 16px;
  background: #f8f9fb;
  border-bottom: 1px solid #eef0f3;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  white-space: nowrap;
}

.data-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
}

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

.data-table tbody tr {
  transition: background 0.12s ease;
}

.data-table tbody tr:hover {
  background: #fafbfc;
}

.data-table .ta-right {
  text-align: right;
}

.data-table .ta-center {
  text-align: center;
}

.data-table tfoot td {
  padding: 12px 16px;
  border-top: 1px solid #eef0f3;
  background: #fafbfc;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.members-table {
  min-width: 780px;
}

.approvals-table {
  min-width: 980px;
}

.logs-table {
  min-width: 1360px;
}

.usage-table {
  min-width: 820px;
}

.logs-table thead th,
.logs-table tbody td {
  padding: 10px 12px;
  font-size: 12.5px;
}

.num {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.01em;
}

/* ---------- 成员单元格 ---------- */
.member-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
}

.member-cell-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.member-cell-text strong {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.member-cell-text small {
  font-size: 11.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ---------- 额度单元格 + tooltip ---------- */
.quota-cell {
  min-width: 210px;
  max-width: 280px;
  cursor: help;
}

.quota-line {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.quota-used {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.quota-sep {
  color: var(--text-quaternary);
}

.quota-total {
  color: var(--text-tertiary);
}

.quota-cell .progress {
  height: 5px;
  margin-top: 7px;
}

.quota-unlimited {
  color: var(--primary);
  font-weight: 600;
}

.tooltip {
  position: fixed;
  z-index: 260;
  min-width: 200px;
  max-width: 300px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #1d2129;
  color: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
  font-size: 12px;
  line-height: 1.6;
  pointer-events: none;
}

.tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: #1d2129;
  transform: rotate(45deg);
  border-radius: 2px;
}

.tooltip.is-below::after {
  top: -5px;
  bottom: auto;
}

.tip-title {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.tip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #c9d1d9;
}

.tip-row + .tip-row {
  margin-top: 3px;
}

.tip-row strong {
  color: #fff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tip-foot {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  color: #9aa4b2;
}

/* ---------- 表格工具栏 ---------- */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.toolbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.table-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-tertiary);
}

.table-note .icon {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  flex: none;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 13px 20px;
  border-top: 1px solid var(--border-light);
}

.search-box {
  position: relative;
  width: 240px;
}

.search-box .icon {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 32px;
  padding: 0 10px 0 32px;
  border: 1px solid #d9dce3;
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 12.5px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

.table-toolbar .select {
  width: auto;
  min-width: 130px;
  height: 32px;
  font-size: 12.5px;
}

/* ---------- 分段筛选 ---------- */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: #f2f3f5;
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

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

.seg-btn.is-active {
  background: #fff;
  color: var(--primary);
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.seg-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(29, 33, 41, 0.06);
  color: var(--text-tertiary);
  font-size: 10.5px;
  font-weight: 600;
}

.seg-btn.is-active .seg-count {
  background: var(--primary-bg);
  color: var(--primary);
}

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.page-btn:hover:not(:disabled) {
  background: #f2f3f5;
  color: var(--primary);
}

.page-btn.is-active {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
  background: #fff;
}

.page-btn:disabled {
  color: var(--text-quaternary);
  cursor: not-allowed;
}

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

/* ---------- 筛选卡片（使用日志） ---------- */
.filter-card {
  margin-bottom: 16px;
  padding: 16px 20px;
}

.filter-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 16px;
}

.filter-field {
  display: flex;
  flex: 1 1 150px;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
  max-width: 190px;
}

.filter-field-wide {
  flex: 1 1 300px;
  max-width: 340px;
}

.filter-label {
  font-size: 12px;
  color: var(--text-tertiary);
}

.filter-field .select {
  height: 34px;
  font-size: 12.5px;
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-inputs .input {
  height: 34px;
  padding: 0 9px;
  font-size: 12.5px;
  min-width: 0;
}

.range-sep {
  color: var(--text-quaternary);
  flex: none;
}

.filter-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  padding-bottom: 1px;
}

/* ---------- 用量统计 ---------- */
.usage-table tfoot .num {
  font-variant-numeric: tabular-nums;
}

/* ---------- 空状态 ---------- */
.empty-state {
  padding: 46px 20px;
  text-align: center;
  color: var(--text-tertiary);
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: #f7f8fa;
  color: #c2ccda;
}

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

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

/* ---------- 页脚 ---------- */
.app-footer {
  padding: 18px 26px 24px;
  text-align: center;
  font-size: 11.5px;
  color: #a9b1bd;
}

/* ---------- Toast ---------- */
.toast-root {
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 320;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(520px, 92vw);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 100%;
  padding: 11px 16px;
  border: 1px solid #eef0f2;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.16);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  animation: toast-in 0.22s ease;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast-icon {
  display: inline-flex;
  margin-top: 1px;
}

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

.toast-success .toast-icon {
  color: var(--success);
}

.toast-info .toast-icon {
  color: var(--primary);
}

.toast-warning .toast-icon {
  color: var(--warning);
}

.toast-error .toast-icon {
  color: var(--danger);
}

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

/* ---------- Modal ---------- */
.modal-root:empty {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 20px 40px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  animation: fade-in 0.16s ease;
}

.modal {
  display: flex;
  flex-direction: column;
  width: 520px;
  max-width: 100%;
  max-height: calc(100vh - 12vh);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.26);
  animation: modal-in 0.2s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.modal.is-wide {
  width: 680px;
}

.modal.is-narrow {
  width: 420px;
}

.modal-header {
  position: relative;
  padding: 22px 24px 0;
}

.modal-title {
  padding-right: 36px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.modal-subtitle {
  margin-top: 6px;
  padding-right: 24px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-tertiary);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.modal-close:hover {
  background: #f2f3f5;
  color: var(--text);
}

.modal-close .icon {
  width: 17px;
  height: 17px;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px 24px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 24px;
  border-top: 1px solid var(--border-light);
  border-radius: 0 0 12px 12px;
  background: #fafbfc;
}

.modal-summary {
  margin-bottom: 18px;
  padding: 13px 15px;
  border: 1px solid #eef1f5;
  border-radius: 9px;
  background: #f7f9fc;
}

.summary-box-title {
  margin-bottom: 8px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  text-transform: none;
}

.summary-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: 12.5px;
}

.summary-row span {
  color: var(--text-tertiary);
}

.summary-row strong {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.summary-row strong.is-primary {
  color: var(--primary);
}

.modal-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid #e6efff;
  border-radius: 8px;
  background: var(--primary-soft);
  font-size: 12px;
  line-height: 1.65;
  color: #31618f;
}

.modal-note .icon {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  flex: none;
  color: var(--primary);
}

.modal-divider {
  height: 1px;
  margin: 18px 0;
  background: var(--border-light);
}

/* ---------- 弹窗内的选项（使用默认/自定义） ---------- */
.modal-options {
  display: grid;
  gap: 9px;
  margin-bottom: 16px;
}

.modal-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.modal-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.modal-option input {
  margin: 2px 0 0;
  accent-color: var(--primary);
}

.modal-option-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.modal-option-title {
  font-size: 12.5px;
  font-weight: 500;
}

.modal-option-desc {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-tertiary);
}

/* ---------- 导出字段勾选 ---------- */
.check-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.check-item:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.check-item input {
  margin: 0;
  accent-color: var(--primary);
}

/* ---------- 日志详情 / 费用明细 ---------- */
.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-table th,
.detail-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-light);
  font-size: 12.5px;
  text-align: left;
}

.detail-table th {
  background: #f8f9fb;
  font-weight: 500;
  color: var(--text-secondary);
}

.detail-table td.num,
.detail-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.detail-list {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 9px 14px;
  margin: 0;
  font-size: 12.5px;
}

.detail-list dt {
  color: var(--text-tertiary);
}

.detail-list dd {
  margin: 0;
  color: var(--text);
  word-break: break-all;
}

/* ---------- 无脚本提示 ---------- */
.noscript-tip {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  font-size: 15px;
  color: var(--text-secondary);
}

/* ---------- 遮罩（移动端侧边栏） ---------- */
.sidebar-mask {
  display: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1320px) {
  .content {
    padding: 20px 22px 8px;
  }

  .topbar {
    padding: 0 22px;
  }

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

@media (max-width: 1120px) {
  .sidebar {
    flex: 0 0 76px;
    width: 76px;
  }

  .sidebar-brand {
    justify-content: center;
    padding: 16px 0 12px;
  }

  .brand-text,
  .org-meta,
  .org-chevron,
  .nav-text,
  .sidebar-user-meta,
  .sidebar-logout,
  .sidebar-note,
  .nav-group-label {
    display: none;
  }

  .org-switcher {
    justify-content: center;
    width: 48px;
    margin: 0 auto 10px;
    padding: 8px;
  }

  .sidebar-nav {
    padding: 4px 10px 12px;
  }

  .nav-group + .nav-group {
    margin-top: 10px;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .nav-item .icon {
    width: 17px;
    height: 17px;
  }

  .nav-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    font-size: 9.5px;
  }

  .sidebar-user {
    justify-content: center;
  }

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

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

@media (max-width: 960px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .demo-pill {
    display: none;
  }

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

  .filter-field {
    max-width: none;
  }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 150;
    width: 244px;
    flex-basis: 244px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
  }

  .sidebar .sidebar-brand {
    justify-content: flex-start;
    padding: 18px 18px 14px;
  }

  .sidebar .brand-text,
  .sidebar .org-meta,
  .sidebar .org-chevron,
  .sidebar .nav-text,
  .sidebar .sidebar-user-meta,
  .sidebar .sidebar-logout,
  .sidebar .sidebar-note,
  .sidebar .nav-group-label {
    display: flex;
  }

  .sidebar .sidebar-note,
  .sidebar .nav-group-label {
    display: block;
  }

  .sidebar .org-switcher {
    justify-content: flex-start;
    width: calc(100% - 24px);
    margin: 0 12px 10px;
    padding: 9px 10px;
  }

  .sidebar .sidebar-nav {
    padding: 4px 12px 12px;
  }

  .sidebar .nav-item {
    justify-content: flex-start;
    padding: 0 10px;
  }

  .sidebar .nav-badge {
    position: static;
    min-width: 18px;
    height: 17px;
    padding: 0 5px;
    font-size: 10.5px;
    margin-left: auto;
  }

  .sidebar .sidebar-user {
    justify-content: flex-start;
  }

  .sidebar-mask {
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(15, 23, 42, 0.42);
    animation: fade-in 0.16s ease;
  }

  body.sidebar-open .sidebar-mask {
    display: block;
  }

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

  .topbar {
    height: 56px;
    gap: 10px;
    padding: 0 14px;
  }

  .topbar-link,
  .topbar-divider {
    display: none;
  }

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

  .breadcrumb {
    font-size: 12.5px;
  }

  .page-title {
    font-size: 20px;
  }

  .app-footer {
    padding: 16px 14px 22px;
  }
}

@media (max-width: 640px) {
  .stat-grid,
  .stat-grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
  }

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

  .member-hero {
    padding: 16px;
  }

  .member-hero-side {
    width: 100%;
    justify-content: space-between;
  }

  .form-actions {
    flex-wrap: wrap;
  }

  .filter-actions {
    margin-left: 0;
    width: 100%;
  }

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

  .modal-overlay {
    padding: 4vh 12px 24px;
  }

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

  .modal-header {
    padding: 18px 18px 0;
  }

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

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

  .cards {
    padding: 0;
  }

  .segmented {
    width: 100%;
  }
}

/* ---------- 动效收敛 ---------- */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   表格 / 弹窗内的细粒度单元样式
   ========================================================================== */

body.modal-open {
  overflow: hidden;
}

.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.cell-sub {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-tertiary);
}

.amount-main {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.amount-sub {
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.amount-original {
  margin: 0 2px;
  color: var(--text-quaternary);
  text-decoration: line-through;
}

.reason-cell {
  display: -webkit-box;
  max-width: 300px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  word-break: break-word;
}

.time-cell {
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.reject-reason {
  max-width: 230px;
  overflow: hidden;
  color: var(--danger-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions-inline {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.status-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.code-ok {
  color: var(--success-text);
  background: var(--success-bg);
}

.code-warn {
  color: var(--warning-text);
  background: var(--warning-bg);
}

.code-err {
  color: var(--danger-text);
  background: var(--danger-bg);
}

.trace-id {
  display: inline-block;
  max-width: 230px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.api-path {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.model-name {
  font-weight: 500;
}

.summary-reason {
  max-width: 270px;
  font-weight: 500 !important;
  color: var(--text-secondary) !important;
  text-align: right;
  word-break: break-word;
}

.confirm-text {
  padding: 2px 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.detail-table tfoot td {
  border-bottom: 0;
  background: #fafbfc;
}

.detail-table tbody tr:last-child td {
  border-bottom: 1px solid var(--border-light);
}

.detail-table td .status-code,
.detail-list .status-code {
  vertical-align: middle;
}

.modal .detail-list {
  margin: 2px 0 4px;
}

.quota-cell:focus-visible {
  outline: 2px solid rgba(22, 119, 255, 0.45);
  outline-offset: 3px;
  border-radius: 4px;
}

.data-table tbody tr:hover .quota-cell .progress {
  background: #eceef1;
}

/* ---------- 小屏顶栏收敛 ---------- */
@media (max-width: 640px) {
  .breadcrumb > *:not(.crumb-current) {
    display: none;
  }

  .breadcrumb {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .user-meta,
  .user-chevron {
    display: none;
  }

  .topbar-right {
    gap: 6px;
  }

  .user-chip {
    padding: 3px;
  }

  .page-desc {
    font-size: 12.5px;
  }
}
