/* 官方总控 — 浅橙 + 绿色主题 · PC / H5 自适应 */
:root {
  --primary: #ff9f43;
  --primary-dark: #e8590c;
  --primary-light: #fff4e6;
  --accent: #51cf66;
  --accent-dark: #37b24d;
  --accent-light: #ebfbee;
  --ok: #40c057;
  --bad: #fa5252;
  --text: #2f3542;
  --text-secondary: #868e96;
  --border: #ffe8cc;
  --bg: #fffbf5;
  --card: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(255, 159, 67, 0.08);
  --shadow-hover: 0 8px 28px rgba(255, 159, 67, 0.16);
  --sidebar-w: 240px;
  --header-h: 56px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 80% 0%, rgba(255, 159, 67, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(81, 207, 102, 0.05) 0%, transparent 35%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* —— 登录 —— */
.page-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 10% 20%, rgba(81, 207, 102, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(255, 159, 67, 0.18) 0%, transparent 40%),
    linear-gradient(160deg, #fff4e6 0%, #fffbf5 50%, #ebfbee 100%);
}
.page-login.hide { display: none; }

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 16px;
  padding: 36px 28px 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.login-logo {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary) 0%, #ffc078 100%);
  box-shadow: 0 4px 14px rgba(255, 159, 67, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 30px;
}

.login-title {
  margin: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
}

.login-sub {
  margin: 8px 0 28px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.form-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  height: 46px;
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(81, 207, 102, 0.15);
}

.form-field i { color: var(--primary); font-size: 18px; }

.form-field input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
}

.btn-primary {
  width: 100%;
  height: 46px;
  margin-top: 8px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--primary) 0%, #ffc078 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 159, 67, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover { box-shadow: 0 6px 16px rgba(255, 159, 67, 0.45); }
.btn-primary:active { transform: scale(0.98); }

.login-err {
  color: var(--bad);
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
  min-height: 18px;
}

/* —— 主壳 H5 默认 —— */
.page-app {
  display: none;
  min-height: 100vh;
  padding-bottom: calc(62px + env(safe-area-inset-bottom, 0));
}

.page-app.show { display: block; }

.sidebar { display: none; }

.main-area {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

/* H5 底部 Tab */
.tabbar--mobile {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 30;
  box-shadow: 0 -2px 12px rgba(255, 159, 67, 0.08);
}

.tabbar-item {
  flex: 1;
  border: none;
  background: transparent;
  padding: 6px 0 6px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: color 0.2s, transform 0.15s;
  position: relative;
}

.tabbar-item i {
  font-size: 20px;
  width: 36px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  transition: background 0.2s, color 0.2s;
}

.tabbar-item.active {
  color: var(--primary-dark);
  font-weight: 600;
}

.tabbar-item.active i {
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  color: var(--primary-dark);
}

/* —— 页头 —— */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  min-height: var(--header-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  flex: 1;
  text-align: center;
  color: var(--primary-dark);
}

.page-header .btn-text {
  border: none;
  background: transparent;
  color: var(--accent-dark);
  font-size: 13px;
  cursor: pointer;
  min-width: 72px;
  padding: 6px 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.page-header .btn-text.left { justify-content: flex-start; }
.page-header .btn-text.right { justify-content: flex-end; }

.page-body {
  padding: 12px 16px 24px;
}

.page-body--grid {
  display: grid;
  gap: 20px;
}

/* —— 分区标题 —— */
.section { margin-bottom: 4px; }

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.section-dot {
  width: 4px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--primary), #ffc078);
  flex-shrink: 0;
}

.section-dot.accent {
  background: linear-gradient(180deg, var(--accent), #8ce99a);
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.section-sub {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* —— 统计卡片 —— */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-grid--single { grid-template-columns: 1fr; max-width: 280px; }

.stat-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 14px 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(255, 159, 67, 0.35);
}

.stat-card-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #ffc078);
  opacity: 0.85;
}

.stat-card.tone-accent .stat-card-top,
.stat-card.tone-ok .stat-card-top {
  background: linear-gradient(90deg, var(--accent), #8ce99a);
}

.stat-card.tone-bad .stat-card-top {
  background: linear-gradient(90deg, var(--bad), #ff8787);
}

.stat-card .ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 159, 67, 0.12);
}

.stat-card .ico.accent { background: var(--accent-light); color: var(--accent-dark); box-shadow: inset 0 0 0 1px rgba(81, 207, 102, 0.15); }
.stat-card .ico.ok { background: var(--accent-light); color: var(--ok); box-shadow: inset 0 0 0 1px rgba(64, 192, 87, 0.15); }
.stat-card .ico.bad { background: #fff5f5; color: var(--bad); box-shadow: inset 0 0 0 1px rgba(250, 82, 82, 0.12); }

.stat-body { min-width: 0; }

.stat-card .label {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.stat-card .value {
  font-size: 22px;
  font-weight: 800;
  margin-top: 2px;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* —— 功能模块 —— */
.mod-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.mod-grid--list {
  grid-template-columns: 1fr;
  gap: 14px;
}

.page-body--agent { max-width: 920px; }

.section--agent { margin-top: 4px; }

.section--agent .section-head { margin-bottom: 16px; }

.agent-mod-grid {
  gap: 16px;
}

.mod-card--agent {
  flex-direction: column;
  align-items: stretch;
  padding: 20px 20px 18px;
  gap: 14px;
  min-height: 0;
}

.mod-card--agent .agent-mod-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mod-card--agent .ico {
  width: 50px;
  height: 50px;
  font-size: 24px;
  margin-bottom: 0;
}

.mod-card--agent .agent-mod-title {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.mod-card--agent .mod-arrow {
  width: 32px;
  height: 32px;
  font-size: 18px;
  flex-shrink: 0;
}

.mod-card--agent .agent-mod-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 64px;
}

.mod-card--agent .agent-mod-chip {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  padding: 6px 12px;
  border-radius: 8px;
  background: #f8f9fa;
  color: var(--text-secondary);
  border: 1px solid #eee;
}

.mod-card--agent.mod-card--orange .agent-mod-chip {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: rgba(255, 159, 67, 0.2);
}

.mod-card--agent.mod-card--green .agent-mod-chip {
  background: var(--accent-light);
  color: var(--accent-dark);
  border-color: rgba(81, 207, 102, 0.2);
}

.agent-mod-grid--duo {
  grid-template-columns: repeat(2, 1fr);
  max-width: 640px;
}

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

.agent-cred-head,
.agent-cred-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.5fr) minmax(72px, 0.8fr) minmax(72px, 0.8fr) 28px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.agent-cred-head {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: linear-gradient(90deg, var(--primary-light), transparent);
  border-bottom: 1px solid var(--primary-light);
}

.agent-cred-row {
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-top: 1px solid rgba(255, 232, 204, 0.55);
  transition: background 0.15s;
  color: inherit;
  font: inherit;
}

.agent-cred-row:first-of-type { border-top: none; }

.agent-cred-row:hover { background: rgba(255, 244, 230, 0.55); }

.agent-cred-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.agent-cred-uid {
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.agent-cred-status {
  justify-self: start;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.agent-cred-status.ok {
  color: var(--accent-dark);
  background: var(--accent-light);
}

.agent-cred-status.off {
  color: #868e96;
  background: #f1f3f5;
}

.agent-cred-status.warn {
  color: #e67700;
  background: #fff3bf;
}

.agent-cred-status.bad {
  color: #c92a2a;
  background: #ffe3e3;
}

.group-cred-head,
.group-cred-row {
  grid-template-columns: minmax(140px, 1.2fr) minmax(140px, 1.5fr) minmax(72px, 0.8fr) 28px;
}

.group-row-id {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-family: ui-monospace, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-row-agent {
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-cred-arrow {
  color: var(--text-secondary);
  font-size: 18px;
  justify-self: end;
}

.agent-cred-row:hover .agent-cred-arrow { color: var(--primary-dark); }

.agent-cred-head--uid,
.agent-cred-row--uid {
  grid-template-columns: minmax(100px, 1fr) minmax(72px, 0.8fr) 28px;
}

.agent-cred-head--toggle,
.agent-cred-row--toggle {
  grid-template-columns: minmax(120px, 1.5fr) minmax(72px, 0.8fr) 52px;
}

.agent-cred-row--toggle {
  cursor: default;
}

.agent-cred-row--toggle:hover {
  background: transparent;
}

.agent-cred-row--toggle .switch {
  justify-self: end;
}

.agent-cred-name.uid {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
}

.cell-value.mono {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}

.mod-card--row {
  flex-direction: row;
  align-items: center;
}

.mod-card--row .mod-text { flex: 1; }

.page-body--narrow { max-width: 560px; }

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.detail-tip {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: linear-gradient(90deg, var(--primary-light), transparent);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* —— 群授权 —— */
.group-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.group-stat-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.group-stat-pill > i {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.group-stat-pill.primary > i { background: var(--primary-light); color: var(--primary-dark); }
.group-stat-pill.accent > i { background: var(--accent-light); color: var(--accent-dark); }
.group-stat-pill.ok > i { background: var(--accent-light); color: var(--ok); }

.group-stat-pill .n {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}

.group-stat-pill .l {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.group-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.group-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.group-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(255, 159, 67, 0.35);
}

.group-card__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--primary-light);
  background: linear-gradient(90deg, rgba(255, 244, 230, 0.5), transparent);
}

.group-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--primary-light), #fff);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.group-card__title { flex: 1; min-width: 0; }

.group-card__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.group-card__id {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
  word-break: break-all;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  opacity: 0.85;
}

.group-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.group-tag.ok { color: var(--accent-dark); background: var(--accent-light); }
.group-tag.warn { color: #e67700; background: #fff4e6; }
.group-tag.bad { color: var(--bad); background: #fff5f5; }

.group-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 4px;
}

.group-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 16px;
  background: #f8f9fa;
  color: var(--text-secondary);
  border: 1px solid #eee;
}

.group-chip i { font-size: 12px; }

.group-chip.ok {
  color: var(--accent-dark);
  background: var(--accent-light);
  border-color: rgba(81, 207, 102, 0.25);
}

.group-chip.off {
  color: #868e96;
  background: #f1f3f5;
}

.group-card__body {
  padding: 4px 0 8px;
}

.group-section {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 232, 204, 0.55);
}

.group-section:first-child { border-top: none; }

.group-section--muted { background: rgba(248, 249, 250, 0.6); }

.group-section__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.group-section__title i { font-size: 14px; color: var(--primary); }

.group-section__title em {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: #f1f3f5;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 4px;
}

.group-section__empty {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 6px 0 2px;
}

.group-card__plugins {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.group-chip.plugin {
  color: var(--primary-dark);
  background: var(--primary-light);
  border-color: rgba(255, 159, 67, 0.25);
}

.group-chip.plugin i { color: var(--primary); font-size: 11px; }

.group-welcome {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
  background: #f8f9fa;
  border: 1px solid #eee;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.group-card__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  padding: 0;
}

.group-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.group-meta-item .k {
  font-size: 11px;
  color: var(--text-secondary);
}

.group-meta-item .v {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.group-meta-item .v.mono {
  font-size: 11px;
  font-weight: 500;
  font-family: ui-monospace, Consolas, monospace;
  color: var(--text-secondary);
}

.group-meta-item .v.ok { color: var(--ok); }
.group-meta-item .v.warn { color: #e67700; }
.group-meta-item .v.bad { color: var(--bad); }

.group-meta-item .v.highlight {
  color: var(--primary-dark);
  background: var(--primary-light);
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  width: fit-content;
}

.group-empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.group-empty__ico {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.group-empty__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.group-empty__desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.group-empty__desc code {
  font-size: 12px;
  background: var(--primary-light);
  padding: 2px 6px;
  border-radius: 4px;
}

.mod-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.mod-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 159, 67, 0.04), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.mod-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(255, 159, 67, 0.4);
}

.mod-card:hover::before { opacity: 1; }

.mod-card:active { transform: translateY(0); }

.mod-card--green::before {
  background: linear-gradient(135deg, rgba(81, 207, 102, 0.06), transparent 60%);
}

.mod-card--green:hover { border-color: rgba(81, 207, 102, 0.4); }

.mod-card--ext {
  border-style: dashed;
  border-color: rgba(81, 207, 102, 0.45);
  background: linear-gradient(135deg, #fff, var(--accent-light));
}

.mod-card .ico {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--primary-light), #fff);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(255, 159, 67, 0.12);
}

.mod-card .ico.green,
.mod-card--green .ico {
  background: linear-gradient(145deg, var(--accent-light), #fff);
  color: var(--accent-dark);
  box-shadow: 0 2px 8px rgba(81, 207, 102, 0.12);
}

.mod-card .ico.ext {
  background: linear-gradient(145deg, var(--accent-light), #fff);
  color: var(--accent-dark);
  box-shadow: 0 2px 8px rgba(81, 207, 102, 0.15);
}

.mod-text { flex: 1; min-width: 0; }

.mod-card .title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.mod-card .desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mod-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}

.mod-card:hover .mod-arrow {
  background: var(--primary);
  color: #fff;
  transform: translateX(2px);
}

.mod-arrow.ext {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.mod-card--ext:hover .mod-arrow.ext {
  background: var(--accent);
  color: #fff;
}

/* —— 卡片 / 列表 —— */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 14px;
  transition: box-shadow 0.2s;
}

.card:hover { box-shadow: var(--shadow-hover); }

.card--status {
  background: linear-gradient(180deg, #fff 0%, #fffbf8 100%);
}

.status-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 14px 16px 18px;
}

.status-tile {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  transition: box-shadow 0.15s;
}

.status-tile.ok { border-color: rgba(81, 207, 102, 0.35); background: linear-gradient(180deg, #fff, var(--accent-light)); }
.status-tile.bad { border-color: rgba(250, 82, 82, 0.35); background: linear-gradient(180deg, #fff, #fff5f5); }
.status-tile.warn { border-color: rgba(230, 119, 0, 0.35); background: linear-gradient(180deg, #fff, var(--primary-light)); }

.st-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.st-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-top: 6px;
  line-height: 1.2;
}

.status-tile.ok .st-value { color: var(--accent-dark); }
.status-tile.bad .st-value { color: var(--bad); }
.status-tile.warn .st-value { color: #e67700; }

.st-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  border-bottom: 1px solid var(--primary-light);
  background: linear-gradient(90deg, rgba(255, 244, 230, 0.6), transparent);
}

.card-title i {
  font-size: 17px;
  color: var(--primary);
  opacity: 0.9;
}

.cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  border-top: 1px solid rgba(255, 232, 204, 0.6);
  gap: 12px;
  transition: background 0.15s;
}

.cell:hover { background: rgba(255, 244, 230, 0.35); }

.cell:first-of-type { border-top: none; }

.cell-main { flex: 1; min-width: 0; }

.cell-title {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cell-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-secondary);
  opacity: 0.35;
  flex-shrink: 0;
}

.cell-dot.ok { background: var(--ok); opacity: 1; box-shadow: 0 0 0 2px rgba(64, 192, 87, 0.2); }
.cell-dot.bad { background: var(--bad); opacity: 1; box-shadow: 0 0 0 2px rgba(250, 82, 82, 0.15); }

.cell-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  word-break: break-all;
  padding-left: 15px;
}

.cell-value {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f8f9fa;
}

.cell-value.ok {
  color: var(--ok);
  font-weight: 600;
  background: var(--accent-light);
}

.cell-value.bad {
  color: var(--bad);
  font-weight: 600;
  background: #fff5f5;
}

.field {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 232, 204, 0.6);
}

.field:first-of-type { border-top: none; }

.field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  outline: none;
  font-size: 14px;
  background: var(--primary-light);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(81, 207, 102, 0.12);
}

.field textarea { min-height: 72px; resize: vertical; }

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

.field-input-wrap input {
  flex: 1;
  width: 100%;
  padding-right: 44px;
}

.btn-password-toggle {
  position: absolute;
  right: 6px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: color 0.15s, background 0.15s;
}

.btn-password-toggle:hover {
  color: var(--primary-dark);
  background: rgba(255, 159, 67, 0.12);
}

.switch {
  width: 44px;
  height: 24px;
  background: #dee2e6;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

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

.switch::after {
  content: "";
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.switch.on::after { left: 22px; }

.btn-block {
  display: block;
  width: 100%;
  padding: 14px;
  margin: 14px 0 10px;
  background: linear-gradient(90deg, var(--primary) 0%, #ffc078 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 159, 67, 0.32);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  letter-spacing: 0.04em;
}

.btn-block:hover {
  filter: brightness(1.04);
  box-shadow: 0 6px 18px rgba(255, 159, 67, 0.4);
}

.btn-block:active { transform: scale(0.99); }

.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 13px;
  margin-bottom: 12px;
  background: var(--card);
  color: var(--accent-dark);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.btn-outline:hover {
  background: var(--accent-light);
  border-color: var(--accent-dark);
}

/* —— 菜单网格 —— */
.menu-section { margin-bottom: 20px; }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 10px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.menu-item {
  position: relative;
  border: none;
  background: transparent;
  padding: 10px 6px 8px;
  cursor: pointer;
  text-align: center;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background 0.15s, transform 0.15s;
}

.menu-item:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.menu-item .ico {
  width: 42px;
  height: 42px;
  margin: 0 auto 8px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--primary-light), #fff);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 6px rgba(255, 159, 67, 0.1);
  transition: box-shadow 0.15s;
}

.menu-item:hover .ico { box-shadow: 0 4px 10px rgba(255, 159, 67, 0.18); }

.menu-item.on-green .ico {
  background: linear-gradient(145deg, var(--accent-light), #fff);
  color: var(--accent-dark);
  box-shadow: 0 2px 6px rgba(81, 207, 102, 0.12);
}

.menu-item.off { opacity: 0.5; }
.menu-item.off .ico { background: #f1f3f5; color: #adb5bd; box-shadow: none; }
.menu-item.off:hover { transform: none; background: #f8f9fa; }

.menu-item span {
  font-size: 11px;
  line-height: 1.35;
  display: block;
  font-weight: 500;
}

.menu-badge {
  display: inline-block;
  font-style: normal;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  margin-top: 5px;
  letter-spacing: 0.02em;
}

.menu-badge.on {
  color: var(--accent-dark);
  background: var(--accent-light);
}

.menu-badge.off {
  color: #868e96;
  background: #f1f3f5;
}

.toast {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(47, 53, 66, 0.88);
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13px;
  display: none;
  z-index: 99;
  white-space: nowrap;
}

.info-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(120deg, #fff 0%, var(--primary-light) 45%, var(--accent-light) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.info-banner::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 159, 67, 0.12), transparent 70%);
  pointer-events: none;
}

.info-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #ffc078);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255, 159, 67, 0.3);
}

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

.info-banner .label {
  font-size: 12px;
  color: var(--text-secondary);
}

.info-banner .value {
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
  color: var(--primary-dark);
}

.info-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.info-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 232, 204, 0.8);
}

.info-chip i { font-size: 13px; color: var(--primary); }

.info-chip.ok {
  color: var(--accent-dark);
  background: rgba(235, 251, 238, 0.9);
  border-color: rgba(81, 207, 102, 0.3);
}

.info-chip.off {
  color: var(--bad);
  background: rgba(255, 245, 245, 0.9);
  border-color: rgba(250, 82, 82, 0.25);
}

.info-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.info-badge.ok {
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(81, 207, 102, 0.35);
  box-shadow: 0 2px 6px rgba(81, 207, 102, 0.1);
}

.info-badge.bad {
  color: var(--bad);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(250, 82, 82, 0.25);
}

/* —— PC 平板 ≥768px —— */
@media (min-width: 768px) {
  .page-login { padding: 40px 24px; }

  .login-card {
    max-width: 420px;
    padding: 40px 36px 36px;
  }

  .page-app.show {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: 1fr;
    min-height: 100vh;
    padding-bottom: 0;
    max-width: none;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    box-shadow: 2px 0 12px rgba(255, 159, 67, 0.06);
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 20px;
    border-bottom: 1px solid var(--primary-light);
    margin-bottom: 16px;
  }

  .brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #ffc078);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
  }

  .brand-title { font-size: 16px; font-weight: 700; color: var(--primary-dark); }
  .brand-sub { font-size: 11px; color: var(--accent-dark); margin-top: 2px; }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: left;
    transition: background 0.15s, color 0.15s;
  }

  .nav-item i { font-size: 20px; width: 24px; text-align: center; }
  .nav-item:hover { background: var(--primary-light); color: var(--primary-dark); }
  .nav-item.active {
    background: linear-gradient(90deg, var(--primary-light), var(--accent-light));
    color: var(--primary-dark);
    font-weight: 600;
    border-left: 3px solid var(--primary);
    padding-left: 11px;
  }

  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    margin-top: auto;
    border-radius: 10px;
    font-size: 13px;
    color: var(--accent-dark);
    text-decoration: none;
    border: 1px dashed var(--accent);
    background: var(--accent-light);
    transition: background 0.15s;
  }

  .sidebar-link:hover { background: #d3f9d8; }

  .main-area {
    max-width: none;
    margin: 0;
    overflow-y: auto;
    min-height: 100vh;
  }

  .tabbar--mobile { display: none; }

  .page-body { padding: 20px 28px 32px; }

  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }

  .mod-grid:not(.mod-grid--list) {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .mod-grid--list { grid-template-columns: 1fr; max-width: 720px; }

  .agent-mod-grid--duo {
    grid-template-columns: repeat(2, 1fr);
    max-width: 560px;
  }

  .agent-cred-head,
  .agent-cred-row {
    grid-template-columns: minmax(140px, 2fr) minmax(80px, 1fr) minmax(80px, 1fr) 28px;
    padding: 14px 20px;
  }

  .mod-card:not(.mod-card--row):not(.mod-card--agent) {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 16px;
  }

  .mod-card:not(.mod-card--row):not(.mod-card--agent) .ico { margin-bottom: 2px; }

  .mod-card:not(.mod-card--row):not(.mod-card--agent) .mod-arrow {
    position: absolute;
    top: 14px;
    right: 14px;
  }

  .mod-card:not(.mod-card--row):not(.mod-card--agent) .mod-text { width: 100%; }

  .menu-grid { grid-template-columns: repeat(6, 1fr); }

  .page-body--grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .page-body--grid .span-full { grid-column: 1 / -1; }

  .toast { bottom: 32px; }

  .page-header { padding: 16px 28px; }
  .page-header h2 { text-align: left; padding-left: 8px; }

  .group-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

/* —— 大屏 PC ≥1200px —— */
@media (min-width: 1200px) {
  :root { --sidebar-w: 260px; }

  .page-body { padding: 24px 40px 40px; max-width: 1100px; }

  .mod-grid { grid-template-columns: repeat(5, 1fr); }

  .mod-card {
    padding: 20px 18px;
  }

  .menu-grid { grid-template-columns: repeat(8, 1fr); }

  .group-list { grid-template-columns: repeat(2, 1fr); }
}

/* —— 超小屏 H5 —— */
@media (max-width: 640px) {
  .status-tiles { grid-template-columns: 1fr; }
  .mod-card--agent .agent-mod-chips { padding-left: 0; }
  .agent-mod-grid--duo { grid-template-columns: 1fr; max-width: none; }
  .agent-cred-head { display: none; }
  .agent-cred-row {
    grid-template-columns: 1fr auto 28px;
    grid-template-rows: auto auto;
  }
  .agent-cred-name { grid-column: 1; grid-row: 1; }
  .agent-cred-uid { grid-column: 1; grid-row: 2; font-size: 12px; }
  .agent-cred-status { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .agent-cred-arrow { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
  .group-cred-row {
    grid-template-columns: 1fr auto 28px;
    grid-template-rows: auto auto;
  }
  .group-row-id { grid-column: 1; grid-row: 1; }
  .group-row-agent { grid-column: 1; grid-row: 2; font-size: 12px; }
  .agent-cred-row--toggle {
    grid-template-columns: 1fr 52px;
    grid-template-rows: auto auto;
  }
  .agent-cred-row--toggle .agent-cred-name { grid-column: 1; grid-row: 1; }
  .agent-cred-row--toggle .agent-cred-uid { grid-column: 1; grid-row: 2; font-size: 12px; }
  .agent-cred-row--toggle .switch { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}

@media (max-width: 480px) {
  .group-overview { grid-template-columns: 1fr; }
  .group-card__meta { grid-template-columns: 1fr; }
  .group-card__head { flex-wrap: wrap; }
  .group-tag { margin-left: 56px; }
}

@media (max-width: 360px) {
  .menu-grid { grid-template-columns: repeat(3, 1fr); }
  .mod-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .tabbar-item span { font-size: 10px; }
}
