/* 中文注释：参考应用宝纯协议1.7，把界面收敛成浅灰画布、小字号、轻阴影、快过渡的工作台风格。 */
:root {
  --bg: #f7f9fc;
  --paper: #ffffff;
  --panel: rgba(255, 255, 255, 0.92);
  --ink: #1a1f2b;
  --ink-soft: #59616f;
  --muted: #9aa2af;
  --line: #eef0f4;
  --line-strong: #e6e9ef;
  --accent: #2f6bf6;
  --accent-press: #245ae0;
  --accent-tint: #eef3ff;
  --admin-accent: #e6534d;
  --admin-tint: #fdeeed;
  --dark: #171d2a;
  --danger: #e6534d;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 55, 0.05), 0 1px 1px rgba(20, 30, 55, 0.04);
  --shadow-md: 0 8px 26px rgba(30, 45, 90, 0.07);
  --shadow-lg: 0 18px 50px rgba(30, 45, 90, 0.13);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --font: "Segoe UI", system-ui, -apple-system, "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

/* 中文注释：全局降低默认字号，减少之前“大字压迫感”。 */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  background:
    radial-gradient(900px 500px at 100% -5%, rgba(47, 107, 246, 0.06), transparent 60%),
    radial-gradient(700px 500px at -5% 105%, rgba(47, 107, 246, 0.045), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* 中文注释：小标签只做定位提示，不抢主标题层级。 */
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

/* 中文注释：首页保留欢迎感，但标题从巨幅海报改成更舒服的中大标题。 */
.welcome-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(22px, 5vw, 56px);
}

/* 中文注释：首页右上角只放一个“羊”字图标，替代原来的系统文字。 */
.home-sheep-mark {
  position: fixed;
  top: 22px;
  right: 28px;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(47, 107, 246, 0.12);
  border-radius: 16px;
  color: #fff;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.58), transparent 25%),
    linear-gradient(135deg, #3d7bff, #2357dc);
  box-shadow: 0 10px 28px rgba(47, 107, 246, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.08em;
  user-select: none;
  animation: pageIn 0.45s var(--ease) both;
}

.home-sheep-mark::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(47, 107, 246, 0.08);
  border-radius: 20px;
  pointer-events: none;
}

.welcome-copy {
  width: min(760px, 100%);
  text-align: center;
  animation: pageIn 0.5s var(--ease) both;
}

.welcome-copy h1 {
  margin: 0 auto;
  max-width: 780px;
  color: #151b27;
  font-size: clamp(42px, 7.6vw, 86px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.welcome-text,
.tiny-tip,
.auth-copy {
  color: var(--muted);
  font-size: 13px;
}

.welcome-text {
  margin: 16px auto 0;
  max-width: 420px;
}

.welcome-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

/* 中文注释：按钮统一成应用宝式小半径、轻阴影、短动画。 */
.primary-btn,
.ghost-btn,
.text-btn,
.side-btn,
.tab {
  border: 0;
  border-radius: var(--radius-pill);
  font-weight: 600;
  transition: transform 0.16s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), color 0.2s var(--ease);
}

.primary-btn {
  min-height: 38px;
  padding: 10px 18px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 6px 16px rgba(47, 107, 246, 0.22);
}

.primary-btn:hover {
  background: var(--accent-press);
  box-shadow: 0 9px 22px rgba(47, 107, 246, 0.30);
}

.full-btn { width: 100%; }

.primary-btn:hover,
.ghost-btn:hover,
.side-btn:hover,
.tab:hover {
  transform: translateY(-1px);
}

.primary-btn:active,
.ghost-btn:active,
.side-btn:active,
.tab:active {
  transform: translateY(1px) scale(0.98);
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 9px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.ghost-btn:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.ghost-btn.small {
  min-height: 32px;
  padding: 7px 12px;
  font-size: 12.5px;
}

/* 中文注释：蓝色小按钮用于后台保存、切换这类主操作，比白底按钮更醒目。 */
.primary-btn.small {
  min-height: 32px;
  padding: 7px 13px;
  font-size: 12.5px;
}

/* 中文注释：危险但不破坏数据的操作用浅红描边，提醒用户这是清空 WEB 配参，不是删除远端桶。 */
.ghost-btn.small.danger {
  color: #b3443f;
  border-color: rgba(179, 68, 63, 0.24);
  background: #fff8f7;
}

.text-btn {
  padding: 4px 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
}

.text-btn:hover { color: var(--ink); }

.tiny-tip { margin: 14px 0 0; }

/* 中文注释：登录注册卡片改成应用宝同款 360-392 宽度，表单更紧凑。 */
.auth-panel,
.admin-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 44px);
}

.auth-card,
.admin-card {
  width: min(392px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  padding: clamp(24px, 4vw, 34px);
  animation: pageIn 0.42s var(--ease) both;
}

.auth-card h2,
.auth-card .auth-copy { text-align: center; }

.auth-card h2,
.admin-card h2,
.empty-state h3 {
  margin: 8px 0 10px;
  color: var(--ink);
  font-size: clamp(22px, 3.2vw, 28px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.tabs {
  display: flex;
  width: fit-content;
  margin: 20px auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #f6f8fc;
}

.tab {
  min-width: 74px;
  padding: 8px 15px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
}

.tab.active {
  color: #fff;
  background: var(--dark);
  box-shadow: 0 4px 12px rgba(23, 29, 42, 0.14);
}

.form-box,
.settings-form,
.admin-login {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(20, 30, 55, 0.02);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}

textarea {
  min-height: 104px;
  line-height: 1.62;
  resize: vertical;
}

input::placeholder,
textarea::placeholder { color: #b4bbc8; }

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(47, 107, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(47, 107, 246, 0.10);
}

.message-line {
  min-height: 22px;
  margin-top: 13px;
  color: var(--accent-press);
  line-height: 1.6;
  text-align: center;
  font-size: 13px;
}

.message-line.bad { color: var(--danger); }

/* 中文注释：登录后工作台缩窄左侧栏，信息密度更接近应用宝管理台。 */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100vh;
  padding: 16px;
  color: #fff;
  background: linear-gradient(180deg, #171d2a, #111722);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.brand-block strong {
  display: block;
  font-size: 14px;
  line-height: 1;
}
.brand-block small {
  display: block;
  color: rgba(255, 255, 255, 0.54);
  font-size: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
}

.project-list {
  display: grid;
  gap: 6px;
}

.project-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px 13px;
  color: rgba(255, 255, 255, 0.74);
  background: transparent;
  transition: transform 0.16s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.project-item.active,
.project-item:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
}

.project-item:hover { transform: translateY(-1px); }
.project-item strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}
.project-item small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.46);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.side-btn {
  width: 100%;
  min-height: 36px;
  padding: 9px 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.side-btn:hover { background: rgba(255, 255, 255, 0.13); }

.workspace {
  min-width: 0;
  padding: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.topbar h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.user-pill {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
}
.user-pill strong { color: var(--accent); }

/* 中文注释：右上角用户信息区域，积分同步按钮固定放在积分下面。 */
.top-user-box {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.points-sync-btn {
  min-height: 30px;
  padding: 6px 13px;
  border: 0;
  border-radius: var(--radius-pill);
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #7f5cff);
  box-shadow: 0 10px 24px rgba(47, 107, 246, 0.18);
  font-size: 12px;
  font-weight: 800;
  transition: transform 0.16s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
}
.points-sync-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 14px 30px rgba(47, 107, 246, 0.24);
}
.points-sync-btn:active { transform: translateY(0); }

.empty-state,
.frame-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.empty-state {
  padding: 34px;
  text-align: center;
}
.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.frame-box { overflow: hidden; }

.frame-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.frame-head h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.01em;
}

iframe {
  display: block;
  width: 100%;
  height: calc(100vh - 126px);
  border: 0;
  background: #fff;
}


/* 中文注释：管理员未登录时只显示小登录卡片，登录后才展开成后台工作台大卡片。 */
#adminPanel .admin-card:has(#adminContent.hidden) {
  width: min(392px, 100%);
}

#adminPanel .admin-card:has(#adminContent.hidden) .admin-head {
  align-items: center;
}

#adminPanel .admin-card:has(#adminContent.hidden) .admin-head h2 {
  text-align: left;
  font-size: 24px;
}
/* 中文注释：管理员后台仍是左侧收纳卡片，但卡片更小、更像工具台，不再显得乱。 */
.admin-panel { align-items: start; }
.admin-card {
  width: min(1180px, 100%);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-lg);
}
.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.admin-head .eyebrow { color: var(--admin-accent); }

.admin-console {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-nav-cards {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 10px;
}

.admin-nav-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 2px;
  width: 100%;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--ink);
  text-align: left;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), color 0.2s var(--ease);
}

.admin-nav-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.admin-nav-card.active {
  color: #fff;
  border-color: transparent;
  background: #1a1f2b;
  box-shadow: 0 12px 30px rgba(26, 31, 43, 0.18);
}

.nav-card-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #fff;
  background: var(--admin-accent);
  font-weight: 800;
  font-size: 13px;
}
.admin-nav-card.active .nav-card-icon {
  color: var(--admin-accent);
  background: #fff;
}
.admin-nav-card strong {
  align-self: end;
  font-size: 14px;
}
.admin-nav-card small {
  color: var(--muted);
  line-height: 1.4;
  font-size: 12px;
}
.admin-nav-card.active small { color: rgba(255, 255, 255, 0.62); }

.admin-stage { min-width: 0; }
.admin-settings-form { display: block; }

.admin-view-panel {
  display: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
.admin-view-panel.active {
  display: block;
  animation: panelIn 0.22s var(--ease) both;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.section-title h3,
.provider-head h4 { margin: 0; }
.section-title h3 { font-size: 20px; }
.provider-head h4 { font-size: 16px; }
.section-title p,
.provider-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-project-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.admin-project-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 7px 12px;
  color: var(--ink-soft);
  background: #fff;
  font-weight: 700;
  font-size: 13px;
  transition: transform 0.16s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.admin-project-tab:hover { transform: translateY(-1px); }

.admin-project-tab.active {
  color: #fff;
  border-color: transparent;
  background: #1a1f2b;
}

.admin-project-tab em {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  color: var(--admin-accent);
  background: var(--admin-tint);
  font-style: normal;
  font-size: 11px;
}

.admin-project-tab.active em {
  color: #1a1f2b;
  background: #fff;
}

.admin-project {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 15px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.admin-project-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-project strong {
  display: block;
  font-size: 15px;
}

.project-status {
  border-radius: var(--radius-pill);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}
.project-status.on {
  color: #167a4a;
  background: #eaf8f1;
}
.project-status.off {
  color: #a43b36;
  background: #fdeeed;
}

.admin-project label { margin-top: 9px; }
.admin-project input,
.admin-project select,
.admin-project textarea { margin-top: 3px; }
.admin-project-meta {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px 10px;
  margin-top: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  background: #fafbfe;
  font-size: 12.5px;
}
.admin-project-meta span {
  color: var(--muted);
}
.admin-project-meta b {
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.admin-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* 中文注释：项目数据桶配参独立成卡片，和名称、注意事项分开，后续接更多项目数据也不乱。 */
.project-param-card {
  display: grid;
  gap: 11px;
  margin-top: 12px;
  border: 1px solid rgba(47, 107, 246, 0.16);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: linear-gradient(180deg, rgba(238, 243, 255, 0.82), rgba(255, 255, 255, 0.96));
}

.project-param-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-param-head strong {
  margin: 0;
  font-size: 14px;
}

.project-param-head p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 12.5px;
}

.project-param-head > span {
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  padding: 4px 9px;
  color: var(--accent);
  background: rgba(47, 107, 246, 0.10);
  font-size: 12px;
  font-weight: 800;
}

.bucket-result {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 34px;
  align-items: center;
  border: 1px dashed rgba(47, 107, 246, 0.22);
  border-radius: var(--radius-md);
  padding: 9px;
  background: rgba(255, 255, 255, 0.74);
}

.bucket-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: var(--radius-pill);
  padding: 4px 9px;
  color: #1d4ed8;
  background: #eaf0ff;
  font-size: 12px;
  font-weight: 800;
}

.bucket-empty {
  color: var(--muted);
  font-size: 12.5px;
}

.bucket-empty--bad {
  color: var(--danger);
  font-weight: 700;
}

/* 中文注释：项目级代理配置和数据桶配参同级，统一卡片风格，方便以后新增项目时照抄。 */
.project-proxy-card {
  display: grid;
  gap: 11px;
  margin-top: 12px;
  border: 1px solid rgba(47, 107, 246, 0.18);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: linear-gradient(180deg, rgba(245, 248, 255, 0.92), rgba(255, 255, 255, 0.98));
}

.proxy-mode-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.proxy-mode-btn {
  min-height: 34px;
  border: 1px solid rgba(47, 107, 246, 0.16);
  border-radius: var(--radius-md);
  color: var(--muted);
  background: #fff;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
}

.proxy-mode-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.proxy-mode-btn.active {
  color: #fff;
  border-color: transparent;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(47, 107, 246, 0.22);
}

.proxy-panel {
  display: none;
  border: 1px dashed rgba(47, 107, 246, 0.20);
  border-radius: var(--radius-md);
  padding: 11px;
  background: rgba(255, 255, 255, 0.76);
}

.proxy-panel.active {
  display: grid;
  gap: 8px;
}

.proxy-panel p,
.proxy-panel em {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
  font-style: normal;
}

.proxy-result {
  display: grid;
  gap: 5px;
  min-height: 36px;
  border: 1px dashed rgba(47, 107, 246, 0.22);
  border-radius: var(--radius-md);
  padding: 10px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 12.5px;
}

.proxy-result b {
  color: var(--ink);
}

.proxy-result b.ok {
  color: #167a4a;
}

.proxy-result b.bad {
  color: #a43b36;
}

.proxy-result em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.5;
}

.proxy-attempts {
  display: grid;
  gap: 4px;
  margin-top: 2px;
}

.proxy-attempts span {
  border-radius: 9px;
  padding: 5px 7px;
  color: #566070;
  background: #f3f6fc;
  overflow-wrap: anywhere;
}

.note-actions,
.proxy-actions {
  justify-content: flex-start;
  align-items: center;
}

.settings-top-card,
.admin-mini-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.settings-top-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.provider-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.provider-card-autman {
  border-color: rgba(230, 83, 77, 0.18);
  background: linear-gradient(180deg, rgba(253, 238, 237, 0.66), rgba(255, 255, 255, 0.96));
}
.provider-card-ddman {
  border-color: rgba(47, 107, 246, 0.20);
  background: linear-gradient(180deg, rgba(238, 243, 255, 0.78), rgba(255, 255, 255, 0.96));
}
.provider-card-cloud { border-style: dashed; }
.provider-head {
  display: flex;
  align-items: center;
  gap: 11px;
}
.provider-badge {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #fff;
  background: var(--dark);
  font-weight: 800;
}
.provider-card-autman .provider-badge { background: var(--admin-accent); }
.provider-card-ddman .provider-badge { background: var(--accent); }

.score-test.admin-mini-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
}

/* 中文注释：用户数据参考应用宝后台，改成统计块 + 工具条 + 表格，避免文字堆在一起。 */
.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.admin-summary-line {
  margin: 0 0 13px;
}

.admin-user-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-stat-card {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--ink-soft);
  background: #fff;
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: transform 0.16s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.admin-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.admin-stat-card .n {
  display: block;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.admin-stat-card .l {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.admin-stat-card.active { border-color: rgba(47, 107, 246, 0.22); }
.admin-stat-card.ok .n { color: #167a4a; }
.admin-stat-card.source .n {
  font-size: 18px;
  color: var(--admin-accent);
}

.admin-user-list {
  display: block;
}

.admin-user-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.25fr) minmax(105px, 0.95fr) minmax(90px, 0.75fr) minmax(86px, 0.72fr) minmax(78px, 0.64fr) minmax(142px, 1fr) 86px;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 13px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
}
.admin-user-row:first-child { border-top: 0; }
.admin-user-row:not(.head):hover {
  background: #fafbfe;
}
.admin-user-row.head {
  min-height: 42px;
  color: var(--muted);
  background: #fafbfe;
  font-size: 12px;
  font-weight: 700;
}
.admin-user-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.user-name {
  display: block;
  color: var(--ink);
  font-size: 13.5px;
}
.admin-user-row em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-style: normal;
  font-size: 11.5px;
}
.mono {
  font-family: "Cascadia Code", Consolas, "Segoe UI Mono", monospace;
  font-variant-numeric: tabular-nums;
}
.points-text {
  color: var(--accent);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.time-text {
  color: var(--muted);
  font-size: 12px;
}
.source-chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 8px;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.source-chip {
  color: var(--ink-soft);
  background: #f4f6fb;
}
.status-pill.ok {
  color: #167a4a;
  background: #eaf8f1;
}
.status-pill.bad {
  color: #a43b36;
  background: #fdeeed;
}

.admin-empty-card {
  border: 1px dashed var(--line-strong);
  border-radius: 15px;
  padding: 26px;
  color: var(--muted);
  background: #fafbfe;
  text-align: center;
}

/* 中文注释：管理员端最后一排更新日志，卡片展示版本和条目。 */
.admin-changelog-list {
  display: grid;
  gap: 12px;
}
.admin-changelog-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 15px;
  background: linear-gradient(180deg, #fff, #fafbff);
  box-shadow: var(--shadow-sm);
}
.admin-changelog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.admin-changelog-head strong {
  color: var(--ink);
  font-size: 14px;
}
.admin-changelog-head span {
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  color: var(--accent);
  background: var(--accent-tint);
  font-size: 11px;
  font-weight: 800;
}
.admin-changelog-card h4 {
  margin: 8px 0 8px;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.admin-changelog-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
}
.admin-changelog-card li { margin: 5px 0; }
.admin-changelog-card p,
.admin-changelog-list pre {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 中文注释：动画只保留轻微上浮和透明过渡，减少“卡顿感”。 */
@keyframes pageIn {
  from { opacity: 0.38; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes panelIn {
  from { opacity: 0.45; transform: translateY(6px) scale(0.998); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 中文注释：尊重系统减少动态效果设置。 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 900px) {
  .app-shell,
  .admin-console { grid-template-columns: 1fr; }
  .admin-nav-cards { position: static; }
  .sidebar { min-height: auto; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-user-box { justify-items: start; }
  iframe { height: 65vh; }
  .score-test.admin-mini-card { grid-template-columns: 1fr; }
  .settings-top-card { grid-template-columns: 1fr; }
  .admin-toolbar,
  .admin-user-list { grid-template-columns: 1fr; }
  .admin-user-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-user-table { overflow-x: auto; }
  .admin-user-row {
    grid-template-columns: 150px 112px 96px 92px 78px 142px 86px;
    min-width: 760px;
  }
  .admin-project-meta { grid-template-columns: 78px minmax(0, 1fr); }
  .proxy-mode-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  body { font-size: 13.5px; }
  .home-sheep-mark {
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    font-size: 18px;
  }
  .welcome-copy h1 { font-size: clamp(38px, 14vw, 64px); }
  .welcome-actions { flex-direction: column; align-items: stretch; }
  .auth-card,
  .admin-card { border-radius: 16px; }
  .workspace { padding: 14px; }
  .frame-head { align-items: flex-start; flex-direction: column; }
  .admin-card { padding: 20px; }
  .proxy-mode-list { grid-template-columns: 1fr; }
}
