/* 字体与 Glisse Liquid Glass 令牌/光学原语统一前置引入，保证全站深浅双模与排版基线一致。 */
@import url("./fonts.css");
@import url("./glisse.css?v=20261201b");

:root {
  /* 字号、版心与留白节奏令牌（色彩、玻璃材质与阴影由 glisse.css 统一维护深浅双模）。 */
  --text-heading: 17px;
  --text-body: 14px;
  --text-sm: 13px;
  --content-width: 1600px;
  --space-section: 20px;
  --space-block: 16px;
  --space-tight: 16px;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background: transparent;
  font-family: "Noto Sans SC", "Albert Sans", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
summary {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
h4 {
  margin-top: 0;
  color: var(--text);
  font-family: "Albert Sans", "Noto Sans SC", sans-serif;
  font-weight: 620;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-wrap: balance;
}

p {
  margin-top: 0;
}

code {
  padding: 2px 6px;
  color: var(--secondary-text);
  background: var(--secondary);
  border-radius: 7px;
  font-family: "SFMono-Regular", "SF Mono", "JetBrains Mono", monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

:focus-visible {
  outline: 2px solid var(--lg-ring);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 9px 14px;
  color: #ffffff;
  background: var(--lg-fill);
  border-radius: 999px;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* 悬浮液态玻璃顶栏：遵循 Glisse 悬浮 Toolbar 形态，让滚动内容与氛围背景穿过玻璃折射。 */
.app-shell {
  background: transparent;
}

.app-frame {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-nav-toggle {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 12px 0 4px;
  background: transparent;
  border: 0;
  box-shadow: none;
  pointer-events: none;
}

.app-topbar-inner {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  width: min(var(--content-width), calc(100% - 48px));
  min-height: 58px;
  margin: 0 auto;
  padding: 6px 12px 6px 16px;
  background-color: var(--lg-glass);
  border-radius: 22px;
  --lg-blur: 18px;
  --lg-saturate: 1.75;
  --lg-rim-shine: 0.34;
  box-shadow:
    inset 0 0 0 0.5px var(--lg-edge),
    0 10px 30px -10px var(--lg-shadow);
}

.app-topbar-inner.lg-glass[data-rim] {
  box-shadow: 0 10px 30px -10px var(--lg-shadow);
}

.brand,
.marketing-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark,
.marketing-brand-mark {
  display: block;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-family: "Albert Sans", "Noto Sans SC", sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.brand-copy small,
.brand-copy .brand-scope {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

/* 平台后台使用靛紫范围词区分企业工作台，避免引入顶部粗色条。 */
.app-shell-platform .brand-copy .brand-scope {
  color: var(--primary);
}

.app-primary-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 0;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 14px;
  color: var(--text-soft);
  border-radius: 999px;
  font-size: var(--text-body);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.nav-link:hover {
  color: var(--text);
  background: var(--lg-hover);
}

.nav-link.active {
  color: var(--primary);
  background: var(--lg-selection);
  box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--primary) 26%, transparent), inset 0 1px 0 var(--lg-surface-edge);
  font-weight: 600;
}

.nav-more {
  position: relative;
}

.nav-more > summary {
  list-style: none;
}

.nav-more > summary::-webkit-details-marker {
  display: none;
}

.nav-more-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 26px 6px 14px;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.nav-more-trigger::after,
.account-menu-trigger::after {
  position: absolute;
  top: 50%;
  right: 11px;
  width: 6px;
  height: 6px;
  content: "";
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  transition: transform 180ms ease;
}

.nav-more[open] > .nav-more-trigger::after,
.account-menu[open] > .account-menu-trigger::after {
  transform: translateY(-20%) rotate(225deg);
}

.nav-more-trigger:hover,
.nav-more-trigger.active,
.nav-more[open] > .nav-more-trigger {
  color: var(--text);
  background: var(--lg-hover);
}

.nav-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 60;
  display: grid;
  gap: 2px;
  min-width: 196px;
  padding: 8px;
  background-color: var(--lg-surface-elevated);
  border: 0;
  border-radius: 20px;
  --lg-glass: var(--lg-surface-elevated);
  --lg-blur: 22px;
  --lg-saturate: 1.85;
  box-shadow:
    inset 0 0 0 0.5px var(--lg-edge),
    0 18px 44px -8px var(--lg-shadow);
}

.nav-popover.lg-glass[data-rim] {
  box-shadow: 0 18px 44px -8px var(--lg-shadow);
}

.nav-more-menu {
  right: auto;
  left: 0;
}

.nav-popover-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 7px 12px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: var(--text-body);
  text-align: left;
  text-decoration: none;
  transition: color 140ms var(--ease-out), background-color 140ms var(--ease-out);
}

.nav-popover-link:hover,
.nav-popover-link.active {
  color: var(--text);
  background: var(--lg-highlight);
}

.account-menu-trigger {
  position: relative;
  display: grid;
  grid-template-columns: 32px auto;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 4px 28px 4px 5px;
  color: var(--text);
  background: var(--lg-within);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out);
}

.account-menu-trigger:hover,
.account-menu[open] > .account-menu-trigger {
  background: var(--lg-within-active);
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--lg-fill), color-mix(in srgb, var(--lg-fill) 72%, #38bdf8));
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35);
}

.account-summary {
  display: grid;
  gap: 0;
  min-width: 0;
}

.account-summary strong {
  max-width: 112px;
  overflow: hidden;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-summary small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.account-menu-panel {
  min-width: 220px;
}

.account-menu-identity {
  display: grid;
  gap: 1px;
  margin: 2px 4px 7px;
  padding: 4px 6px 10px;
  border-bottom: 1px solid var(--border);
}

.account-menu-identity strong {
  font-size: 13px;
}

.account-menu-identity span {
  color: var(--muted);
  font-size: 11px;
}

.account-menu-panel form {
  margin: 0;
}

.account-logout {
  color: var(--danger);
}

.app-nav-trigger {
  display: none;
}

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

.workspace {
  width: min(var(--content-width), calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

/* 标题与操作同一行，取消海报式大标题和装饰线，第一屏优先展示真实业务数据。 */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-header-copy {
  min-width: 0;
}

.eyebrow,
.section-kicker,
.marketing-hero-eyebrow {
  margin: 0 0 9px;
  color: var(--signal);
  font-family: "Albert Sans", "Noto Sans SC", sans-serif;
  font-size: 12px;
  font-weight: 480;
}

.page-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 680;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.page-intro p {
  max-width: 65ch;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: var(--text-body);
}

/* 辅助计数与时间范围统一使用纯排版元信息，取代装饰性空心胶囊。 */
.page-meta,
.section-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 450;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.page-meta strong,
.section-meta strong {
  color: var(--text);
  font-weight: 620;
}

.meta-sep {
  color: var(--border-strong);
}

.page-header-actions,
.hero-action-cluster,
.form-actions-inline,
.actions,
.chip-row,
.metric-inline,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.page-header-actions,
.hero-action-cluster {
  justify-content: flex-end;
}

/* 模块内分段导航：遵循 Glisse SegmentedControl 胶囊轨道 + 滑动液态药丸指示器。 */
.section-tabs {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 0 0 18px;
  padding: 4px;
  background: var(--lg-segment-track);
  border: 0.5px solid var(--lg-edge);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(12px) saturate(1.5);
  backdrop-filter: blur(12px) saturate(1.5);
  box-shadow: inset 0 1px 2px var(--lg-field-inner);
}

.section-tab {
  position: relative;
  z-index: 1;
  padding: 6px 16px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: 999px;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.section-tab:hover {
  color: var(--text);
}

.section-tab.active {
  color: var(--text);
  background: var(--lg-segment-thumb);
  font-weight: 600;
  box-shadow: 0 1px 4px rgb(15 23 42 / 0.1), inset 0 1px 0 var(--lg-surface-edge);
}

/* 滑动液态指示器激活后由 .lg-seg-indicator 绘制胶囊底板，避免与激活项背景叠影。 */
.section-tabs:has(> .lg-seg-indicator) .section-tab.active {
  background: transparent;
  box-shadow: none;
}

/* L2 液态磨砂业务表面：半透明磨砂 + 顶沿高光描边，保持数据容器静止无跳动。 */
.page-section {
  min-width: 0;
  margin-bottom: var(--space-section);
  padding: 20px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(18px) saturate(1.45);
  backdrop-filter: blur(18px) saturate(1.45);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.page-section:last-child {
  margin-bottom: 0;
}

.editor-surface {
  min-width: 0;
  margin-bottom: var(--space-section);
  padding: 20px;
  background: var(--surface-strong);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* 编辑器和工具面板复用同一表面，内部小节不再生成阴影与嵌套卡片。 */
.work-surface,
.panel {
  margin-bottom: var(--space-block);
  padding: 20px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(18px) saturate(1.45);
  backdrop-filter: blur(18px) saturate(1.45);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.work-surface .work-surface,
.work-surface .subsection,
.subsection {
  /* 网格子项允许收缩到当前列宽，宽表只滚动 table-scroll，不能反向撑开整页。 */
  min-width: 0;
  margin-bottom: 0;
  padding: 16px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.work-surface + .work-surface,
.panel + .panel {
  margin-top: var(--space-block);
}

.section-head,
.toolbar,
.app-modal-head,
.plugin-binding-card-head,
.chatroom-scope-card-head,
.wechat-action-result-head,
.chatroom-scope-editor-head,
.chatroom-json-hint-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.section-head {
  align-items: center;
}

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

.section-head h2,
.toolbar h2,
.info-panel h3,
.login-card h1,
.login-card h2,
.app-modal-head h2 {
  margin: 0;
  font-size: var(--text-heading);
  font-weight: 620;
  letter-spacing: -0.015em;
}

.muted-text,
.event-list p {
  color: var(--muted);
}

.muted-text {
  margin: 6px 0 0;
  font-size: var(--text-sm);
}

.top-gap {
  margin-top: var(--space-tight);
}

.notice-card,
.marketing-notice {
  margin-bottom: 20px;
  padding: 13px 16px;
  color: var(--text);
  background: var(--surface);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.notice-card p,
.marketing-notice p {
  margin: 5px 0 0;
}

.notice-card-danger,
.notice-danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 24%, transparent);
}

.action-feedback .action-feedback-icon-info,
.action-feedback[data-state="info"] .directory-sync-icon-working {
  display: none;
}

.action-feedback[data-state="info"] .action-feedback-icon-info {
  display: block;
}

.action-zone {
  background: var(--danger-soft);
}

/* Glisse 胶囊按钮：主操作采用品牌实色玻璃，次要操作采用 Field Glass，危险操作采用红透玻璃。 */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--lg-fill);
  border: 1px solid color-mix(in srgb, #ffffff 18%, transparent);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.28),
    0 2px 6px color-mix(in srgb, var(--lg-fill) 28%, transparent),
    0 8px 20px -6px color-mix(in srgb, var(--lg-fill) 36%, transparent);
  cursor: pointer;
  font-size: var(--text-body);
  font-weight: 560;
  text-decoration: none;
  --lg-press-stretch: none;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.btn:hover {
  background: color-mix(in srgb, var(--lg-fill) 88%, #ffffff);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.34),
    0 6px 20px -4px color-mix(in srgb, var(--lg-fill) 42%, transparent);
}

.btn:active,
.btn[data-pressed] {
  background: color-mix(in srgb, var(--lg-fill) 85%, #000000);
}

.btn:focus-visible {
  outline: 2px solid var(--lg-ring);
  outline-offset: 2px;
}

.btn-secondary,
.btn-ghost {
  color: var(--text);
  background: var(--lg-field-glass);
  border-color: var(--border);
  box-shadow:
    inset 0 1px 0 var(--lg-surface-edge),
    0 1px 3px var(--lg-drop);
}

.btn-secondary:hover,
.btn-ghost:hover {
  color: var(--text);
  background: var(--lg-field-glass-active);
  border-color: var(--border-strong);
  box-shadow:
    inset 0 1px 0 var(--lg-surface-edge),
    0 4px 12px -4px var(--lg-drop);
}

.btn-secondary:active,
.btn-secondary[data-pressed],
.btn-ghost:active,
.btn-ghost[data-pressed] {
  background: var(--lg-within-active);
}

.btn-danger {
  color: #ffffff;
  background: color-mix(in srgb, var(--lg-destructive) 88%, transparent);
  border-color: color-mix(in srgb, #ffffff 18%, transparent);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.28),
    0 6px 18px -4px color-mix(in srgb, var(--lg-destructive) 36%, transparent);
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--lg-destructive) 80%, #ffffff);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.32),
    0 8px 22px -4px color-mix(in srgb, var(--lg-destructive) 42%, transparent);
}

/* 次要的风险操作(如删除):红字浅红透玻璃,不抢主操作的视线,悬停才加深。 */
.btn-danger-soft {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 22%, transparent);
  box-shadow: none;
}

.btn-danger-soft:hover {
  color: #ffffff;
  background: color-mix(in srgb, var(--lg-destructive) 86%, transparent);
  border-color: transparent;
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--lg-destructive) 32%, transparent);
}

.btn-small {
  min-height: 32px;
  padding: 0 13px;
  font-size: var(--text-sm);
  border-radius: 999px;
}

.btn.is-disabled,
.btn[aria-disabled="true"],
.btn:disabled {
  pointer-events: none;
  opacity: 0.42;
  box-shadow: none;
}

/* 状态标签仅用于表格状态列与控件语义反馈，采用半透明胶囊微标并保障双主题对比度。 */
.chip,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 9px;
  color: var(--secondary-text);
  background: var(--secondary);
  border: 1px solid color-mix(in srgb, var(--secondary-text) 18%, transparent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 560;
  line-height: 1.25;
}

.chip-outline,
.btn-ghost {
  color: var(--text-soft);
  background: var(--lg-field-glass);
  border-color: var(--border);
}

.chip-muted {
  color: var(--muted);
  background: var(--surface-muted);
  border-color: var(--border);
}

.chip-success,
.badge-running,
.badge-healthy,
.badge-enabled,
.badge-info {
  color: var(--success);
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 22%, transparent);
}

.badge-warning {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: color-mix(in srgb, var(--warning) 26%, transparent);
}

.badge-error,
.badge-critical,
.badge-stopped,
.badge-disabled {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 24%, transparent);
}

.chip-action {
  color: #ffffff;
  background: var(--lg-fill);
  border-color: transparent;
  text-decoration: none;
}

.stats-grid,
.metrics-grid,
.metric-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* 顶部指标条合并为单一 L2 磨砂玻璃网格带，内部采用透明底与极细发丝分割线。 */
.metric-band {
  gap: 0;
  margin-bottom: var(--space-section);
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  -webkit-backdrop-filter: blur(18px) saturate(1.45);
  backdrop-filter: blur(18px) saturate(1.45);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.dashboard-overview {
  margin-bottom: var(--space-section);
}

.dashboard-overview .section-head {
  padding: 0 2px;
}

/* 企业总览的双列业务表面由网格统一拉伸，内容高度不依赖固定值。 */
.overview-card-grid {
  align-items: stretch;
  margin-bottom: var(--space-section);
}

.overview-card-grid > .page-section {
  display: flex;
  align-self: stretch;
  flex-direction: column;
  min-height: 0;
  margin: 0;
}

.overview-card-grid > .page-section + .page-section {
  margin-top: 0;
}

.dashboard-kpi-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-band-compact {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
  margin: 14px 0 0;
  padding: 14px 0 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

/* 卡片内部的补充指标保持平面，不在白色业务卡片中再次叠加浮起卡片。 */
.metric-band-compact .metric-item {
  padding: 8px 0;
  background: transparent;
  box-shadow: none;
}

.page-section .metric-item,
.work-surface .metric-item,
.panel .metric-item {
  padding: 8px 0;
  background: transparent;
  box-shadow: none;
}

.metric-item-primary strong {
  color: var(--primary-strong);
}

.metric-item-danger strong {
  color: var(--danger);
}

.metric-item {
  min-width: 0;
  padding: 18px 20px;
  background: transparent;
  border-radius: 0;
  box-shadow: -1px 0 0 var(--border), 0 -1px 0 var(--border);
}

.metric-item span {
  display: block;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 500;
}

.metric-item strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-family: "Albert Sans", "Noto Sans SC", sans-serif;
  font-size: 32px;
  font-weight: 660;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.metric-item .muted-text {
  margin-top: 6px;
  font-size: var(--text-sm);
  line-height: 1.4;
}

/* 平台概览把说明推到指标项底部，文案长度不同时仍保持统一的阅读基线。 */
.platform-metric-band .metric-item {
  display: flex;
  flex-direction: column;
}

.platform-metric-band .metric-item .muted-text {
  margin-top: auto;
  padding-top: 6px;
}

/* 平台大盘使用大业务表面承载同一分析链路，内部图表和统计项保持单层结构。 */
.analytics-page-actions,
.analytics-range-control,
.analytics-chart-legend,
.analytics-chart-axis {
  display: flex;
  align-items: center;
}

.analytics-page-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.analytics-range-control {
  padding: 3px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.analytics-range-option {
  min-width: 70px;
  padding: 6px 12px;
  color: var(--text-soft);
  border-radius: 7px;
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.analytics-range-option:hover {
  color: var(--text);
}

.analytics-range-option.active {
  color: var(--primary-strong);
  background: var(--surface);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), inset 0 0 0 1px var(--border);
}

.platform-analytics-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding: 0;
}

.platform-analytics-kpis .metric-item {
  min-height: 112px;
}

.platform-analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: var(--space-section);
}

.platform-analytics-surface {
  min-width: 0;
  margin-bottom: var(--space-section);
  padding: 0;
}

.platform-analytics-surface > .platform-analytics-grid {
  margin-bottom: 0;
}

/* 平台分析按业务分区各自成面，外层只负责布局，保证相邻卡片分开且高度对齐。 */
.platform-analytics-surface .page-section {
  margin: 0;
}

.platform-analytics-grid > .page-section {
  margin-bottom: 0;
}

.platform-analytics-chart-grid {
  gap: 16px;
}

.analytics-chart-section {
  min-width: 0;
}

.analytics-chart-total {
  display: grid;
  justify-items: end;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}

.analytics-chart-total strong {
  font-family: "Albert Sans", "Noto Sans SC", sans-serif;
  font-size: 28px;
  font-weight: 660;
  letter-spacing: -0.025em;
  line-height: 1;
}

.analytics-chart-total span,
.analytics-chart-legend,
.analytics-chart-axis {
  color: var(--muted);
  font-size: var(--text-sm);
}

.analytics-chart-axis {
  font-size: 12px;
}

.analytics-chart-legend {
  gap: 18px;
  margin: -6px 0 14px;
}

.analytics-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-line {
  display: inline-block;
  width: 18px;
  height: 2px;
  background: var(--primary);
}

.legend-line-info {
  background: var(--info);
}

.legend-line-wood {
  background: var(--warning);
}

.analytics-chart-shell {
  position: relative;
  width: 100%;
  height: 210px;
  padding-bottom: 26px;
}

.analytics-chart {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.analytics-chart-grid-line,
.analytics-chart-baseline {
  stroke: var(--border);
  stroke-width: 0.75;
  vector-effect: non-scaling-stroke;
}

.analytics-chart-grid-line {
  stroke-dasharray: 2 3;
  opacity: 0.7;
}

.analytics-chart-area {
  stroke: none;
}

.analytics-chart-area-info {
  fill: rgba(73, 107, 168, 0.08);
}

.analytics-chart-area-primary {
  fill: rgba(99, 102, 241, 0.08);
}

.analytics-chart-series {
  fill: none;
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.analytics-chart-series-info {
  stroke: var(--info);
}

.analytics-chart-series-wood {
  stroke: var(--warning);
}

.analytics-chart-axis {
  position: absolute;
  right: 2%;
  bottom: 0;
  left: 2%;
  justify-content: space-between;
  font-family: "Albert Sans", "Noto Sans SC", sans-serif;
  font-variant-numeric: tabular-nums;
}

.platform-analytics-operations-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
}

.analytics-funnel {
  display: grid;
  gap: 10px;
}

.analytics-funnel-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(80px, 2fr) minmax(72px, 0.55fr);
  align-items: center;
  gap: 12px;
  min-height: 42px;
}

.analytics-funnel-label,
.analytics-funnel-value,
.analytics-health-tenant {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.analytics-funnel-label span,
.analytics-funnel-value span,
.analytics-summary-item span,
.analytics-health-tenant small,
.analytics-ranking-table small {
  color: var(--muted);
  font-size: 12px;
}

.analytics-funnel-label strong,
.analytics-funnel-value strong {
  font-size: var(--text-body);
  font-weight: 560;
}

.analytics-funnel-track {
  height: 8px;
  overflow: hidden;
  background: var(--primary-soft);
  border-radius: 999px;
}

.analytics-funnel-fill {
  display: block;
  min-width: 3px;
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}

.analytics-funnel-value {
  justify-items: end;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
}

.analytics-summary-item {
  display: grid;
  align-content: space-between;
  gap: 6px;
  min-height: 72px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.analytics-summary-item strong {
  font-family: "Albert Sans", "Noto Sans SC", sans-serif;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.analytics-summary-item-wide {
  grid-column: 1 / -1;
}

.analytics-table {
  min-width: 760px;
}

.analytics-ranking-table {
  min-width: 1060px;
}

.analytics-ranking-table small {
  display: block;
  margin-top: 4px;
}

.analytics-quota-value {
  font-variant-numeric: tabular-nums;
}

.platform-analytics-health-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  margin-bottom: 0;
}

.analytics-health-list {
  border-top: 1px solid var(--border);
}

.analytics-health-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  padding: 12px 6px;
  color: var(--text-soft);
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.analytics-health-row:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.analytics-health-index {
  color: var(--signal);
  font-family: "Albert Sans", sans-serif;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.analytics-health-tenant strong {
  overflow: hidden;
  font-size: var(--text-body);
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(189, 66, 96, 0.18);
}

.badge-muted {
  color: var(--muted);
  background: var(--surface-muted);
  border-color: var(--border);
}

.text-link {
  color: var(--primary-strong);
  font-size: var(--text-sm);
  font-weight: 560;
  text-decoration: none;
  transition: color 160ms var(--ease-out);
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ranking-value {
  color: var(--text);
  font-family: "Albert Sans", "Noto Sans SC", sans-serif;
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.metric-item-accent {
  color: var(--primary-strong);
  background: transparent;
}

.danger-soft {
  color: var(--danger);
  background: transparent;
}

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

.time-metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-value-time,
.metric-item-time strong,
.metric-item-text strong {
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.panel-grid,
.detail-grid,
.provider-action-grid,
.plugin-detail-meta-grid,
.chatroom-scope-grid,
.chatroom-scope-notes,
.wechat-action-code-grid {
  display: grid;
  gap: 20px;
}

.panel-grid,
.panel-grid-balanced,
.detail-grid,
.plugin-detail-meta-grid,
.wechat-action-code-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-grid-wide {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
}

.provider-action-grid,
.chatroom-scope-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.table-scroll,
.record-scroll-panel,
.record-scroll-panel-md,
.record-scroll-panel-lg {
  max-width: 100%;
  overflow: auto;
}

.record-scroll-panel-md {
  max-height: 520px;
}

.record-scroll-panel-lg {
  max-height: 680px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-soft);
  background: transparent;
  font-size: var(--text-body);
  font-variant-numeric: tabular-nums;
}

.table th,
.table td {
  padding: 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.table th {
  color: var(--muted);
  background: transparent;
  border-bottom: 1px solid var(--border-strong);
  font-size: var(--text-sm);
  font-weight: 560;
  white-space: nowrap;
}

.table tbody tr {
  transition: background-color 160ms var(--ease-out);
}

.table tbody tr:hover {
  background: var(--surface-soft);
}

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

.table-tight {
  font-size: var(--text-sm);
}

.table-tight th,
.table-tight td {
  padding: 10px 8px;
}

/* 群资料在既有工作表面内分组，长公告保留段落并自然换行，不叠加卡片或固定正文高度。 */
.chatroom-profile {
  display: grid;
  gap: 20px;
}

.chatroom-profile-section {
  min-width: 0;
}

.chatroom-profile-section .section-head {
  align-items: center;
  justify-content: flex-start;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chatroom-profile-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  margin: 0;
}

.chatroom-profile-facts > div {
  min-width: 0;
}

.chatroom-profile-facts dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

.chatroom-profile-facts dd {
  margin: 0;
  color: var(--text-soft);
  overflow-wrap: anywhere;
  font-size: 14px;
}

.chatroom-notice-body {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chatroom-notice-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.chatroom-notice-meta {
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}

.chatroom-profile-technical {
  margin-top: 20px;
  overflow-wrap: anywhere;
}

/* 邀请图谱沿用群详情单一表面。画布单独承载平移缩放，关系与成员资料不撑开整页。 */
.invitation-panel {
  min-width: 0;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.invitation-panel [hidden] {
  display: none !important;
}

.invitation-panel-head,
.invitation-summary,
.invitation-toolbar,
.invitation-controls,
.invitation-caption,
.invitation-inspector-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.invitation-panel-head,
.invitation-toolbar,
.invitation-caption,
.invitation-inspector-head {
  justify-content: space-between;
}

.invitation-panel-head h3,
.invitation-inspector-head h4 {
  margin: 0;
}

.invitation-summary {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.invitation-summary > span:first-child {
  color: var(--primary-strong);
  font-weight: 600;
}

/* 同步工具与状态共用后台的轻量表面，窄屏自然换行，不挤占图谱画布。 */
.invitation-actions,
.invitation-sync-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.invitation-actions form {
  margin: 0;
}

.invitation-sync {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 13px;
}

.invitation-sync p {
  margin: 0;
  overflow-wrap: anywhere;
}

.invitation-sync progress {
  display: block;
  width: 100%;
  height: 6px;
  margin: 10px 0;
  accent-color: var(--primary-strong);
}

.invitation-sync .muted-text,
.invitation-time-hint {
  margin-top: 8px;
  font-size: 12px;
}

.invitation-toolbar {
  align-items: flex-end;
  margin: 16px 0 12px;
}

.invitation-search {
  position: relative;
  flex: 1 1 240px;
  min-width: 0;
  max-width: 320px;
}

.invitation-search label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-soft);
  font-size: 12px;
}

.invitation-search input {
  /* 独立搜索框沿用后台输入材质，避免脱离表单容器后退回浏览器默认的直角边框。 */
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.invitation-search input:focus-visible {
  outline: none;
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}

.invitation-controls {
  gap: 6px;
}

.invitation-controls .btn {
  min-width: 44px;
  min-height: 44px;
}

.invitation-scale {
  min-width: 40px;
  color: var(--text-soft);
  font-size: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.invitation-search-results {
  position: absolute;
  z-index: 12;
  top: 100%;
  right: 0;
  left: 0;
  max-height: 280px;
  margin: 6px 0 0;
  padding: 6px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 44px rgba(72, 82, 140, .12);
  list-style: none;
}

.invitation-search-results button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.invitation-search-results button:hover {
  background: var(--primary-soft);
}

.invitation-search-results small {
  display: block;
  color: var(--muted);
}

.invitation-search-status {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.invitation-search-status:empty {
  display: none;
}

.invitation-viewport {
  position: relative;
  min-width: 0;
  background-color: var(--surface-soft);
  background-image: radial-gradient(var(--border-strong) .8px, transparent .8px);
  background-size: 20px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.invitation-graph-scene {
  position: relative;
  transform-origin: 0 0;
}

.invitation-graph-nodes,
.invitation-unlinked-nodes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(248px, 100%), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.invitation-graph-nodes {
  padding: 12px;
}

.invitation-graph-node {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(72, 82, 140, .045);
}

.invitation-graph-node.is-related {
  border-color: var(--border-strong);
}

.invitation-graph-node.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .14);
}

/* 图谱卡片保留身份摘要，完整昵称和成员 ID 由详情承载；布局仍按实际高度留出连线。 */
.invitation-member {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 12px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 14px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.invitation-member:hover {
  background: var(--surface-soft);
}

.invitation-member .identity-cell {
  display: flex;
  min-width: 0;
  align-items: flex-start;
}

.invitation-member .identity-text {
  min-width: 0;
}

.invitation-member .identity-id,
.invitation-member .identity-name {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}

.invitation-member .identity-id {
  margin-top: 2px;
  font-size: 11px;
}

.invitation-member-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.invitation-member-tags,
.invitation-member-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.invitation-member-tags {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.invitation-member-tags:empty {
  display: none;
}

.invitation-member-footer {
  justify-content: space-between;
  min-height: 44px;
  padding: 0 8px 0 12px;
  border-top: 1px solid var(--border);
}

.invitation-count {
  min-height: 44px;
  padding: 0;
  color: var(--primary-strong);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.invitation-count:hover {
  text-decoration: underline;
}

.invitation-group-summary {
  border-style: dashed;
  border-color: var(--border-strong);
}

.invitation-group-summary strong,
.invitation-group-action {
  display: block;
}

.invitation-group-action {
  margin-top: 12px;
  color: var(--primary-strong);
  font-size: 12px;
}

.invitation-group-avatars {
  display: flex;
  margin-bottom: 10px;
  padding-left: 6px;
}

.invitation-group-avatars .identity-avatar {
  width: 30px;
  height: 30px;
  margin-left: -6px;
  border: 2px solid var(--surface);
  font-size: 12px;
}

.invitation-branch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 64px;
  min-height: 44px;
  padding: 0 6px;
  color: var(--primary-strong);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.invitation-branch:hover {
  background: var(--primary-soft);
}

.invitation-branch[aria-expanded="true"] .i {
  transform: rotate(90deg);
}

.invitation-graph-edges {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  color: #9ba7c5;
  overflow: visible;
  pointer-events: none;
}

.invitation-graph-edges g > path {
  fill: none;
  stroke: #9ba7c5;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.invitation-graph-edges g > path.is-highlighted {
  stroke: var(--primary);
  stroke-width: 2;
}

/* 仅在交互脚本就绪后启用绝对定位；无脚本时卡片保持网格，关系文字仍然可阅读。 */
.invitation-panel.is-ready .invitation-viewport:not(.is-empty) {
  height: 440px;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

.invitation-panel.is-ready .invitation-graph-nodes {
  display: block;
  position: absolute;
  inset: 0;
  padding: 0;
}

.invitation-panel.is-ready .invitation-graph-nodes > .invitation-graph-node {
  position: absolute;
  width: 248px;
}

.invitation-panel.is-ready .invitation-graph-edges {
  display: block;
}

.invitation-panel.is-ready .invitation-viewport.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.invitation-caption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.invitation-caption > span:first-child {
  color: var(--text-soft);
}

.invitation-empty {
  display: flex;
  min-height: 180px;
  padding: 24px 20px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.invitation-empty > .i {
  color: var(--primary);
  font-size: 24px;
}

.invitation-empty p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.invitation-inspector {
  min-width: 0;
  margin-top: 12px;
  padding: 14px;
  background: var(--surface-soft);
  border-radius: 12px;
}

.invitation-focus-bar,
.invitation-member-browser-tools,
.invitation-member-pagination,
.invitation-inspector-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.invitation-focus-bar {
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 10px 12px;
  color: var(--primary-strong);
  background: var(--surface-soft);
  border-radius: 12px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.invitation-focus-bar > span {
  flex: 1 1 200px;
  min-width: 0;
}

.invitation-member-browser {
  min-width: 0;
  margin-top: 12px;
  padding: 14px;
  background: var(--surface-soft);
  border-radius: 12px;
}

.invitation-member-browser h4 {
  margin: 0;
}

.invitation-member-browser-tools {
  justify-content: space-between;
  margin: 16px 0 12px;
  font-size: 12px;
}

.invitation-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr));
  gap: 10px;
  max-height: min(500px, 60dvh);
  margin: 0;
  padding: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}

.invitation-member-grid > li {
  min-width: 0;
}

.invitation-member-grid button {
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 12px;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.invitation-member-grid button:hover,
.invitation-member-grid button[aria-pressed="true"] {
  border-color: var(--primary);
}

.invitation-member-grid small,
.invitation-member-grid .muted-text {
  color: var(--muted);
  font-size: 12px;
}

.invitation-member-grid .identity-cell,
.invitation-member-grid .identity-text {
  min-width: 0;
  max-width: 100%;
}

.invitation-member-grid .identity-cell {
  align-items: flex-start;
}

.invitation-member-grid .identity-name,
.invitation-member-grid small {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* 极长昵称只占两行，避免一个成员撑高整排；点击后仍可查看完整文字。 */
.invitation-member .identity-name,
.invitation-member-grid .identity-name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.invitation-member-pagination {
  justify-content: flex-end;
  margin-top: 12px;
}

.invitation-inspector-actions {
  margin-top: 16px;
}

.invitation-inspector-head {
  align-items: flex-start;
  flex-wrap: nowrap;
}

.invitation-inspector-head > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.invitation-inspector-head h4 {
  font-size: 14px;
}

.invitation-inspector-head p {
  margin: 2px 0 0;
  font-size: 12px;
}

.invitation-inspector-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 12px 0 0;
}

.invitation-inspector-facts dt {
  color: var(--muted);
  font-size: 12px;
}

.invitation-inspector-facts dd {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.invitation-inspector-description {
  grid-column: 1 / -1;
}

.invitation-inspector-description dd {
  white-space: pre-wrap;
}

.invitation-unlinked {
  margin-top: 12px;
}

.invitation-unlinked > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 32px 8px 0;
  color: var(--text-soft);
  font-size: 13px;
}

.invitation-unlinked > summary span {
  color: var(--muted);
}

.invitation-unlinked > p {
  margin: 4px 0 12px;
  font-size: 12px;
}

.app-modal.invitation-graph-dialog {
  width: min(1480px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
}

.invitation-graph-dialog .app-modal-card {
  max-height: calc(100dvh - 32px);
  padding: 20px;
}

.invitation-panel.is-ready .invitation-graph-dialog .invitation-viewport:not(.is-empty) {
  height: min(62dvh, 700px);
}

/* 多列名册保留可读列宽；长名字在身份列内换行，角色和状态不被挤成逐字竖排。 */
.chatroom-members-table {
  min-width: 880px;
}

.chatroom-members-table td:first-child {
  min-width: 210px;
  max-width: 280px;
}

.chatroom-members-table td:nth-child(2) {
  min-width: 100px;
  max-width: 180px;
  overflow-wrap: anywhere;
}

.chatroom-members-table .identity-name,
.chatroom-members-table .identity-id {
  white-space: normal;
  overflow-wrap: anywhere;
}

.chatroom-members-table .member-inviter {
  min-width: 140px;
  max-width: 220px;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  /* 手机基本资料单列展示，让长群名与公告始终在当前视口内换行。 */
  .chatroom-profile-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .invitation-search {
    flex-basis: 100%;
    max-width: none;
  }

  .invitation-controls {
    width: 100%;
  }

  .invitation-controls > .btn-small {
    flex: 1 0 auto;
  }

  .invitation-panel.is-ready .invitation-viewport:not(.is-empty) {
    height: 380px;
  }

  .invitation-inspector-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-modal.invitation-graph-dialog {
    width: calc(100vw - 16px);
  }

  .invitation-graph-dialog .app-modal-card {
    padding: 16px;
  }

  .invitation-panel.is-ready .invitation-graph-dialog .invitation-viewport:not(.is-empty) {
    height: 54dvh;
  }
}

.col-id,
.col-count,
.col-bool,
.col-dir,
.col-type,
.col-status,
.col-action,
.col-compact {
  width: 1%;
  white-space: nowrap;
}

.col-time {
  width: 148px;
  white-space: nowrap;
}

.table-actions {
  min-width: 136px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.form-grid.points-ledger-filter {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  margin-bottom: 16px;
}

.delta-positive {
  color: var(--success);
  font-variant-numeric: tabular-nums;
}

.delta-negative {
  color: var(--danger);
  font-variant-numeric: tabular-nums;
}

/* 管理清单只保留低对比行分隔，连续数据不采用逐行阴影和大块留白。 */
.record-list {
  border-top: 1px solid var(--border);
}

.record-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.1fr) minmax(0, 3fr) 40px;
  align-items: center;
  gap: 16px;
  min-height: 66px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
}

.record-row:last-child {
  border-bottom: 0;
}

.record-primary {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.record-primary strong {
  overflow: hidden;
  font-size: var(--text-body);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-primary > span {
  color: var(--muted);
  font-size: var(--text-sm);
}

.ai-provider-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.ai-provider-row .record-primary > span,
.ai-provider-models {
  min-width: 0;
  overflow-wrap: anywhere;
}

.media-library-bar, .media-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 20px 0;
}
/* 批量操作共享居中轴；窄屏自然换行，复选框与文字也保持垂直居中。 */
.media-library-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.media-library-actions form { display: flex; align-items: center; margin: 0; }
.media-library-actions .checkbox-field { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; align-items: start; }
.media-grid.is-masonry { grid-auto-rows: 1px; grid-auto-flow: row dense; row-gap: 0; }
.media-tile { position: relative; min-width: 0; align-self: start; }
.media-tile:has(.media-info[open]) { z-index: 5; }
.media-preview {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-muted);
  color: var(--text-soft);
}
.media-open { position: relative; display: block; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.media-open:focus-visible { outline: 2px solid var(--primary); outline-offset: -4px; }
.media-open img { display: block; width: 100%; height: auto; }
.media-open img[hidden] { display: none; }
.media-tile-video .media-open { min-height: 160px; }
.media-tile-video .media-open:has(img:not([hidden])) { min-height: 0; }
.media-tile-audio .media-preview, .media-tile-file .media-preview { padding: 60px 12px 18px; min-height: 132px; }
.media-video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}
.media-preview audio { width: 100%; min-width: 0; }
.media-play-error { padding: 0 10px; font-size: 12px; }
/* 文件信息浮层不占瀑布流高度，点击和键盘都能打开；同一时间只展开一项。 */
/* 图片上的选择与信息入口不绘制外框，仍保留 44px 点击区域和键盘焦点。 */
.media-info { position: absolute; inset: 8px 8px auto; pointer-events: none; }
.media-info summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  color: var(--text);
  font-size: 22px;
  list-style: none;
  cursor: pointer;
  pointer-events: auto;
}
.media-info summary::-webkit-details-marker { display: none; }
.media-info summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.media-info-panel {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding: 14px;
  max-height: min(340px, 60vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  pointer-events: auto;
}
.media-file-title, .media-file-meta { overflow-wrap: anywhere; min-width: 0; }
.media-file-meta { display: grid; gap: 3px; color: var(--muted); font-size: 12px; }
.media-tile-select {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  cursor: pointer;
}
.media-tile-select input, .media-library-bar input { width: 18px; height: 18px; margin: 0; }
.media-tile:has([data-media-select]:checked) .media-preview { outline: 2px solid var(--primary); outline-offset: 2px; }
/* 图片尚未加载完成前隐藏左上勾选和右上信息图标，避免图片未撑开时两枚浮层图标堆叠在一起。 */
.media-tile-image .media-tile-select,
.media-tile-image .media-info {
  transition: opacity 150ms ease;
}
.media-tile-image.is-loading .media-tile-select,
.media-tile-image.is-loading .media-info {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.media-pagination { justify-content: center; margin-bottom: 0; }
.media-grid > .wechat-empty { grid-column: 1 / -1; }
.media-dedup-name { overflow-wrap: anywhere; white-space: normal; }
@media (max-width: 1100px) {
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-library .btn { min-height: 44px; }
}
@media (max-width: 560px) {
  .media-grid { grid-template-columns: minmax(0, 1fr); }
  .media-tile-select input, .media-library-bar input { min-width: 24px; min-height: 24px; }
}

.record-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 12px 18px;
  min-width: 0;
  margin: 0;
}

.record-meta div {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
}

.record-meta dt {
  color: var(--muted);
  font-size: var(--text-sm);
}

.record-meta dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: var(--text-body);
  overflow-wrap: anywhere;
}

.record-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 40px;
}

.record-actions form {
  margin: 0;
}

.record-action-trigger {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.record-action-trigger:hover,
.record-action-menu[open] > .record-action-trigger {
  color: var(--text);
  background: var(--primary-soft);
}

.record-action-popover {
  min-width: 168px;
}

.record-action-popover form {
  margin: 0;
}

.record-link {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.record-link:hover {
  text-decoration: underline;
}

/* 账号接入使用三项连续指标和自适应记录行，窄屏不创建固定宽度表格。 */
.account-metric-band {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.account-record-row {
  /* 操作列固定宽度(两个按钮:详情 + 删除),保证每行的数据列对齐。 */
  grid-template-columns: minmax(180px, 1.05fr) minmax(0, 2.8fr) 112px;
}

.account-presence {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.account-presence-badge {
  gap: 6px;
  font-weight: 600;
}

.account-presence-badge.badge-warning {
  color: var(--warning);
}

.account-presence-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.account-presence-time {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* 代理池使用四项连续指标和高密度开放列表，状态变化不会改变记录行结构。 */
.proxy-metric-band {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.proxy-record-row {
  grid-template-columns: minmax(170px, 0.9fr) minmax(0, 3.8fr) 40px;
}

.proxy-record-meta {
  grid-template-columns: minmax(130px, 1.1fr) minmax(130px, 1fr) repeat(4, minmax(90px, 0.8fr));
}

.proxy-form-grid {
  align-items: end;
}

.account-empty-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.connection-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 20px;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.connection-step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 15px 18px;
  color: var(--muted);
}

.connection-step:not(:last-child)::after {
  position: absolute;
  top: 17px;
  right: 0;
  bottom: 17px;
  width: 1px;
  content: "";
  background: var(--border);
}

.connection-step span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  color: var(--muted);
  background: var(--surface-muted);
  border-radius: 50%;
  font-size: 11px;
}

.connection-step strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-step.is-active {
  color: var(--primary-strong);
}

.connection-step.is-active span {
  color: #fff;
  background: var(--primary);
}

.connection-surface {
  max-width: 880px;
  margin-right: auto;
  margin-left: auto;
}

.connection-choice-list {
  border-top: 1px solid var(--border);
}

.connection-choice {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 16px;
  min-height: 84px;
  padding: 14px 4px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: color 240ms ease, background-color 240ms ease;
}

.connection-choice:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.connection-choice-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
}

.connection-choice > span:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.connection-choice strong {
  font-size: 14px;
  font-weight: 600;
}

.connection-choice small {
  color: var(--muted);
  font-size: 12px;
}

.connection-form {
  max-width: 680px;
}

.login-network-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.login-network-fieldset legend {
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.login-network-segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: 0;
}

.login-network-segment {
  position: relative;
  min-width: 0;
  margin: 0;
  cursor: pointer;
}

.login-network-segment input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.login-network-segment span {
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.login-network-segment strong {
  font-size: 13px;
}

.login-network-segment small {
  color: var(--muted);
  font-size: 11px;
}

.login-network-segment input:checked + span {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-color: #c5c8f4;
}

.login-network-segment input:checked + span small {
  color: var(--primary-strong);
}

.login-network-segment input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--focus);
}

.login-network-segment input:disabled + span {
  color: var(--muted);
  background: var(--surface-muted);
  cursor: not-allowed;
}

.login-network-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  margin-top: 16px;
}

.login-network-fields[hidden] {
  display: none;
}

.connection-progress-body > p {
  margin-bottom: 18px;
}

.connection-qrcode-panel {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  gap: 30px;
}

.connection-qrcode-panel img {
  width: 220px;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.login-status-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 28px;
  border-top: 1px solid var(--border-strong);
}

.login-status-track span {
  position: relative;
  padding: 12px 8px 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.login-status-track span::before {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--border-strong);
  transform: translateX(-50%);
}

.login-status-track span.is-active,
.login-status-track span.is-complete {
  color: var(--primary-strong);
}

.login-status-track span.is-active::before,
.login-status-track span.is-complete::before {
  background: var(--primary);
}

.connection-qrcode-focus {
  display: grid;
  justify-items: center;
  min-height: 410px;
  text-align: center;
}

.connection-qrcode-frame {
  display: grid;
  place-items: center;
  width: 242px;
  height: 242px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border-strong);
}

.connection-qrcode-frame img {
  width: 240px;
  height: 240px;
  object-fit: contain;
}

.connection-qrcode-focus h3 {
  margin: 20px 0 6px;
  font-size: 18px;
}

.connection-qrcode-focus > p {
  max-width: 460px;
  margin: 0;
}

.connection-network-label {
  padding-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.connection-login-actions {
  justify-content: center;
  margin-top: 20px;
}

.business-list {
  border-top: 1px solid var(--border);
}

.business-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 10px 2px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.business-list-row > span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.business-list-row small {
  color: var(--muted);
  font-size: 11px;
}

/* WeBridge 资料卡片沿用后台 Soft UI 表面，头像缺失时用首字母保持信息层级完整。 */
.profile-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.profile-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line-subtle, rgba(148, 163, 184, .24));
  border-radius: 14px;
  background: var(--surface-raised, rgba(255, 255, 255, .72));
  box-shadow: var(--shadow-soft, 0 8px 24px rgba(15, 23, 42, .06));
}

.profile-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.profile-card p {
  margin: 3px 0 0;
}

.profile-card-avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  color: var(--accent-strong, #1e40af);
  background: var(--accent-soft, #dbeafe);
  font-weight: 700;
}

.profile-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.webridge-connection-address {
  display: flex;
  align-items: center;
  gap: 12px;
}
.webridge-connection-address textarea {
  flex: 1;
  min-width: 0;
  width: 100%;
  overflow-wrap: anywhere;
  font-family: monospace;
  resize: vertical;
}
.webridge-connection-address button { flex-shrink: 0; }
.webridge-account-heading { display: flex; align-items: center; gap: 12px; }
[data-webridge-connect] [hidden] { display: none !important; }
@media (max-width: 600px) {
  .webridge-connection-address { flex-direction: column; align-items: stretch; }
}

.connection-confirm-list {
  margin: 0;
  border-top: 1px solid var(--border);
}

.connection-confirm-list div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.connection-confirm-list dt {
  color: var(--muted);
  font-size: 12px;
}

.connection-confirm-list dd {
  margin: 0;
  color: var(--text-soft);
}

.cell-break,
.cell-break code,
.value-break,
.provider-node-breakable {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.form-grid label,
.confirm-match-input,
.wechat-action-field,
.chatroom-scope-mode-form {
  display: grid;
  align-content: start;
  gap: 6px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 460;
}

.form-grid input:where(:not([type="checkbox"]):not([type="radio"])),
.form-grid select,
.form-grid textarea,
.webridge-connection-address textarea,
.inline-form input:where(:not([type="checkbox"]):not([type="radio"])),
.inline-form select,
.confirm-match-input input,
.chatroom-scope-select,
.wechat-action-select {
  width: 100%;
  min-height: 40px;
  padding: 8px 13px;
  color: var(--text);
  background: var(--lg-field-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 2px var(--lg-field-inner);
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.form-grid textarea {
  min-height: 112px;
  resize: vertical;
}

.form-grid label.checkbox-field {
  display: flex;
  align-items: center;
  align-self: end;
  min-height: 42px;
  gap: 9px;
}

.form-grid .checkbox-field input[type="checkbox"] {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  min-height: 19px;
  margin: 0;
}

.form-grid .check-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
}

.form-grid .check-option input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
}

.form-grid input:where(:not([type="checkbox"]):not([type="radio"])):hover,
.form-grid select:hover,
.form-grid textarea:hover,
.webridge-connection-address textarea:hover,
.inline-form input:where(:not([type="checkbox"]):not([type="radio"])):hover,
.inline-form select:hover {
  border-color: var(--border-strong);
}

.form-grid input:where(:not([type="checkbox"]):not([type="radio"])):focus-visible,
.form-grid select:focus-visible,
.form-grid textarea:focus-visible,
.webridge-connection-address textarea:focus-visible,
.inline-form input:where(:not([type="checkbox"]):not([type="radio"])):focus-visible,
.inline-form select:focus-visible,
.confirm-match-input input:focus-visible,
.chatroom-scope-select:focus-visible,
.wechat-action-select:focus-visible {
  outline: none;
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--focus), 0 4px 14px rgba(99, 102, 241, 0.06);
}

.full-row {
  grid-column: 1 / -1;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

/*
 * 查询筛选与数据录入承担不同任务：筛选需要在有限高度内快速比较多个条件，不能继续
 * 继承 `.form-grid` 的双列大间距和 44px 控件。这里提供唯一的后台筛选布局，桌面端
 * 强制展示内容，移动端再交给原生 details 控制展开状态，避免引入额外脚本和双状态。
 */
.compact-filter {
  margin: 0 0 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
}

.compact-filter-summary {
  display: none;
}

.compact-filter-summary-text,
.compact-filter-count {
  color: var(--muted);
  font-size: 12px;
}

.compact-filter-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.compact-filter-field {
  display: grid;
  flex: 0 1 168px;
  min-width: 132px;
  gap: 4px;
  color: var(--text-soft);
  font-size: var(--text-sm);
  font-weight: 520;
}

.compact-filter-field-query {
  flex: 1 1 280px;
  min-width: 220px;
}

.compact-filter-field input,
.compact-filter-field select {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: var(--text-sm);
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.compact-filter-field input:hover,
.compact-filter-field select:hover {
  border-color: var(--text-soft);
}

.compact-filter-field input:focus-visible,
.compact-filter-field select:focus-visible {
  outline: none;
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}

.compact-filter-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
}

.compact-filter-actions .btn {
  min-height: 36px;
  padding: 0 13px;
}

.form-actions,
.form-actions-inline {
  margin-top: 4px;
}

.auth-form-actions,
.wechat-action-controls {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.checkbox-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.empty-state {
  padding: 32px 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.event-list,
.dashboard-ranking-list,
.info-stack,
.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-list li,
.dashboard-ranking-row,
.detail-row {
  display: grid;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.event-list li:last-child,
.dashboard-ranking-row:last-child,
.detail-row:last-child {
  border-bottom: 0;
}

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

.dashboard-ranking-row,
.detail-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.detail-row span {
  color: var(--muted);
}

.detail-row strong {
  text-align: right;
}

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

.list-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.list-pagination-summary {
  color: var(--muted);
  font-size: 12px;
}

.list-pagination-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.list-pagination-jump,
.list-pagination-jump label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.list-pagination-jump label {
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.list-pagination-jump input[type="number"] {
  width: 72px;
  min-width: 0;
  min-height: 40px;
  padding: 8px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.list-pagination-jump input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .list-pagination-jump input[type="number"] {
    min-height: 44px;
    font-size: 16px;
  }
}

.message-preview,
.message-preview-short,
.message-preview-full {
  max-width: 580px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message-preview-card summary {
  list-style: none;
  cursor: pointer;
}

.message-preview-card summary::-webkit-details-marker {
  display: none;
}

.message-preview-toggle {
  display: grid;
  gap: 6px;
}

.message-preview-toggle-collapsed,
.message-preview-toggle-expanded {
  width: fit-content;
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 600;
}

.message-preview-toggle-expanded,
.message-preview-full {
  display: none;
}

.message-preview-card[open] .message-preview-toggle-collapsed,
.message-preview-card[open] .message-preview-short {
  display: none;
}

.message-preview-card[open] .message-preview-toggle-expanded,
.message-preview-card[open] .message-preview-full {
  display: block;
}

/* 总览图表使用低饱和数据色，图形区域自身只保留一个工作表面。 */
.dashboard-top-grid {
  align-items: stretch;
}

.dashboard-chart-card {
  min-width: 0;
  padding: 10px 0 0;
}

.dashboard-line-chart {
  display: block;
  width: 100%;
  height: 180px;
  overflow: visible;
}

.chart-line {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart-area {
  stroke: none;
}

.chart-area-primary {
  fill: rgba(73, 107, 168, 0.09);
}

.chart-area-success {
  fill: rgba(99, 102, 241, 0.1);
}

.chart-line-primary {
  stroke: var(--info);
}

.chart-line-success {
  stroke: var(--primary);
}

/* 图形区：左侧 Y 轴刻度列 + 右侧画布；画布内的数值标注用绝对定位，不随 SVG 拉伸。 */
.chart-plot {
  display: flex;
  gap: 8px;
}

.chart-yaxis {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: space-between;
  min-width: 28px;
  height: 180px;
  color: var(--muted);
  font-family: "Albert Sans", "Noto Sans SC", sans-serif;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: right;
}

.chart-canvas {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.chart-point-label {
  position: absolute;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface, #fff);
  color: var(--text, #1f2937);
  font-family: "Albert Sans", "Noto Sans SC", sans-serif;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  pointer-events: none;
  transform: translate(-50%, -140%);
  white-space: nowrap;
}

/* 末点在右边缘，标注向左靠齐，避免溢出卡片。 */
.chart-point-last {
  transform: translate(-100%, -140%);
}

.chart-xaxis {
  display: flex;
  justify-content: space-between;
  margin: 10px 0 0 36px;
  color: var(--muted);
  font-family: "Albert Sans", "Noto Sans SC", sans-serif;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* 数值明细按需展开，替代原来常驻的二十四个柱块；不丢失读数，也不额外叠加卡片。 */
.dashboard-chart-detail summary {
  min-height: 36px;
  padding: 8px 0;
  color: var(--primary-strong);
  cursor: pointer;
  font-size: 12px;
}

.dashboard-chart-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 16px;
  max-height: 180px;
  margin: 4px 0 12px;
  overflow-y: auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.dashboard-chart-values > div {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.dashboard-chart-values dt {
  color: var(--muted);
}

.dashboard-chart-values dd {
  margin: 0;
}

.dashboard-ranking-row {
  display: flex;
  justify-content: space-between;
  margin: 0 -8px;
  padding: 12px 8px;
  border-radius: 8px;
  transition: background-color 160ms var(--ease-out);
}

.dashboard-ranking-row:hover {
  background: var(--surface-soft);
}

/* 插件、群管理与运维内部控件使用浅色边界，避免每个子项重复产生浮起表面。 */

/* 猜图片题库与其他后台清单共用一个业务表面；缩略图与元信息按行排列，避免面板套卡片。 */
.gi-list-heading,
.gi-counts,
.gi-question-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.gi-counts {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.gi-counts strong {
  margin-left: 4px;
  color: var(--text);
  font-weight: 600;
}

.gi-question-list {
  border-top: 0;
}

.gi-question-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1.1fr) minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.gi-question-row:last-child {
  border-bottom: 0;
}

.gi-question-row.gi-readonly {
  grid-template-columns: 76px minmax(0, 1.1fr) minmax(0, 1fr);
}

.gi-thumbnail {
  display: grid;
  place-items: center;
  width: 76px;
  height: 64px;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.gi-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gi-question-copy,
.gi-attribution,
.gi-attribution dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.gi-question-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gi-question-title .chip {
  flex-shrink: 0;
}

.gi-question-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.gi-attribution {
  display: grid;
  gap: 5px;
  margin: 0;
  font-size: 12px;
}

.gi-attribution > div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
}

.gi-attribution dt {
  color: var(--muted);
}

.gi-attribution dd {
  margin: 0;
  color: var(--text-soft);
}

.gi-row-actions .btn,
.gi-modal .btn {
  min-width: 44px;
  min-height: 44px;
}

/* 弹窗只补充题库特有的图片与预览布局，表单控件和浮层材质继续使用全站组件。 */
.gi-editor-fields {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.gi-modal form,
.gi-modal label,
.gi-modal .form-grid > *,
.gi-bank .compact-filter-field > .ui-select {
  min-width: 0;
}

.gi-modal input[type="file"] {
  max-width: 100%;
  font-size: 12px;
}

.gi-modal input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 4px 10px;
  color: var(--primary-strong);
  font: inherit;
  background: var(--primary-soft);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.gi-modal .form-grid small,
.gi-import-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.gi-image-field {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.gi-image-preview {
  display: grid;
  place-items: center;
  height: 88px;
  overflow: hidden;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.gi-image-preview > .i {
  width: 28px;
  height: 28px;
}

.gi-image-preview img {
  width: 100%;
  height: 88px;
  object-fit: contain;
}

.gi-loading {
  margin: 0 0 16px;
}

.gi-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.gi-actions-end {
  justify-content: flex-end;
  margin-top: 16px;
}

.gi-import-help p {
  margin: 0 0 8px;
}

.gi-import-help > code {
  display: block;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.gi-import-summary {
  margin: 0;
  font-weight: 550;
}

.gi-import-table-wrap {
  max-width: 100%;
  margin-top: 16px;
  overflow-x: auto;
}

.gi-import-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.gi-import-table th,
.gi-import-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.gi-import-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 500;
}

.gi-audit-results {
  margin: 0 0 16px;
}

.gi-audit-results > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.gi-audit-results dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 680px) {
  /* 手机先展示缩略图、答案与编辑按钮，来源授权接在文字下方，不产生横向滚动。 */
  .gi-question-row {
    grid-template-columns: 60px minmax(0, 1fr) 44px;
    align-items: start;
    gap: 8px 12px;
  }

  .gi-question-row.gi-readonly {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .gi-thumbnail {
    width: 60px;
    height: 60px;
  }

  .gi-attribution {
    grid-column: 2 / -1;
    grid-row: 2;
  }

  .gi-row-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .gi-bank .compact-filter-summary,
  .gi-bank .compact-filter-actions .btn,
  .gi-bank .compact-filter-field input,
  .gi-bank .compact-filter-field .ui-select-trigger,
  .gi-modal .form-grid input:not([type="hidden"]),
  .gi-modal .ui-select-trigger {
    min-height: 44px;
  }

  .gi-image-field {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .gi-image-preview {
    height: 112px;
  }

  .gi-image-preview img {
    height: 112px;
  }
}

.action-disclosure {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.action-disclosure > summary {
  padding: 15px 17px;
  list-style: none;
  cursor: pointer;
}

.action-disclosure > summary::-webkit-details-marker {
  display: none;
}

.action-disclosure[open] > summary {
  border-bottom: 1px solid var(--border);
}

.action-disclosure-body {
  padding: 16px;
}

.plugin-binding-card,
.chatroom-scope-card,
.wechat-action-result-block,
.wechat-action-code-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.plugin-binding-card:hover,
.chatroom-scope-card:hover {
  background: var(--surface-soft);
  border-color: var(--border-strong);
}

.plugin-binding-card p {
  margin-bottom: 0;
}

.plugin-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 28px;
}

.plugin-detail-title {
  margin: 14px 0 7px;
  font-size: 28px;
}

.plugin-detail-description {
  color: var(--muted);
}

.plugin-detail-tech {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.plugin-detail-summary {
  display: grid;
  align-content: start;
}

.plugin-detail-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.plugin-detail-summary span {
  color: var(--muted);
}

.plugin-overview-alert {
  margin-top: 12px;
  padding: 11px 13px;
  color: var(--warning);
  background: var(--warning-soft);
  border-radius: var(--radius-sm);
}

.plugin-overview-alert-danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.chatroom-scope-badges,
.chatroom-scope-facts,
.wechat-action-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chatroom-scope-facts > div,
.wechat-action-facts > div {
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.chatroom-scope-label,
.wechat-action-label {
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 600;
}

.chatroom-scope-editor,
.wechat-action-console {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  gap: 20px;
  align-items: start;
}

.chatroom-scope-mode-form,
.wechat-action-composer,
.wechat-action-result {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.wechat-action-json-panel,
.wechat-action-payload,
.log-message-block {
  color: #ffffff;
  background: var(--text);
  border: 0;
  border-radius: var(--radius-md);
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 12px;
}

.wechat-action-payload {
  width: 100%;
  min-height: 250px;
  padding: 15px;
  color: #e9ece9;
  background: #303936;
  border: 0;
  resize: vertical;
}

.wechat-action-json-panel {
  min-height: 250px;
  max-height: 360px;
  margin: 10px 0 0;
  padding: 15px;
  overflow: auto;
}

.wechat-action-json-panel code {
  display: block;
  padding: 0;
  color: inherit;
  background: transparent;
  white-space: pre-wrap;
}

.wechat-action-description,
.wechat-action-feedback,
.wechat-action-summary {
  margin: 10px 0 0;
  color: var(--muted);
}

.wechat-action-meta {
  display: grid;
  gap: 12px;
}

.wechat-ipad-login-actions,
.wechat-ipad-profile-picker,
.wechat-ipad-profile-switch {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.wechat-ipad-profile-picker {
  align-items: flex-start;
}

.wechat-ipad-profile-option {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.wechat-ipad-profile-option.is-active {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-color: #c5c8f4;
}

.log-tab-row {
  display: flex;
  gap: 18px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.log-tab {
  padding: 8px 0;
  color: var(--muted);
  text-decoration: none;
}

.log-tab.is-active {
  color: var(--primary-strong);
  border-bottom: 2px solid var(--primary);
}

.log-message-block {
  min-height: 62vh;
  max-height: 76vh;
  margin: 0;
  padding: 13px;
  overflow: auto;
  line-height: 1.55;
  white-space: pre;
}

/* 首次安装页复用 Glisse 液态磨砂材质；登录和注册由下方 access 组件独立组织。 */
.auth-shell {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  background: transparent;
}

.auth-layout {
  width: min(960px, 100%);
  margin: auto;
}

.auth-panel {
  min-width: 0;
  padding: 28px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(22px) saturate(1.65);
  backdrop-filter: blur(22px) saturate(1.65);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

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

.auth-brand strong {
  font-size: 20px;
  font-weight: 600;
}

.auth-brand p {
  margin: 2px 0 0;
  color: var(--muted);
}

.auth-showcase {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: center;
}

.auth-showcase-single {
  display: block;
  min-width: 0;
}

.auth-showcase-copy h1,
.auth-showcase-copy h2 {
  margin-bottom: 12px;
  font-size: 28px;
}

.auth-eyebrow {
  margin: 0 0 8px;
  color: var(--primary-strong);
  font-size: 13px;
}

.auth-lead {
  max-width: 480px;
  color: var(--muted);
  font-size: 14px;
}

.auth-form-card,
.login-card,
.auth-complete-card {
  margin: 0;
  padding: 20px 0;
  background: transparent;
  border: 0;
}

.auth-card-head {
  margin-bottom: 20px;
}

.auth-form-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.auth-form-grid input:where(:not([type="checkbox"]):not([type="radio"])),
.auth-form-grid select {
  min-width: 0;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* 登录记住选项复用共享复选框，移除文本输入框的内边距并保留触控高度。 */
.auth-form-grid label.checkbox-field {
  min-height: 44px;
}

.auth-form-grid .checkbox-field input[type="checkbox"] {
  padding: 0;
}

.auth-submit {
  width: 100%;
  gap: 12px;
}

.auth-tip-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.auth-complete-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  color: var(--success);
  background: var(--success-soft);
  border-radius: 50%;
}

/* 企业、平台、注册共享 Glisse Liquid Glass 认证壳，支持深浅双模且不共享账号字段、表单地址或会话。 */
.access-page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  background: transparent;
}

.access-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1280px, calc(100% - 64px));
  min-height: 82px;
  margin: 0 auto;
}

.access-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.access-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  color: var(--text-soft);
  background: var(--lg-field-glass);
  border: 0.5px solid var(--lg-edge);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(12px) saturate(1.6);
  backdrop-filter: blur(12px) saturate(1.6);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.access-back:hover {
  color: var(--primary);
  background: var(--lg-field-glass-active);
}

.access-main {
  display: grid;
  align-items: center;
  padding: 24px;
}

.access-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: min(1040px, 100%);
  min-height: 550px;
  margin: 0 auto;
  padding: 12px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  backdrop-filter: blur(24px) saturate(1.7);
  border: 1px solid var(--border);
  border-radius: 30px;
  box-shadow: var(--shadow-soft);
}

.access-context {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 36px;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--primary) 14%, transparent),
    color-mix(in srgb, #38bdf8 10%, transparent) 55%,
    color-mix(in srgb, #a855f7 9%, transparent)
  );
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  border-radius: 22px;
  box-shadow: inset 0 1px 0 var(--lg-surface-edge);
}

.access-context h2 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 30px;
  font-weight: 680;
  letter-spacing: -0.028em;
  line-height: 1.38;
}

.access-context-summary {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

.access-visual {
  position: relative;
  flex: 0 0 auto;
  width: min(360px, 100%);
  height: 220px;
  margin: 20px auto;
}

.access-connectors {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.access-connectors path {
  stroke: color-mix(in srgb, var(--primary) 38%, transparent);
  stroke-width: 1.5;
}

.access-connectors circle {
  stroke: color-mix(in srgb, var(--primary) 24%, transparent);
  stroke-width: 1;
  stroke-dasharray: 3 6;
}

.access-hub {
  position: absolute;
  top: 48%;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 106px;
  padding: 16px;
  color: var(--text);
  background-color: var(--lg-glass);
  border-radius: 24px;
  --lg-blur: 14px;
  --lg-saturate: 1.8;
  box-shadow: 0 14px 36px -6px var(--lg-shadow);
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 600;
}

.access-hub img {
  width: 42px;
  height: 42px;
}

.access-channel {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px 9px 10px;
  color: var(--text);
  background-color: var(--lg-glass);
  border-radius: 999px;
  --lg-blur: 12px;
  --lg-saturate: 1.75;
  box-shadow: 0 8px 22px -6px var(--lg-shadow);
  font-size: 13px;
  font-weight: 500;
}

.access-channel i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  font-style: normal;
}

.access-channel-wechat {
  top: 12px;
  left: 4px;
}

.access-channel-wechat i {
  color: var(--success);
  background: var(--success-soft);
}

.access-channel-work {
  top: 28px;
  right: -4px;
}

.access-channel-work i {
  color: var(--primary);
  background: var(--primary-soft);
}

.access-channel-telegram {
  bottom: 12px;
  left: 22px;
}

.access-channel-telegram i {
  color: var(--info);
  background: var(--info-soft);
  font-size: 18px;
}

.access-orbit-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.access-orbit-dot-one {
  top: 12px;
  right: 112px;
  background: color-mix(in srgb, var(--primary) 55%, #ffffff);
}

.access-orbit-dot-two {
  right: 44px;
  bottom: 32px;
  background: color-mix(in srgb, #ec4899 50%, #ffffff);
}

.access-context-points {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-soft);
  font-size: 13px;
}

.access-context-points span + span::before {
  margin-right: 12px;
  color: var(--muted);
  content: "·";
}

.access-form {
  align-self: center;
  min-width: 0;
  padding: 36px 44px;
}

.access-heading {
  margin-bottom: 28px;
}

.access-heading h1 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 680;
  letter-spacing: -0.028em;
}

.access-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.access-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

/* 认证页验证码保持输入、图片和换图操作在同一字段组内，窄屏也不会撑破表单。 */
.access-captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.access-captcha-visual {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.access-captcha-visual img {
  display: block;
  width: 138px;
  height: auto;
  background: #fff;
  border-radius: var(--radius-sm);
}

.access-captcha-refresh {
  min-height: 44px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.access-captcha-refresh:hover {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-color: rgba(99, 102, 241, 0.35);
}

.access-captcha-refresh:disabled {
  cursor: wait;
  opacity: 0.65;
}

.access-captcha-hint {
  color: var(--muted);
  font-size: 13px;
}

.access-password {
  position: relative;
  display: block;
  min-width: 0;
}

.access-password input {
  padding-right: 68px;
}

.password-toggle {
  position: absolute;
  top: 2px;
  right: 4px;
  min-width: 52px;
  min-height: 44px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.password-toggle:hover {
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.password-toggle:active {
  background: var(--surface-muted);
}

.access-form .auth-submit {
  min-height: 48px;
  margin-top: 6px;
  font-size: 14px;
}

.access-switch {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.access-switch a {
  color: var(--primary-strong);
  text-decoration: none;
}

.access-switch a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.access-identity {
  margin: 24px 0 0;
  padding-top: 18px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 13px;
  text-align: center;
}

.access-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 20px 24px 28px;
  color: var(--muted);
  font-size: 12px;
}

.access-footer strong {
  color: var(--text-soft);
  font-weight: 600;
}

.access-footer a {
  color: var(--text-soft);
  text-decoration: none;
  transition: color 160ms var(--ease-out);
}

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

.access-register-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.access-page-register .access-form {
  padding: 24px 32px;
}

.access-page-register .access-heading {
  margin-bottom: 20px;
}

.access-page-register .access-switch {
  margin-top: 18px;
}

/* 公开站点采用 Glisse 悬浮玻璃顶栏、Hero 光学折射棱镜与 L2 磨砂分区，完整支持深浅双模。 */
.marketing-body {
  background: transparent;
}

.marketing-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 12px 0 4px;
  background: transparent;
  border: 0;
  box-shadow: none;
  pointer-events: none;
}

.marketing-header-inner,
.marketing-footer-inner,
.marketing-section-inner,
.marketing-page-head-inner {
  width: min(1200px, calc(100vw - 48px));
  margin: 0 auto;
}

.marketing-header-inner {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 60px;
  padding: 6px 14px 6px 18px;
  background-color: var(--lg-glass);
  border-radius: 22px;
  --lg-blur: 18px;
  --lg-saturate: 1.75;
  --lg-rim-shine: 0.36;
  box-shadow:
    inset 0 0 0 0.5px var(--lg-edge),
    0 10px 30px -10px var(--lg-shadow);
}

.marketing-header-inner.lg-glass[data-rim] {
  box-shadow: 0 10px 30px -10px var(--lg-shadow);
}

.marketing-brand {
  font-family: "Albert Sans", "Noto Sans SC", sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}

.marketing-nav,
.marketing-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.marketing-nav a,
.marketing-footer a {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 160ms var(--ease-out);
}

.marketing-nav a:hover,
.marketing-nav a[aria-current="page"],
.marketing-footer a:hover {
  color: var(--primary);
}

.marketing-actions {
  justify-content: flex-end;
  gap: 8px;
}

/* 转化按钮与后台主操作共用 Glisse 品牌实色玻璃。 */
.marketing-actions .btn:not(.btn-secondary),
.marketing-hero-actions .btn:not(.btn-secondary) {
  background: var(--lg-fill);
  border-color: color-mix(in srgb, #ffffff 18%, transparent);
}

.marketing-notice {
  width: min(1200px, calc(100vw - 48px));
  margin: 18px auto 0;
}

.marketing-hero {
  position: relative;
  display: grid;
  min-height: clamp(500px, 70vh, 620px);
  overflow: hidden;
  background: transparent;
}

.marketing-hero-scene {
  --hero-pointer-x: 0;
  --hero-pointer-y: 0;
  --hero-signal-x: 0px;
  --hero-signal-y: 0px;
  --hero-marker-x: 0px;
  --hero-marker-y: 0px;
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Hero 品牌主视觉升级为 Glisse 液态玻璃折射方圆透镜，在环境光场前折射光晕并响应轻微指针位移。 */
.marketing-hero-signal {
  position: absolute;
  top: 112px;
  right: max(6vw, calc((100vw - 1200px) / 2));
  z-index: 1;
  width: clamp(220px, 22vw, 310px);
  aspect-ratio: 1;
  background-color: color-mix(in srgb, var(--primary) 12%, var(--lg-glass));
  border-radius: 36%;
  --lg-blur: 14px;
  --lg-saturate: 1.9;
  --lg-rim-shine: 0.55;
  --lg-glass-dispersion: 1;
  box-shadow:
    0 28px 64px -12px color-mix(in srgb, var(--primary) 28%, var(--lg-shadow)),
    inset 0 1px 0 var(--lg-surface-edge);
  transform: translate(var(--hero-signal-x), var(--hero-signal-y));
  transition: outline-offset 160ms var(--ease-out), transform 180ms var(--ease-out);
}

.marketing-hero-signal span {
  position: absolute;
  inset: 27%;
  background: url('/static/brand-mark.svg') center / contain no-repeat;
}

.marketing-hero-marker {
  position: absolute;
  top: clamp(372px, 31vw, 428px);
  right: max(10vw, calc((100vw - 1200px) / 2 + 40px));
  width: 78px;
  height: 78px;
  background: radial-gradient(
    circle at 32% 30%,
    rgb(255 255 255 / 0.65),
    color-mix(in srgb, #ec4899 36%, transparent) 55%,
    color-mix(in srgb, var(--primary) 26%, transparent)
  );
  -webkit-backdrop-filter: blur(10px) saturate(1.8);
  backdrop-filter: blur(10px) saturate(1.8);
  border: 0.5px solid var(--lg-surface-edge);
  border-radius: 50%;
  box-shadow: 0 14px 36px -6px color-mix(in srgb, #ec4899 24%, var(--lg-shadow));
  transform: translate(var(--hero-marker-x), var(--hero-marker-y));
  transition: transform 180ms var(--ease-out);
}

/* 键盘进入首屏操作区时同步强调构图锚点，鼠标并不是获得反馈的唯一方式。 */
.marketing-hero:focus-within .marketing-hero-signal {
  outline: 2px solid var(--focus);
  outline-offset: 6px;
}

/* 左侧主张与右侧品牌构图各自保留范围，首屏下方及时露出产品内容。 */
.marketing-hero-copy {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100vw - 48px));
  margin: auto;
  padding: clamp(64px, 8vh, 96px) 0;
}

.marketing-hero-copy h1 {
  margin: 0 0 18px;
  font-family: "Albert Sans", "Noto Sans SC", sans-serif;
  font-size: clamp(52px, 6vw, 72px);
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.marketing-hero-lead {
  max-width: 620px;
  margin: 0;
  color: var(--text);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.marketing-hero-summary {
  max-width: 590px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.marketing-hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 34px;
}

.marketing-hero-points {
  display: flex;
  gap: 28px;
  margin: 28px 0 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

.marketing-hero-points li::before {
  margin-right: 7px;
  color: var(--primary);
  content: "•";
}

.marketing-section,
.marketing-page-head {
  padding: 64px 0;
  background: transparent;
  scroll-margin-top: 96px;
}

.marketing-section-alt,
.marketing-page-head {
  background: color-mix(in srgb, var(--surface) 44%, transparent);
}

.marketing-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 32px;
}

.marketing-section-heading h2,
.marketing-page-head h1,
.marketing-cta-band h2 {
  margin: 0;
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 680;
  letter-spacing: -0.028em;
  line-height: 1.2;
}

.marketing-section-heading > p,
.marketing-page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.marketing-feature-grid,
.marketing-steps,
.marketing-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding: 0;
  list-style: none;
}

/* 只有有序步骤列表需要清除浏览器默认外边距，价格网格必须保留内容容器的自动居中。 */
.marketing-steps {
  margin: 0;
}

.marketing-feature-grid article,
.marketing-steps li {
  padding: 26px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.marketing-feature-grid article > span,
.marketing-step-number {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
}

.marketing-feature-grid h3 {
  display: block;
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.marketing-steps strong {
  display: block;
  margin: 18px 0 10px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.marketing-feature-grid p,
.marketing-steps li > span:last-child {
  color: var(--muted);
  font-size: 15px;
}

.marketing-plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 330px;
  padding: 28px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(18px) saturate(1.55);
  backdrop-filter: blur(18px) saturate(1.55);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: box-shadow 180ms var(--ease-out), border-color 180ms var(--ease-out);
}

.marketing-plan-card:hover,
.marketing-plan-card.is-featured {
  background: var(--surface-strong);
  border-color: color-mix(in srgb, var(--primary) 48%, var(--border));
  box-shadow: 0 16px 40px -8px color-mix(in srgb, var(--primary) 18%, var(--lg-shadow));
}

.marketing-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.marketing-plan-head h2,
.marketing-plan-head h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.marketing-plan-badge {
  flex-shrink: 0;
  width: fit-content;
  padding: 3px 8px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.marketing-plan-quota,
.marketing-plan-price,
.marketing-plan-description {
  margin: 0;
}

.marketing-plan-quota strong,
.marketing-plan-price strong {
  color: var(--text);
  font-family: "Albert Sans", "Noto Sans SC", sans-serif;
  font-size: 34px;
  font-weight: 680;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.marketing-plan-price span,
.marketing-plan-description {
  color: var(--muted);
}

.marketing-price-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

.marketing-price-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.marketing-price-list dd {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.marketing-plan-card .btn,
.marketing-plan-card > form {
  align-self: stretch;
  margin-top: auto;
}

.marketing-empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px 0;
  color: var(--muted);
  text-align: center;
}

.marketing-pricing-note {
  padding: 0 0 48px;
  background: var(--surface);
}

.marketing-pricing-note .marketing-section-inner {
  padding: 22px 0;
  border-top: 1px solid var(--border);
}

.marketing-pricing-note p {
  margin: 5px 0 0;
  color: var(--muted);
}

.marketing-section-action {
  margin-top: 38px;
  text-align: right;
}

.marketing-section-action a {
  color: var(--text);
  text-underline-offset: 4px;
}

.marketing-cta-band {
  padding: 64px 0;
  color: var(--text);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--primary) 14%, var(--surface)),
    color-mix(in srgb, #38bdf8 10%, var(--surface))
  );
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.marketing-cta-band .marketing-section-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.marketing-cta-band h2,
.marketing-cta-band .section-kicker {
  color: var(--text);
}

.marketing-cta-band .btn {
  color: #ffffff;
  background: var(--lg-fill);
  border-color: color-mix(in srgb, #ffffff 18%, transparent);
}

/* 全站开源项目页脚与版本/仓库徽标：官网展示完整双层开源说明，双后台与认证页保持轻量克制。 */
.project-gh-icon {
  display: block;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

.project-version-badge,
.project-license-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 550;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.project-version-badge {
  color: var(--text-soft);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.project-version-badge:hover {
  color: var(--primary-strong);
  border-color: var(--border-strong);
}

.project-commit {
  opacity: 0.72;
}

.project-license-badge {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
}

.project-license-badge:hover {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
}

.project-gh-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-soft);
  text-decoration: none;
  transition: color 160ms var(--ease-out);
}

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

.project-gh-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 13px;
  color: var(--text);
  background: var(--lg-field-glass, var(--surface));
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 520;
  text-decoration: none;
  box-shadow: 0 1px 4px var(--lg-drop, rgba(15, 23, 42, 0.05));
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.project-gh-pill:hover {
  color: var(--primary-strong);
  background: var(--lg-field-glass-active, var(--surface-strong));
  border-color: var(--border-strong);
}

/* 后台工作台页脚：贴底弱化展示版本、协议与 GitHub 入口，不干扰主工作区注意力。 */
.app-footer {
  margin-top: auto;
  padding: 0 0 22px;
}

.app-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  width: min(var(--content-width), calc(100% - 48px));
  margin: 0 auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.app-footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.app-footer-mark {
  display: block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 5px;
}

.app-footer-name {
  color: var(--text-soft);
  font-family: "Albert Sans", "Noto Sans SC", sans-serif;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.app-footer-sep {
  opacity: 0.45;
}

.app-footer-desc a {
  color: var(--text-soft);
  text-decoration: none;
}

.app-footer-desc a:hover {
  color: var(--primary);
}

.app-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
}

.app-footer-links a {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  transition: color 160ms var(--ease-out);
}

.app-footer-links a:hover {
  color: var(--primary);
}

.marketing-footer {
  padding: 40px 0 28px;
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.45);
  backdrop-filter: blur(18px) saturate(1.45);
  border-top: 1px solid var(--border);
}

.marketing-footer-inner {
  display: grid;
  gap: 28px;
  color: var(--muted);
  font-size: 13px;
}

.marketing-footer-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px 48px;
}

.marketing-footer-about {
  display: grid;
  justify-items: start;
  gap: 12px;
  max-width: 460px;
}

.marketing-footer-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.marketing-footer-mark {
  display: block;
  width: 26px;
  height: 26px;
}

.marketing-footer-title strong {
  color: var(--text);
  font-family: "Albert Sans", "Noto Sans SC", sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.marketing-footer-copy {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.65;
}

.marketing-footer-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 56px;
}

.marketing-footer-col {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 112px;
}

.marketing-footer-heading {
  color: var(--text);
  font-size: 13px;
  font-weight: 620;
}

.marketing-footer-col nav {
  display: grid;
  gap: 8px;
}

.marketing-footer-col nav a {
  font-size: 13px;
  font-weight: 450;
}

.marketing-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 820px) {
  .marketing-footer-main {
    flex-direction: column;
    gap: 24px;
  }

  .app-footer-inner {
    width: min(var(--content-width), calc(100% - 32px));
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .marketing-footer {
    background-color: var(--bg-cool) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

.payment-bank-details {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.payment-qr-image {
  display: block;
  width: min(260px, 100%);
  aspect-ratio: 1;
  margin: 18px 0;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* Glisse 液态玻璃原生弹窗：顶层 dialog + 柔雾遮罩 + 高磨砂玻璃卡片，保持内部滚动与焦点归还。 */
.app-modal {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  overflow: visible;
  overscroll-behavior: contain;
}

.app-modal[open] {
  animation: app-modal-in 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.app-modal::backdrop {
  background: rgb(6 10 22 / 0.34);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: app-backdrop-in 200ms var(--ease-out);
}

@keyframes app-modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.965);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes app-backdrop-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-modal[open],
  .app-modal::backdrop {
    animation: none;
  }
}

.app-modal-card {
  max-height: calc(100vh - 48px);
  padding: 28px;
  overflow: auto;
  overscroll-behavior: contain;
  background-color: var(--lg-surface-elevated);
  --lg-glass: var(--lg-surface-elevated);
  --lg-blur: 30px;
  --lg-saturate: 1.75;
  border: 0;
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
}

.app-modal-card.lg-glass[data-rim] {
  box-shadow: 0 24px 56px -12px var(--lg-shadow);
}

.app-modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  flex-shrink: 0;
  min-height: 34px;
  padding: 0;
  color: var(--muted);
  background: var(--lg-within);
  border: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px var(--lg-edge);
  font-size: 18px;
  cursor: pointer;
  transition: color 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

.app-modal-close:hover {
  color: var(--text);
  background: var(--lg-within-active);
  box-shadow: inset 0 0 0 0.5px var(--lg-edge);
}

.app-modal-head {
  margin-bottom: 20px;
}

/* 确认/提示弹窗(dialog.js):L1 液态玻璃提醒卡，危险操作用半透红调高亮图标与确认按钮。 */
.app-dialog {
  width: min(440px, calc(100vw - 32px));
}

.app-dialog [hidden] {
  display: none !important;
}

.app-dialog-card {
  padding: 28px 28px 22px;
  background-color: var(--lg-surface-elevated);
  --lg-glass: var(--lg-surface-elevated);
  --lg-blur: 24px;
  --lg-saturate: 1.85;
  border: 0;
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
}

.app-dialog-card.lg-glass[data-rim] {
  box-shadow: 0 24px 56px -12px var(--lg-shadow);
}

.app-dialog-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 16px;
}

.app-dialog[data-tone="danger"] .app-dialog-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.app-dialog-title {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.app-dialog-message {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-line;
}

.app-dialog-points {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 12px 14px;
  list-style: none;
  color: var(--text-soft);
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.app-dialog[data-tone="danger"] .app-dialog-points {
  background: var(--danger-soft);
}

.app-dialog-points li {
  position: relative;
  padding-left: 16px;
  line-height: 1.55;
}

.app-dialog-points li::before {
  content: "";
  position: absolute;
  top: 0.6em;
  left: 2px;
  width: 6px;
  height: 6px;
  background: var(--muted);
  border-radius: 50%;
}

.app-dialog[data-tone="danger"] .app-dialog-points li::before {
  background: var(--danger);
}

.app-dialog-match {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  color: var(--text-soft);
  font-size: 13px;
}

.app-dialog-match input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.app-dialog-match input:focus-visible {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 4px var(--focus);
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

@media (max-width: 480px) {
  .app-dialog-card {
    padding: 24px 20px 20px;
  }

  .app-dialog-actions {
    flex-direction: column-reverse;
  }

  .app-dialog-actions .btn {
    width: 100%;
  }
}

.confirm-modal-card {
  width: min(520px, 100%);
  margin: 0 auto;
}

@media (max-width: 1100px) {
  .access-form {
    padding: 28px;
  }

  .access-context {
    padding: 28px;
  }

  .stats-grid,
  .metrics-grid,
  .metric-band,
  .compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .platform-analytics-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .platform-analytics-operations-grid,
  .platform-analytics-health-grid {
    grid-template-columns: 1fr;
  }

  .provider-action-grid,
.chatroom-scope-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .marketing-hero-copy h1 {
    font-size: 56px;
  }

  .marketing-hero-lead {
    max-width: 540px;
    font-size: 28px;
  }

  .marketing-hero-summary {
    max-width: 540px;
  }
}

@media (max-width: 820px) {
  

  

  

  

  

  /* 窄屏登录将输入置于视觉中心，品牌区缩为简短身份提示，表单不被装饰推离首屏。 */
  .access-topbar {
    width: calc(100% - 40px);
    min-height: 72px;
  }

  .access-topbar .brand-copy small {
    display: none;
  }

  .access-main {
    align-items: start;
    padding: 16px 20px;
  }

  .access-layout {
    grid-template-columns: minmax(0, 1fr);
    width: min(480px, 100%);
    min-height: 0;
    padding: 8px;
  }

  .access-context,
  .access-context h2,
  .access-context-summary,
  .access-visual,
  .access-context-points {
    display: none;
  }

  .access-form,
  .access-page-register .access-form {
    padding: 28px 20px;
  }

  .access-heading h1 {
    font-size: 26px;
  }

  .access-footer {
    padding: 16px 20px;
  }

  .app-topbar {
    padding: 8px 0 4px;
  }

  .app-topbar-inner {
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    width: calc(100% - 24px);
    min-height: 54px;
    padding: 6px 10px 6px 12px;
    border-radius: 20px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .app-primary-nav {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
    max-height: calc(100svh - 86px);
    padding: 12px;
    overflow-y: auto;
    background: var(--lg-surface-elevated);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    backdrop-filter: blur(24px) saturate(1.8);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
  }

  .app-nav-toggle:checked ~ .app-topbar .app-primary-nav {
    display: flex;
  }

  .app-primary-nav .nav-link {
    justify-content: flex-start;
    width: 100%;
    min-height: 44px;
    padding-right: 16px;
    padding-left: 16px;
    border-radius: 14px;
  }

  .app-primary-nav .nav-more {
    width: 100%;
  }

  .app-primary-nav .nav-more-trigger {
    width: 100%;
    min-height: 44px;
    padding-left: 16px;
    border-radius: 14px;
  }

  .app-primary-nav .nav-more-menu {
    position: static;
    min-width: 0;
    margin: 2px 0 6px;
    padding: 3px 0 3px 12px;
    background: transparent;
    border: 0;
    border-left: 1px solid var(--border);
    box-shadow: none;
  }

  .app-nav-trigger {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    background: var(--lg-within);
    border-radius: 50%;
    cursor: pointer;
  }

  .app-nav-trigger span {
    display: block;
    width: 17px;
    height: 1.5px;
    margin: 0;
    background: var(--text);
    border-radius: 2px;
  }

  .account-menu-panel {
    right: 0;
  }

  .workspace {
    width: calc(100% - 32px);
    padding: 20px 0 32px;
  }

  .record-row {
    grid-template-columns: minmax(0, 1fr) 40px;
    align-items: start;
    gap: 12px 16px;
  }

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

  .account-record-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .proxy-record-row {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .connection-qrcode-panel {
    grid-template-columns: 1fr;
  }

  .login-network-segments,
  .login-network-fields {
    grid-template-columns: 1fr;
  }

  .record-meta {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .record-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .page-header {
    display: grid;
    justify-content: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .page-header-actions,
  .hero-action-cluster {
    justify-content: flex-start;
  }

  /* 大盘页头在网格模式下必须拉满轨道，否则桌面的 space-between 会让分段控件按内容宽度收缩。 */
  .page-header-actions:has(.analytics-page-actions) {
    width: 100%;
  }

  .analytics-page-actions {
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
  }

  .analytics-range-control {
    flex: 1;
  }

  .analytics-range-option {
    flex: 1;
    min-width: 0;
  }

  .platform-analytics-grid,
  .platform-analytics-chart-grid,
  .platform-analytics-operations-grid,
  .platform-analytics-health-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .platform-analytics-surface {
    padding: 0;
  }

  .analytics-chart-shell {
    height: 200px;
  }

  .analytics-funnel-row {
    grid-template-columns: minmax(130px, 0.9fr) minmax(120px, 1.4fr) minmax(78px, 0.55fr);
    gap: 12px;
  }

  .panel-grid,
  .panel-grid-balanced,
  .detail-grid,
  .detail-grid-wide,
  .plugin-detail-meta-grid,
  .plugin-detail-hero,
  .chatroom-scope-editor,
  .wechat-action-console,
  .wechat-action-code-grid {
    grid-template-columns: 1fr;
  }

  .page-section,
  .editor-surface {
    margin-bottom: 16px;
  }

  .page-section,
  .editor-surface,
  .work-surface,
  .panel {
    padding: 18px;
  }

  .table {
    min-width: 720px;
  }

  .page-section:has(> .table),
  .work-surface:has(> .table) {
    overflow-x: auto;
  }

  .section-head,
.toolbar,
.plugin-binding-card-head,
.chatroom-scope-card-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .form-grid.points-ledger-filter {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .auth-showcase {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .auth-brand {
    padding: 0;
  }

  .auth-showcase-copy h1,
  .auth-showcase-copy h2 {
    font-size: 32px;
  }

  .marketing-header-inner {
    grid-template-columns: 1fr auto;
    min-height: 66px;
  }

  .marketing-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    gap: 20px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
  }

  .marketing-hero {
    min-height: 500px;
  }

  .marketing-hero-copy {
    padding: 56px 0 80px;
  }

  .marketing-hero-signal {
    top: auto;
    right: 24px;
    bottom: 16px;
    width: 72px;
  }

  .marketing-hero-marker {
    top: auto;
    right: 112px;
    bottom: 38px;
    width: 20px;
    height: 20px;
  }

  .marketing-hero-copy h1 {
    font-size: 52px;
  }

  .marketing-hero-lead {
    font-size: 26px;
  }

  .marketing-section-heading {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .marketing-feature-grid,
  .marketing-steps,
  .marketing-plan-grid {
    grid-template-columns: 1fr;
  }

  .marketing-cta-band .marketing-section-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  /*
   * 820px 以下包含平板竖屏和窄窗口，此时多条件工具栏容易换成三到五行。默认只保留
   * 一行筛选摘要，存在有效条件时模板输出 open，用户仍能立即看到当前条件。
   */
  .compact-filter {
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .compact-filter-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
    gap: 12px;
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 560;
    list-style: none;
  }

  .compact-filter-summary::-webkit-details-marker {
    display: none;
  }

  .compact-filter:not([open]) > .compact-filter-form {
    display: none;
  }

  .compact-filter[open] > .compact-filter-form {
    display: grid;
  }

  .compact-filter-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding-top: 10px;
  }

  .compact-filter-field,
  .compact-filter-field-query {
    width: 100%;
    min-width: 0;
  }

  .compact-filter-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .marketing-header-inner,
  .marketing-footer-inner,
  .marketing-section-inner,
  .marketing-page-head-inner,
  .marketing-hero-copy,
  .marketing-notice {
    width: min(100% - 40px, 520px);
  }

  .brand-copy small {
    display: block;
  }

  .account-summary {
    display: none;
  }

  .account-menu-trigger {
    grid-template-columns: 34px;
    padding-right: 5px;
  }

  .account-menu-trigger::after {
    display: none;
  }

  .time-metric-grid,
.provider-action-grid,
.chatroom-scope-grid,
.chatroom-scope-facts,
.wechat-action-facts {
    grid-template-columns: 1fr;
  }

  /* 手机指标默认仍保留两列；时间类细节单独采用单列，避免把短数字排成漫长卡片。 */
  .stats-grid:not(.time-metric-grid),
  .metrics-grid,
  .metric-band,
  .compact-grid:not(.time-metric-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-metric-band {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .platform-analytics-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 0;
  }

  .platform-analytics-kpis .metric-item {
    min-height: 104px;
  }

  .dashboard-kpi-grid,
  .proxy-metric-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-item {
    padding: 14px 16px;
  }

  .metric-item strong {
    font-size: 26px;
  }

  .metric-item-time strong,
  .metric-item-text strong {
    font-size: 14px;
  }

  .metric-item .muted-text {
    font-size: 12px;
  }

  .analytics-page-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .analytics-funnel-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .analytics-funnel-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .analytics-funnel-value {
    grid-column: 2;
    grid-row: 1;
  }

  .analytics-summary-grid {
    gap: 0 18px;
  }

  .platform-analytics-surface {
    padding: 0;
  }

  .analytics-health-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .analytics-health-row .badge {
    grid-column: 2;
    justify-self: start;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .connection-step {
    justify-content: center;
    padding: 13px 8px;
  }

  .connection-step strong {
    display: none;
  }

  .account-empty-state {
    align-items: flex-start;
    flex-direction: column;
  }

  .full-row {
    grid-column: auto;
  }

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

  .section-tabs {
    gap: 6px;
  }

  .editor-surface,
  .work-surface,
  .panel,
  .auth-form-card,
  .login-card,
  .auth-complete-card {
    padding: 18px;
  }

  .marketing-header-inner {
    min-height: 62px;
  }

  .marketing-brand-mark {
    width: 34px;
    height: 34px;
  }

  .marketing-actions .btn-secondary {
    display: none;
  }

  .marketing-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .marketing-hero {
    min-height: 0;
  }

  .marketing-hero-signal {
    top: auto;
    right: 20px;
    bottom: 16px;
    left: auto;
    width: 72px;
    height: 72px;
  }

  .marketing-hero-marker {
    top: auto;
    right: 104px;
    bottom: 38px;
    width: 20px;
    height: 20px;
  }

  .marketing-hero-copy h1 {
    font-size: 48px;
  }

  .marketing-hero-lead {
    font-size: 23px;
  }

  .marketing-hero-summary {
    font-size: 15px;
  }

  .marketing-hero-actions,
  .marketing-hero-points {
    align-items: stretch;
    flex-direction: column;
  }

  .marketing-hero-points {
    gap: 8px;
  }

  .marketing-section,
  .marketing-page-head,
  .marketing-cta-band {
    padding: 48px 0;
  }

  .marketing-section-heading h2,
  .marketing-page-head h1,
  .marketing-cta-band h2 {
    font-size: 31px;
  }

  .access-register-form {
    grid-template-columns: 1fr;
  }

  .access-form input {
    /* 认证输入保持 16px，避免手机聚焦时浏览器放大页面并遮挡登录动作。 */
    font-size: 16px;
  }

  .list-pagination {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* 触控下扩大命中区，桌面仍使用 36px 筛选与紧凑列表，不以缩小文字换取密度。 */
@media (pointer: coarse), (max-width: 820px) {
  .btn,
  .btn-small,
  .compact-filter-actions .btn,
  .compact-filter-summary,
  .section-tab,
  .analytics-range-option,
  .nav-popover-link,
  .record-action-trigger,
  .app-nav-trigger,
  .dashboard-chart-detail summary {
    min-height: 44px;
  }

  .form-grid input:where(:not([type="checkbox"]):not([type="radio"])),
  .form-grid select,
  .compact-filter-field input:where(:not([type="checkbox"]):not([type="radio"])),
  .compact-filter-field select {
    min-height: 44px;
  }

  .record-action-trigger,
  .app-nav-trigger,
  .app-modal-close {
    min-width: 44px;
  }
}

.app-nav-toggle:focus-visible ~ .app-topbar .app-nav-trigger {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  /* 系统要求减少动态效果时固定几何场景，正文和操作入口仍保持完整可用。 */
  .marketing-hero-signal,
  .marketing-hero-marker,
  .btn:hover,
  .btn:active {
    transform: none !important;
  }
}

/* 开发文档使用独立阅读列，左侧只放定位提示，避免把长接口正文挤成窄栏。 */
.developer-docs-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.developer-docs-aside {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  padding: 12px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* 目录由 markdown toc 扩展生成：外层 div.toc > ul，二级标题为一级条目，三级标题缩进。 */
.developer-docs-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.developer-docs-toc ul ul {
  padding-left: 14px;
}

.developer-docs-toc a {
  display: block;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-soft);
  text-decoration: none;
  border-radius: 6px;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.developer-docs-toc a:hover {
  color: var(--primary-strong);
  background: var(--primary-soft);
}

/* 正文 H1 已是页面标题，目录里只有其子级；锚点跳转时避开顶部固定栏。 */
.markdown-body h2,
.markdown-body h3 {
  scroll-margin-top: 92px;
}

.developer-docs-content {
  min-width: 0;
  padding: clamp(22px, 3vw, 40px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

/* Markdown 正文沿用后台的灰阶与圆角，代码和表格在窄屏下可以独立横向滚动。 */
.markdown-body {
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.78;
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  scroll-margin-top: 96px;
  color: var(--text);
}

.markdown-body h1 {
  margin-bottom: 20px;
  font-size: clamp(28px, 3vw, 40px);
}

.markdown-body h2 {
  margin-top: 42px;
  padding-bottom: 8px;
  font-size: 24px;
  border-bottom: 1px solid var(--border);
}

.markdown-body h3 {
  margin-top: 28px;
  font-size: 18px;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote {
  max-width: 900px;
}

.markdown-body li + li {
  margin-top: 5px;
}

.markdown-body blockquote {
  margin: 18px 0;
  padding: 12px 16px;
  color: var(--info);
  background: var(--info-soft);
  border-left: 3px solid var(--info);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.markdown-body pre {
  max-width: 100%;
  margin: 18px 0;
  padding: 16px 18px;
  overflow-x: auto;
  color: #e6edf3;
  background: #1f2937;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.markdown-body pre code {
  padding: 0;
  color: inherit;
  background: transparent;
  font-size: 13px;
  white-space: pre;
  word-break: normal;
}

.markdown-body table {
  display: block;
  max-width: 100%;
  margin: 18px 0;
  overflow-x: auto;
  border-collapse: collapse;
}

.markdown-body th,
.markdown-body td {
  min-width: 130px;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--border);
}

.markdown-body th {
  color: var(--text);
  background: var(--surface-muted);
  font-weight: 600;
}

.markdown-body a {
  color: var(--primary-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

@media (max-width: 820px) {
  .developer-docs-layout {
    grid-template-columns: 1fr;
  }

  .developer-docs-aside {
    position: static;
    max-height: 240px;
  }
}

@media (max-width: 560px) {
  .developer-docs-content {
    padding: 20px 16px;
    border-radius: var(--radius-lg);
  }

  .markdown-body {
    font-size: 14px;
  }

  .markdown-body h2 {
    margin-top: 32px;
    font-size: 21px;
  }
}

/* 统一身份展示：头像 + 昵称 + 下一行 ID，用于消息流水、会话和群成员列表。 */
.identity-cell { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }
.identity-avatar { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 13px; }
.identity-avatar img { width: 100%; height: 100%; object-fit: cover; }
.identity-lg .identity-avatar { width: 42px; height: 42px; flex-basis: 42px; border-radius: 12px; }
.identity-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.identity-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-id { color: var(--muted, #64748b); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 群详情使用 Glisse SegmentedControl 分段胶囊，支持滑动液态指示器且移动端自然滚动。 */
.chatroom-tabs {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  margin: 4px 0 22px;
  background: var(--lg-segment-track);
  border: 0.5px solid var(--lg-edge);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(12px) saturate(1.5);
  backdrop-filter: blur(12px) saturate(1.5);
  overflow-x: auto;
}
.chatroom-tabs a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 16px;
  border-radius: 999px;
  color: var(--text-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms var(--ease-out);
}
.chatroom-tabs a:hover { color: var(--text); }
.chatroom-tabs a.active {
  color: var(--text);
  background: var(--lg-segment-thumb);
  box-shadow: 0 1px 4px rgb(15 23 42 / 0.1), inset 0 1px 0 var(--lg-surface-edge);
  font-weight: 600;
}
.chatroom-tabs:has(> .lg-seg-indicator) a.active { background: transparent; box-shadow: none; }
.chatroom-tabs a:focus-visible { outline: 2px solid var(--lg-ring); outline-offset: -2px; }
.chatroom-tab-count { padding: 1px 7px; font-size: 12px; line-height: 1.5; border-radius: 999px; background: var(--lg-within); color: var(--muted); }
.chatroom-tabs .active .chatroom-tab-count { color: var(--primary); background: var(--primary-soft); }
.chatroom-plugins-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:0 0 12px; }
.chatroom-plugin-search { display:inline-flex; align-items:center; gap:8px; flex:1 1 240px; min-width:0; max-width:360px; padding:0 12px; min-height:36px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-soft); }
.chatroom-plugin-search input { width:100%; min-width:0; border:0; background:transparent; color:var(--text); font:inherit; font-size:13px; padding:6px 0; }
.chatroom-plugin-search input:focus { outline:0; }
.chatroom-plugin-search:focus-within { border-color:var(--primary); box-shadow:0 0 0 3px var(--focus); background:var(--surface); }
.chatroom-plugin-state-filter { margin-left:auto; }
.chatroom-plugin-title { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.chatroom-plugin-ver { padding:1px 6px; border-radius:6px; background:var(--surface-muted); color:var(--muted); font-size:11px; font-variant-numeric:tabular-nums; }
.chatroom-plugin-summary { display:flex; flex-wrap:wrap; gap:4px 10px; margin-top:4px; color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
.chatroom-plugin-source { color:var(--primary-strong); font-size:12px; font-weight:600; }
.chatroom-plugin-card .gf-head-copy p { max-width:960px; line-height:1.45; }
.chatroom-plugin-card .gf-head-copy p,
.chatroom-plugin-card .chatroom-plugin-summary { display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden; }
.chatroom-plugin-card .chatroom-plugin-warning { color:var(--warning); font-size:12px; margin-top:3px; }
/* 停用插件也允许预先编辑，保持表单文字清楚可读。 */
.gf-card.chatroom-plugin-card:not(.is-on) .gf-body { opacity:1; }
.chatroom-plugin-card .form-grid textarea { width:100%; min-width:0; resize:vertical; }
.chatroom-plugin-card textarea[name^="command__"] { min-height:64px; }
.chatroom-plugin-default-note { color:var(--muted); font-size:12px; margin:0; }
.chatroom-plugin-default-note a { color:var(--primary-strong); text-underline-offset:3px; }
.gf-foot.chatroom-plugin-footer { justify-content:space-between; flex-wrap:wrap; gap:12px; }
.chatroom-plugin-reset-actions { display:flex; flex-wrap:wrap; gap:6px; }
.chatroom-plugin-feedback { margin:0; color:var(--success); font-size:13px; }
.chatroom-plugin-feedback.is-error { color:var(--danger); }
@media (max-width:760px) {
  .chatroom-tabs { width:100%; margin-bottom:16px; }
  .chatroom-tabs a { padding:9px 12px; }
  .chatroom-plugin-state-filter { margin-left:0; }
  .chatroom-plugin-footer > .btn { margin-left:auto; }
}

/* ===== 全局下拉框(由 static/js/select.js 把原生 select 升级而来) =====
 * 触发按钮沿用输入框的底色、边框、圆角和聚焦环;选项面板沿用卡片阴影。
 * 原生 select 仍留在 DOM 里承载 value 与表单提交,只是视觉隐藏。 */
.ui-select {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

/* 使用元素选择器盖过 select:disabled，禁用时原生文字也必须保持透明。 */
select.ui-select-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  border: 0;
}

.ui-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 13px;
  color: var(--text);
  font: inherit;
  text-align: left;
  background: var(--lg-field-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 0 var(--lg-surface-edge);
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.ui-select-trigger:hover:not(:disabled) {
  background: var(--lg-field-glass-active);
  border-color: var(--border-strong);
}

.ui-select-trigger:focus-visible,
.ui-select-open .ui-select-trigger {
  outline: none;
  background: var(--surface-strong);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}

.ui-select-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

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

.ui-select.is-placeholder .ui-select-label {
  color: var(--muted);
}

/* 下拉箭头用 CSS 画,展开时翻转。 */
.ui-select-caret {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 200ms var(--ease-out), border-color 200ms ease;
}

.ui-select-open .ui-select-caret {
  margin-top: 3px;
  border-color: var(--primary);
  transform: rotate(-135deg);
}

.ui-select-panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  left: 0;
  min-width: 100%;
  max-width: min(420px, 90vw);
  max-height: 264px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  background-color: var(--lg-surface-elevated);
  --lg-glass: var(--lg-surface-elevated);
  --lg-blur: 22px;
  --lg-saturate: 1.85;
  border: 0;
  border-radius: 18px;
  box-shadow:
    inset 0 0 0 0.5px var(--lg-edge),
    0 18px 44px -8px var(--lg-shadow);
}

.ui-select-panel.lg-glass[data-rim] {
  box-shadow: 0 18px 44px -8px var(--lg-shadow);
}

.ui-select-panel[hidden] {
  display: none;
}

.ui-select-up .ui-select-panel {
  top: auto;
  bottom: calc(100% + 8px);
}

.ui-select-option {
  padding: 8px 12px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}

.ui-select-option.is-active {
  background: var(--lg-highlight);
}

.ui-select-option.is-selected {
  color: var(--primary);
  font-weight: 600;
  background: var(--lg-selection);
}

.ui-select-option.is-disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.55;
}

/* 有内置候选的文本配置：按名称或 ID 搜索，列表高度不撑开表单。 */
.config-suggestions {
  display: block;
  position: relative;
  min-width: 0;
}

.config-suggestions > input[type="text"] {
  width: 100%;
}

.config-suggestions-panel {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.config-suggestions-up .config-suggestions-panel {
  top: auto;
  bottom: calc(100% + 6px);
}

.config-suggestions-panel .ui-select-option {
  white-space: normal;
  overflow-wrap: anywhere;
}

.config-suggestions-panel .ui-select-option > span,
.config-suggestions-panel .ui-select-option > small {
  display: block;
}

.config-suggestions-panel .ui-select-option > small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.config-suggestions-count {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.config-suggestions-summary {
  overflow-wrap: anywhere;
}

/* 筛选栏里的紧凑下拉:与 compact-filter-field 的输入框同高同圆角。 */
.compact-filter-field .ui-select-trigger {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.compact-filter-field .ui-select-trigger:focus-visible,
.compact-filter-field .ui-select-open .ui-select-trigger {
  box-shadow: 0 0 0 3px var(--focus);
}

.compact-filter-field .ui-select-option {
  font-size: 13px;
}

@media (max-width: 1100px) {
  .ui-select-trigger {
    min-height: 44px;
  }
}

/* ===== 平台日志阅读器:框内滚动、按级别着色、字段徽标 ===== */
.log-reader {
  height: min(70vh, 720px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overscroll-behavior: contain;
}
.log-entry { border-bottom: 1px solid var(--border); border-left: 3px solid transparent; }
.log-entry > summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  padding: 7px 12px; cursor: pointer; list-style: none; font-size: 13px; line-height: 1.5;
}
.log-entry > summary::-webkit-details-marker { display: none; }
.log-entry > summary:hover { background: var(--surface-soft); }
.log-entry[open] > summary { background: var(--surface-muted); }
.log-error[open] > summary { background: var(--danger-soft); }
.log-warning[open] > summary { background: var(--warning-soft); }
.log-time { color: var(--muted); font-family: "Consolas", "SFMono-Regular", monospace; font-size: 12px; white-space: nowrap; }
.log-level { font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 4px; background: var(--surface-muted); color: var(--text-soft); }
.log-title { font-weight: 600; color: var(--text); }
.log-field { font-size: 12px; color: var(--text-soft); background: var(--surface-soft); border-radius: 4px; padding: 0 6px; max-width: 100%; overflow-wrap: anywhere; }
.log-field em { font-style: normal; color: var(--muted); margin-right: 4px; }
.log-source { margin-left: auto; font-size: 11px; color: var(--muted); }
.log-warning { border-left-color: var(--warning); background: var(--warning-soft); }
.log-warning .log-level { background: var(--warning); color: #fff; }
.log-error, .log-critical { border-left-color: var(--danger); background: var(--danger-soft); }
.log-error .log-level, .log-critical .log-level { background: var(--danger); color: #fff; }
.log-error .log-title, .log-critical .log-title { color: var(--danger); }
.log-raw {
  margin: 0; padding: 10px 14px; overflow-x: auto; max-height: 320px; overflow-y: auto;
  color: #e2e8f0; background: #0f172a; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: "Consolas", "SFMono-Regular", monospace; font-size: 12px; line-height: 1.55;
}

/* ===== 群功能卡片(群详情「群功能」「插件」主从工作台 + 插件详情页独立卡片) =====
   群详情在桌面(>=1024px)采用主从分栏:左侧为严格等高的 1px 细线清单，右侧固定展示当前选中项的配置表单与明细，
   避免多列网格高低参差与跨行炸开超大卡片；窄屏(<1024px)退化为单列互斥手风琴。 */
.gf-list {
  display: grid;
  gap: 10px;
  margin-bottom: var(--space-block);
  align-items: start;
}

.gf-card {
  background: var(--surface);
  -webkit-backdrop-filter: blur(16px) saturate(1.45);
  backdrop-filter: blur(16px) saturate(1.45);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.gf-card:hover,
.gf-card.is-open {
  background: var(--surface-strong);
  border-color: var(--border-strong);
}

.gf-mode-bar {
  margin-bottom: 14px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(16px) saturate(1.45);
  backdrop-filter: blur(16px) saturate(1.45);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.gf-mode-bar > .gf-head {
  padding: 12px 16px;
}

.gf-mode-bar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.gf-mode-bar-head p {
  margin: 0;
}

.gf-mode-bar .gf-head-actions.gf-mode-list {
  gap: 2px;
}

.gf-head {
  /* 介绍占剩余空间，操作列固定在右侧；点击标题区即可选中/展开。 */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  padding: 13px 16px;
  transition: background-color 160ms var(--ease-out);
}

.gf-head-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.gf-head-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 8px;
  min-width: 0;
}

.gf-head-copy h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

.gf-head-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gf-head-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.chatroom-feature-card .gf-head-copy p {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gf-detail-head {
  display: none;
}

.gf-extra {
  padding: 14px 20px 18px;
  background: var(--surface-soft);
  border-top: 1px solid var(--border);
}

/* 触发回复无前置表单区，右栏直接承接规则工作台，避免在细节头下方再套一层灰底盒。 */
.gf-extra:has(> .tr-panel) {
  padding: 16px 20px 20px;
  background: var(--surface);
  border-top: 0;
}

.gf-extra .pay-ledger {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
}

.gf-workbench-empty {
  display: none;
}

@media (min-width: 1024px) {
  .gf-workbench {
    --gf-rail-width: 400px;
    position: relative;
    display: grid;
    grid-template-columns: var(--gf-rail-width) minmax(0, 1fr);
    gap: 0 20px;
    align-items: start;
    align-content: start;
  }

  /* 主从分栏下左栏卡片必须关闭 backdrop-filter，否则按 CSS Filter 规范会建立新的包含块，
     导致子元素 .gf-collapse(position:absolute; left:420px; right:0) 相对 400px 左栏被压成 0 宽。 */
  .gf-workbench > .gf-card {
    grid-column: 1;
    border-radius: 0;
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    overflow: visible;
  }

  .gf-workbench > .gf-card + .gf-card {
    margin-top: -1px;
  }

  .gf-workbench > .gf-card:first-child {
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
  }

  /* 左栏卡片为避免截断右侧面板使用 overflow:visible，首尾项的 .gf-head 同步圆角防止选中底色溢出。 */
  .gf-workbench > .gf-card:first-child > .gf-head {
    border-top-left-radius: calc(var(--radius-md) - 1px);
    border-top-right-radius: calc(var(--radius-md) - 1px);
  }

  .gf-workbench > .gf-card:has(+ .gf-workbench-empty),
  .gf-workbench > .gf-card:last-child {
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
  }

  .gf-workbench > .gf-card:has(+ .gf-workbench-empty) > .gf-head,
  .gf-workbench > .gf-card:last-child > .gf-head {
    border-bottom-left-radius: calc(var(--radius-md) - 1px);
    border-bottom-right-radius: calc(var(--radius-md) - 1px);
  }

  .gf-workbench > .gf-card:hover,
  .gf-workbench > .gf-card.is-open {
    border-color: var(--border);
  }

  .gf-workbench > .gf-card > .gf-head {
    min-height: 70px;
  }

  .gf-workbench > .gf-card > .gf-head .gf-head-actions {
    gap: 10px;
  }

  /* 无右侧详情面板的项保留与箭头等宽的内边距，使左栏所有主开关严格垂直成列。 */
  .gf-workbench > .gf-card:not(.has-panel) > .gf-head .gf-head-actions {
    padding-right: 42px;
  }

  .gf-workbench > .gf-card.has-panel:hover > .gf-head {
    background: var(--surface-soft);
  }

  .gf-workbench > .gf-card.is-open > .gf-head {
    background: var(--primary-soft);
    box-shadow: inset 3px 0 0 var(--primary);
  }

  .gf-workbench > .gf-card.is-open > .gf-head h3 {
    color: var(--primary-strong);
  }

  /* 主从分栏下右侧箭头始终指向右侧详情面板，选中态以纯白圆底与靛紫箭头高亮。 */
  .gf-workbench > .gf-card .gf-toggle::before {
    transform: rotate(-90deg);
  }

  .gf-workbench > .gf-card.is-open .gf-toggle {
    color: var(--primary-strong);
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  }

  .gf-workbench > .gf-card.is-open .gf-toggle::before {
    transform: rotate(-90deg);
    background-color: var(--primary-strong);
  }

  .gf-workbench > .gf-card > .gf-collapse {
    position: absolute;
    top: 0;
    left: calc(var(--gf-rail-width) + 20px);
    right: 0;
    background: var(--surface);
    -webkit-backdrop-filter: blur(18px) saturate(1.45);
    backdrop-filter: blur(18px) saturate(1.45);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
  }

  .gf-workbench .gf-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }

  .gf-workbench .gf-detail-head-copy {
    min-width: 0;
  }

  .gf-workbench .gf-detail-head .chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .gf-workbench .gf-detail-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 680;
    letter-spacing: -0.015em;
    color: var(--text);
  }

  .gf-workbench .gf-detail-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
  }

  .gf-workbench .gf-body {
    background: var(--surface);
  }

  .gf-workbench .gf-foot {
    border-top: 1px solid var(--border);
  }

  .gf-workbench-empty:not([hidden]) {
    position: absolute;
    top: 0;
    left: calc(var(--gf-rail-width) + 20px);
    right: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 6px;
    min-height: 220px;
    padding: 32px;
    text-align: center;
    background: var(--surface-soft);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
  }

  .gf-workbench-empty p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .gf-workbench {
    --gf-rail-width: 348px;
  }
}

/* ===== 跨群聊天管理工作台（左侧统一房间清单 + 右侧配置与转发流水） ===== */
.relay-workbench {
  display: grid;
  gap: 20px;
  align-items: start;
}

@media (min-width: 1024px) {
  .relay-workbench {
    grid-template-columns: 320px minmax(0, 1fr);
  }

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

@media (min-width: 1024px) and (max-width: 1279px) {
  .relay-workbench {
    grid-template-columns: 272px minmax(0, 1fr);
  }
}

.relay-record-summary {
  min-width: 160px;
}

.relay-rail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.relay-rail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  transition: background-color 160ms var(--ease-out);
}

.relay-rail-item + .relay-rail-item {
  border-top: 1px solid var(--border);
}

.relay-rail-item:hover {
  background: var(--surface-soft);
}

.relay-rail-item.is-active {
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}

.relay-rail-item.is-paused .relay-rail-title-row strong {
  color: var(--muted);
}

.relay-rail-link {
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.relay-rail-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.relay-rail-title-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relay-rail-item.is-active .relay-rail-title-row strong {
  color: var(--primary-strong);
}

.relay-rail-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.relay-rail-sub {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relay-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.relay-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.relay-panel-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.015em;
  color: var(--text);
}

.relay-panel-head p {
  margin: 4px 0 0;
  font-size: 13px;
}

.relay-panel-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.relay-panel-head-actions form {
  margin: 0;
}

.relay-form {
  display: grid;
  gap: 18px;
}

.relay-section {
  display: grid;
  gap: 12px;
}

.relay-section h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
}

.relay-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.relay-account-groups {
  display: grid;
  gap: 12px;
}

.relay-account-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

.relay-account-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 10px 14px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.relay-account-head strong {
  color: var(--text);
  font-weight: 650;
}

.relay-group-rows {
  display: grid;
}

.relay-group-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 10px 14px;
  background: var(--surface);
  transition: background-color 160ms var(--ease-out);
}

.relay-group-row + .relay-group-row {
  border-top: 1px solid var(--border);
}

.relay-group-row.is-checked {
  background: var(--primary-soft);
}

.relay-group-row.is-occupied {
  opacity: 0.58;
  background: var(--surface-soft);
}

.relay-group-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 220px;
  min-width: 0;
  cursor: pointer;
}

.relay-group-row.is-occupied .relay-group-pick {
  cursor: not-allowed;
}

.relay-group-pick input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex: 0 0 auto;
}

.relay-group-name {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.relay-group-name strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relay-group-name small {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.relay-group-opts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.relay-group-opts[hidden] {
  display: none;
}

.relay-dir-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
  white-space: nowrap;
}

.relay-dir-flag input[type="checkbox"] {
  accent-color: var(--primary);
}

.relay-alias-input {
  width: 136px;
  min-height: 32px;
  padding: 4px 10px;
  color: var(--text);
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.relay-alias-input:focus-visible {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 3px var(--focus);
}

.relay-form-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.relay-records {
  display: grid;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.relay-records h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
}

@media (max-width: 720px) {
  .relay-panel {
    padding: 16px;
  }

  .relay-alias-input {
    width: 100%;
    min-width: 140px;
  }
}

.gf-master {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 36px;
  cursor: pointer;
}

.gf-master-text {
  color: var(--muted);
  font-size: 13px;
}

.gf-card.is-on .gf-master-text {
  color: var(--primary-strong);
  font-weight: 600;
}

/* iOS 26 / Glisse Liquid Glass 开关(.ui-switch):忠实移植 0kzh/glisse 比例与液态透镜抬升质感。
   保留真实 <input type="checkbox" role="switch"> 键盘、读屏与 switches.js 自动保存语义；
   glisse-engine.js 注入 .lg-switch-thumb 后，按压/拖动/点击时滑块抬升出轨道并化为清透折射玻璃滴。 */
.ui-switch {
  --lg-sw-w: 60px;
  --lg-sw-h: 26px;
  --lg-sw-thumb-w: 54px;
  --lg-sw-thumb-h: 34px;
  --lg-sw-rest-scale: 0.64;
  --lg-sw-travel: calc(var(--lg-sw-w) - 4px - var(--lg-sw-thumb-w) * var(--lg-sw-rest-scale));
  --lg-lift: 0;
  --lg-pos: 0;
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: var(--lg-sw-w);
  height: var(--lg-sw-h);
  overflow: visible;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.ui-switch input {
  position: absolute;
  inset: -6px -4px;
  z-index: 3;
  width: calc(100% + 8px);
  height: calc(100% + 12px);
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.ui-switch-track {
  position: absolute;
  inset: 0;
  overflow: visible;
  background: var(--lg-track);
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.16);
  transition: background-color 200ms var(--ease-out);
}

/* 轨道激活填色层：拖动过程中由 --lg-pos 实时平滑过渡，未挂载脚本时退回 :checked 规则。 */
.ui-switch-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--lg-on);
  opacity: var(--lg-pos, 0);
  pointer-events: none;
}

.ui-switch:not([data-lg-switch]) input:checked + .ui-switch-track {
  background: var(--lg-on);
}

/* 无脚本兜底滑块（glisse-engine.js 接管后由真实 .lg-switch-thumb 替代）。 */
.ui-switch:not([data-lg-switch]) .ui-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 34px;
  height: calc(var(--lg-sw-h) - 4px);
  background: #ffffff;
  border-radius: 999px;
  box-shadow:
    0 3px 10px rgb(0 0 0 / 0.22),
    inset 0 0 0 0.5px rgb(255 255 255 / 0.85);
  transition: transform 240ms cubic-bezier(0.22, 1.28, 0.36, 1);
}

.ui-switch:not([data-lg-switch]) input:checked + .ui-switch-track::after {
  transform: translateX(var(--lg-sw-travel));
}

/* Glisse 真实液态玻璃滑块：静止时居中缩为润泽白胶囊，抬升时放大超越轨道并透出下方色彩与高光棱边。 */
.ui-switch .lg-switch-thumb {
  --lg-settled: calc(1 - var(--lg-lift, 0));
  --lg-thumb-blur: calc(2px * var(--lg-settled) + 0.6px * var(--lg-lift, 0));
  --lg-thumb-scale: calc(var(--lg-sw-rest-scale) + (1 - var(--lg-sw-rest-scale)) * var(--lg-lift, 0));
  position: absolute;
  top: 50%;
  left: calc(2px - var(--lg-sw-thumb-w) * (1 - var(--lg-sw-rest-scale)) / 2);
  z-index: 2;
  width: var(--lg-sw-thumb-w);
  height: var(--lg-sw-thumb-h);
  border-radius: 999px;
  pointer-events: none;
  transform: translate3d(calc(var(--lg-sw-travel) * var(--lg-pos, 0)), -50%, 0) scale(var(--lg-thumb-scale));
  -webkit-backdrop-filter: blur(var(--lg-thumb-blur)) brightness(calc(1 + 0.14 * var(--lg-settled))) saturate(1.75);
  backdrop-filter: blur(var(--lg-thumb-blur)) brightness(calc(1 + 0.14 * var(--lg-settled))) saturate(1.75);
  box-shadow:
    0 6px 22px rgb(0 0 0 / calc(0.18 + 0.08 * var(--lg-lift, 0))),
    inset 0 0 0 1.4px rgb(255 255 255 / calc(0.55 + 0.25 * var(--lg-lift, 0))),
    inset 0 2px 1px rgb(255 255 255 / 0.52),
    inset 2px 6px 18px rgb(0 0 0 / 0.09),
    inset -2px -6px 18px rgb(255 255 255 / 0.20);
  will-change: transform;
}

.ui-switch .lg-thumb-face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #ffffff;
  opacity: calc(1 - 0.86 * var(--lg-lift, 0));
}

.ui-switch input:focus-visible + .ui-switch-track {
  outline: 2px solid var(--lg-ring);
  outline-offset: 2px;
}

.ui-switch-small {
  --lg-sw-w: 48px;
  --lg-sw-h: 22px;
  --lg-sw-thumb-w: 42px;
  --lg-sw-thumb-h: 28px;
}

.ui-switch-small:not([data-lg-switch]) .ui-switch-track::after {
  width: 27px;
}

.gf-body {
  display: grid;
  gap: 18px;
  padding: 18px 20px;
  background: var(--surface-soft);
  transition: opacity 180ms var(--ease-out);
}

/* 总开关关闭时设置区变淡,提示“这些设置当前不生效”;仍可编辑,保存后下次开启即用。 */
.gf-card:not(.is-on) .gf-body {
  opacity: 0.55;
}

.gf-section h4 {
  margin: 0 0 10px;
}

/* 小节标题、明细卡片标题共用一套:卡片标题(h3)16px,其下各级标题统一 14px,同一字体、同一粗细。 */
.gf-section h4,
.config-section h4,
.pay-ledger-title {
  color: var(--text);
  font-family: "Albert Sans", "Noto Sans SC", sans-serif;
  font-size: 14px;
  font-weight: 600;
}

.gf-switch-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px 16px;
}

.gf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 10px 16px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.gf-row + .gf-row {
  box-shadow: inset 0 1px 0 var(--surface-muted);
}

.gf-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.gf-switch-list + .gf-inputs {
  margin-top: 14px;
}

.gf-field {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.gf-field-wide {
  grid-column: 1 / -1;
}

/* 配置字段使用 grid 布局，需显式保证 hidden 仍生效；来源切换只隐藏字段，不清空值。 */
.gf-field[hidden] {
  display: none;
}

.gf-field-label {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
}

.gf-field input,
.gf-field select:not(.ui-select-native) {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.gf-field input:hover,
.gf-field select:not(.ui-select-native):hover {
  border-color: var(--border-strong);
}

.gf-field input:focus-visible,
.gf-field select:not(.ui-select-native):focus-visible {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 4px var(--focus);
}

.gf-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.gf-row.is-dim,
.gf-field.is-dim {
  opacity: 0.5;
}

.gf-foot {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
  background: var(--surface-soft);
}

.gf-head-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 16px;
  justify-self: end;
}

.gf-field textarea {
  width: 100%;
  padding: 8px 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  resize: vertical;
}

.gf-field textarea:focus-visible {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 4px var(--focus);
}

@media (max-width: 720px) {
  .gf-head {
    align-items: start;
    gap: 8px 12px;
    padding: 16px;
  }

  /* 手机上标题和操作仍各占一侧，介绍与摘要换到完整的一行，避免正文挤成细列。 */
  .gf-head-copy {
    display: contents;
  }

  .gf-head-copy > * {
    grid-column: 1 / -1;
  }

  .gf-head-copy > :first-child {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }

  .gf-head-actions {
    grid-column: 2;
    grid-row: 1;
    gap: 10px;
  }

  .gf-head-actions .gf-toggle {
    width: 44px;
    height: 44px;
  }

  .gf-mode-bar > .gf-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .gf-mode-bar .gf-head-copy {
    display: flex;
  }

  .gf-mode-bar .gf-head-actions.gf-mode-list {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    justify-content: space-between;
  }

  .gf-mode-bar .gf-mode {
    flex: 1 1 0;
    justify-content: center;
  }

  .gf-body {
    gap: 16px;
    padding: 16px;
  }

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

/* 群运行模式:与顶部导航统一的 Glisse 分段控制器，支持滑动液态胶囊指示器。 */
.gf-mode-list {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px;
  background: var(--lg-segment-track);
  border: 0.5px solid var(--lg-edge);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(12px) saturate(1.5);
  backdrop-filter: blur(12px) saturate(1.5);
}

.gf-mode {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.gf-mode:hover {
  color: var(--text);
}

.gf-mode.is-selected {
  background: var(--lg-segment-thumb);
  box-shadow: 0 1px 4px rgb(15 23 42 / 0.1), inset 0 1px 0 var(--lg-surface-edge);
}

.gf-mode-list:has(> .lg-seg-indicator) .gf-mode.is-selected {
  background: transparent;
  box-shadow: none;
}

.gf-mode:has(input:focus-visible) {
  outline: 2px solid var(--lg-ring);
  outline-offset: 1px;
}

.gf-mode input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.gf-mode-text {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.gf-mode-text strong {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 560;
  transition: color 160ms var(--ease-out);
}

.gf-mode.is-selected .gf-mode-text strong {
  color: var(--primary-strong);
  font-weight: 640;
}

.gf-mode-text small {
  display: none;
}

@media (max-width: 720px) {
  .gf-mode-list {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .gf-mode {
    min-height: 38px;
    padding: 0 6px;
  }
}

/* 表单里的开关行(如 AI 助手页):在 .form-grid 内也保持"文字在左、开关在右",并避免被表单输入框样式撑变形。 */
.gf-switch-list-soft {
  background: var(--surface-soft);
}

.form-grid .gf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.form-grid .ui-switch input {
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

/* 配置以平面分组承载字段；同组内才允许自然换行，不把所有参数混在一条流里。
   这里与共享配置组件放在一起维护，替换旧 compact 覆盖，不再追加末尾补丁。 */
.form-grid.config-stack {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}

.config-section {
  min-width: 0;
  margin: 0;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius-md);
}

.config-section h4 {
  margin: 0 0 14px;
  line-height: 1.5;
}

.config-section-hint {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.form-grid.config-flow,
.gf-inputs.config-flow,
.config-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.config-field {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  color: var(--text-soft);
  font-size: 13px;
}

.config-field > span:first-child {
  min-height: 20px;
  line-height: 20px;
}

.config-field > small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.config-flow > .config-field {
  flex: 1 1 260px;
}

.config-flow > .config-field-short {
  flex: 1 1 160px;
  max-width: 240px;
}

.config-flow > .full-row,
.config-flow > .config-field-wide {
  flex: 0 0 100%;
  width: 100%;
  max-width: none;
}

.config-flow > [hidden],
.plugin-revoke-range[hidden] {
  display: none;
}

.config-flow .config-switch,
.gf-switch-list .config-switch {
  /* 文字与所属开关共用一个轻量边界，避免并排时把前一项的开关误看成后一项的操作。
     内边距给柔影和文字留出空间，右侧开关仍按同一内容边缘对齐。 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  min-height: 52px;
  margin: 0;
  padding: 12px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}

.config-switch .gf-row-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.config-switch .field-hint {
  display: block;
  margin-top: 4px;
  font-weight: 400;
  line-height: 1.6;
}

.config-section .gf-field input,
.config-section .gf-field select:not(.ui-select-native),
.config-section .gf-field textarea {
  background: var(--surface-soft);
}

.plugin-delivery-settings > .field-hint {
  max-width: 800px;
  margin: 12px 0 0;
  line-height: 1.6;
}

.plugin-revoke-range {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  width: 100%;
  max-width: 356px;
  min-width: 0;
}

.plugin-revoke-range .config-field {
  flex: 1;
}

.plugin-revoke-range-separator {
  align-self: flex-end;
  padding-bottom: 10px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .config-section {
    padding: 16px;
  }

  .config-flow > .config-field {
    flex: 1 1 100%;
    max-width: none;
  }

  /* 两个足够短的数字可并排；为可能换成两行的标签预留相同高度，保持输入框对齐。 */
  .config-flow > .config-field-numeric {
    flex: 1 1 104px;
    max-width: 240px;
  }

  .config-field-numeric > span:first-child {
    min-height: 40px;
  }
}

.gf-row-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.gf-row-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

/* 消息中心共用一个面板，筛选栏固定，会话列表和聊天记录独立滚动。 */
.msg-center {
  display: grid;
  grid-template-columns: clamp(154px, 15%, 218px) clamp(242px, 26%, 350px) minmax(0, 1fr);
  height: calc(100dvh - 200px);
  min-height: 460px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.wechat-account-rail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 10px;
  overflow: auto;
  background: var(--surface-soft);
  border-inline-end: 1px solid var(--border);
}

.wechat-account-rail h2,
.wechat-inbox-tools h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.wechat-account-rail h2 { margin: 0 8px 12px; }
.wechat-account-rail a {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 48px;
  padding: 6px 8px;
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.wechat-account-rail a:hover { background: var(--surface-muted); }
.wechat-account-rail a[aria-current] { color: var(--primary-strong); background: var(--primary-soft); }
.wechat-account-rail a:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.wechat-account-rail .identity-name { white-space: normal; overflow-wrap: anywhere; }
.wechat-account-rail .identity-avatar { background: var(--surface-muted); color: var(--muted); }
.wechat-account-rail [aria-current] .identity-avatar { color: var(--surface); background: var(--primary-strong); }

.wechat-inbox-directory {
  display: flex;
  justify-content: space-around;
  gap: 4px;
  padding: 4px 8px;
  border-top: 1px solid var(--border);
}
.wechat-inbox-directory a {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 36px;
  padding-inline: 8px;
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 13px;
}
.wechat-inbox-directory a:hover { color: var(--primary-strong); background: var(--surface-soft); }

.wechat-inbox,
.wechat-thread {
  min-width: 0;
  min-height: 0;
}

.wechat-inbox {
  display: flex;
  flex-direction: column;
  border-inline-end: 1px solid var(--border);
}

.wechat-inbox-tools {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.msg-kind-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.msg-kind-tab {
  display: grid;
  min-height: 36px;
  place-items: center;
  color: var(--text-soft);
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.msg-kind-tab:hover {
  background: var(--primary-soft);
}

.msg-kind-tab.active {
  color: var(--surface);
  background: var(--primary-strong);
}

.wechat-inbox-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline: 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.wechat-inbox-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}

.wechat-inbox-search input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.wechat-conversation-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.wechat-conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  color: inherit;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.wechat-conversation-item:hover {
  background: var(--surface-soft);
}

.wechat-conversation-item.active {
  background: var(--primary-soft);
  box-shadow: inset 3px 0 var(--primary);
}

.wechat-conversation-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.wechat-conversation-item .wechat-avatar {
  border-radius: 50%;
}

.wechat-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 14px;
  font-weight: 650;
}

.wechat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wechat-conversation-copy {
  flex: 1;
  min-width: 0;
}

.wechat-conversation-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.wechat-conversation-name,
.wechat-conversation-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 群名占用时间之外的剩余空间，长名称在自身范围省略，避免被右侧时间挤成零宽。 */
.wechat-conversation-name {
  flex: 1;
  min-width: 0;
}

.msg-kind-badge {
  margin-right: 4px;
  color: var(--warning);
  font-size: 13px;
  vertical-align: -0.15em;
}

.wechat-conversation-preview {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.wechat-conversation-time {
  /* 短时间不参与压缩，首屏与自动刷新使用相同的名称／时间空间分配。 */
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wechat-thread {
  display: flex;
  flex-direction: column;
}

.wechat-thread-head {
  flex: 0 0 auto;
  position: relative;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
}

.wechat-inbox-back {
  display: none;
}

.wechat-thread-head h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  font-size: 17px;
}

.wechat-thread-head p {
  margin: 2px 0 0;
  font-size: 13px;
}

/* 对话区占满剩余高度,只在这里滚动;底色比卡片略深,气泡才有层次。 */
.wechat-thread-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 22px;
  overflow-y: auto;
  background: var(--surface-soft);
  overscroll-behavior: contain;
}

.wechat-thread-idle {
  display: grid;
  height: 100%;
  align-content: center;
  justify-items: center;
  color: var(--muted);
}

.wechat-thread-idle .i {
  font-size: 32px;
}

.wechat-load-hint {
  padding: 4px 0 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.wechat-message-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
}

.wechat-message-row.out {
  flex-direction: row-reverse;
}

.wechat-message-row .wechat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.wechat-message-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  max-width: 76%;
}

.wechat-message-row.out .wechat-message-main {
  align-items: flex-end;
}

.wechat-message-meta {
  max-width: 100%;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.wechat-msg-status {
  margin-left: 6px;
  padding: 1px 8px;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 999px;
}

.wechat-message-bubble {
  position: relative;
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 6px var(--radius-md) var(--radius-md) var(--radius-md);
  box-shadow: 0 1px 3px var(--border-strong);
}

.wechat-message-bubble.out {
  background: color-mix(in srgb, var(--lg-on) 24%, var(--surface-strong));
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--lg-on) 26%, transparent);
  border-radius: var(--radius-md) 6px var(--radius-md) var(--radius-md);
  box-shadow: none;
}

.wechat-send-error {
  position: absolute;
  top: 50%;
  left: -27px;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  color: #ffffff;
  background: var(--danger);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
}

.wechat-message-content {
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.wechat-empty {
  display: grid;
  min-height: 240px;
  place-items: center;
  color: var(--muted);
}

/* 输入和工具栏共用浅灰底座，编辑区在上，媒体入口与发送按钮在下。 */
.wechat-composer {
  position: relative;
  flex: 0 0 auto;
  padding: 12px 18px 10px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.wechat-composer-box {
  display: flex;
  flex-direction: column;
  padding: 12px 12px 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: border-color 200ms ease-in-out, box-shadow 200ms ease-in-out, background-color 200ms ease-in-out;
}

.wechat-composer-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}

.wechat-composer-box textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 88px;
  max-height: 140px;
  padding: 2px 4px 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  box-shadow: none;
  line-height: 1.55;
  outline: 0;
  resize: none;
}

.wechat-composer-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 8px;
}

.wechat-send {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 38px;
  margin-left: auto;
  padding: 0 14px;
  color: #ffffff;
  background: var(--primary-strong);
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.18);
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
  transition: background-color 200ms ease-in-out, box-shadow 200ms ease-in-out, opacity 200ms ease-in-out;
}

.wechat-send:hover:not(:disabled) {
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.24);
}

.wechat-send:disabled {
  background: var(--border-strong);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.7;
}

.wechat-composer-hint {
  margin: 4px 4px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.wechat-composer-hint.is-error {
  color: var(--danger);
}

.wechat-composer-tools {
  display: flex;
  align-items: center;
}

.wechat-mentions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.wechat-mention-picker {
  position: absolute;
  z-index: 40;
  bottom: calc(100% - 8px);
  left: 18px;
  width: min(380px, calc(100% - 36px));
  max-height: 240px;
  padding: 5px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.wechat-mention-picker button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
}

.wechat-mention-picker button:hover,
.wechat-mention-picker button[aria-selected="true"] {
  background: var(--primary-soft);
}

.wechat-mention-picker .wechat-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.wechat-mention-picker button > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.wechat-mention-picker-status {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
}

.wechat-tool {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-height: 36px;
  padding: 0;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.wechat-mentions button {
  min-height: 36px;
  padding: 4px 10px;
  color: var(--text-soft);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.wechat-tool:hover,
.wechat-tool:focus-visible,
.wechat-context-menu button:hover,
.wechat-context-menu button:focus-visible {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.wechat-tool:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.wechat-tool:disabled {
  opacity: .5;
  cursor: wait;
}

.wechat-composer-context {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 12px;
}

.wechat-composer-context > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wechat-attachment > img {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
}

.wechat-attachment select {
  flex: 0 0 auto;
  width: auto;
  max-width: 94px;
  min-height: 32px;
  padding: 3px 5px;
  color: var(--text-soft);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
}

.wechat-composer-context button {
  flex: 0 0 auto;
  width: 32px;
  min-height: 32px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 20px;
}

.wechat-context-menu {
  position: fixed;
  z-index: 1100;
  min-width: 168px;
  max-width: calc(100vw - 16px);
  padding: 6px;
  background-color: var(--lg-surface-elevated);
  --lg-glass: var(--lg-surface-elevated);
  --lg-blur: 20px;
  --lg-saturate: 1.8;
  border: 0;
  border-radius: 18px;
  box-shadow:
    inset 0 0 0 0.5px var(--lg-edge),
    0 18px 44px -8px var(--lg-shadow);
}

.wechat-context-menu button {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
}

.wechat-context-menu button:disabled {
  color: var(--muted);
  cursor: default;
}

.wechat-context-menu [data-message-action="revoke"] {
  color: var(--danger);
}

/* 组件的 display 规则不能覆盖浏览器的 hidden 行为。 */
.wechat-context-menu[hidden],
.wechat-context-menu button[hidden],
.wechat-mention-picker[hidden],
.wechat-composer-context[hidden],
.wechat-mentions[hidden] {
  display: none;
}

@media (pointer: coarse) {
  .wechat-tool,
  .wechat-context-menu button,
  .wechat-composer-context button,
  .wechat-attachment select,
  .wechat-mentions button {
    min-height: 44px;
  }

  .wechat-tool {
    width: 44px;
  }

  .wechat-send {
    min-height: 44px;
  }
}

@media (max-width: 820px) {
  .msg-center {
    grid-template-columns: minmax(0, 1fr);
  }

  .msg-center[data-conversation-id=""] { grid-template-rows: auto minmax(0, 1fr); }
  .wechat-account-rail {
    min-width: 0;
    flex-direction: row;
    align-items: center;
    padding: 6px 10px;
    border: 0;
    border-bottom: 1px solid var(--border);
  }
  .wechat-account-rail h2 { margin: 0 4px; flex-shrink: 0; font-size: 13px; }
  .wechat-account-rail a { max-width: 175px; min-height: 44px; }
  .wechat-account-rail .identity-name { white-space: nowrap; }
  .wechat-inbox-directory a { min-height: 44px; }
  .msg-center:not([data-conversation-id=""]) .wechat-account-rail { display: none; }
  .wechat-thread-head { padding-inline-start: 56px; }

  .wechat-inbox {
    border: 0;
  }

  .msg-center[data-conversation-id=""] .wechat-thread,
  .msg-center:not([data-conversation-id=""]) .wechat-inbox {
    display: none;
  }

  .wechat-inbox-back {
    position: absolute;
    inset-inline-start: 6px;
    top: 50%;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    color: var(--text-soft);
    transform: translateY(-50%);
  }

  .wechat-thread-head,
  .msg-kind-tab,
  .wechat-inbox-search input {
    min-height: 44px;
  }

  .wechat-message-main {
    max-width: 88%;
  }
}

/* ===== 收款明细与统计(自动抢红包 / 自动收款底下的折叠卡片) ===== */
.pay-ledger {
  margin: 14px 20px 18px;
  background: var(--surface-soft);
  border-radius: var(--radius-md);
}

.gf-card .pay-ledger {
  margin-top: 0;
}

.pay-ledger > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}

.pay-ledger {
  --disclosure-inset: 16px;
}

.pay-ledger-sum {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.pay-ledger-body {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.pay-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pay-stat {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

.pay-stat-label {
  color: var(--muted);
  font-size: 12px;
}

.pay-stat strong {
  font-size: 20px;
  font-weight: 650;
}

.pay-stat small {
  color: var(--muted);
}

.pay-attention,
.pay-chip-danger {
  color: var(--danger);
}

.pay-chip-warning {
  color: var(--warning);
}

.pay-table-wrap {
  max-height: 360px;
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

.pay-note {
  margin: 0;
  font-size: 12px;
}

@media (max-width: 720px) {
  .pay-stats {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ===== 功能卡片的设置区折叠 ===== */
.gf-toggle {
  display: inline-grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  background: var(--secondary);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 200ms ease-in-out, color 200ms ease-in-out;
}

.gf-toggle:hover {
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.gf-card.is-open .gf-toggle::before {
  transform: rotate(180deg);
}

.gf-head-copy[data-gf-toggle-title] {
  cursor: pointer;
}

.gf-collapse[hidden] {
  display: none;
}

/* ===== 展开/收起:整个工程统一用右侧的小箭头图标(不用"展开""设置"这类小文字) =====
   图标只画一份(--icon-chevron),<details class="disclosure"> 的右侧箭头、功能卡片的折叠按钮都用它;展开时翻转。
   下拉菜单(更多、账号菜单、"…"操作)是弹出菜单,不属于展开内容,不使用这套图标。 */
:root {
  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

details.disclosure > summary {
  position: relative;
  padding-right: calc(var(--disclosure-inset, 0px) + 28px);
  cursor: pointer;
  list-style: none;
}

details.disclosure > summary::-webkit-details-marker {
  display: none;
}

details.disclosure > summary::after,
.gf-toggle::before {
  content: "";
  width: 16px;
  height: 16px;
  background-color: var(--muted);
  -webkit-mask: var(--icon-chevron) center / contain no-repeat;
  mask: var(--icon-chevron) center / contain no-repeat;
  transition: transform 200ms ease-in-out, background-color 200ms ease-in-out;
}

details.disclosure > summary::after {
  position: absolute;
  top: 50%;
  right: var(--disclosure-inset, 0px);
  margin-top: -8px;
}

details.disclosure[open] > summary::after {
  transform: rotate(180deg);
}

details.disclosure > summary:hover::after {
  background-color: var(--primary-strong);
}

/* 自己带内边距的展开块:箭头与文字左侧对称留出同样的边距。 */
.action-disclosure {
  --disclosure-inset: 17px;
}

.log-entry {
  --disclosure-inset: 12px;
}

/* ===== 提示条(appToast)与点击即保存的开关 ===== */
.app-toast-host {
  position: fixed;
  right: 0;
  bottom: 28px;
  left: 0;
  z-index: 1200;
  display: grid;
  justify-items: center;
  gap: 10px;
  pointer-events: none;
}

.app-toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 18px 11px 14px;
  color: var(--text);
  background-color: var(--lg-surface-elevated);
  --lg-glass: var(--lg-surface-elevated);
  --lg-blur: 20px;
  --lg-saturate: 1.85;
  border-radius: 999px;
  box-shadow:
    inset 0 0 0 0.5px var(--lg-edge),
    0 16px 40px -8px var(--lg-shadow);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: opacity 220ms var(--ease-out), transform 260ms cubic-bezier(0.22, 1.16, 0.36, 1);
}

.app-toast.lg-glass[data-rim] {
  box-shadow: 0 16px 40px -8px var(--lg-shadow);
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.app-toast-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--success);
}

/* 图标用圆形底色 + 白色符号叠出:成功是对勾,失败是感叹号,提示是 i。 */
.app-toast-icon {
  position: relative;
}

.app-toast-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  -webkit-mask: var(--toast-glyph) center / 12px no-repeat;
  mask: var(--toast-glyph) center / 12px no-repeat;
}

.app-toast-success {
  --toast-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

.app-toast-danger {
  --toast-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M12 6v7'/%3E%3Cpath d='M12 18.2v.1'/%3E%3C/svg%3E");
}

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

.app-toast-info {
  --toast-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M12 11v7'/%3E%3Cpath d='M12 5.8v.1'/%3E%3C/svg%3E");
}

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

/* 提交中或只读禁用态：开关视觉降饱和并给出明确光标语义。 */
.ui-switch.is-busy {
  opacity: 0.6;
}

.ui-switch:has(input:disabled):not(.is-busy) {
  opacity: 0.46;
}

.ui-switch.is-busy input:disabled {
  cursor: progress;
}

.ui-switch:not(.is-busy) input:disabled {
  cursor: not-allowed;
}

/* 表单里的"启用"开关字段(员工、插件绑定):文字在左、开关在右,与其他开关行一致。 */
.form-grid .switch-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
}

.ui-switch input[type="hidden"] {
  display: none;
}

/* ===== 朋友圈 ===== */
.moments-page {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.moments-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.moments-accounts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.moments-account-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  background: var(--surface-muted);
  border-radius: 12px;
}

.moments-account-tab {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  color: var(--text-soft);
  border-radius: 9px;
  font-size: 13px;
  text-decoration: none;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.moments-account-tab:hover {
  color: var(--primary-strong);
}

.moments-account-tab.active {
  color: var(--primary-strong);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  font-weight: 600;
}

.moments-note {
  margin: 0;
  font-size: 13px;
}

.moments-feed {
  display: grid;
  gap: 16px;
}

.moment-card {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.moment-avatar {
  flex: 0 0 auto;
}

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

.moment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.moment-name {
  color: var(--primary-strong);
}

.moment-time {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.moment-content {
  margin: 8px 0 0;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.moment-media {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-width: 420px;
  margin-top: 10px;
}

.moment-media-single {
  grid-template-columns: minmax(0, 260px);
}

/* 单张竖图/竖视频太高时截到一屏内能看清的高度(cover 裁切) */
.moment-media-single .moment-thumb {
  max-height: 340px;
}

.moment-thumb {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
}

.moment-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.moment-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.moment-stat.is-active {
  color: var(--primary-strong);
  font-weight: 600;
}

.moment-comments {
  margin-top: 8px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  --disclosure-inset: 12px;
}

.moment-comments > summary {
  padding: 8px 12px;
  font-size: 13px;
}

.moment-comments ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 12px 10px;
  list-style: none;
  font-size: 13px;
}

.moments-more {
  text-align: center;
}

@media (max-width: 720px) {
  .moment-card {
    padding: 14px;
  }
}

/* hidden 属性必须真的隐藏:.chip、.btn 这类设置了 display 的元素会盖过浏览器默认的 [hidden] 样式
   (朋友圈的"正在取回"标签、群列表的"只采集"标签、群插件的"已自定义"标签都靠它显示/隐藏)。 */
[hidden] {
  display: none !important;
}

/* ===== 消息中心的消息卡片:引用、链接/小程序/聊天记录/通知、媒体占位 ===== */
:root {
  --icon-msg-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='3'/%3E%3Ccircle cx='9' cy='10' r='1.6'/%3E%3Cpath d='m21 16-5-5-8 8'/%3E%3C/svg%3E");
  --icon-msg-video: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='13' height='14' rx='3'/%3E%3Cpath d='m16 10 5-3v10l-5-3z'/%3E%3C/svg%3E");
  --icon-msg-voice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3'/%3E%3C/svg%3E");
  --icon-msg-emoji: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8.5 14a4 4 0 0 0 7 0M9 9.5v.01M15 9.5v.01'/%3E%3C/svg%3E");
  --icon-msg-file: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5'/%3E%3C/svg%3E");
  --icon-msg-link: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1'/%3E%3Cpath d='M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1'/%3E%3C/svg%3E");
  --icon-msg-mini_program: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  --icon-msg-merged: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 6h14M5 12h14M5 18h9'/%3E%3C/svg%3E");
  --icon-msg-notice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9a6 6 0 0 1 12 0c0 6 2 7 2 7H4s2-1 2-7'/%3E%3Cpath d='M10 20a2 2 0 0 0 4 0'/%3E%3C/svg%3E");
  --icon-msg-unknown: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v5M12 16v.01'/%3E%3C/svg%3E");
}

.msg-card-icon,
.msg-media-icon {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
}

.msg-card-icon::after,
.msg-media-icon::after {
  content: "";
  position: absolute;
  inset: 10px;
  background-color: var(--primary-strong);
  -webkit-mask: var(--glyph) center / contain no-repeat;
  mask: var(--glyph) center / contain no-repeat;
}

[data-icon="image"] {
  --glyph: var(--icon-msg-image);
}

[data-icon="video"] {
  --glyph: var(--icon-msg-video);
}

[data-icon="voice"] {
  --glyph: var(--icon-msg-voice);
}

[data-icon="emoji"] {
  --glyph: var(--icon-msg-emoji);
}

[data-icon="file"] {
  --glyph: var(--icon-msg-file);
}

[data-icon="link"] {
  --glyph: var(--icon-msg-link);
}

[data-icon="mini_program"] {
  --glyph: var(--icon-msg-mini_program);
}

[data-icon="merged"] {
  --glyph: var(--icon-msg-merged);
}

[data-icon="notice"] {
  --glyph: var(--icon-msg-notice);
}

[data-icon="unknown"] {
  --glyph: var(--icon-msg-unknown);
}

/* 卡片消息:气泡本身去掉底色和内边距,由卡片自己承担外观 */
.wechat-message-bubble.is-card {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.msg-card,
.msg-media {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 320px);
  padding: 12px 14px;
  color: inherit;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 10px rgba(72, 82, 140, 0.08);
  text-decoration: none;
}

.wechat-message-bubble.out > .msg-card,
.wechat-message-bubble.out > .msg-media {
  background: color-mix(in srgb, var(--lg-on) 22%, var(--surface-strong));
}

a.msg-card,
.msg-media {
  cursor: pointer;
  transition: box-shadow 200ms ease-in-out, transform 200ms ease-in-out;
}

a.msg-card:hover,
.msg-media:hover {
  box-shadow: 0 6px 18px rgba(72, 82, 140, 0.16);
  transform: translateY(-1px);
}

.msg-media:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px var(--focus);
}

.msg-card-copy,
.msg-media-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.msg-card-copy strong,
.msg-media-copy strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.msg-card-copy small,
.msg-media-copy small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.msg-card-copy em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.msg-card-unknown .msg-card-icon {
  background: var(--surface-muted);
}

/* 公众号推送使用同一容器保留文章顺序；首篇大封面，后续文章紧凑排列。 */
.msg-articles {
  width: 320px;
  max-width: 100%;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.msg-article {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
}

.msg-article + .msg-article,
.msg-articles-source {
  border-top: 1px solid var(--border);
}

.msg-article:first-child {
  flex-direction: column;
  align-items: stretch;
}

.msg-article-cover,
.msg-card-cover {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.msg-article:first-child .msg-article-cover {
  flex: none;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.msg-article:not(:first-child) .msg-article-cover {
  order: 1;
  margin-left: auto;
}

.msg-article .msg-card-copy strong {
  display: block;
  overflow: visible;
}

.msg-articles-source {
  padding: 8px 14px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

a.msg-article:hover {
  background: var(--surface-soft);
}

a.msg-article:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* 媒体占位:获取中的提示文字轻微闪动,失败变红 */
.msg-media.is-loading .msg-media-copy small {
  color: var(--primary-strong);
  animation: msg-media-pulse 1.4s ease-in-out infinite;
}

.msg-media.is-failed .msg-media-copy small {
  color: var(--danger);
}

@keyframes msg-media-pulse {
  50% {
    opacity: 0.45;
  }
}

.msg-media-image,
.msg-media-emoji {
  display: block;
  max-width: 280px;
  max-height: 320px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.msg-media-emoji {
  max-width: 140px;
  max-height: 140px;
  background: transparent;
}

.msg-media-player {
  display: block;
  max-width: 300px;
  border-radius: var(--radius-md);
}

/* 引用:回复内容在上,被引用的人和内容缩进在下 */
.msg-quote-refer {
  display: grid;
  gap: 2px;
  margin: 8px 0 0;
  padding: 6px 10px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.045);
  border-left: 3px solid var(--border-strong);
  border-radius: 6px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.msg-quote-refer strong {
  color: var(--text-soft);
  font-weight: 600;
}

.msg-system {
  color: var(--muted);
  font-size: 13px;
}

.msg-raw {
  margin-top: 6px;
  font-size: 12px;
}

.msg-raw pre {
  max-height: 200px;
  margin: 6px 0 0;
  padding: 8px 10px;
  overflow: auto;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-all;
}

/* 朋友圈媒体占位卡片:图标 + 说明,点击才让手机下载并传回;加载后换成图片/视频 */
.moment-thumb {
  cursor: pointer;
  transition: box-shadow 200ms ease-in-out;
}

.moment-thumb:hover {
  box-shadow: 0 4px 14px rgba(72, 82, 140, 0.18);
}

.moment-thumb:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px var(--focus);
}

.moment-thumb-body {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 6px;
  text-align: center;
}

.moment-thumb-body small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.moment-thumb.is-loading .moment-thumb-body small {
  color: var(--primary-strong);
  animation: msg-media-pulse 1.4s ease-in-out infinite;
}

.moment-thumb.is-failed .moment-thumb-body small {
  color: var(--danger);
}

.moment-thumb.is-loaded {
  cursor: zoom-in;
  background: transparent;
}

.moment-thumb.is-loaded:hover {
  box-shadow: none;
}

.moment-thumb video {
  background: #000;
}

.moment-media-single .moment-thumb.is-loaded {
  max-height: none;
  aspect-ratio: auto;
}

.moment-media-single .moment-thumb.is-loaded img,
.moment-media-single .moment-thumb.is-loaded video {
  height: auto;
  max-height: 420px;
}

/* 已显示的消息图片:点击放大 */
.msg-media-image {
  cursor: zoom-in;
}

/* 图片/视频放大查看器(lightbox.js):全屏深色遮罩,居中显示,多张时左右切换 */
.app-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 14, 0.88);
}

.app-lightbox[hidden] {
  display: none;
}

html.has-lightbox {
  overflow: hidden;
}

.app-lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 56px 72px 92px;
  overflow: hidden;
}

.app-lightbox-stage video {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  background: #000;
  object-fit: contain;
}

/* 图片布局使用原尺寸，缩放只通过 transform，1:1 不受 max-width 影响。 */
.app-lightbox-stage img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  max-height: none;
  user-select: none;
  touch-action: none;
  transform-origin: center;
  /* 缩放/拖动是直接操作，不应被全站 reduced-motion 的短过渡延迟。 */
  transition-property: none;
}
.app-lightbox-stage.is-pannable img { cursor: grab; }
.app-lightbox-stage.is-dragging img { cursor: grabbing; }
.app-lightbox-toolbar {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}
.app-lightbox-toolbar[hidden] { display: none; }
.app-lightbox-toolbar button {
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
}
.app-lightbox-toolbar button:hover { background: var(--primary-soft); }
.app-lightbox button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.app-lightbox button:disabled { opacity: 0.45; cursor: default; }
.app-lightbox-zoom { min-width: 48px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }

.app-lightbox-error {
  color: #fff;
  font-size: 14px;
}

.app-lightbox-close,
.app-lightbox-nav {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s ease;
}

.app-lightbox-close:hover,
.app-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.26);
}

.app-lightbox-close {
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  font-size: 26px;
}

.app-lightbox-nav {
  top: 50%;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  font-size: 30px;
}

.app-lightbox-nav.is-prev {
  left: 16px;
}

.app-lightbox-nav.is-next {
  right: 16px;
}

.app-lightbox-nav[hidden],
.app-lightbox-counter[hidden] {
  display: none;
}

.app-lightbox-counter {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 13px;
}

@media (max-width: 640px) {
  .app-lightbox-stage {
    inset: 64px 12px 100px;
  }
  .app-lightbox-close { width: 44px; height: 44px; }
}

/* 一行控件(.row-controls):状态标签、开关、按钮并排时垂直居中、高度统一。
   标签和小按钮统一 32px 高,开关(24px)居中;靠右对齐,中间的标签隐藏时右侧的开关和按钮位置不变。
   用在表格操作列和卡片行右侧,避免默认的基线对齐造成高低不一。 */
.row-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.row-controls > form {
  display: flex;
  align-items: center;
  margin: 0;
}

.row-controls .chip,
.row-controls .btn-small {
  box-sizing: border-box;
  height: 32px;
  min-height: 32px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
  white-space: nowrap;
}

.row-controls .chip {
  padding-left: 12px;
  padding-right: 12px;
}

.row-controls .btn-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 插件配置表单(清单 v2 声明的字段):必填标记、字段说明 */
.field-required {
  margin-left: 4px;
  color: var(--danger);
  font-style: normal;
}

.field-hint {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

/* 插件页:使用方法、绑定卡片里的运行信息 */
.plugin-usage {
  margin-top: 14px;
}

.plugin-usage code {
  margin: 0 2px;
}

.plugin-binding-info {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.plugin-binding-info p {
  margin: 2px 0;
}

/* ============================================================
   通用小部件:分段选择(.pp-seg)、搜索框(.pp-search)、勾选列表(.pp-pick-*)
   原生的单选框/复选框一律隐藏,外观由相邻元素绘制,保持 Soft UI:不用硬框线,靠底色和柔影分层。
   ============================================================ */
.pp-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.pp-seg-wide {
  display: flex;
}

.pp-seg-wide .pp-seg-item {
  flex: 1 1 0;
  text-align: center;
}

.pp-seg-item {
  position: relative;
  cursor: pointer;
}

.pp-seg-item input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pp-seg-item span {
  display: block;
  padding: 6px 13px;
  color: var(--text-soft);
  font-size: var(--text-sm);
  white-space: nowrap;
  border-radius: 7px;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.pp-seg-item:hover span {
  color: var(--text);
}

.pp-seg-item input:checked + span {
  color: var(--primary-strong);
  font-weight: 600;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), inset 0 0 0 1px var(--border);
}

.pp-seg-item input:focus-visible + span {
  box-shadow: 0 0 0 4px var(--focus);
}

.pp-search {
  position: relative;
  display: block;
  flex: 1 1 240px;
  max-width: 360px;
}

.pp-search input {
  width: 100%;
  min-height: 40px;
  padding: 8px 14px 8px 40px;
  color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center / 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.pp-search input:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px var(--focus);
}

.pp-search-inline {
  max-width: none;
}

.pp-search-inline input {
  background-color: var(--surface-muted);
  box-shadow: none;
}

.pp-hint {
  margin: 10px 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.pp-link {
  padding: 4px 2px;
  color: var(--primary-strong);
  font-size: 13px;
  white-space: nowrap;
  background: none;
  border: 0;
  cursor: pointer;
}

.pp-link:hover {
  text-decoration: underline;
}

.pp-pick-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  padding: 4px;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--surface-soft);
  border-radius: var(--radius-md);
}

.pp-pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 150ms ease-in-out;
}

.pp-pick-row:hover {
  background: var(--surface);
}

.pp-pick-row input {
  position: absolute;
  width: 0;
  height: 0;
  margin: 0;
  opacity: 0;
}

.pp-check {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 18px;
  height: 18px;
  background: var(--surface);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1.5px var(--border-strong);
  transition: background-color 150ms ease-in-out, box-shadow 150ms ease-in-out;
}

.pp-pick-row input:checked + .pp-check {
  background: var(--primary);
  box-shadow: none;
}

.pp-pick-row input:checked + .pp-check::after {
  width: 4px;
  height: 8px;
  margin-top: -2px;
  content: "";
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.pp-pick-row input:focus-visible + .pp-check {
  box-shadow: 0 0 0 4px var(--focus);
}

.pp-pick-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pp-pick-row small {
  flex: 0 0 auto;
  color: var(--muted);
}

.chip-danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(189, 66, 96, 0.18);
}

/* ============================================================
   紧凑小卡片网格：好友列表与积分账户共用，桌面一行 5-6 张小卡，操作全部图标化。
   ============================================================ */
.compact-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.points-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.compact-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.compact-card:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.compact-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.compact-card-identity {
  flex: 1 1 auto;
  min-width: 0;
}

.compact-card-tag {
  flex: 0 0 auto;
  max-width: 96px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  min-width: 0;
}

.compact-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.compact-card-stats strong {
  color: var(--text);
  font-weight: 600;
}

.contact-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 10px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  padding: 12px 10px 9px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.contact-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}

.contact-card-avatar-row {
  display: flex;
  justify-content: center;
  margin-bottom: 2px;
}

.contact-card-avatar {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary-soft) 0%, color-mix(in srgb, var(--primary) 20%, var(--surface-muted)) 100%);
  color: var(--primary-strong);
  font-size: 22px;
  font-weight: 650;
  border: 2px solid var(--surface);
  box-shadow: 0 3px 10px rgba(72, 82, 140, 0.14);
}

.contact-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-card-nickname {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-card-remark {
  min-width: 0;
  min-height: 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.contact-card-remark .disclosure {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.contact-card-remark .disclosure summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  max-width: 100%;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 11px;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-card-remark .disclosure summary:hover {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.contact-card-remark .disclosure form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
}

.contact-card-metrics {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.contact-card-metrics strong {
  color: var(--text);
  font-weight: 600;
}

.contact-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 7px;
  border-top: 1px solid var(--border);
  min-width: 0;
}

.contact-card-channel-foot {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .compact-card-grid.contact-card-grid,
  .compact-card-grid.points-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 积分页竖向用户卡片：沿用好友页大头像结构，补充角色徽标、备注/微信号核对胶囊与醒目积分指标。 */
.points-card {
  position: relative;
}

.points-card-role {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
}

.points-card-sub {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 20px;
}

.points-card-pill {
  display: inline-block;
  max-width: 100%;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.points-card-uid {
  display: inline-block;
  max-width: 100%;
  color: var(--muted);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.points-card-metrics {
  align-items: baseline;
  margin-top: 3px;
  font-size: 12px;
}

.points-card-metrics strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
}

.points-card-metrics strong.is-positive {
  color: var(--primary-strong);
}

.points-card-handle-foot {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* 调整积分弹窗：放大目标头像与二次核对信息，并用 Glisse 胶囊分段切换发放/扣减。 */
.points-target {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.points-target .identity-avatar {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  font-size: 18px;
}

.points-target .identity-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.points-target-balance {
  display: grid;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.points-target-balance small {
  color: var(--text-soft);
  font-size: 12px;
}

.points-target-balance strong {
  color: var(--primary-strong);
  font-size: 22px;
  line-height: 1.1;
}

.points-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 3px;
  background: var(--lg-segment-track, var(--surface-soft));
  border: 1px solid var(--border);
  border-radius: 999px;
}

.points-mode-option {
  display: block;
  position: relative;
}

.points-mode-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.points-mode-option span {
  display: block;
  padding: 8px 0;
  text-align: center;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-soft);
  transition: background-color 200ms ease, color 200ms ease;
}

.points-mode-option input:checked + span {
  background: var(--lg-segment-thumb, var(--surface));
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

.points-mode-option input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

@media (max-width: 560px) {
  .points-adjust-form {
    grid-template-columns: 1fr;
  }
}

.compact-card-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.compact-card-actions form {
  margin: 0;
}

/* 竖向小卡片底栏的图标操作钮在窄屏保持正圆比例，避免被触控 min-height:44px 拉伸为竖椭圆。 */
.contact-card .compact-card-actions .btn-icon {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

@media (max-width: 560px) {
  .compact-card-grid:not(.contact-card-grid):not(.points-card-grid) {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============================================================
   插件功能卡片：企业目录与平台管理共用结构，等高拉伸对齐，简介严格限两行，
   无调用时收起折线图以压缩行高，宽屏排布更多精致卡片。
   ============================================================ */
.plugin-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.pp-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.plugin-card,
.pp-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 13px 14px 12px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(16px) saturate(1.45);
  backdrop-filter: blur(16px) saturate(1.45);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out), background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.plugin-card:hover,
.pp-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}

.plugin-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.plugin-card-icon {
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 650;
}

.plugin-card:nth-child(3n + 2) .plugin-card-icon,
.pp-card:nth-child(3n + 2) .plugin-card-icon {
  color: var(--success);
  background: var(--success-soft);
}

.plugin-card:nth-child(3n) .plugin-card-icon,
.pp-card:nth-child(3n) .plugin-card-icon {
  color: var(--info);
  background: var(--info-soft);
}

.plugin-card-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.plugin-card-copy h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plugin-card-copy h3 a {
  color: inherit;
  text-decoration: none;
}

.plugin-card-copy h3 a:hover {
  color: var(--primary-strong);
}

.plugin-card-meta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  min-width: 0;
}

.plugin-card-version {
  flex: 0 0 auto;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border-radius: 0;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.plugin-card-code {
  min-width: 0;
  padding: 0;
  color: var(--muted);
  background: none;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 简介统一锁死两行高度并省略超长文案，确保同行卡片说明区与下方指标严格水平对齐。 */
.plugin-card-description {
  flex: 0 0 auto;
  margin: 0;
  height: calc(1.45em * 2);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plugin-card-warning {
  margin: 0;
  color: var(--warning);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plugin-card.is-broken {
  border-color: var(--danger);
}

.plugin-card.is-broken .plugin-card-warning {
  color: var(--danger);
}

.plugin-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  min-width: 0;
}

.plugin-card-author {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plugin-card-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  margin-left: auto;
}

.plugin-card-actions .btn-icon {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
}

/* 企业插件宽屏支持 6 列 / 5 列 / 4 列 / 3 列 / 2 列 / 1 列平滑递进；平台卡片因含状态开关与多操作适当宽松一档。 */
@media (min-width: 1560px) {
  .plugin-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 1479px) {
  .pp-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1279px) {
  .plugin-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

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

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

@media (max-width: 540px) {
  .plugin-grid,
  .pp-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
}

/* 每张插件卡片的调用趋势直接融入原卡片，不额外叠加白色面板或阴影。
   企业与平台使用同一组尺寸、色彩和图例，窄屏仍保留三个可比较的数值。 */
.plugin-usage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: 14px 0;
}
.plugin-usage-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.plugin-usage-heading strong { font-size: 14px; font-weight: 650; }
.plugin-usage-heading > span, .plugin-usage-updated { color: var(--muted); font-size: 12px; }
.plugin-usage-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.plugin-usage-periods { display: flex; gap: 3px; padding: 3px; border: 0.5px solid var(--lg-edge); border-radius: 999px; background: var(--lg-segment-track); }
.plugin-usage-periods button { min-height: 30px; padding: 4px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--text-soft); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out); }
.plugin-usage-periods button[aria-pressed="true"] { background: var(--lg-segment-thumb); color: var(--text); font-weight: 600; box-shadow: 0 1px 4px rgb(15 23 42 / 0.1), inset 0 1px 0 var(--lg-surface-edge); }
.plugin-usage-periods button:focus-visible, .plugin-usage-svg:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.plugin-usage-card { min-width: 0; padding-top: 8px; border-top: 1px solid var(--border); }
.plugin-usage-numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.plugin-usage-metric { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.plugin-usage-metric > span { display: flex; align-items: center; gap: 4px; font-size: 11px; white-space: nowrap; }
.plugin-usage-metric i { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: currentColor; }
.plugin-usage-metric strong { color: var(--text); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.plugin-usage-matched { color: var(--info); }
.plugin-usage-success { color: var(--success); }
.plugin-usage-error { color: var(--danger); }
.plugin-usage-plot { display: grid; grid-template-columns: minmax(18px, max-content) minmax(0, 1fr); column-gap: 6px; margin-top: 6px; }
.plugin-usage-plot[hidden] { display: none; }
.plugin-usage-yaxis { display: flex; justify-content: space-between; flex-direction: column; padding: 0; color: var(--muted); font-size: 10px; line-height: 1; font-variant-numeric: tabular-nums; }
.plugin-usage-svg { display: block; width: 100%; height: 44px; min-width: 0; overflow: visible; border-radius: 3px; touch-action: pan-y; cursor: crosshair; }
.plugin-usage-gridline { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.plugin-usage-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
/* 命中使用虚线，重合时仍能透出正常实线；异常保持红色实线，避免只有颜色能区分。 */
.plugin-usage-line.plugin-usage-matched { stroke-dasharray: 4 4; }
.plugin-usage-line.plugin-usage-error { stroke-width: 2.5; }
.plugin-usage-marker { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; opacity: .6; vector-effect: non-scaling-stroke; pointer-events: none; }
.plugin-usage-xaxis { display: flex; justify-content: space-between; grid-column: 2; gap: 4px; margin-top: 4px; color: var(--muted); font-size: 10px; }
.plugin-usage-readout { min-height: 0; margin: 5px 0 2px; color: var(--text-soft); font-size: 11px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.plugin-usage-card.is-idle .plugin-usage-readout { color: var(--muted); }
.plugin-usage-last { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; white-space: nowrap; }
.plugin-usage-last time { color: var(--text-soft); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 680px) {
  .plugin-usage-toolbar { gap: 10px; }
  .plugin-usage-heading { width: 100%; }
  .plugin-usage-controls { margin-left: 0; }
  .plugin-usage-updated { flex-basis: 100%; }
}

/* 平台插件管理的筛选、启停状态与共用弹窗。卡片基础视觉由上方统一维护。 */
.pp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.pp-note {
  margin: 0 0 16px 2px;
  color: var(--muted);
  font-size: 13px;
}

.pp-card.is-off {
  background: var(--surface-soft);
}

.pp-card.is-off .plugin-card-copy h3 {
  color: var(--muted);
}

/* 卡片上可点击的小标签:看起来是一个状态,点开是设置 */
.pp-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 25px;
  padding: 3px 8px 3px 10px;
  color: var(--primary-strong);
  font: inherit;
  font-size: 12px;
  line-height: 1.25;
  background: var(--primary-soft);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 150ms ease-in-out, box-shadow 150ms ease-in-out;
}

.pp-chip-btn::after {
  width: 10px;
  height: 10px;
  content: "";
  background: currentColor;
  opacity: 0.6;
  -webkit-mask: var(--icon-chevron) center / contain no-repeat;
  mask: var(--icon-chevron) center / contain no-repeat;
}

.pp-chip-btn:hover {
  box-shadow: 0 0 0 3px var(--focus);
}

.pp-chip-btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px var(--focus);
}

.pp-card-chips {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

/* 卸载放在卡片操作尾部，沿用按钮尺寸和危险色；确认前不增加重复说明。 */
.pp-uninstall {
  margin-inline-start: auto;
}

.pp-uninstall button {
  color: var(--danger);
}

.pp-dialog {
  width: min(560px, calc(100vw - 32px));
}

.pp-picker {
  margin-top: 14px;
}

.pp-picker-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.pp-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.pp-count {
  color: var(--muted);
  font-size: 13px;
}

.pp-dialog-actions {
  display: flex;
  gap: 8px;
}

.pp-version-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.pp-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border-radius: var(--radius-md);
}

.pp-version small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

/* ============================================================
   统一文件选择器(.ui-file):替代浏览器原生的文件框。整块可点,左边显示文件名,右边是按钮。
   ============================================================ */
.ui-file {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 6px 6px 14px;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 150ms ease-in-out, box-shadow 150ms ease-in-out;
}

.ui-file:hover {
  background: var(--primary-soft);
}

.ui-file:focus-within {
  box-shadow: 0 0 0 4px var(--focus);
}

.ui-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.ui-file-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-file.has-file .ui-file-name {
  color: var(--text);
}

.ui-file-btn {
  flex: 0 0 auto;
  padding: 6px 14px;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 560;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}

.tr-file {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.tr-file .ui-file {
  align-self: stretch;
}

.tr-file.is-removed .ui-file {
  opacity: 0.55;
}

/* ============================================================
   群触发回复:规则卡片网格与编辑页
   输入框是浅灰底的扁平风格(无框线),聚焦时出现柔光圈。
   ============================================================ */
.tr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.tr-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 16px 18px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.tr-card.is-off {
  background: var(--surface-soft);
}

.tr-card.is-off .tr-card-head h3,
.tr-card.is-off .tr-card-line {
  color: var(--muted);
}

.tr-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tr-card-head h3 {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tr-card-line {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}

.tr-card-line strong {
  margin-right: 6px;
  color: var(--primary-strong);
  font-weight: 600;
}

.tr-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tr-card-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 6px;
}

.tr-card-foot form {
  margin: 0;
}

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

/* 群功能主从工作台右栏内嵌的触发规则管理面板（列表 + 原地新建/编辑表单） */
.tr-panel {
  display: grid;
  gap: 14px;
  transition: opacity 160ms var(--ease-out);
}

.tr-panel.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.tr-panel-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
}

.tr-panel-count {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.tr-panel-count strong {
  color: var(--text);
  font-weight: 650;
}

.tr-panel-off-tip {
  margin: 0;
  padding: 10px 14px;
  color: var(--warning);
  font-size: 13px;
  line-height: 1.5;
  background: var(--warning-soft);
  border: 1px solid rgba(166, 100, 22, 0.2);
  border-radius: var(--radius-sm);
}

.tr-panel-off-tip[hidden] {
  display: none;
}

.tr-inline-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

.tr-inline-item {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  background: var(--surface);
  transition: background-color 160ms var(--ease-out);
}

.tr-inline-item + .tr-inline-item {
  border-top: 1px solid var(--border);
}

.tr-inline-item:hover {
  background: var(--surface-soft);
}

.tr-inline-item.is-off {
  background: var(--surface-soft);
}

.tr-inline-item.is-off .tr-inline-title h4,
.tr-inline-item.is-off .tr-card-line {
  color: var(--muted);
}

.tr-inline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.tr-inline-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}

.tr-inline-title h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

.tr-inline-tag {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.tr-inline-tag::before {
  content: "· ";
  color: var(--border-strong);
}

.tr-inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.tr-inline-summary {
  display: grid;
  gap: 4px;
}

.tr-inline-empty {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 20px;
  background: var(--surface-soft);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
}

.tr-inline-empty strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.tr-inline-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.tr-panel-form-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.tr-panel-form-head h4 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}

.tr-form-inline {
  max-width: none;
  gap: 12px;
}

.tr-form-inline .tr-step {
  padding: 16px 18px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.tr-form-inline .tr-step h2 {
  margin-bottom: 12px;
  font-size: 14px;
}

.tr-form-inline .tr-choice-body {
  background: var(--surface);
  border: 1px solid var(--border);
}

.tr-form-inline .tr-input {
  background: var(--surface);
  border: 1px solid var(--border);
}

.tr-form-inline .tr-action {
  background: var(--surface);
  border: 1px solid var(--border);
}

.tr-form-inline .tr-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.tr-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 820px;
}

.tr-step {
  padding: 20px 22px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.tr-step h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 620;
}

.tr-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 600;
  background: var(--primary-soft);
  border-radius: 50%;
}

.tr-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 14px;
}

.tr-field:first-child {
  margin-top: 0;
}

.tr-field > .tr-input,
.tr-field > textarea {
  align-self: stretch;
}

.tr-step > .tr-fields {
  margin-top: 16px;
}

.tr-action .tr-fields {
  margin-top: 4px;
}

.tr-field-short .tr-input {
  width: 160px;
}

.tr-label {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
}

.tr-label em {
  margin-left: 6px;
  color: var(--danger);
  font-size: 12px;
  font-style: normal;
}

.tr-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.tr-input {
  min-height: 42px;
  padding: 9px 14px;
  color: var(--text);
  background: var(--surface-muted);
  border: 0;
  border-radius: var(--radius-md);
  transition: background-color 150ms ease-in-out, box-shadow 150ms ease-in-out;
}

textarea.tr-input {
  resize: vertical;
  line-height: 1.55;
}

.tr-input:hover {
  background: var(--secondary);
}

.tr-input:focus-visible {
  background: var(--surface);
  outline: 0;
  box-shadow: 0 0 0 4px var(--focus);
}

.tr-input::placeholder {
  color: #94a3b8;
}

.tr-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.tr-choice {
  position: relative;
  cursor: pointer;
}

.tr-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.tr-choice-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 12px 14px;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  transition: background-color 150ms ease-in-out, box-shadow 150ms ease-in-out;
}

.tr-choice-body strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.tr-choice-body small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.tr-choice:hover .tr-choice-body {
  background: var(--secondary);
}

.tr-choice input:checked + .tr-choice-body {
  background: var(--primary-soft);
}

.tr-choice input:checked + .tr-choice-body strong {
  color: var(--primary-strong);
}

.tr-choice input:focus-visible + .tr-choice-body {
  box-shadow: 0 0 0 4px var(--focus);
}

.tr-vars {
  margin-bottom: 12px;
}

.tr-var-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tr-var {
  padding: 4px 12px;
  color: var(--primary-strong);
  font: inherit;
  font-size: 13px;
  background: var(--primary-soft);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: box-shadow 150ms ease-in-out;
}

.tr-var:hover {
  box-shadow: 0 0 0 3px var(--focus);
}

.tr-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.tr-action {
  padding: 14px 16px 16px;
  background: var(--surface-soft);
  border-radius: var(--radius-md);
}

.tr-action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tr-action .pp-seg {
  background: var(--surface-muted);
}

.tr-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.tr-form-actions {
  display: flex;
  gap: 10px;
  padding-bottom: 8px;
}

@media (max-width: 640px) {
  .tr-step {
    padding: 16px;
  }

  .tr-action-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ---- 企业插件目录筛选条：保留紧凑筛选，结果使用上方统一的功能卡片。 ---- */
.plugin-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

/* 下拉增强后由 .ui-select 包装节点参与排布，宽度必须约束实际的弹性子项。 */
.plugin-filter > select,
.plugin-filter > .ui-select {
  flex: 0 1 132px;
  width: 132px;
  min-width: 0;
}

.plugin-filter-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 260px;
  min-width: 180px;
}

.plugin-filter-search .i {
  position: absolute;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
}

.plugin-filter-search input {
  width: 100%;
  min-height: 40px;
  padding-left: 36px;
}

.plugin-filter-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 560px) {
  .plugin-filter-search {
    flex-basis: 100%;
  }

  .plugin-filter > select,
  .plugin-filter > .ui-select {
    flex: 1 1 calc(50% - 4px);
    width: auto;
  }
}

/* 平台基础设施组件卡片：复用平台运维的单层表面，手机端自然堆叠。 */
.component-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.platform-component-card {
  min-width: 0;
}

.platform-component-card .section-head {
  align-items: flex-start;
}

.platform-component-card h2 {
  margin: 0;
}

.platform-component-card .muted-text {
  max-width: 520px;
  margin: 6px 0 0;
}

.component-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.component-meta dt {
  color: var(--muted);
  font-size: 12px;
}

.component-meta dd {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.component-result {
  margin: 16px 0 0;
  color: var(--text-soft);
  font-size: 13px;
}

.component-actions {
  margin-top: 20px;
}

@media (max-width: 820px) {
  .component-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .component-meta {
    grid-template-columns: 1fr 1fr;
  }
}
