/* ================= 账户中心与管理后台页面样式 ================= */

body {
  min-width: 320px;
  background: var(--ground, #fefefe);
}

.admin-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: 2px;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}
.admin-loading-fill {
  position: relative;
  width: 0;
  height: 100%;
  background: #8dd7b0;
  transition: width 0.5s ease;
}
.admin-loading-peg {
  position: absolute;
  top: 0;
  left: calc(var(--progress, 0%) - 5.5%);
  width: 5%;
  height: 100%;
  background: rgba(141, 215, 176, 0.55);
  box-shadow: 0 0 10px rgba(141, 215, 176, 0.38), 0 0 5px rgba(141, 215, 176, 0.28);
  transform: rotate(2deg) translate(0, -2px);
  transition: left 0.5s ease;
}
.admin-loading-bar:not(.is-active):not(.is-complete) .admin-loading-fill,
.admin-loading-bar:not(.is-active):not(.is-complete) .admin-loading-peg {
  transition: none;
}
.admin-loading-bar.is-active {
  opacity: 1;
}
.admin-loading-bar.is-complete {
  opacity: 0;
  transition: opacity 0.3s ease-out 1s;
}
@media (prefers-reduced-motion: reduce) {
  .admin-loading-bar,
  .admin-loading-fill,
  .admin-loading-peg { transition: none; }
}

#admin-app {
  display: flex;
  height: 100vh;
  background: var(--ground, #fefefe);
}

/* ---- 左侧导航 ---- */
#admin-nav {
  width: 240px;
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px 12px;
  overflow-y: auto;
}

#back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  height: 32px;
  margin: 12px 0 10px;
  padding: 0 4px;
  color: var(--text-dim, rgba(0, 0, 0, 0.6));
  font-size: 14px;
  text-decoration: none;
}
#back-link svg {
  width: 18px;
  height: 18px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group-title {
  padding: 16px 10px 4px;
  font-size: 13px;
  line-height: 20px;
  color: var(--text-faint, rgba(0, 0, 0, 0.45));
  user-select: none;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text, rgba(0, 0, 0, 0.9));
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s;
}
.nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: rgba(0, 0, 0, 0.75);
}
.nav-item:hover {
  background: var(--sb-hover, rgba(0, 0, 0, 0.04));
}
.nav-item.active {
  background: var(--sb-active, rgba(0, 0, 0, 0.06));
  font-weight: 500;
}

/* ---- 主区：白色圆角卡片 ---- */
#admin-main {
  flex: 1;
  min-width: 0;
  margin: 8px 8px 8px 0;
  padding: 48px 32px 72px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  background: #fff;
}

.admin-page {
  display: none;
  width: min(100%, 780px);
  margin: 0 auto;
}
.admin-page.wide {
  width: min(100%, 1350px);
}
.admin-page.active {
  display: block;
  animation: page-in 0.2s ease both;
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.page-title {
  margin: 0 0 24px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  color: var(--text, rgba(0, 0, 0, 0.9));
}
.title-hint {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-faint, rgba(0, 0, 0, 0.45));
}
.section-caption {
  margin: 28px 0 8px;
  padding: 0 4px;
  font-size: 13px;
  line-height: 20px;
  color: var(--text-faint, rgba(0, 0, 0, 0.45));
}
.page-title + .section-caption {
  margin-top: 0;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 24px;
}
.page-head .page-title {
  margin: 0;
}

/* ---- 账号头部：大头像 + 名称 + 黑色角色徽章 ---- */
.account-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
  text-align: center;
}
.account-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}
.account-name {
  margin-top: 4px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  color: var(--text, rgba(0, 0, 0, 0.9));
}

.role-badge {
  display: inline-block;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-dim, rgba(0, 0, 0, 0.6));
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}
.role-badge.owner { background: #111; color: #fff; }
.role-badge.admin { background: rgba(23, 131, 255, 0.1); color: var(--link, #1783ff); }

.id-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  font-size: 12px;
  line-height: 20px;
  color: var(--text-dim, rgba(0, 0, 0, 0.6));
  white-space: nowrap;
}
.id-chip code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  user-select: all;
}
.id-copy {
  padding: 0 6px;
  border: 0;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.id-copy:hover { background: rgba(0, 0, 0, 0.1); }
.id-line { display: block; }
.dep-warn { color: var(--danger, #d4380d); font-size: 12px; line-height: 18px; }

/* ---- 灰色分组卡片 ---- */
.group-card {
  padding: 0 16px;
  border-radius: 12px;
  background: var(--admin-card, #f7f7f7);
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 10px 0;
  font-size: 14px;
}
.row + .row {
  border-top: 1px solid var(--admin-line, rgba(0, 0, 0, 0.06));
}
label.row { cursor: pointer; }
.row-label { color: var(--text, rgba(0, 0, 0, 0.9)); }
.row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-desc { font-size: 12px; line-height: 18px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.row-value { display: inline-flex; align-items: center; gap: 6px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); text-align: right; }
.row-right { display: inline-flex; align-items: center; gap: 14px; }
.row-control { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.row-link { color: var(--link, #1783ff); font-size: 14px; text-decoration: none; white-space: nowrap; }
.row-link:hover { text-decoration: none; }
button.row-link { background: none; border: none; padding: 0; font: inherit; cursor: pointer; text-decoration: none; }
button.row-link:hover { text-decoration: none; }
.unit { min-width: 44px; font-size: 13px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.num { font-variant-numeric: tabular-nums; }

.wide-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  margin-top: 32px;
  padding: 0 16px;
  border: none;
  border-radius: 12px;
  background: var(--admin-card, #f7f7f7);
  color: var(--text, rgba(0, 0, 0, 0.9));
  font-size: 14px;
  cursor: pointer;
}
.wide-btn:hover { background: #efefef; }
.wide-btn.primary { background: #111; color: #fff; }
.wide-btn.primary:hover { background: #000; }

/* ---- 账单与用量 ---- */
.points-summary { padding: 20px 20px 18px; }
.summary-label { font-size: 13px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.points-big {
  margin-top: 8px;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text, rgba(0, 0, 0, 0.9));
}
.points-big.negative { color: var(--danger, #FF3849); }

.ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 10px 0;
}
.ledger-row + .ledger-row { border-top: 1px solid var(--admin-line, rgba(0, 0, 0, 0.06)); }
.ledger-type { font-size: 14px; color: var(--text, rgba(0, 0, 0, 0.9)); }
.ledger-meta { margin-top: 3px; font-size: 12px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.ledger-change { flex-shrink: 0; font-size: 14px; font-weight: 500; }
.ledger-hint { margin: 10px 4px 0; line-height: 1.6; }
.empty-tip { padding: 28px 0; text-align: center; font-size: 14px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }

/* ---- 兑换码 ---- */
.face-zero { color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.cell-sub { margin-top: 2px; font-size: 12px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.time-cell { font-variant-numeric: tabular-nums; color: var(--text-dim, rgba(0, 0, 0, 0.6)); }

.redeem-code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12.5px;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.05);
}

.red-item { display: flex; gap: 12px; padding: 12px 0; }
.red-item + .red-item { border-top: 1px solid var(--admin-line, rgba(0, 0, 0, 0.06)); }
.red-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; color: rgba(0, 0, 0, 0.75); }
.red-main { min-width: 0; }
.red-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.red-chip {
  display: inline-block;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-dim, rgba(0, 0, 0, 0.6));
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}
.red-meta { margin-top: 6px; font-size: 12px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.redeem-control { display: inline-flex; align-items: center; gap: 8px; }
.redeem-control input {
  width: 230px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--text, rgba(0, 0, 0, 0.9));
  font: inherit;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  transition: border-color 0.15s;
}
.redeem-control input:focus { border-color: rgba(0, 0, 0, 0.16); }

.quota-strip {
  display: flex;
  gap: 32px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--admin-line, rgba(0, 0, 0, 0.06));
}
.quota-item { display: flex; align-items: baseline; gap: 8px; }
.quota-label { font-size: 12px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.quota-value { font-size: 13px; color: var(--text-dim, rgba(0, 0, 0, 0.6)); }

/* 筛选栏与表单控件 */
.usage-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -8px 0 16px;
}
.usage-filter input[type="text"],
.settings-number, .model-form input[type="text"], .model-form input[type="number"] {
  height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  outline: none;
  background: #f2f2f2;
  color: var(--text, rgba(0, 0, 0, 0.9));
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s, background-color 0.15s;
}
.settings-number:focus, .model-form input:focus { border-color: rgba(0, 0, 0, 0.16); background: #fff; }
.usage-filter input[type="text"] { width: 220px; }
.usage-filter input[type="text"]::placeholder { color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.usage-filter input[type="text"]:focus { border-color: transparent; background: #ebebeb; }
.group-card .settings-number { width: 110px; background: #fff; text-align: right; }
.group-card .settings-text { width: 220px; text-align: left; }
.mail-domain-row > .row-text { flex: 0 0 auto; }
.mail-domain-editor {
  display: flex;
  flex: 0 1 340px;
  max-width: 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s;
}
.mail-domain-editor:focus-within { border-color: rgba(0, 0, 0, 0.16); }
.mail-domain-tags { display: contents; }
.mail-domain-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 7px 4px 10px;
  border-radius: 5px;
  background: #f2f2f2;
  color: var(--text, rgba(0, 0, 0, 0.9));
  font-size: 13px;
  line-height: 20px;
}
.mail-domain-tag > span { min-width: 0; overflow-wrap: anywhere; }
.mail-domain-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-faint, rgba(0, 0, 0, 0.45));
  font: inherit;
  cursor: pointer;
}
.mail-domain-remove:hover { background: #e5e5e5; color: var(--text, #111); }
.mail-domain-remove:focus-visible { outline: 2px solid rgba(23, 131, 255, 0.4); outline-offset: 1px; }
.mail-domain-remove:disabled { opacity: 0.5; cursor: default; }
.mail-domain-input {
  flex: 1 1 130px;
  min-width: 0;
  width: 130px;
  height: 28px;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text, rgba(0, 0, 0, 0.9));
  font: inherit;
  font-size: 14px;
}
.mail-domain-input::placeholder { color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.admin-page.is-loading .mail-domain-editor { background: rgba(0, 0, 0, 0.05); pointer-events: none; }
.admin-page.is-loading .mail-domain-editor > * { visibility: hidden; }
@media (max-width: 520px) {
  .mail-domain-row > .mail-domain-editor { flex-basis: 100%; }
}
.usage-sep { font-size: 14px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }

.model-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--admin-card, #f7f7f7);
}
.model-form input[type="text"], .model-form input[type="number"] { background: #fff; }
.model-form input[type="text"] { width: 260px; }
.model-form input[type="number"] { width: 100px; }
.model-enabled { display: inline-flex; align-items: center; gap: 8px; margin: 0 6px; font-size: 14px; color: var(--text-dim, rgba(0, 0, 0, 0.6)); cursor: pointer; }

/* ---- 模型配置：Provider 与模型的行列表 ---- */
.mc-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 8px;
}
.mc-section-head .section-caption {
  margin: 0;
  padding: 0 4px;
}
.mc-list {
  max-height: 560px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  scrollbar-gutter: stable;
  transition: opacity 0.15s;
}
.mc-list.fetching {
  opacity: 0.6;
  pointer-events: none;
}
.mc-row,
.mc-sk-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 12px 16px;
}
.mc-row + .mc-row,
.mc-sk-row + .mc-sk-row {
  border-top: 1px solid var(--admin-line, rgba(0, 0, 0, 0.06));
}
.mc-provider {
  cursor: pointer;
  transition: background-color 0.15s;
}
.mc-provider:hover {
  background: rgba(0, 0, 0, 0.02);
}
.mc-row-main.mc-provider-main {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.mc-provider-icon {
  display: block;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.mc-provider-text {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.mc-row-main {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.mc-row-title {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  color: var(--text, rgba(0, 0, 0, 0.9));
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mc-row-title .badge {
  vertical-align: 1px;
  margin-left: 6px;
}
.mc-row-sub {
  overflow: hidden;
  font-size: 12px;
  color: var(--text-faint, rgba(0, 0, 0, 0.45));
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mc-row-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
}
.mc-chip {
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-dim, rgba(0, 0, 0, 0.6));
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}
.mc-row-meta {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-faint, rgba(0, 0, 0, 0.45));
}
.mc-row-acts {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.mc-go.icon {
  width: 16px;
  height: 16px;
}
.mc-go {
  flex-shrink: 0;
  color: var(--text-faint, rgba(0, 0, 0, 0.45));
}
.mc-sw {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
  cursor: pointer;
}
.mc-empty {
  padding: 40px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-faint, rgba(0, 0, 0, 0.45));
}
.mc-count {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  font-size: 12px;
  line-height: 18px;
}
.mc-count:empty {
  display: none;
}

/* 二级页头部与工具行 */
.mc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
}
.mc-head .page-title {
  margin: 0;
}
.mc-head .icon-btn .icon {
  width: 20px;
  height: 20px;
}
.mc-head-url {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mc-tools {
  justify-content: space-between;
}
.mc-search {
  width: 260px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  outline: none;
  background: #f2f2f2;
  color: var(--text, rgba(0, 0, 0, 0.9));
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s, background-color 0.15s;
}
.mc-search:focus {
  border-color: rgba(0, 0, 0, 0.16);
  background: #fff;
}
.mc-tools-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.mc-fetch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: 10px;
  background: #f2f2f2;
  color: var(--text, rgba(0, 0, 0, 0.9));
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s;
}
.mc-fetch-btn:hover:not(:disabled) {
  background: #ebebeb;
}
.mc-fetch-btn:active:not(:disabled) {
  background: #e2e2e2;
}
.mc-fetch-btn:focus-visible {
  outline: 2px solid rgba(23, 131, 255, 0.4);
  outline-offset: 1px;
}
.mc-fetch-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.mc-fetch-btn .icon {
  width: 15px;
  height: 15px;
}
.mc-custom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: #f2f2f2;
  color: var(--text, rgba(0, 0, 0, 0.9));
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s;
}
.mc-custom-btn:hover {
  background: #ebebeb;
}
.mc-custom-btn:active {
  background: #e2e2e2;
}
.mc-custom-btn:focus-visible {
  outline: 2px solid rgba(23, 131, 255, 0.4);
  outline-offset: 1px;
}
.mc-custom-btn.primary {
  background: #111;
  color: #fff;
}
.mc-custom-btn.primary:hover {
  background: #000;
}
.mc-custom-btn.primary:active {
  background: #1a1a1a;
}

/* 模型弹窗 */
.ui-dialog-box.mc-model-dlg {
  width: min(580px, 100%);
}
.md-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}
.md-grid-2:first-of-type {
  margin-top: 18px;
}
.md-grid-2 .ui-field {
  margin-top: 0;
}
.md-static {
  display: flex;
  align-items: center;
  height: 40px;
  box-sizing: border-box;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--admin-card, #f7f7f7);
  font-size: 14px;
  color: var(--text-dim, rgba(0, 0, 0, 0.6));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.md-switch-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text, rgba(0, 0, 0, 0.9));
  cursor: pointer;
}
.mc-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--admin-line, rgba(0, 0, 0, 0.06));
}
.mc-dialog-footer .md-switch-row {
  margin: 0;
  user-select: none;
}
.mc-dialog-footer .ui-dialog-actions {
  margin-top: 0;
  gap: 10px;
}

.settings-hint { font-size: 12px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.settings-actions { position: relative; }
.search-settings-fields { margin: 0; padding: 0; border: 0; min-width: 0; }
.search-settings-fields > .section-caption:first-child { margin-top: 0; }
.search-settings-fields:disabled { opacity: 0.6; }
#search-save:disabled { opacity: 0.5; cursor: not-allowed; }

/* 存储页：存储类型为本地时隐藏 OSS 配置行 */
.admin-page.oss-hidden .oss-row { display: none; }
.settings-tip {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  text-align: center;
  font-size: 13px;
  color: var(--admin-green, #2fb36d);
}

/* 开关控件 */
.quota-inherit { color: var(--text-faint, rgba(0, 0, 0, 0.45)); }

.ref-cell {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  color: var(--text-dim, rgba(0, 0, 0, 0.6));
}

#failure-filter .settings-number { width: min(220px, 100%); }
#failure-table { width: 100%; min-width: 0; table-layout: fixed; }
.failure-col-time, .failure-col-user { width: 18%; }
.failure-col-points, .failure-col-status { width: 12%; }
.failure-col-actions { width: 130px; }
#failure-table .failure-time { font-variant-numeric: tabular-nums; }
#failure-table .admin-btn { height: 28px; }
#failure-table .admin-btn + .admin-btn { margin-left: 10px; }
#failure-table .admin-btn:disabled { opacity: 0.5; cursor: not-allowed; }
#failure-pager { flex-wrap: wrap; gap: 8px; }
.admin-page[data-page="failure-events"] .admin-btn:focus-visible { outline: 2px solid rgba(23, 131, 255, 0.4); outline-offset: 1px; }
.failure-detail { position: fixed; inset: 0; box-sizing: border-box; width: min(860px, calc(100vw - 32px)); max-width: none; max-height: min(84vh, 900px); margin: auto; padding: 0; border: 0; border-radius: 16px; background: #fff; color: var(--text); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.14); outline: none; overflow: hidden; }
.failure-detail[open] { display: flex; flex-direction: column; }
.failure-detail::backdrop { background: rgba(0, 0, 0, 0.32); }
.failure-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: none; padding: 20px 24px; border-bottom: 1px solid var(--admin-border, rgba(0, 0, 0, 0.08)); }
#failure-detail-body { min-height: 0; padding: 24px; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 820px) {
  #failure-table { min-width: 700px; }
  #failure-table th:last-child, #failure-table .failure-actions { position: sticky; right: 0; background: var(--bg, #fff); }
}
@media (max-width: 480px) {
  .failure-detail { width: calc(100vw - 16px); max-height: calc(100dvh - 24px); border-radius: 12px; }
  .failure-detail-head { padding: 14px 16px; }
  #failure-detail-body { padding: 16px; }
}
.failure-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px 24px; margin: 0; padding: 20px; background: var(--admin-card, #f7f7f7); border-radius: 12px; }
.failure-meta > div { min-width: 0; }
.failure-meta dt { font-size: 12px; color: var(--text-faint); }
.failure-meta dd { margin: 5px 0 0; font-size: 14px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.failure-text, .failure-payload pre { margin: 0; padding: 14px 16px; border-radius: 10px; background: var(--admin-card, #f7f7f7); font-size: 13px; line-height: 1.7; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.failure-payload { min-width: 0; margin-top: 18px; }
.failure-payload summary { padding: 8px 4px; font-size: 13px; color: var(--text-dim); cursor: pointer; }
.failure-payload pre { max-height: 420px; overflow-y: auto; }
.failure-detail-sk { display: block; width: 100%; height: 48px; margin: 12px 0; border-radius: 10px; }
.failure-error { font-size: 14px; color: var(--danger); overflow-wrap: anywhere; }

/* 系统设置加载中：输入框呈骨架态（无文字、脉动、不可编辑） */
.admin-page.is-loading .settings-number,
.admin-page.is-loading .settings-text,
.admin-page.is-loading input.switch {
  color: transparent;
  background: rgba(0, 0, 0, 0.05);
  pointer-events: none;
}
.admin-page.is-loading input.switch::before {
  opacity: 0;
}

.group-card .settings-number:focus { border-color: rgba(0, 0, 0, 0.16); }

/* ---- 我的知识库 ---- */
.knowledge-page { width: min(100%, 1350px); }
.knowledge-page .page-head { justify-content: flex-start; margin-bottom: 16px; }
.kb-usage { font-size: 13px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
#kb-library-pick { margin-left: auto; }
.kb-tabs { margin-bottom: 18px; flex-wrap: wrap; }
.kb-subtabs { flex-wrap: wrap; }
.kb-select { height: 34px; }
.kb-hint { font-size: 13px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.kb-warn { margin: 8px 0; padding: 8px 12px; border-radius: 10px; font-size: 13px; background: var(--notice-bg, rgba(169, 97, 10, 0.06)); color: var(--warn, #a9610a); }
.kb-empty { padding: 48px 16px; text-align: center; font-size: 14px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.kb-empty-cell { padding: 40px 12px !important; text-align: center; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.kb-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.kb-mini { height: 28px !important; padding: 0 10px !important; font-size: 13px !important; }
.admin-btn.danger { color: var(--danger, #FF3849); }
.kb-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-dim, rgba(0, 0, 0, 0.6)); font-size: 16px; cursor: pointer;
}
.kb-icon-btn:hover { background: var(--hover-bg, rgba(0, 0, 0, 0.04)); }
.kb-badge-info { background: rgba(23, 131, 255, 0.1); color: var(--link, #1783ff); }
.kb-badge-warn { background: var(--notice-bg, rgba(169, 97, 10, 0.06)); color: var(--warn, #a9610a); }
.kb-tag { margin-left: 6px; }
.kb-title-link { color: var(--text, rgba(0, 0, 0, 0.9)); font-weight: 500; text-decoration: none; cursor: pointer; }
.kb-title-link:hover { color: var(--link, #1783ff); }
.kb-ellipsis { max-width: 220px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kb-menu { display: flex; flex-direction: column; padding: 4px; }
.kb-menu-item { padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text, rgba(0, 0, 0, 0.9)); font-size: 14px; text-align: left; cursor: pointer; }
.kb-menu-item:hover { background: var(--hover-bg, rgba(0, 0, 0, 0.04)); }
.kb-menu-item.danger { color: var(--danger, #FF3849); }

/* 文档库：左侧文件夹树 + 右侧列表 */
.kb-library { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.kb-tree { position: sticky; top: 0; max-height: calc(100vh - 160px); overflow-y: auto; padding: 8px; border-radius: 14px; background: var(--admin-card, #f7f7f7); }
.kb-tree-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 8px; }
.kb-tree-title { font-size: 13px; font-weight: 600; color: var(--text-dim, rgba(0, 0, 0, 0.6)); }
.kb-tree-hint { padding: 10px 8px 4px; font-size: 12px; line-height: 18px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.kb-folder { display: flex; align-items: center; gap: 6px; min-height: 34px; padding-right: 4px; border-radius: 8px; font-size: 14px; color: var(--text, rgba(0, 0, 0, 0.9)); cursor: pointer; }
.kb-folder:hover { background: var(--hover-bg, rgba(0, 0, 0, 0.04)); }
.kb-folder.active { background: var(--sb-active, rgba(0, 0, 0, 0.06)); font-weight: 500; }
.kb-folder.drop, .kb-table-card.drop, .kb-dropzone.drop { outline: 2px dashed var(--link, #1783ff); outline-offset: -2px; }
.kb-folder:focus-visible { outline: 2px solid rgba(23, 131, 255, 0.4); }
.kb-folder-icon { flex: none; width: 16px; height: 16px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.kb-folder-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kb-folder-count { font-size: 12px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); font-variant-numeric: tabular-nums; }
.kb-folder .kb-icon-btn { width: 24px; height: 24px; opacity: 0; }
.kb-folder:hover .kb-icon-btn, .kb-folder:focus-within .kb-icon-btn { opacity: 1; }
.kb-toolbar { margin: 0 0 12px; }
.kb-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; padding: 8px 12px; border-radius: 12px; background: rgba(23, 131, 255, 0.06); }
.kb-bulk-count { font-size: 13px; font-weight: 500; margin-right: 4px; }
.kb-table-scroll { overflow-x: auto; }
.kb-table { min-width: 760px; }
.kb-table td { vertical-align: middle; }
.kb-check { width: 36px; }
.kb-title-cell { min-width: 220px; }
.kb-actions, .kb-ops { white-space: nowrap; text-align: right; }
.kb-ops .admin-btn + .admin-btn { margin-left: 6px; }
.kb-progress { min-width: 110px; }
.kb-progress-text { font-size: 12px; color: var(--text-dim, rgba(0, 0, 0, 0.6)); }
.kb-progress-bar { height: 4px; margin-top: 4px; border-radius: 2px; background: var(--muted, #ebebee); overflow: hidden; }
.kb-progress-fill { height: 100%; background: var(--link, #1783ff); transition: width 0.3s; }

/* 检索 */
.kb-search { max-width: 920px; }
.kb-search-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.kb-search-input, .kb-input {
  flex: 1; min-width: 0; height: 40px; padding: 0 14px; border: 1px solid transparent; border-radius: 12px; outline: none;
  background: #f2f2f2; color: var(--text, rgba(0, 0, 0, 0.9)); font: inherit; font-size: 15px;
}
.kb-input { width: 100%; height: 36px; box-sizing: border-box; font-size: 14px; }
.kb-search-input:focus, .kb-input:focus { background: #ebebeb; }
.kb-search-bar .admin-btn { height: 40px; padding: 0 20px; }
.kb-search-opts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.kb-results > .kb-hint { margin-bottom: 10px; }
.kb-answer { margin-bottom: 14px; padding: 16px 18px; border-radius: 14px; background: rgba(23, 131, 255, 0.06); }
.kb-answer.weak { background: var(--notice-bg, rgba(169, 97, 10, 0.06)); }
.kb-answer-text { font-size: 15px; line-height: 1.75; white-space: pre-wrap; }
.kb-result { margin-bottom: 10px; padding: 14px 16px; border: 1px solid var(--border, rgba(0, 0, 0, 0.08)); border-radius: 14px; }
.kb-result.weak { opacity: 0.7; }
.kb-result-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.kb-snippet { font-size: 14px; line-height: 1.7; color: var(--text-dim, rgba(0, 0, 0, 0.6)); white-space: pre-wrap; overflow-wrap: anywhere; }
.kb-snippet mark { padding: 0 2px; border-radius: 3px; background: rgba(255, 196, 0, 0.35); color: inherit; }

/* 上传 */
.kb-dropzone { padding: 40px 16px; border: 1.5px dashed var(--border, rgba(0, 0, 0, 0.16)); border-radius: 16px; text-align: center; cursor: pointer; transition: background-color 0.15s; }
.kb-dropzone:hover { background: var(--hover-bg, rgba(0, 0, 0, 0.03)); }
.kb-dropzone-title { margin-bottom: 6px; font-size: 15px; font-weight: 500; }
.kb-queue { margin-top: 8px; }
.kb-queue-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 8px; }
.kb-queue-item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 0; border-bottom: 1px solid var(--border-soft, rgba(0, 0, 0, 0.05)); font-size: 14px; }
.kb-queue-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kb-queue-err { font-size: 13px; color: var(--danger, #FF3849); }

/* 文档详情 */
.kb-overlay { position: fixed; inset: 0; z-index: 250; display: flex; justify-content: flex-end; background: rgba(0, 0, 0, 0.32); }
.kb-detail { display: flex; flex-direction: column; width: min(760px, 100vw); height: 100%; background: var(--bg, #fff); box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12); outline: none; }
.kb-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: none; padding: 18px 24px; border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08)); }
.kb-detail-title { margin: 0; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.kb-detail-body { flex: 1; min-height: 0; padding: 20px 24px 32px; overflow-y: auto; overscroll-behavior: contain; }
.kb-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.kb-detail-actions a.admin-btn { display: inline-flex; align-items: center; text-decoration: none; }
.kb-detail-form { display: grid; gap: 10px; margin-bottom: 18px; }
.kb-detail-form .admin-btn { justify-self: start; }
.kb-field { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 10px; }
.kb-field-label { font-size: 13px; color: var(--text-dim, rgba(0, 0, 0, 0.6)); }
.kb-meta { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px 16px; margin: 0 0 20px; padding: 14px 16px; border-radius: 12px; background: var(--admin-card, #f7f7f7); font-size: 13px; }
.kb-meta dt { color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.kb-meta dd { margin: 0; overflow-wrap: anywhere; }
.kb-chunk-list { margin-top: 10px; }
.kb-chunk { padding: 10px 0; border-bottom: 1px solid var(--border-soft, rgba(0, 0, 0, 0.05)); }
.kb-chunk-head { margin-bottom: 4px; font-size: 12px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.kb-chunk-text { max-height: 260px; overflow: auto; font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.kb-pre { max-height: 420px; overflow: auto; padding: 14px; border-radius: 12px; background: var(--code-bg, #f5f5f5); font-size: 12px; }

@media (max-width: 820px) {
  .kb-library { grid-template-columns: 1fr; }
  .kb-tree { position: static; max-height: 260px; }
  .kb-meta { grid-template-columns: auto minmax(0, 1fr); }
  .kb-detail-head, .kb-detail-body { padding-left: 16px; padding-right: 16px; }
}

/* ---- 滚动条：与主站一致，悬停浮现 ---- */
#admin-main::-webkit-scrollbar, .table-card::-webkit-scrollbar, .mc-list::-webkit-scrollbar { width: 8px; height: 8px; }
#admin-main::-webkit-scrollbar-thumb, .table-card::-webkit-scrollbar-thumb, .mc-list::-webkit-scrollbar-thumb {
  min-height: 60px;
  min-width: 60px;
  background: transparent;
  border-radius: 999px;
}
#admin-main:hover::-webkit-scrollbar-thumb, .table-card:hover::-webkit-scrollbar-thumb, .mc-list:hover::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb, #c8c8c8); }
#admin-main::-webkit-scrollbar-thumb:hover, .table-card::-webkit-scrollbar-thumb:hover, .mc-list::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover, #a8a8a8); }

#admin-mobilebar, #admin-nav-backdrop { display: none; }

/* 窄屏：顶部栏加抽屉式侧栏，页面不横向滚动 */
@media (max-width: 820px) {
  html, body { overflow-x: hidden; }
  #admin-app { flex-direction: column; height: auto; min-height: 100vh; }
  #admin-mobilebar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px;
    height: 52px; padding: 0 8px; background: var(--bg, #fff); border-bottom: 1px solid var(--admin-line, rgba(0, 0, 0, 0.06));
  }
  #admin-menu-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    border: none; border-radius: 10px; background: transparent; color: inherit; cursor: pointer;
  }
  #admin-menu-btn svg { width: 22px; height: 22px; }
  #admin-menu-btn:active { background: rgba(0, 0, 0, 0.06); }
  #admin-mobile-title { overflow: hidden; font-size: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
  #admin-nav {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; width: min(280px, 82vw);
    overflow-y: auto; overscroll-behavior: contain; background: var(--sidebar-bg, #f7f7f7);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12); transform: translateX(-105%); transition: transform 0.22s ease;
  }
  body.nav-open #admin-nav { transform: translateX(0); }
  #admin-nav-backdrop { position: fixed; inset: 0; z-index: 40; display: block; background: rgba(0, 0, 0, 0.32); }
  #admin-nav-backdrop[hidden] { display: none; }
  body.nav-open { overflow: hidden; }
  #admin-main { flex: 1; min-width: 0; margin: 0; padding: 20px 16px 56px; overflow: visible; border: none; border-radius: 0; }
  .admin-page { min-width: 0; max-width: 100%; }
  .table-card { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .page-title { font-size: 20px; }
}
@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
  #admin-nav { transition: none; }
}

@media (max-width: 520px) {
  .row { flex-wrap: wrap; }
  .group-card .settings-number { width: 96px; }
  .points-big { font-size: 28px; }
  .md-grid-2 { grid-template-columns: 1fr; gap: 14px; }
}

/* ---- 技能中心、应用中心 ---- */
.mk-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.mk-tabs { display: flex; gap: 4px; }
.mk-tab {
  height: 34px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--text-dim, rgba(0, 0, 0, 0.6)); font-size: 14px; cursor: pointer;
  transition: background-color 0.15s;
}
.mk-tab:hover { background: var(--hover-bg, rgba(0, 0, 0, 0.04)); }
.mk-tab.active { background: var(--sb-active, rgba(0, 0, 0, 0.06)); color: var(--text, rgba(0, 0, 0, 0.9)); font-weight: 500; }
.mk-tab:focus-visible, .mk-cat:focus-visible, .mk-link:focus-visible { outline: 2px solid rgba(23, 131, 255, 0.4); outline-offset: 1px; }
.mk-search {
  display: flex; align-items: center; gap: 8px; width: 300px; max-width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid transparent; border-radius: 10px; background: #f2f2f2; transition: background-color 0.15s;
}
.mk-search:focus-within { background: #ebebeb; }
.mk-search svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.mk-search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 14px; }
.mk-search input::placeholder { color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.mk-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.mk-cats:empty { display: none; }
.mk-cat {
  height: 32px; padding: 0 14px; border: 1px solid transparent; border-radius: 999px;
  background: #f2f2f2; color: var(--text-dim, rgba(0, 0, 0, 0.6)); font-size: 14px; cursor: pointer;
  transition: background-color 0.15s;
}
.mk-cat:hover { background: #ebebeb; }
.mk-cat.active { background: #111; color: #fff; }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.mk-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 18px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.06)); border-radius: 16px; background: var(--admin-card, #fff);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.mk-card:hover { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08); transform: translateY(-1px); }
.mk-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mk-icon {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 56px; height: 56px;
  overflow: hidden; border-radius: 14px; background: linear-gradient(135deg, #eef2ff, #f5f5f5);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05); color: var(--text-dim, rgba(0, 0, 0, 0.6));
  font-size: 22px; font-weight: 600;
}
.mk-icon img { width: 100%; height: 100%; object-fit: cover; }
.mk-title { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.mk-name { overflow: hidden; font-size: 15px; font-weight: 600; line-height: 22px; text-overflow: ellipsis; white-space: nowrap; }
.mk-meta { overflow: hidden; font-size: 12px; line-height: 18px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); text-overflow: ellipsis; white-space: nowrap; }
.mk-badge {
  flex-shrink: 0; align-self: flex-start; padding: 2px 8px; border-radius: 999px;
  background: #fff4d6; color: #8a5a00; font-size: 12px; line-height: 18px;
}
.mk-summary {
  display: -webkit-box; margin: 0; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  font-size: 13px; line-height: 20px; min-height: 40px; color: var(--text-dim, rgba(0, 0, 0, 0.6));
}
.mk-tags { display: flex; flex-wrap: wrap; gap: 6px; max-height: 24px; overflow: hidden; }
.mk-tag {
  padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.04);
  color: var(--text-dim, rgba(0, 0, 0, 0.6)); font-size: 12px; line-height: 18px; white-space: nowrap;
}
.mk-status { font-size: 12px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.mk-status.warn { color: var(--warn, #a9610a); }
.mk-foot {
  display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.06));
}
.mk-price { overflow: hidden; font-size: 13px; color: var(--text, rgba(0, 0, 0, 0.9)); font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.mk-installed { font-size: 13px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.mk-foot .mk-primary { flex-shrink: 0; padding: 0 16px; border-radius: 999px; background: #111; color: #fff; }
.mk-foot .mk-primary:hover:not(:disabled) { background: #333; }
.mk-foot .mk-primary:disabled { background: rgba(0, 0, 0, 0.06); color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.mk-more-wrap { position: relative; flex-shrink: 0; }
.mk-more-btn { width: 32px; padding: 0; border-radius: 999px; font-size: 16px; line-height: 1; }
.mk-menu {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 20; display: flex; flex-direction: column;
  min-width: 132px; padding: 6px; border-radius: 12px; background: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.mk-menu.hidden { display: none; }
.mk-menu .mk-menu-item {
  justify-content: flex-start; width: 100%; height: 34px; padding: 0 10px; border: none; border-radius: 8px;
  background: transparent; text-align: left; white-space: nowrap;
}
.mk-menu .mk-menu-item:hover:not(:disabled) { background: rgba(0, 0, 0, 0.05); }
.mk-menu .mk-menu-item.danger { color: var(--danger, #d4380d); }
.mk-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 320px; text-align: center;
}
.mk-empty-title { font-size: 16px; font-weight: 600; color: var(--text, rgba(0, 0, 0, 0.9)); }
.mk-empty-sub { margin-bottom: 12px; font-size: 13px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.mk-more { margin-top: 20px; text-align: center; }
.mk-link {
  margin-left: 4px; padding: 0 2px; border: none; border-radius: 4px; background: transparent;
  color: var(--link, #1783ff); font-size: 12px; cursor: pointer;
}
@media (max-width: 520px) {
  .mk-search { width: 100%; }
  .mk-grid { grid-template-columns: 1fr; }
}

/* ---- 扩展中心 ---- */
.ext-name.mk-link { margin: 0; padding: 0; font-size: 14px; text-align: left; }
.ext-item-actions { display: flex; gap: 8px; margin-bottom: 4px; }
.section-caption .ext-filter { width: 120px; height: 30px; margin-left: 8px; font-size: 13px; font-weight: 400; vertical-align: middle; }

/* ---- 组织中心 ---- */
.admin-table td.positive { color: var(--admin-green, #2fb36d); }
.org-spend { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .org-spend { grid-template-columns: 1fr; } }
.usage-filter.org-filter { margin-top: 12px; }
.member-pick { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.member-pick-modes { display: flex; gap: 16px; font-size: 14px; }
.member-pick-mode { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.member-pick-list { display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; border: 1px solid var(--admin-line, rgba(0, 0, 0, 0.08)); border-radius: 10px; }
.member-pick-list.disabled { opacity: 0.45; pointer-events: none; }
.member-pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 14px; cursor: pointer; }
.member-pick-row + .member-pick-row { border-top: 1px solid var(--admin-line, rgba(0, 0, 0, 0.05)); }
.member-pick-name { flex-shrink: 0; }
.member-pick-meta { min-width: 0; overflow: hidden; color: var(--text-faint, rgba(0, 0, 0, 0.45)); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.org-notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 8px 0 24px; }
.org-note {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 108px; padding: 16px;
  border: 1px solid var(--admin-line, rgba(0, 0, 0, 0.08)); border-radius: 12px; background: #fff; text-align: left;
  cursor: pointer; transition: border-color 0.15s, background-color 0.15s;
}
.org-note:hover { border-color: rgba(0, 0, 0, 0.18); background: #fafafa; }
.org-note:focus-visible { outline: 2px solid rgba(23, 131, 255, 0.4); outline-offset: 1px; }
.org-note-title { font-size: 15px; font-weight: 500; color: var(--text, rgba(0, 0, 0, 0.9)); }
.org-note-hint { flex: 1; font-size: 13px; line-height: 20px; color: var(--text-faint, rgba(0, 0, 0, 0.5)); }
.org-note-action { font-size: 13px; color: var(--link, #1783ff); }
.mk-tabs.org-tabs { margin: 20px 0 4px; flex-wrap: wrap; }

/* 存储管理中心 */
.sc-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.sc-stat { padding: 16px; border-radius: 14px; background: var(--admin-card, #f7f7f7); }
.sc-stat-label { font-size: 12px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.sc-stat-value { margin-top: 6px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sc-stat-sub { margin-top: 4px; font-size: 12px; color: var(--text-dim, rgba(0, 0, 0, 0.6)); }
.sc-card { margin-bottom: 16px; padding: 16px; border-radius: 14px; background: var(--admin-card, #f7f7f7); }
.sc-card-title { margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.sc-hint { margin-top: 10px; font-size: 13px; line-height: 20px; color: var(--text-dim, rgba(0, 0, 0, 0.6)); }
.sc-bar { position: relative; height: 12px; overflow: hidden; border-radius: 999px; background: rgba(0, 0, 0, 0.08); }
.sc-bar-fill { height: 100%; border-radius: 999px; background: #1f9d55; }
.sc-bar-fill.warn { background: #d48806; }
.sc-bar-fill.danger { background: #d4380d; }
.sc-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(0, 0, 0, 0.35); }
.sc-mark.warn { left: 80%; }
.sc-mark.block { left: 90%; }
.sc-advice { display: flex; flex-direction: column; gap: 8px; }
.sc-advice-item { padding: 10px 12px; border-left: 3px solid #1783ff; border-radius: 8px; background: #fff; }
.sc-advice-item.warn { border-left-color: #d48806; }
.sc-advice-item.danger { border-left-color: #d4380d; }
.sc-advice-title { font-size: 13px; font-weight: 600; }
.sc-advice-detail { margin-top: 2px; font-size: 13px; color: var(--text-dim, rgba(0, 0, 0, 0.6)); }
.sc-trend { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.sc-trend-col { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.sc-trend-bar { width: 100%; max-width: 36px; border-radius: 6px 6px 0 0; background: #1783ff; }
.sc-trend-label { margin-top: 4px; font-size: 11px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.sc-table { width: 100%; }
.sc-empty { text-align: center; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }

/* 资费卡：成本价定价 */
.pricing-form { margin: 0 0 16px; }
.model-form .pricing-label { font-size: 13px; color: var(--text-dim, rgba(0, 0, 0, 0.6)); }
.model-form #pricing-ppu, .model-form #pricing-markup { width: 90px; text-align: right; }
.model-form [id^="cost-"] { width: 120px; }
.model-form-break { flex-basis: 100%; height: 0; }

/* 头像选择 */
.account-avatar-btn { position: relative; padding: 0; border: none; border-radius: 50%; background: none; cursor: pointer; }
.account-avatar-btn .account-avatar { display: block; }
.account-avatar-edit {
  position: absolute; right: -4px; bottom: -2px; padding: 1px 6px; border-radius: 999px;
  background: #111; color: #fff; font-size: 11px; line-height: 16px;
}
.account-avatar-btn:focus-visible { outline: 2px solid rgba(23, 131, 255, 0.5); outline-offset: 2px; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; margin-top: 4px; }
.avatar-option {
  aspect-ratio: 1; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 50%;
  background: #f2f2f2; cursor: pointer; transition: transform 0.12s ease, border-color 0.12s ease;
}
.avatar-option img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-option:hover { transform: scale(1.05); }
.avatar-option.selected { border-color: #1783ff; box-shadow: 0 0 0 2px rgba(23, 131, 255, 0.25); }

/* 监控中心 */
.mon-stat.warn .sc-stat-value { color: #b8740b; }
.mon-stat.danger .sc-stat-value { color: #d4380d; }
.mon-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #bbb; }
.mon-dot.ok { background: #1f9d55; }
.mon-dot.warn { background: #d48806; }
.mon-dot.danger { background: #d4380d; }
.mon-level { padding: 1px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.mon-level.warn { background: #fff4d6; color: #8a5a00; }
.mon-level.critical { background: #ffe4dc; color: #b42d0b; }
.mon-table { margin: 0; }
.mon-table td { vertical-align: middle; overflow-wrap: anywhere; }
.mon-range { margin-bottom: 12px; flex-wrap: wrap; }
.mon-chart svg { display: block; width: 100%; height: 180px; }
.mon-grid { stroke: rgba(0, 0, 0, 0.08); stroke-dasharray: 4 4; }
.mon-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; font-size: 13px; }
.mon-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.mon-swatch { width: 12px; height: 3px; border-radius: 2px; }
.mon-axis { display: flex; justify-content: space-between; margin-top: 4px; font-size: 12px; color: var(--text-faint, rgba(0, 0, 0, 0.45)); }
.mon-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.mon-rules { display: flex; flex-direction: column; gap: 10px; }
.mon-rule { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mon-toggle { display: inline-flex; align-items: center; gap: 8px; min-width: 220px; font-size: 14px; }
.mon-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.mon-field .settings-number { width: 76px; background: #fff; text-align: right; }
.mon-rule .settings-text {
  flex: 1 1 220px; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px; outline: none; background: #fff; font-size: 14px;
}
.mon-rule .settings-text:focus { border-color: rgba(0, 0, 0, 0.3); }
.mon-subtitle { margin-top: 20px; }
.mon-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.mon-updated { margin: 0 0 16px; }
.avatar-upload {
  display: flex; align-items: center; justify-content: center; border: 2px dashed rgba(0, 0, 0, 0.2);
  background: #fafafa; color: var(--text-dim, rgba(0, 0, 0, 0.6)); font-size: 26px; line-height: 1;
}
.avatar-upload:disabled { opacity: 0.5; cursor: progress; }
