/* ==========================================================================
   appcratehq · 后台管理皮肤
   严格对齐 redesign/admin/admin.css 的度量：侧栏 232px 白底、页头 26px、
   指标卡图标在上、面板 22/24px、表格 13px、徽章带圆点。
   载入顺序最后（styles → marketplace → application → storefront → admin-skin），
   同特异性下覆盖 application.css 的旧后台样式。
   约束：只叠加视觉层，不改结构、不改 ID，避免影响后台交互与 E2E 断言。
   ========================================================================== */

/* ---------- 侧边栏 ---------- */
.admin-view .admin-sidebar {
  width: 232px;
  padding: 20px 14px 16px;
  background: #fff;
  border-right: 1px solid #e5eae7;
}
.admin-view .admin-logo { gap: 8px; margin: 0 6px 14px; padding-top: 2px; font-size: 20px; letter-spacing: -.01em; }
.admin-view .admin-logo svg { width: 30px; height: 30px; }
.admin-view .admin-logo-copy { display: flex; flex-direction: column; min-width: 0; padding-bottom: 3px; }
.admin-view .admin-logo-wordmark {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  font-family: "Avenir Next", "Nunito Sans", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.06em;
  line-height: 1;
}
.admin-view .admin-logo-wordmark::after {
  position: absolute;
  right: -18px;
  bottom: -2px;
  left: -2px;
  height: 2px;
  border-radius: 999px;
  background: #0c8264;
  content: "";
}
.admin-view .admin-logo-wordmark b { margin-left: 1px; color: #0c8264; font-weight: 500; letter-spacing: -.04em; }
.admin-view .admin-logo small { padding-top: 4px; color: #7f8d87; font-size: 10.5px; letter-spacing: .02em; }

.admin-view .admin-workspace {
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: #e2f1ea;
}
.admin-view .workspace-avatar { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.admin-view .admin-workspace strong { font-size: 12.5px; }
.admin-view .admin-workspace small { color: #55635d; font-size: 10.5px; }

.admin-view .admin-nav { gap: 2px; padding-bottom: 12px; }
.admin-view .admin-nav .nav-group-label { margin: 16px 8px 6px; color: #7f8d87; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; }
.admin-view .admin-nav .nav-group-label:first-child { margin-top: 0; }
.admin-view .admin-nav-item {
  min-height: 0;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #55635d;
  font-size: 13px;
}
.admin-view .admin-nav-item svg { width: 17px; height: 17px; stroke-width: 1.7; }
.admin-view .admin-nav-item:hover { background: #edf1ef; color: #15201c; }
.admin-view .admin-nav-item.active {
  color: #0c8264;
  background: #e2f1ea;
  box-shadow: none;
  font-weight: 600;
}
.admin-view .admin-nav-item.active::before { display: none; }
.admin-view .admin-nav-item > span {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 7px;
  color: #55635d;
  background: #edf1ef;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}
.admin-view .admin-nav-item.active > span { color: #0c8264; background: #fff; }

.admin-view .admin-account { padding-top: 14px; border-top: 1px solid #e5eae7; }
.admin-view .admin-user { gap: 9px; padding: 7px 8px; border-radius: 10px; }
.admin-view .user-avatar { width: 30px; height: 30px; font-size: 12px; font-weight: 600; color: #fff; background: #14211c; }
.admin-view .admin-user:hover { background: #edf1ef; }
.admin-view .admin-user:hover .user-avatar { box-shadow: none; }
.admin-view .admin-user:focus-visible { outline-color: rgba(12, 130, 100, .38); }
.admin-view .admin-user-copy strong { font-size: 12.5px; }
.admin-view .admin-user-copy small { color: #7f8d87; font-size: 10.5px; }
.admin-view .admin-account-menu { border-radius: 12px; box-shadow: 0 14px 34px rgba(21, 32, 28, .14); }
.admin-view .admin-account-menu .admin-logout-button { border-radius: 8px; color: #55635d; }
.admin-view .admin-account-menu .admin-logout-button:hover,
.admin-view .admin-account-menu .admin-logout-button:focus-visible { color: #0c8264; border-color: transparent; background: #e2f1ea; }

/* ---------- 内容区与页头 ---------- */
.admin-view .admin-content { padding: 26px 30px 60px; }
.admin-view .admin-header {
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 22px;
  padding: 0;
  border-bottom: 0;
  background: transparent;
}
.admin-view .admin-header h1 { font-size: 26px; font-weight: 700; letter-spacing: -.015em; }
.admin-view .admin-header .eyebrow { margin: 0 0 6px; color: #0c8264; font-size: 11px; font-weight: 700; letter-spacing: .09em; }
.admin-view .admin-subtitle { margin: 5px 0 0; color: #55635d; font-size: 13.5px; }
.admin-view .admin-header-actions { gap: 10px; }
.admin-view .admin-header-tools { gap: 10px; }

.admin-view .admin-main { padding: 0; min-width: 0; }

.admin-view .admin-icon-button {
  width: 38px;
  min-height: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  color: #55635d;
  background: #edf1ef;
}
.admin-view .admin-icon-button:hover { background: #e0e7e3; color: #15201c; }
.admin-view .admin-icon-button svg { width: 16px; height: 16px; stroke-width: 1.8; }
.admin-view .admin-icon-button i { top: 8px; right: 9px; width: 7px; height: 7px; border: 0; background: #c4322a; }

.admin-view .admin-primary-button,
.admin-view .admin-secondary-button {
  min-height: 38px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
}
.admin-view .admin-primary-button { background: #0c8264; border-color: #0c8264; color: #fff; }
.admin-view .admin-primary-button:hover { background: #0a6e54; border-color: #0a6e54; }
.admin-view .admin-secondary-button { border-color: #b9cfc3; color: #0c8264; background: transparent; }
.admin-view .admin-secondary-button:hover { border-color: #0c8264; background: #e2f1ea; }
.admin-view .admin-primary-button svg,
.admin-view .admin-secondary-button svg { width: 15px; height: 15px; stroke-width: 2; }
.admin-view .text-button { color: #0c8264; font-size: 13px; font-weight: 500; }
.admin-view .text-button svg { width: 12px; height: 12px; stroke-width: 2.2; }

/* 页头右侧状态区（监控 / 资源）：对齐原型 page-head-actions 的说明文字 */
.admin-view .admin-header-meta { display: flex; align-items: center; gap: 10px; }
.admin-view .admin-header-meta[hidden] { display: none; }
.admin-view .admin-header-meta > span { color: #7f8d87; font-size: 12px; }

/* ---------- 指标卡 ---------- */
.admin-view .metric-grid { gap: 14px; margin-bottom: 18px; }
.admin-view .metric-card,
.admin-view .metric-card:nth-child(2),
.admin-view .metric-card:nth-child(3),
.admin-view .metric-card:nth-child(4),
.admin-view .system-metric-card,
.admin-view .system-metric-card:nth-child(2),
.admin-view .system-metric-card:nth-child(3),
.admin-view .system-metric-card:nth-child(4) {
  min-height: 0;
  padding: 17px 18px 16px;
  border: 1px solid #e5eae7;
  border-radius: 14px;
  background: #fff;
}
.admin-view .metric-card:nth-child(1) { background: #fff; }

.admin-view .m-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border-radius: 22%;
  color: #0c8264;
  background: #e2f1ea;
}
.admin-view .m-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.admin-view .m-value,
.admin-view .metric-card > strong,
.admin-view .system-metric-card > strong {
  display: block;
  margin: 0;
  color: #15201c;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.admin-view .m-label { display: block; margin-top: 2px; color: #15201c; font-size: 12.5px; font-weight: 600; }
.admin-view .m-note { display: block; margin-top: 1px; color: #7f8d87; font-size: 11.5px; }

.admin-view .metric-card.warn .m-icon,
.admin-view .system-metric-card.warn .m-icon { color: #9a6a0a; background: #fbf3e2; }
.admin-view .metric-card.alert .m-icon,
.admin-view .system-metric-card.alert .m-icon { color: #c4322a; background: #f9e9e7; }

/* 监控卡片进度条 */
.admin-view .m-bar { height: 6px; margin-top: 10px; overflow: hidden; border-radius: 3px; background: #edf1ef; }
.admin-view .m-bar span { display: block; height: 100%; border-radius: 3px; background: #0c8264; }
.admin-view .system-metric-card.warn .m-bar span { background: #e8a020; }
.admin-view .system-metric-card.alert .m-bar span { background: #c4322a; }
.admin-view .system-metric-unavailable { margin: 10px 0 0; color: #7f8d87; font-size: 11.5px; }

/* 兼容旧结构（若仍有 metric-label / 系统卡旧类）：保持同度量 */
.admin-view .metric-label,
.admin-view .system-metric-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 15px; color: #7f8d87; font-size: 11px; }
.admin-view .metric-label svg,
.admin-view .system-metric-label svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.admin-view .metric-card > span:not(.m-icon):not(.m-label):not(.m-note) { display: block; margin-top: 9px; color: #7f8d87; font-size: 11.5px; }

/* ---------- 面板 ---------- */
.admin-view .admin-grid { grid-template-columns: 1.6fr 1fr; gap: 18px; margin-top: 18px; align-items: start; }
.admin-view .admin-panel { padding: 22px 24px; border: 1px solid #e5eae7; border-radius: 14px; background: #fff; }
.admin-view .panel-head { margin-bottom: 16px; gap: 16px; }
.admin-view .panel-head h2 { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.admin-view .panel-head p { margin: 3px 0 0; color: #55635d; font-size: 12.5px; }
.admin-view .panel-head > span.soft-badge { flex: none; }

.admin-view .soft-badge {
  padding: 3px 10px;
  border-radius: 8px;
  color: #55635d;
  background: #edf1ef;
  font-size: 11px;
  font-weight: 600;
}
.admin-view .soft-badge.brand { color: #0c8264; background: #e2f1ea; }
.admin-view .soft-badge.amber { color: #9a6a0a; background: #fbf3e2; }

/* 图表 */
.admin-view .chart-summary { margin: 0 0 18px; gap: 8px; }
.admin-view .chart-summary strong { font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.admin-view .chart-summary span { color: #55635d; font-size: 12.5px; }
.admin-view .download-chart { height: 170px; gap: 10px; padding-top: 20px; border-bottom: 0; }
.admin-view .download-chart .chart-bar {
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #16a184, #0c8264);
  opacity: 1;
}
.admin-view .download-chart .chart-bar:hover,
.admin-view .download-chart .chart-bar:focus { background: linear-gradient(180deg, #0f9a76, #0a6e54); }
.admin-view .chart-bar b { top: -20px; color: #55635d; font-size: 10.5px; font-weight: 600; }
.admin-view .chart-bar span { bottom: -23px; color: #7f8d87; font-size: 10.5px; }

/* 动态 / 审计 / 网络接口列表：统一 feed 节奏 */
.admin-view .activity-item { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; padding: 11px 2px; border-top: 0; border-bottom: 1px solid #e5eae7; }
.admin-view .activity-item:last-child { border-bottom: 0; }
.admin-view .activity-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #55635d; background: #edf1ef; font-size: 12px; font-weight: 700; }
.admin-view .activity-avatar.brand { color: #fff; background: #0c8264; }
.admin-view .activity-item strong { font-size: 13px; font-weight: 600; }
.admin-view .activity-item p,
.admin-view .activity-item time { margin: 0; color: #7f8d87; font-size: 11.5px; }
.admin-view .activity-item p { margin-top: 1px; }

/* 审计条目复用 feed-item 结构（保留 .audit-item 类给回归用例做锚点） */
.admin-view .audit-item.feed-item { gap: 12px; padding: 11px 2px; border-top: 0; border-bottom: 1px solid #e5eae7; }
.admin-view .audit-item:last-child { border-bottom: 0; }
.admin-view .audit-item time { color: #7f8d87; font-size: 11.5px; }

/* ---------- 工具栏（搜索 / 筛选 / 计数） ---------- */
.admin-view .product-toolbar { align-items: center; justify-content: flex-start; gap: 10px; margin-bottom: 16px; }
.admin-view .toolbar-spacer { flex: 1 1 auto; }
.admin-view .toolbar-count { color: #7f8d87; font-size: 12px; white-space: nowrap; }
.admin-view .version-filters { display: flex; align-items: center; gap: 10px; }

.admin-view .admin-search {
  width: 240px;
  max-width: 100%;
  min-height: 38px;
  height: 38px;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid #cfd8d3;
  border-radius: 10px;
  background: #fff;
}
.admin-view .admin-search svg { width: 15px; height: 15px; stroke: #7f8d87; stroke-width: 2; }
.admin-view .admin-search input { font-size: 13px; }
.admin-view .admin-search:focus-within { border-color: #0c8264; box-shadow: 0 0 0 3px #e2f1ea; }

.admin-view .admin-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 8px 0 13px;
  border: 1px solid #cfd8d3;
  border-radius: 10px;
  color: #55635d;
  background: #fff;
  font-size: 12.5px;
}
.admin-view .admin-filter select {
  min-height: 30px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  color: #15201c;
  background-color: #edf1ef;
  font-size: 12.5px;
  font-weight: 600;
}
.admin-view .admin-filter select:focus { border-color: transparent; box-shadow: 0 0 0 3px #e2f1ea; }

/* 后台的应用图标用原型的饱和配色（前台走柔和渐变，后台列表要更清晰） */
.admin-view .of-orange { background: #fdeee2; color: #f7771f; }
.admin-view .of-peach { background: #feede3; color: #fb925c; }
.admin-view .of-blue { background: #e6effc; color: #1668e3; }
.admin-view .of-mint { background: #e0f4f1; color: #0fa38f; }
.admin-view .of-lilac { background: #ece7fc; color: #7b5ce0; }
.admin-view .of-slate { background: #e8ecf1; color: #4a5568; }
.admin-view .of-app-icon { border: 0; box-shadow: none; }
.admin-view .of-app-icon::before { display: none; }

/* ---------- 数据表格 ---------- */
/* 整页表格：面板本身充当 table-wrap，边到边排列（对齐原型 section.table-wrap） */
.admin-view .product-manager-panel,
.admin-view .version-manager-panel,
.admin-view .plan-manager-panel,
.admin-view .order-manager-panel,
.admin-view .license-manager-panel,
.admin-view .user-manager-panel,
.admin-view .webhook-manager-panel,
.admin-view .server-inventory-panel,
.admin-view .audit-manager-panel,
.admin-view .role-manager-panel { padding: 0; overflow: hidden; }
/* 角色卡上方仍有间距，表格面板内分页需要内边距 */
.admin-view .role-manager-panel > #admins-pagination,
.admin-view .server-inventory-panel > #server-inventory-pagination { padding: 0 18px; }

.admin-view .ad-table { overflow-x: auto; }
.admin-view .ad-table-row { align-items: center; border-bottom: 1px solid #e5eae7; display: grid; gap: 14px; grid-template-columns: minmax(190px, 1.5fr) minmax(90px, .8fr) minmax(170px, 1.2fr) minmax(75px, .6fr) minmax(105px, .8fr); min-width: 720px; padding: 13px 18px; }
.admin-view .ad-table-row:last-child { border-bottom: 0; }
.admin-view .ad-table-row.header { background: #f7f9f7; color: #7f8d87; font-size: 11px; font-weight: 600; }
.admin-view .ad-main { align-items: center; display: flex; gap: 10px; min-width: 0; }
.admin-view .ad-main img { background: #eef2ef; border-radius: 7px; height: 42px; object-fit: cover; width: 64px; }
.admin-view .ad-main > span { display: flex; flex-direction: column; min-width: 0; }
.admin-view .ad-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-view .ad-main small, .admin-view .ad-schedule small { color: #87938d; display: block; font-size: 11px; margin-top: 3px; }
.admin-view .ad-schedule { font-size: 12px; }
@media (max-width: 700px) {
  .admin-view .ad-table-row { min-width: 680px; padding-left: 12px; padding-right: 12px; }
}

/* 概览里的产品状态表是面板内嵌小表：加内描边以对齐原型的 table-wrap */
.admin-view .products-panel .admin-product-table { margin-top: 0; border: 1px solid #e5eae7; border-radius: 12px; overflow: hidden; }

.admin-view .admin-table-row,
.admin-view .version-table-row,
.admin-view .plan-table-row,
.admin-view .order-table-row,
.admin-view .subscription-table-row,
.admin-view .license-table-row,
.admin-view .user-table-row,
.admin-view .webhook-table-row,
.admin-view .server-inventory-row {
  gap: 14px;
  padding: 12px 18px;
  border-top: 0;
  border-bottom: 1px solid #e5eae7;
  font-size: 13px;
}
.admin-view .admin-table-row:last-child,
.admin-view .version-table-row:last-child,
.admin-view .plan-table-row:last-child,
.admin-view .order-table-row:last-child,
.admin-view .subscription-table-row:last-child,
.admin-view .license-table-row:last-child,
.admin-view .user-table-row:last-child,
.admin-view .webhook-table-row:last-child,
.admin-view .server-inventory-row:last-child { border-bottom: 0; }

.admin-view .admin-table-row.header,
.admin-view .version-table-row.header,
.admin-view .plan-table-row.header,
.admin-view .order-table-row.header,
.admin-view .subscription-table-row.header,
.admin-view .license-table-row.header,
.admin-view .user-table-row.header,
.admin-view .webhook-table-row.header,
.admin-view .server-inventory-row.header {
  padding: 9px 18px;
  border-bottom: 0;
  color: #7f8d87;
  background: #f3f6f4;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
}
.admin-view .admin-table-row:hover:not(.header),
.admin-view .version-table-row:hover:not(.header),
.admin-view .plan-table-row:hover:not(.header),
.admin-view .order-table-row:hover:not(.header),
.admin-view .subscription-table-row:hover:not(.header),
.admin-view .license-table-row:hover:not(.header),
.admin-view .user-table-row:hover:not(.header),
.admin-view .webhook-table-row:hover:not(.header),
.admin-view .server-inventory-row:hover:not(.header) { background: #f8fbf9; }

/* 栅格单元最小宽度归零（原型 .trow > span），否则长路径/长邮箱会把列撑破 */
.admin-view .admin-table-row > *,
.admin-view .version-table-row > *,
.admin-view .plan-table-row > *,
.admin-view .order-table-row > *,
.admin-view .subscription-table-row > *,
.admin-view .license-table-row > *,
.admin-view .user-table-row > *,
.admin-view .webhook-table-row > *,
.admin-view .server-inventory-row > *,
.admin-view .role-row > *,
.admin-view .integration-table-row > * { min-width: 0; }

/* 产品表栅格：产品 / 平台·分类 / 版本 / 状态 / 下载（/ 操作）——与原型 .cols-product 同比例。
   表头与数据行必须同时带 .detailed，否则 5 列与 6 列栅格错位。 */
.admin-view .admin-table-row { grid-template-columns: 2.2fr 1.2fr .8fr 1fr .9fr; min-width: 640px; }
.admin-view .admin-table-row.detailed { grid-template-columns: 2.2fr 1.2fr .8fr 1fr .9fr 1.1fr; min-width: 760px; }
.admin-view .admin-product-table { overflow-x: auto; }
.admin-view .admin-table-row .num { color: #15201c; font-variant-numeric: tabular-nums; }
.admin-view .admin-table-row.header .num { color: inherit; font-variant-numeric: normal; }
.admin-view .admin-table-row .cell-muted { overflow: hidden; color: #55635d; text-overflow: ellipsis; white-space: nowrap; }

.admin-view .admin-product-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.admin-view .admin-product-cell > span { min-width: 0; }
.admin-view .admin-product-cell .of-app-icon,
.admin-view .version-product .of-app-icon,
.admin-view .integration-product .of-app-icon { width: 34px; height: 34px; flex: none; border-radius: 22%; }
.admin-view .admin-product-cell .of-app-icon svg,
.admin-view .version-product .of-app-icon svg { width: 16px; height: 16px; }
.admin-view .admin-product-cell strong,
.admin-view .version-product strong { display: block; overflow: hidden; color: #15201c; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.admin-view .admin-product-cell small,
.admin-view .version-product small { display: block; overflow: hidden; color: #7f8d87; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

/* 版本 / 付费 / 订单 / 订阅 / 授权 / 用户 / Webhook / 资源 栅格（原型 cols-*） */
.admin-view .version-table-row { grid-template-columns: 2fr 1fr .9fr 1.3fr 1fr 1fr; min-width: 720px; }
.admin-view .version-table-row .version-number strong { color: #15201c; font-size: 13px; }
.admin-view .version-table-row .version-number small { color: #7f8d87; font-size: 11px; }

.admin-view .plan-table-row { grid-template-columns: 1.6fr .9fr .8fr 1.5fr 1fr .8fr 1.1fr; min-width: 820px; }
.admin-view .plan-table-row > span:first-child strong { color: #15201c; font-size: 13px; font-weight: 600; }
.admin-view .plan-table-row > span:first-child small { color: #7f8d87; font-size: 11px; }
.admin-view .plan-price strong { color: #15201c; font-size: 13px; }
.admin-view .plan-price small { color: #7f8d87; font-size: 11px; }

.admin-view .order-table-row { grid-template-columns: 1.5fr 1.4fr 1.2fr .8fr .9fr .6fr; min-width: 760px; }
/* 订单号/订阅号是两行（主键 + 支付商引用），strong/small 必须各自占行 */
.admin-view .order-table-row .mono strong,
.admin-view .subscription-table-row .mono strong,
.admin-view .license-table-row .mono strong,
.admin-view .webhook-table-row .mono strong,
.admin-view .version-table-row .mono strong { display: block; font-size: 12.5px; }
.admin-view .order-table-row .mono small,
.admin-view .subscription-table-row .mono small,
.admin-view .license-table-row .mono small,
.admin-view .webhook-table-row .mono small,
.admin-view .version-table-row .mono small { display: block; margin-top: 1px; color: #7f8d87; font-size: 11px; }

.admin-view .subscription-table-row { grid-template-columns: 1.5fr 1.4fr 1.2fr 1.4fr .9fr .6fr; min-width: 780px; }
.admin-view .subscription-cancel-note { display: block; color: #9a6a0a; font-size: 10.5px; }

.admin-view .license-table-row { grid-template-columns: 1.4fr 1.1fr 1.5fr .8fr .9fr .9fr 1fr; min-width: 820px; }

.admin-view .user-table-row { grid-template-columns: 2fr .9fr .9fr .8fr .9fr 1fr; min-width: 700px; }
.admin-view .user-table-row .admin-product-cell strong { font-size: 13px; }

.admin-view .webhook-table-row { grid-template-columns: 1.4fr 1.3fr .8fr 1fr 1fr .9fr; min-width: 720px; }
.admin-view .webhook-table-row .mono strong { font-size: 12.5px; }
.admin-view .webhook-table-row small { display: block; color: #7f8d87; font-size: 10.5px; }

.admin-view .server-inventory-row { grid-template-columns: 1.4fr 1.2fr 1.4fr 1.4fr .8fr .8fr; min-width: 820px; }
.admin-view .server-inventory-row strong { display: block; color: #15201c; font-size: 13px; font-weight: 600; }
.admin-view .server-inventory-row .mono { color: #55635d; font-size: 12px; }
.admin-view .server-inventory-row .server-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-view .server-inventory-row .num { font-variant-numeric: tabular-nums; }

/* 首列：34px 圆角图标 + 名称/状态（原型 .cell-main + .mini-icon） */
.admin-view .cell-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.admin-view .cell-main > span:last-child { min-width: 0; }
.admin-view .cell-main .of-app-icon { flex: none; width: 34px; height: 34px; border-radius: 22%; }
.admin-view .mini-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 22%;
  color: #0c8264;
  background: #e2f1ea;
}
.admin-view .mini-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* 行内按钮：默认品牌绿，危险操作用红色（对应原型 row-action brand / danger） */
.admin-view .table-action {
  min-height: 0;
  padding: 4px 10px;
  border: 0;
  border-radius: 7px;
  color: #0c8264;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}
.admin-view .table-action:hover { border-color: transparent; background: #e2f1ea; color: #0a6e54; }
.admin-view .table-action.danger { color: #c4322a; }
.admin-view .table-action.danger:hover { background: #f9e9e7; color: #a92b24; }

/* ---------- 徽章 / 标签 ---------- */
.admin-view .status-badge,
.admin-view .badge,
.admin-view .role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 3px 10px;
  border-radius: 8px;
  color: #55635d;
  background: #edf1ef;
  font-size: 11.5px;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}
.admin-view .status-badge::before,
.admin-view .badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.admin-view .badge.plain::before { display: none; }

/* 付费方式：原型 .billing 是独立的浅色胶囊（不带圆点，三档同色） */
.admin-view .billing {
  display: inline-flex;
  padding: 2px 9px;
  border-radius: 7px;
  color: #0c8264;
  background: #e2f1ea;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.admin-view .badge.brand,
.admin-view .role-badge.role-admin,
.admin-view .status-badge.status-published,
.admin-view .status-badge.status-active,
.admin-view .status-badge.status-paid,
.admin-view .status-badge.status-processed,
.admin-view .status-badge.status-succeeded { color: #0c8264; background: #e2f1ea; }

.admin-view .badge.amber,
.admin-view .role-badge.role-ops,
.admin-view .status-badge.status-processing,
.admin-view .status-badge.status-pending,
.admin-view .status-badge.status-paused,
.admin-view .status-badge.status-inactive,
.admin-view .status-badge.status-expired,
.admin-view .status-badge.status-withdrawn { color: #9a6a0a; background: #fbf3e2; }

.admin-view .badge.danger,
.admin-view .status-badge.status-failed,
.admin-view .status-badge.status-refunded,
.admin-view .status-badge.status-revoked { color: #c4322a; background: #f9e9e7; }

.admin-view .badge.gray,
.admin-view .role-badge.role-readonly,
.admin-view .role-badge.role-member,
.admin-view .status-badge.status-draft,
.admin-view .status-badge.status-cancelled,
.admin-view .status-badge.status-unknown { color: #55635d; background: #edf1ef; }

.admin-view .release-channel,
.admin-view .billing-badge {
  display: inline-flex;
  padding: 2px 9px;
  border-radius: 7px;
  color: #55635d;
  background: #edf1ef;
  font-size: 11px;
  font-weight: 600;
}
.admin-view .release-channel.beta { color: #9a6a0a; background: #fbf3e2; }
.admin-view .billing-badge { color: #0c8264; background: #e2f1ea; }
.admin-view .billing-yearly { color: #5b4f96; background: #efecf8; }
.admin-view .billing-one_time { color: #9c5a42; background: #faeee6; }
.admin-view .plan-products span { color: #0c8264; background: #e2f1ea; }
.admin-view .plan-products i { color: #5b4f96; background: #efecf8; }

/* ---------- 分页 ---------- */
.admin-view .pagination {
  min-height: 0;
  margin-top: 0;
  padding: 12px 4px 0;
  border-top: 0;
  color: #7f8d87;
  font-size: 12px;
}
.admin-view .pagination-summary { font-variant-numeric: tabular-nums; }
.admin-view .pagination-meta { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.admin-view .pagination-size-select {
  height: 28px;
  padding: 0 4px;
  border: 0;
  border-radius: 8px;
  color: #55635d;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}
.admin-view .pagination-size-select:hover { background: #edf1ef; }
.admin-view .pagination-size select {
  min-height: 28px;
  height: 28px;
  padding: 0 4px;
  border: 0;
  border-radius: 8px;
  color: #55635d;
  background: transparent;
  font-size: 12px;
}
.admin-view .pagination-size select:hover { background: #edf1ef; }
.admin-view .pagination-controls { gap: 4px; }
.admin-view .pagination-button {
  min-width: 28px;
  min-height: 28px;
  height: 28px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  color: #55635d;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}
.admin-view .pagination-button:hover:not(:disabled) { border-color: transparent; background: #edf1ef; }
.admin-view .pagination-button[aria-current="page"] { border-color: transparent; color: #fff; background: #0c8264; }
.admin-view .pagination-spacer { color: #7f8d87; }

/* ---------- 角色与权限 ---------- */
/* 原型是三列并排（.role-cards），display 必须显式声明为 grid，否则旧规则回落 block */
.admin-view .role-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.admin-view .role-card { padding: 18px; border: 1px solid #e5eae7; border-radius: 14px; background: #fff; }
.admin-view .role-card h3 { margin: 10px 0 4px; color: #15201c; font-size: 15px; font-weight: 700; }
.admin-view .role-card p { margin: 0; color: #55635d; font-size: 12.5px; line-height: 1.7; }

.admin-view .role-row {
  display: grid;
  grid-template-columns: 2fr 1fr .9fr 1.1fr 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-top: 0;
  border-bottom: 1px solid #e5eae7;
  font-size: 13px;
}
.admin-view .role-row:last-child { border-bottom: 0; }
.admin-view .role-row.header { padding: 9px 18px; border-bottom: 0; color: #7f8d87; background: #f3f6f4; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; }
.admin-view .role-row > .admin-user-cell { display: flex; flex-direction: row; align-items: center; gap: 11px; min-width: 0; }
.admin-view .role-row .user-avatar { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; font-size: 12px; }
.admin-view .role-row .admin-user-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.admin-view .role-row .admin-user-copy strong { overflow: hidden; color: #15201c; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.admin-view .role-row .admin-user-copy small { color: #7f8d87; font-size: 11px; }
.admin-view .role-row > .role-badge,
.admin-view .role-row > .status-badge { margin-left: 0; }
.admin-view .role-row .num { color: #55635d; font-variant-numeric: tabular-nums; }

/* ---------- 接入凭证 ---------- */
.admin-view .integration-table { display: flex; flex-direction: column; }
.admin-view .integration-table-row { gap: 14px; padding: 12px 0; border-top: 0; border-bottom: 1px solid #e5eae7; font-size: 13px; }
.admin-view .integration-table-row:last-child { border-bottom: 0; }
.admin-view .integration-table-row { grid-template-columns: 1.6fr 1.2fr 1.6fr .9fr 1fr .9fr; min-width: 760px; }
.admin-view .integration-table-row.header { padding: 9px 0; border-bottom: 0; color: #7f8d87; background: transparent; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; }
.admin-view .integration-name strong { display: block; overflow: hidden; color: #15201c; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.admin-view .integration-name small { display: block; margin-top: 2px; color: #7f8d87; font-size: 11px; }
.admin-view .integration-product { display: flex; align-items: center; gap: 11px; min-width: 0; }
.admin-view .integration-product .of-app-icon { width: 34px; height: 34px; border-radius: 22%; }
.admin-view .integration-product .of-app-icon svg { width: 16px; height: 16px; }

/* ---------- 审计流水 ---------- */
.admin-view .audit-manager-panel { overflow-x: auto; }
.admin-view #audit-list { display: block; min-width: 780px; }
/* 行必须是 grid：只写 grid-template-columns 而漏 display，会回落 block 导致五列挤成一段文字 */
.admin-view .audit-table-row { display: grid; align-items: center; grid-template-columns: 1.1fr 1.1fr 1.1fr 1.4fr 2.4fr; gap: 14px; padding: 12px 18px; border-top: 0; border-bottom: 1px solid #e5eae7; font-size: 13px; }
.admin-view .audit-table-row > span { min-width: 0; }
.admin-view .audit-table-row:last-child { border-bottom: 0; }
.admin-view .audit-table-row.header { padding: 9px 18px; border-bottom: 0; color: #7f8d87; background: #f3f6f4; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; }
.admin-view .audit-table-row .audit-actor,
.admin-view .audit-table-row .audit-target { overflow: hidden; color: #15201c; text-overflow: ellipsis; white-space: nowrap; }
.admin-view .audit-table-row .audit-detail { color: #55635d; line-height: 1.6; }

/* ---------- 平台升级时间线 ---------- */
.admin-view #platform-release-list { display: flex; flex-direction: column; }
/* 原型是 flex：左侧固定 76px 版本徽章 + 右侧自适应正文 */
.admin-view .release-item { display: flex; gap: 16px; padding: 16px 2px; border-top: 0; border-bottom: 1px solid #e5eae7; }
.admin-view .release-item:last-child { border-bottom: 0; }
.admin-view .r-version {
  flex: none;
  width: 76px;
  padding: 4px 0;
  border-radius: 9px;
  color: #0c8264;
  background: #e2f1ea;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.admin-view .release-item .r-body { flex: 1; min-width: 0; }
.admin-view .r-body time { display: block; margin-bottom: 4px; color: #7f8d87; font-size: 11.5px; }
.admin-view .r-body ul { margin: 0; padding-left: 18px; color: #55635d; font-size: 13px; line-height: 1.7; }
.admin-view .r-body li { margin: 2px 0; }

/* ---------- 列表行（网络接口 / 概览流水）：原型 .feed-item ---------- */
.admin-view .system-network-list { display: flex; flex-direction: column; }
.admin-view .feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid #e5eae7;
  font-size: 13px;
}
.admin-view .feed-item:last-child { border-bottom: 0; }
.admin-view .feed-item .f-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #55635d;
  background: #edf1ef;
}
.admin-view .feed-item .f-avatar.brand { color: #fff; background: #0c8264; }
/* 头像里的图标尺寸必须写在 svg 元素的 CSS 上，<use> 的内联宽高会被忽略 */
.admin-view .feed-item .f-avatar svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.admin-view .feed-item .f-body { flex: 1; min-width: 0; }
.admin-view .feed-item .f-body strong { display: block; overflow: hidden; color: #15201c; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.admin-view .feed-item .f-body small { display: block; color: #7f8d87; font-size: 11.5px; }
.admin-view .feed-item time { flex: none; color: #7f8d87; font-size: 11.5px; white-space: nowrap; }
.admin-view .feed-item .f-traffic { flex: none; color: #55635d; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.admin-view .net-total {
  display: flex;
  gap: 28px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e5eae7;
  color: #55635d;
  font-size: 12.5px;
}
.admin-view .net-total strong { color: #15201c; font-variant-numeric: tabular-nums; }
.admin-view .system-network-list .of-latest-empty { margin: 0; padding: 20px 0; color: #7f8d87; font-size: 12.5px; }

/* ---------- 说明列表（能力 / 采集口径 / 影响说明） ---------- */
.admin-view .perm-list { display: flex; flex-direction: column; gap: 10px; margin-top: 0; }
.admin-view .perm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  background: #f3f6f4;
}
.admin-view .perm-row > .role-badge,
.admin-view .perm-row > .badge { flex: 0 0 auto; min-width: 0; justify-content: center; padding: 3px 10px; }
.admin-view .perm-row > span { color: #55635d; font-size: 13px; line-height: 1.6; }
.admin-view .perm-row code { padding: 1px 5px; border-radius: 5px; background: #e5eae7; font-size: 12px; }
.admin-view .integration-doc-link { margin-top: 16px; padding-top: 14px; border-top: 1px solid #e5eae7; font-size: 13px; }
.admin-view .integration-doc-link a { color: #087c60; font-weight: 600; text-underline-offset: 3px; }

/* ---------- 表单 ---------- */
.admin-view .form-check { gap: 10px; padding: 12px 14px; border: 0; border-radius: 10px; background: #f3f6f4; }
.admin-view .form-check input { width: 17px; height: 17px; margin-top: 2px; accent-color: #0c8264; }
.admin-view .form-check strong { display: block; color: #15201c; font-size: 13px; }
.admin-view .form-check small { display: block; color: #55635d; font-size: 11.5px; line-height: 1.5; }
.admin-view .settings-actions { margin-top: 20px; gap: 10px; justify-content: flex-end; }
.admin-view .settings-actions [role="status"] { margin-right: auto; color: #0c8264; font-size: 12.5px; font-weight: 600; }
.admin-view .settings-actions .admin-primary-button { padding: 9px 18px; }

/* 设置与升级记录：原型把 page-narrow 加在 .admin-content 上（max-width 980 含 30px 左右内边距），
   所以这里的屏幕宽度应是 980 - 60 = 920 才能对齐 */
.admin-view .admin-screen[data-admin-screen="settings"],
.admin-view .admin-screen[data-admin-screen="platform-releases"] { max-width: 920px; }
.admin-view .admin-screen[data-admin-screen="settings"] .admin-panel + .admin-panel { margin-top: 18px; }
.admin-view .admin-screen[data-admin-screen="platform-releases"] .admin-panel { padding: 22px 24px; }

/* ---------- 弹窗与表单控件（弹窗在 body 下，不嵌在 .admin-view 内） ---------- */
.product-dialog,
.detail-dialog { border-color: #e5eae7; border-radius: 22px; background: #fff; box-shadow: 0 24px 64px rgba(20, 33, 28, .22); }
.product-dialog::backdrop,
.detail-dialog::backdrop { background: rgba(20, 33, 28, .42); backdrop-filter: blur(3px); }
.product-dialog .dialog-header h2 { font-size: 20px; letter-spacing: -.01em; }
.product-dialog .dialog-header .eyebrow { color: #0c8264; font-size: 11px; letter-spacing: .09em; }
.product-dialog .dialog-close { width: 32px; height: 32px; border-radius: 50%; background: #edf1ef; }
.product-dialog .dialog-close:hover { background: #e0e7e3; }
.form-field input,
.form-field select,
.form-field textarea { min-height: 40px; padding: 9px 12px; border: 0; border-radius: 10px; background: #edf1ef; font-size: 13.5px; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { background: #fff; border-color: transparent; box-shadow: inset 0 0 0 1px #0c8264, 0 0 0 3px #e2f1ea; outline: 0; }
.form-field.invalid input,
.form-field.invalid select,
.form-field.invalid textarea { box-shadow: inset 0 0 0 1px #c4322a, 0 0 0 3px #f9e9e7; }
.form-actions { margin-top: 20px; }
.form-feedback { color: #0c8264; font-size: 12.5px; font-weight: 600; }

/* ---------- 登录弹窗 ---------- */
.admin-login-card { border-radius: 22px; box-shadow: 0 26px 70px rgba(21, 32, 28, .28); }
.admin-login-card .admin-login-logo { color: #0c8264; }
.admin-login-card .eyebrow { color: #0c8264; }
.admin-login-card h2 { letter-spacing: -.02em; }
.admin-login-sub,
.admin-login-hint { color: #55635d; }

/* ---------- 空态 / 建设中 ---------- */
.admin-view .empty-state { padding: 44px 20px; color: #55635d; }
.admin-view .empty-state h3,
.admin-view .empty-state h4 { margin: 0 0 4px; color: #15201c; font-size: 15px; }
.admin-view .empty-state p { margin: 0; font-size: 12.5px; }
.admin-view .planned-state > span { color: #0c8264; background: #e2f1ea; }
.admin-view .integration-manager-panel .of-latest-empty { margin: 0; padding: 34px 0; text-align: center; }

/* ---------- 服务器监控 ---------- */
.admin-view .system-metrics-grid { gap: 14px; }
.admin-view .system-monitor-grid { align-items: start; }
.admin-view .system-monitor-grid > .admin-panel { display: flex; flex-direction: column; }
.admin-view .system-monitor-grid > .admin-panel > .perm-list { flex: 1; }
.admin-view .system-monitor-grid .perm-list { flex: 1; }

@media (max-width: 1100px) {
  .admin-view .admin-content { padding: 22px 24px 48px; }
  .admin-view .system-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-view .system-network-list { grid-template-columns: 1fr; }
  .admin-view .role-cards { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .admin-view .admin-sidebar { width: auto; padding: 12px 16px; border-right: 0; border-bottom: 1px solid #e5eae7; }
  .admin-view .admin-nav-item.active::before { display: none; }
  .admin-view .admin-content { padding: 20px 16px 48px; }
  .admin-view .admin-header { padding: 0; }
  .admin-view .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-view .admin-grid { grid-template-columns: 1fr; }
  .admin-view .admin-search { width: 100%; }
}
@media (max-width: 760px) {
  .admin-view .metric-grid,
  .admin-view .system-metrics-grid { grid-template-columns: 1fr; }
  .admin-view .admin-nav-item.active::before { display: none; }
}
