/* ==========================================================================
   全局核心设计体系与后台管理视觉重构 (Modern SaaS / ERP Style · 参考图1)
   设计特点：
   1. 配色基调：极简纯净浅灰背景 (#f4f6fa / #f8fafc)、纯白卡片 (#ffffff)、雅致深蓝紫主色 (#4f46e5 / #6366f1)
   2. 侧边栏：极简分组导航、活跃项柔和浅紫背景 + 左侧圆润指示、优雅文字层级
   3. 顶栏：轻量透明、精细路径面包屑、胶囊搜索框与现代操作按钮
   4. 概览指标卡片：纯白浮层、细腻微光边框、高质感数字与微标
   5. 数据表格与设置列表：清爽表头、自适应间距、优雅胶囊药丸状态指示、平滑按键
   ========================================================================== */
:root {
    color-scheme: light;
    --bg: #f4f6fa;
    --paper: #ffffff;
    --ink: #0f172a;
    --ink-secondary: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-light: #f1f5f9;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --soft: #eef2ff;
    --green: #10b981;
    --green-soft: #ecfdf5;
    --amber: #f59e0b;
    --amber-soft: #fffbeb;
    --rose: #f43f5e;
    --rose-soft: #fff1f2;
    --radius: 16px;
    --radius-sm: 10px;
    --space-sm: 8px;
    --public-page-gutter: max(5vw, calc(var(--space-sm) * 4));
    --cover-size: 48px;
    --platform-depth-near: 1;
    --platform-depth-middle: 0.6;
    --platform-depth-far: 0.2;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 10px 25px -3px rgba(100, 110, 140, 0.06), 0 4px 6px -4px rgba(100, 110, 140, 0.04);
    --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Segoe UI", Roboto, sans-serif;
    font-family: var(--font-main);
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

input[type="number"]::-webkit-inner-spin-button {
    opacity: 1;
    cursor: pointer;
}

.ui-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    flex: none;
    vertical-align: -0.125em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-size: 13px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
    color: inherit;
}

button:disabled {
    cursor: wait;
    opacity: 0.55;
}

a {
    color: inherit;
    text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ==========================================================================
   全局统一控件：下拉选择器组件规范 (Unified Select / Dropdown Component)
   设计要点：
   1. 彻底清除系统默认三角外观 (-webkit-appearance: none)，替换为精致内嵌 SVG 矢量箭头
   2. 统一高度 (38px)、圆角 (10px)、发丝边框 (#e2e8f0)、舒适右侧呼吸间距 (36px)
   3. 聚焦态统一柔和发光环 (0 0 0 3px rgba(79, 70, 229, 0.12))，箭头随之高亮变色
   4. 扁平无阴影设计，与整体 Modern SaaS / 苹果极简视觉严格统一
   ========================================================================== */
select,
.select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 38px;
    line-height: 36px;
    padding: 0 36px 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6.5L8 10.5L12 6.5' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 14px;
    color: var(--ink-secondary);
    font-size: 13px;
    font-weight: 550;
    box-shadow: none;
    cursor: pointer;
    vertical-align: middle;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

select:hover,
.select:hover {
    border-color: #cbd5e1;
    background-color: #f8fafc;
    color: var(--ink);
}

select:focus,
select:focus-visible,
.select:focus {
    border-color: var(--accent);
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6.5L8 10.5L12 6.5' stroke='%234f46e5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    outline: none;
}

select:disabled,
.select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background-color: #f1f5f9;
}

select option {
    background: #ffffff;
    color: #0f172a;
    font-size: 13px;
    padding: 8px 12px;
}

[hidden] {
    display: none !important;
}

.skip-link {
    position: fixed;
    top: -80px;
    z-index: 50;
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    transition: top 0.2s;
}

.skip-link:focus {
    top: 12px;
    left: 12px;
}

/* --------------------------------------------------------------------------
   后台侧边栏导航 (Sidebar · 参考图1现代 ERP 架构)
   -------------------------------------------------------------------------- */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 240px;
    background: var(--paper);
    border-right: 1px solid var(--line);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    z-index: 30;
    box-shadow: 1px 0 0 rgba(0, 0, 0, 0.02);
}

/* 品牌 Logo */
.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: 28px;
    padding: 0 8px;
}

/* 品牌 Logo 图标 (极简平整无阴影) */
.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-content: center;
    background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
    border-radius: 10px;
    color: white;
    font-size: 18px;
    font-weight: 800;
    box-shadow: none;
    /* 去除图标阴影 */
}

/* 分组标题与导航项 */
.nav-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 16px 12px 8px;
}

nav .nav-label {
    margin-top: 24px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: transparent;
    text-align: left;
    color: var(--ink-secondary);
    font-size: 13px;
    font-weight: 550;
    margin-bottom: 4px;
    transition: all 0.15s ease;
}

.nav-item>span:first-child {
    font-size: 16px;
    line-height: 1;
    min-width: 18px;
    text-align: center;
    color: #94a3b8;
    transition: color 0.15s ease;
}

.nav-item:hover:not(.active) {
    background: #f8fafc;
    color: var(--ink);
}

.nav-item:hover:not(.active)>span:first-child {
    color: var(--ink);
}

.nav-item.active {
    color: var(--accent);
    background: var(--soft);
    font-weight: 600;
}

.nav-item.active>span:first-child {
    color: var(--accent);
}

.nav-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    background: rgba(79, 70, 229, 0.1);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 980px;
}

.workspace {
    margin-left: 240px;
    min-height: 100vh;
    background: var(--bg);
}

/* --------------------------------------------------------------------------
   顶部栏 (Topbar) 与主体容器
   -------------------------------------------------------------------------- */
.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.breadcrumb {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
}

.breadcrumb span {
    padding: 0 8px;
    color: #cbd5e1;
}

.breadcrumb strong {
    font-weight: 600;
    color: var(--ink);
}

.top-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.top-actions time {
    font-size: 11px;
    color: var(--muted);
}

main {
    max-width: 1520px;
    margin: 0 auto;
    padding: 32px 36px 40px;
}

/* 页面头部区域 */
.heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.eyebrow {
    letter-spacing: 0.5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
    text-transform: uppercase;
}

h1 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.heading p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

/* ==========================================================================
   后台管理按钮规范 (极简平整设计 · 去除所有阴影 box-shadow，呈现干净现代质感)
   ========================================================================== */
.button {
    border: 1px solid var(--line);
    border-radius: 980px;
    background: var(--paper);
    padding: 8px 18px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-secondary);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    box-shadow: none;
    /* 统一去除基础按钮阴影 */
    transition: all 0.15s ease;
}

.button:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: var(--ink);
    box-shadow: none;
    /* 去除悬浮阴影，避免浮动光晕 */
    transform: none;
    /* 保持平稳无位移 */
}

.button.subtle {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: var(--muted);
    padding: 8px 12px;
}

.button.subtle:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--ink);
    box-shadow: none;
    transform: none;
}

.button.primary {
    background: #4f46e5;
    color: white;
    border: 1px solid transparent;
    box-shadow: none;
    /* 去除主操作按钮阴影 */
}

.button.primary:hover {
    background: #4338ca;
    box-shadow: none;
    /* 去除主操作按钮悬浮阴影 */
    transform: none;
}

/* --------------------------------------------------------------------------
   后台数据概览统计卡片 (Summary Metric Cards · 参考图1)
   -------------------------------------------------------------------------- */
.summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 0;
    margin-bottom: 28px;
    box-shadow: var(--shadow-md);
}

/* 当数据概览为空或隐藏时彻底隐藏并不占据外部间距 */
.summary:empty {
    display: none !important;
}

.metric {
    padding: 0 28px;
    border-right: 1px solid var(--line-light);
    min-width: 0;
}

.metric:last-child {
    border-right: 0;
}

.metric-label {
    font-size: 12px;
    font-weight: 550;
    color: var(--muted);
    margin-bottom: 6px;
}

.metric strong {
    font-size: 26px;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--ink);
    line-height: 1.1;
}

.metric-note {
    font-size: 11px;
    color: #94a3b8;
    margin-left: 8px;
    font-weight: 500;
}

.metric:last-child strong {
    font-size: 18px;
    letter-spacing: 0;
}

/* --------------------------------------------------------------------------
   分类切换与搜索过滤栏 (Browse Tools)
   -------------------------------------------------------------------------- */
.browse-tools {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

.tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tabs button {
    background: transparent;
    border: 1px solid transparent;
    padding: 6px 16px;
    border-radius: 980px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 550;
    transition: all 0.15s ease;
}

.tabs button:hover:not(.selected) {
    color: var(--ink);
    background: rgba(0, 0, 0, 0.03);
}

/* 分类标签选中状态 (极简纯平无阴影) */
.tabs button.selected {
    background: var(--paper);
    border-color: var(--line);
    color: var(--accent);
    font-weight: 600;
    box-shadow: none;
    /* 去除分类选中按钮阴影 */
}

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 7px 14px;
    border-radius: 980px;
    color: var(--muted);
    width: 260px;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
}

.search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.search>span {
    font-size: 16px;
    line-height: 1;
    color: #94a3b8;
}

.search input {
    border: 0;
    width: 100%;
    min-width: 0;
    font-size: 13px;
    background: transparent;
    color: var(--ink);
    padding: 0;
}

.search input:focus {
    outline: none;
}

.search kbd {
    padding: 1px 6px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: inherit;
    color: var(--ink-secondary);
    background: var(--paper);
}

/* --------------------------------------------------------------------------
   热榜广场卡片网格 (Board Grid)
   -------------------------------------------------------------------------- */
.board-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.board {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    min-width: 0;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.board:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-lg);
}

.board-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 14px;
}

/* 平台图标徽章 (极简平整无阴影) */
.platform-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: none;
    /* 去除平台徽章阴影 */
}

.platform-icon.baidu {
    background: #eff6ff;
    color: #2563eb;
}

.platform-icon.weibo {
    background: #fff1f2;
    color: #e11d48;
}

.platform-icon.hupu {
    background: #fef2f2;
    color: #dc2626;
}

.platform-icon.v2ex_hot,
.platform-icon.v2ex_new {
    background: #f1f5f9;
    color: #475569;
    font-size: 14px;
}

.board-title {
    min-width: 0;
}

.board-title h2 {
    font-size: 15px;
    margin: 0;
    font-weight: 700;
    color: var(--ink);
}

.board-title p {
    font-size: 11px;
    color: var(--muted);
    margin: 2px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   多频道切换胶囊分段选择器 (Segmented Control)
   用于在同一平台内平滑切换子频道（如 V2EX 最热/最新、果核剥壳 文章/软件 等）
   采用轻量级胶囊背景与活跃项微浮雕设计
   -------------------------------------------------------------------------- */
.source-channels {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 980px;
}

.source-channels button {
    border: 0;
    background: transparent;
    padding: 4px 12px;
    border-radius: 980px;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    line-height: 1.4;
}

.source-channels button:hover:not(.active) {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.7);
}

.source-channels button.active {
    background: #ffffff;
    color: var(--accent);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* 广场卡片内多频道选择器的外边距 */
.board-channels {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--space-sm) / 2);
    margin: 0 calc(var(--space-sm) * 2) var(--space-sm);
    padding: calc(var(--space-sm) / 2);
    background: var(--line-light);
    border-color: var(--line);
    border-radius: var(--radius-sm);
}

.board-channels button {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    padding: var(--space-sm) calc(var(--space-sm) * 1.5);
    border-radius: var(--radius-sm);
    white-space: normal;
    overflow-wrap: anywhere;
}

/* 详情/前台大卡片头部多频道选择器的外边距 */
.public-board-header .source-channels {
    margin-top: 12px;
}

.board-meta {
    padding: 0 20px 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 11px;
    color: #94a3b8;
}

/* 状态药丸标签 (Status Pill) */
.status-pill {
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    padding: 2px 8px;
    display: inline-block;
    white-space: nowrap;
    background: var(--green-soft);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-pill.failed,
.status-pill.stale {
    background: var(--amber-soft);
    color: var(--amber);
    border-color: rgba(245, 158, 11, 0.25);
}

.status-pill.paused {
    background: #f1f5f9;
    color: #64748b;
    border-color: var(--line);
}

.status-pill.running {
    background: #eff6ff;
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.25);
}

/* 榜单条目列表 */
.rank-list {
    list-style: none;
    padding: 0 20px;
    margin: 0;
}

.rank-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 38px;
    padding: 8px 0;
    border-top: 1px solid var(--line-light);
    font-size: 13px;
}

.rank-list li:has(.item-cover) {
    align-items: center;
    gap: var(--space-sm);
}

.rank-list .item-cover {
    width: var(--cover-size);
    height: var(--cover-size);
    flex: none;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--paper);
}

.rank {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    min-width: 16px;
    font-variant-numeric: tabular-nums;
}

.rank-list li:nth-child(-n+3) .rank {
    color: var(--accent);
    font-weight: 700;
}

.topic-link {
    line-height: 20px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink-secondary);
    transition: color 0.15s ease;
}

.topic-link:hover {
    color: var(--accent);
}

.heat {
    margin-left: auto;
    white-space: nowrap;
    color: #94a3b8;
    font-size: 11px;
    line-height: 20px;
    min-width: 24px;
    text-align: right;
}

.board-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    padding: 12px 20px;
    background: #fafbfc;
    border-top: 1px solid var(--line-light);
    font-size: 11px;
    color: var(--muted);
}

.text-button {
    padding: 0;
    border: 0;
    background: transparent;
    font-size: inherit;
    font-weight: 600;
    color: var(--accent);
}

.text-button:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.board-empty {
    padding: 24px 20px;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.board-empty strong {
    color: var(--ink);
    font-size: 14px;
    margin-bottom: 6px;
}

.notice {
    background: var(--amber-soft);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #b45309;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 24px;
}

.empty-state,
.loading-state {
    padding: 60px 24px;
    background: var(--paper);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    text-align: center;
    color: var(--muted);
    box-shadow: var(--shadow-sm);
}

.empty-state h2 {
    font-size: 18px;
    color: var(--ink);
    margin: 0 0 8px;
}

/* --------------------------------------------------------------------------
   后台管理面板 (Panel · 包含平台设置与授权表格等)
   -------------------------------------------------------------------------- */
.panel {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.panel h2 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--ink);
}

.panel p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 16px;
}

.panel .api-error-note,
.public-api-section .panel .api-error-note {
    margin-top: 14px;
}

/* 面板标题栏与操作组 (统一高度与组件对齐规范) */
.panel-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.admin-preview-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-preview-picker {
    position: relative;
    width: 270px;
}

.admin-preview-picker summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    cursor: pointer;
    list-style: none;
}

.admin-preview-picker summary::-webkit-details-marker {
    display: none;
}

.admin-preview-picker summary .ui-icon {
    color: var(--muted);
}

.admin-preview-picker[open] summary {
    border-color: var(--accent);
}

.admin-preview-menu {
    position: absolute;
    z-index: 10;
    top: calc(100% + 6px);
    right: 0;
    width: min(380px, calc(100vw - 40px));
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
}

.admin-preview-filters {
    display: flex;
    gap: 8px;
}

.admin-preview-filters .settings-search {
    width: auto;
    min-width: 0;
    flex: 1;
    height: 38px;
}

.admin-preview-options {
    max-height: 240px;
    overflow-y: auto;
}

.admin-preview-all,
.admin-preview-options button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.admin-preview-all {
    margin-top: 8px;
    font-weight: 600;
}

.admin-preview-all:hover,
.admin-preview-options button:hover {
    background: #f1f5ff;
}

.admin-preview-options code {
    color: var(--muted);
    font-size: 11px;
}

.admin-preview-options button[hidden],
.admin-preview-empty[hidden] {
    display: none;
}

.admin-preview-empty {
    margin: 8px 10px 2px;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 640px) {
    .admin-preview-toolbar {
        width: 100%;
    }

    .admin-preview-picker {
        min-width: 0;
        flex: 1;
    }
}

.admin-preview-toolbar .button {
    height: 38px;
    padding: 0 18px;
}

/* 管理员数据预览 JSON 视窗 (高对比度深色背景与天蓝字阶) */
.admin-api-preview .api-preview-output {
    min-height: 200px;
    max-height: 480px;
    margin: 0;
    padding: 18px 20px;
    border-radius: 12px;
    background: #0f172a;
    border: 1px solid #1e293b;
    color: #38bdf8;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-wrap;
    tab-size: 2;
    overflow: auto;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 15px;
}

table {
    border-collapse: collapse;
    width: 100%;
    text-align: left;
    font-size: 13px;
    white-space: nowrap;
}

th {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    background: #f8fafc;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-light);
    color: var(--ink-secondary);
}

td.error-cell {
    white-space: normal;
    min-width: 160px;
    max-width: 360px;
    font-size: 12px;
    color: #b45309;
}

/* ==========================================================================
   最近采集记录与历史保留配置美化 (Runs & Retention Form Styles)
   ========================================================================== */

/* 1. 采集记录保留期限表单 (紧凑精致胶囊控制单元) */
.retention-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px 4px 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 980px;
    transition: all 0.15s ease;
}

.retention-form:focus-within {
    border-color: #cbd5e1;
    background: #ffffff;
}

.retention-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.retention-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 2px 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.retention-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

.retention-input-wrap input {
    width: 44px;
    height: 26px;
    border: 0;
    background: transparent;
    text-align: center;
    font-size: 13px;
    font-weight: 650;
    color: var(--ink);
    padding: 0;
    outline: none;
}

.retention-unit {
    font-size: 11px;
    color: var(--muted);
    font-weight: 550;
}

.retention-form .button {
    height: 30px;
    padding: 0 14px;
    font-size: 12px;
    border-radius: 980px;
}

/* 2. 迷你平台图标徽章 */
.platform-icon.mini {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    font-size: 11px;
    flex-shrink: 0;
}

.platform-icon.mini img {
    inset: 3px;
    width: 20px;
    height: 20px;
}

/* 3. 采集记录单元格排版美化 (标题不加粗，ID 微标精致并列) */
.run-platform-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.run-platform-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.run-platform-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.4;
    white-space: nowrap;
}

.run-platform-id {
    font-size: 11px;
    font-weight: 400;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 1px 7px;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    line-height: 1.4;
}

.run-time-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.run-time-cell span {
    font-size: 12px;
    color: var(--ink-secondary);
    font-variant-numeric: tabular-nums;
}

.run-time-cell small {
    font-size: 10px;
    color: var(--muted);
}

.run-count-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    font-size: 11px;
    color: var(--muted);
}

.run-count-badge strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.run-error-msg {
    color: #dc2626;
    font-size: 11px;
    line-height: 1.4;
    word-break: break-all;
}

/* 4. 采集记录 AJAX 滚动列表容器 (不限制高度，随页面平滑自然延伸) */
.runs-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
}

.runs-sentinel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    margin-top: 14px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px dashed var(--line);
    font-size: 12px;
    font-weight: 550;
    color: var(--muted);
    transition: all 0.2s ease;
}

.sentinel-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
}

.sentinel-end {
    color: #94a3b8;
}

.sentinel-error {
    color: #dc2626;
    cursor: pointer;
}

.runs-loading-init {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 20px;
    color: var(--muted);
    font-size: 13px;
}

/* 通用旋转加载环 */
.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(79, 70, 229, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: hotapi-spin 0.65s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes hotapi-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 平台设置工具栏 (统一组件高度、对齐与无阴影极简规范) */
.settings-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    flex-wrap: wrap;
}

.settings-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 280px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    color: var(--muted);
    box-shadow: none;
    /* 去除阴影，保持平整 */
    transition: all 0.15s ease;
}

.settings-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.settings-search span {
    font-size: 16px;
    line-height: 1;
    color: #94a3b8;
}

.settings-search input {
    width: 100%;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    font-size: 13px;
    color: var(--ink);
    padding: 0;
}

.settings-search input:focus {
    outline: none;
}

/* 平台设置分类筛选下拉框 (继承全局统一下拉组件) */
.settings-toolbar select {
    min-width: 130px;
    height: 38px;
}

.settings-count {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 550;
}

.settings-bulk-actions {
    display: flex;
    gap: 8px;
}

.settings-bulk-actions > .button {
    height: 38px;
    padding: 0 16px;
}

.settings-panel > .panel-heading-row > h2 {
    margin: 0;
}

.settings-panel .settings-bulk-actions {
    align-items: center;
    flex-wrap: wrap;
}

.settings-panel .settings-toolbar .settings-count {
    margin-left: 0;
}

.settings-panel .settings-toolbar .settings-bulk-actions {
    margin-left: auto;
}

/* 平台设置列表 */
.settings-list {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
}

.settings-head,
.settings-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.8fr) 110px 56px 148px 110px 90px 148px;
    align-items: center;
    column-gap: 12px;
    min-width: 1000px;
}

.settings-head {
    padding: 12px 16px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    border-bottom: 1px solid var(--line);
}

.settings-head span:not(:first-child) {
    text-align: center;
}

.settings-row {
    padding: 10px 16px;
    border-top: 1px solid var(--line-light);
    transition: background 0.12s ease;
}

.settings-row:hover {
    background: #fafbfc;
}

.settings-group > summary {
    cursor: pointer;
    list-style: none;
}

.settings-group > summary::-webkit-details-marker {
    display: none;
}

.settings-group > summary.settings-row .setting-platform {
    grid-column: 1 / -2;
    text-align: left;
}

.settings-group[open] > summary .setting-platform > .ui-icon {
    transform: rotate(180deg);
}

[data-category-drag] {
    cursor: grab;
    touch-action: none;
}

[data-category-row].dragging {
    background: var(--soft);
}

.category-table th:last-child {
    text-align: center;
}

.category-table .setting-actions {
    justify-content: center;
}

.setting-platform {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.setting-platform .platform-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 14px;
}

.setting-platform .platform-icon img {
    inset: 4px;
}

.setting-name {
    min-width: 0;
}

.setting-name strong,
.setting-name small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.setting-name strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.setting-name small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.settings-check {
    display: grid;
    place-items: center;
}

.settings-row input[type=checkbox] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.setting-number {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
}

.setting-number input {
    width: 68px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 550;
    color: var(--ink);
}

.setting-interval input,
.setting-interval .custom-select-trigger {
    height: 32px;
    line-height: normal;
}

.setting-interval input {
    width: 56px;
}

.settings-row > .custom-select .custom-select-trigger {
    width: 100%;
    min-width: 0;
}

.settings-row > .custom-select .trigger-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-row .custom-select-menu {
    position: fixed;
    right: auto;
    max-height: 50vh;
    overflow-y: auto;
}

.setting-interval .custom-select-menu {
    min-width: 0;
}

.setting-number input:focus {
    border-color: var(--accent);
    outline: none;
}

.settings-row>div:nth-last-child(2) {
    text-align: center;
}

.setting-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.setting-actions .button {
    padding: 6px 12px;
    font-size: 11px;
    white-space: nowrap;
}

.settings-empty {
    padding: 40px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.field {
    display: grid;
    gap: 6px;
    font-size: 12px;
    font-weight: 550;
    color: var(--ink-secondary);
    margin: 20px 0 10px;
}

.field input {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    min-width: 0;
    font-size: 13px;
    background: #ffffff;
    color: var(--ink);
}

.field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    outline: none;
}

.notification-panel { max-width: 980px; }
.notification-heading { display: flex; justify-content: space-between; gap: 20px; }
.notification-heading h2, .notification-section h3 { margin: 0; }
.notification-heading p, .notification-help { color: var(--muted); font-size: 13px; line-height: 1.7; }
.notification-form { display: grid; gap: 20px; margin-top: 22px; }
.notification-section { border-top: 1px solid var(--line-light); padding-top: 20px; }
.notification-section h3 { font-size: 15px; }
.notification-channels, .notification-templates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.notification-channel { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.notification-channel > span, .notification-events > label { color: var(--ink); font-size: 13px; font-weight: 650; }
.notification-channel small, .notification-events small { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.6; }
.notification-channel input[type=email], .notification-channel input[type=url], .notification-channel textarea, .notification-templates textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); font: inherit; }
.notification-channel input[type=email], .notification-channel input[type=url] { padding: 9px 11px; font-size: 13px; }
.notification-channel textarea { min-height: calc(var(--space-sm) * 12); padding: var(--space-sm) calc(var(--space-sm) * 1.5); resize: vertical; }
.notification-channel textarea:focus { border-color: var(--accent); box-shadow: var(--shadow-sm); outline: none; }
.notification-channel input:focus, .notification-templates textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12); outline: none; }
.notification-events { display: grid; gap: 10px; margin-top: 12px; }
.notification-events > label { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 8px; }
.notification-events input[type=checkbox], .notification-channel input[type=checkbox] { margin: 2px 0 0; accent-color: var(--accent); }
.notification-events input[type=number] { width: 48px; margin: 0 2px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 5px; text-align: center; }
.notification-templates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.notification-templates label { display: grid; gap: 7px; color: var(--ink-secondary); font-size: 12px; font-weight: 650; }
.notification-templates textarea { min-height: 104px; padding: 10px 11px; resize: vertical; font-size: 12px; line-height: 1.55; }
.notification-actions { display: flex; align-items: center; gap: 10px; }
@media (max-width: 780px) { .notification-channels, .notification-templates { grid-template-columns: 1fr; } }

/* ==========================================================================
   后台接口授权表单现代化两行布局重构 (Clean Two-Row Responsive Grid)
   第一行：授权名称 (6/12) + 授权域名 (6/12) —— 充裕宽度，输入清晰舒适
   第二行：有效期限、防盗链安全与生成按钮
   ========================================================================== */
.license-form {
    margin-top: 18px;
}

.license-form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px 14px;
    align-items: end;
}

/* 第一行：授权名称与授权域名 */
.license-form-grid .field-name {
    grid-column: span 6;
}

.license-form-grid .field-domain {
    grid-column: span 6;
}

/* 第二行：有效期限、防盗链安全与生成按钮 */
.license-form-grid .field-duration {
    grid-column: span 4;
}

.license-form-grid .field-encrypt {
    grid-column: span 3;
}

.license-form-grid .license-form-action {
    grid-column: span 2;
    display: flex;
    align-items: flex-end;
}

.field-title {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-secondary);
    margin-bottom: 2px;
}

.license-form-grid .field {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.license-form-grid .field input[type=text],
.license-form-grid .field input:not([type]) {
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    color: var(--ink);
    font-size: 13px;
    width: 100%;
}

.license-form-grid .field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    outline: none;
}

/* 有效期组合控件（输入框 + 单位 + 永久勾选） */
.duration-control {
    display: flex;
    align-items: center;
    height: 38px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 10px;
    gap: 6px;
    transition: all 0.15s ease;
}

.duration-control:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.duration-control>input {
    width: 48px !important;
    height: 28px !important;
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 13px !important;
    font-weight: 650 !important;
    text-align: center;
    outline: none !important;
    color: var(--ink);
}

.duration-control>input:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.unit-text {
    font-size: 11px;
    color: var(--muted);
    font-weight: 550;
    white-space: nowrap;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    font-size: 12px;
    color: var(--ink-secondary);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.checkbox-inline input[type=checkbox] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* 防盗链加密卡片式开关控件 */
.encrypt-switch-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.encrypt-switch-box:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.encrypt-switch-box:has(input:checked) {
    border-color: rgba(16, 185, 129, 0.35);
    background: #f0fdf4;
}

.encrypt-switch-box input[type=checkbox] {
    width: 16px;
    height: 16px;
    accent-color: #10b981;
    cursor: pointer;
}

.encrypt-switch-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-secondary);
}

.encrypt-switch-box:has(input:checked) .encrypt-switch-text {
    color: #059669;
}

/* 生成按钮规范 */
.license-submit-btn {
    width: 100%;
    height: 38px !important;
    font-size: 13px !important;
    font-weight: 650 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    padding: 0 16px !important;
}

@media (max-width: 1100px) {
    .license-form-grid .field-name {
        grid-column: span 12;
    }

    .license-form-grid .field-domain {
        grid-column: span 12;
    }

    .license-form-grid .field-duration {
        grid-column: span 6;
    }

    .license-form-grid .field-encrypt {
        grid-column: span 6;
    }

    .license-form-grid .license-form-action {
        grid-column: span 6;
    }
}

@media (max-width: 640px) {

    .license-form-grid .field-duration,
    .license-form-grid .field-encrypt,
    .license-form-grid .license-form-action {
        grid-column: span 12;
    }
}

.key-actions {
    display: flex;
    gap: 6px;
}

.key-icon-button {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: #64748b;
    transition: all 0.15s ease;
}

.key-icon-button svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.key-icon-button:hover {
    border-color: #cbd5e1;
    color: var(--ink);
}

.key-icon-button.danger:hover {
    border-color: #fecdd3;
    background: #fff1f2;
    color: #e11d48;
}

.key-icon-button.enable {
    color: #059669;
}

/* 接口授权表格中 Key 与域名一键复制按钮样式 */
.key-copy {
    border: 0;
    background: transparent;
    color: var(--accent);
    padding: 0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.key-copy:hover {
    text-decoration: underline;
}

/* 接口授权列表中链接保护按钮与状态微标 */
.encrypt-toggle-btn {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.encrypt-tag {
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    padding: 2px 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.encrypt-tag.on {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.encrypt-tag.on:hover {
    background: #d1fae5;
}

.encrypt-tag.off {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.encrypt-tag.off:hover {
    background: #e2e8f0;
    color: var(--ink);
}

/* 接口授权域名胶囊标签（非编辑状态下点击直接一键复制，悬浮轻量高亮交互） */
.domain-badge-btn {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: var(--ink-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    line-height: 1.4;
}

.domain-badge-btn code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    font-weight: 500;
}

.domain-badge-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: var(--accent);
}

.domain-badge-btn:active {
    transform: scale(0.97);
}

.key-unavailable {
    color: var(--muted);
    font-size: 11px;
}

.key-state {
    display: block;
    margin-top: 3px;
    color: var(--rose);
    font-size: 10px;
    font-weight: 600;
}

.key-usage strong,
.key-usage small {
    display: block;
}

.key-usage strong {
    font-size: 12px;
    color: var(--ink);
}

.key-usage small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.key-row-edit input[type=text],
.key-row-edit input[type=number],
.key-row-edit input:not([type]) {
    width: 130px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 12px;
}

.key-row-edit [name=name] {
    width: 110px;
}

/* 响应式调整 */
@media(max-width: 1200px) {
    .sidebar {
        width: 210px;
        padding: 24px 12px;
    }

    .workspace {
        margin-left: 210px;
    }

    main {
        padding: 24px 24px;
    }

    .topbar {
        padding: 0 24px;
    }

    .board-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric {
        padding: 0 18px;
    }
}

@media(max-width: 760px) {
    .sidebar {
        position: static;
        width: auto;
        padding: 16px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .sidebar>.nav-label,
    nav .nav-label {
        display: none;
    }

    .sidebar nav {
        display: flex;
        overflow: auto;
        gap: 6px;
    }

    .nav-item {
        width: auto;
        white-space: nowrap;
        padding: 8px 12px;
    }

    .workspace {
        margin-left: 0;
    }

    .topbar {
        height: 56px;
        padding: 0 16px;
    }

    main {
        padding: 20px 16px;
    }

    .summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px 0;
    }

    .metric:nth-child(2) {
        border-right: 0;
    }

    .board-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   通用基础与全局极简精致滚动条 (Apple-style Subtle Scrollbar)
   ========================================================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 110, 130, 0.25);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 110, 130, 0.45);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 110, 130, 0.25) transparent;
}

/* ==========================================================================
   通用弹窗 (Dialog) 与登录窗口 (#login-dialog) 柔和极简玻璃质感设计
   ========================================================================== */
dialog {
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 22px;
    padding: 32px 28px 26px;
    width: min(400px, calc(100% - 32px));
    background: rgba(255, 255, 255, 0.92);
    color: #1d2129;
    box-shadow: 0 20px 50px rgba(74, 58, 120, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
    font-family: inherit;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

dialog::backdrop {
    background: rgba(43, 49, 68, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* 弹窗顶部微标与标题 */
dialog .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 980px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #4f46e5;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0;
}

dialog h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #1d2129;
    margin: 14px 0 6px;
}

dialog p {
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 18px;
}

/* 圆形极简关闭按钮 */
.dialog-close {
    position: absolute;
    right: 18px;
    top: 18px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: #64748b;
    display: grid;
    place-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
}

.dialog-close:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1e293b;
}

/* 表单输入框与错误提示 */
dialog .field {
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: #334155;
    font-weight: 550;
    margin: 0 0 14px;
}

dialog .field input {
    padding: 10px 14px;
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 10px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 13px;
    transition: all 0.15s ease;
}

dialog .field input:focus {
    border-color: #6366f1;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    outline: none;
}

.form-error {
    color: #e11d48;
    font-size: 12px;
    margin: 2px 0 8px;
    min-height: 18px;
}

/* 登录提交按钮 (极简扁平无阴影) */
#login-form .primary {
    width: 100%;
    min-height: 42px;
    border-radius: 980px;
    background: #4f46e5;
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    border: 0;
    box-shadow: none;
    /* 去除登录按钮阴影 */
    transition: all 0.18s ease;
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#login-form .primary:hover {
    background: #4338ca;
    box-shadow: none;
    /* 去除登录按钮悬浮阴影 */
    transform: none;
}

dialog small {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    display: block;
    line-height: 1.5;
}

/* 榜单详情弹窗 (#detail-dialog) */
.detail-dialog {
    width: min(640px, calc(100% - 24px));
    max-height: 85vh;
    border-radius: var(--radius-sm);
    padding: calc(var(--space-sm) * 3);
    overflow: hidden;
}

.detail-dialog[open],
#detail-content {
    display: flex;
    flex-direction: column;
}

#detail-content {
    min-height: 0;
}

#detail-content > :not(#detail-items) {
    flex-shrink: 0;
}

#detail-content > .eyebrow {
    align-self: flex-start;
    margin-right: calc(var(--space-sm) * 4);
}

#detail-items {
    min-height: 0;
    overflow-y: auto;
    padding-right: var(--space-sm);
}

.detail-dialog .dialog-close {
    top: calc(var(--space-sm) * 2);
    right: calc(var(--space-sm) * 2);
    width: calc(var(--space-sm) * 4);
    height: calc(var(--space-sm) * 4);
}

.detail-dialog .rank-list {
    padding: 0;
}

.detail-dialog .topic-link {
    white-space: normal;
}

.detail-dialog .panel-heading-row {
    gap: var(--space-sm);
    margin-bottom: calc(var(--space-sm) * 2);
}

.detail-dialog .panel-heading-row p,
.detail-dialog .history-control {
    margin: 0;
}

.detail-dialog .history-control {
    gap: var(--space-sm);
    margin-left: auto;
    flex-wrap: wrap;
}

/* 历史版本查看控制 (统一下拉组件规范) */
.history-control {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 16px 0;
    font-size: 12px;
    font-weight: 550;
    color: #64748b;
}

.history-control select {
    height: 36px;
    min-width: 160px;
    padding: 0 32px 0 12px;
    font-size: 12px;
    background-position: right 10px center;
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 35px;
    margin-top: 10px;
    font-size: 10px;
    color: #9ca2ad;
}

.toast {
    position: fixed;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 22px;
    border-radius: 980px;
    background: rgba(30, 41, 59, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    font-size: 13px;
    font-weight: 500;
    z-index: 30;
    max-width: 90vw;
    backdrop-filter: blur(12px);
}

.code {
    background: #1e2430;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 18px;
    border-radius: 10px;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    color: #e2e8f0;
}

.panel ul {
    color: #64748b;
    font-size: 13px;
    padding-left: 20px;
}

@media(min-width:1600px) {
    main {
        padding-top: 50px
    }

    .board-grid {
        gap: 24px
    }

    .rank-list li {
        min-height: 43px
    }
}

@media(max-width:1200px) {
    .sidebar {
        width: 196px;
        padding: 30px 16px
    }

    .workspace {
        margin-left: 196px
    }

    main {
        padding: 30px 26px
    }

    .topbar {
        padding: 0 26px
    }

    .board-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .metric {
        padding: 0 17px
    }

    .metric-note {
        display: block;
        margin: 0
    }

    .heading h1 {
        font-size: 25px
    }
}

@media(max-width:760px) {
    .sidebar {
        position: static;
        width: auto;
        padding: 16px 20px 8px;
        border-right: 0;
        border-bottom: 1px solid var(--line)
    }

    .brand {
        margin-bottom: 16px;
        font-size: 18px
    }

    .brand-mark {
        width: 36px;
        height: 38px;
        font-size: 25px
    }

    .sidebar>.nav-label,
    nav .nav-label {
        display: none
    }

    .sidebar nav {
        display: flex;
        overflow: auto;
        gap: 5px
    }

    .nav-item {
        width: auto;
        white-space: nowrap;
        padding: 8px 11px;
        font-size: 12px;
        gap: 6px;
        flex-shrink: 0;
        margin: 0
    }

    .nav-item>span:first-child {
        font-size: 16px;
        min-width: 15px
    }

    .nav-count {
        display: none
    }

    .workspace {
        margin-left: 0
    }

    .topbar {
        height: 57px;
        padding: 0 20px
    }

    .top-actions time {
        display: none
    }

    main {
        padding: 25px 20px
    }

    .heading {
        align-items: flex-start;
        margin-bottom: 22px
    }

    .eyebrow {
        font-size: 9px
    }

    .heading h1 {
        font-size: 22px;
        line-height: 1.5
    }

    .heading p {
        font-size: 11px;
        max-width: 210px
    }

    .summary {
        grid-template-columns: repeat(2, 1fr);
        padding: 4px 0;
        margin-bottom: 23px
    }

    .metric {
        padding: 15px 18px
    }

    .metric:nth-child(2) {
        border-right: 0
    }

    .metric:nth-child(-n+2) {
        border-bottom: 1px solid var(--line)
    }

    .metric strong {
        font-size: 24px
    }

    .metric-note {
        display: inline;
        margin-left: 6px
    }

    .metric:last-child strong {
        font-size: 17px
    }

    .browse-tools {
        display: block
    }

    .tabs {
        gap: 3px;
        margin-bottom: 15px
    }

    .tabs button {
        padding: 7px 12px;
        font-size: 11px
    }

    .search {
        max-width: none;
        padding: 8px 12px
    }

    .board-grid {
        grid-template-columns: 1fr;
        gap: 18px
    }

    .board-header {
        padding-top: 18px
    }

    .rank-list li {
        min-height: 42px
    }

    .topic-link {
        font-size: 13px
    }

    .settings-toolbar {
        align-items: stretch;
        flex-wrap: wrap
    }

    .settings-search {
        width: auto;
        flex: 1 1 100%
    }

    .settings-count {
        margin-left: 0
    }

    .settings-list {
        margin: 0 -18px;
        border-radius: 0;
        border-left: 0;
        border-right: 0
    }

    .panel {
        padding: 18px
    }

    footer {
        display: block;
        line-height: 2.2
    }

    .top-actions {
        gap: 0
    }
}

@media(prefers-reduced-motion:reduce) {
    *:not(.public-platform) {
        scroll-behavior: auto !important;
        transition: none !important
    }
}

.summary.public-summary {
    grid-template-columns: repeat(2, 1fr)
}

.public-summary .metric {
    border-bottom: 0
}

.public-summary .metric:last-child strong {
    font-size: 26px
}

.platform-icon {
    position: relative
}

.platform-icon img {
    position: absolute;
    inset: 5px;
    object-fit: contain
}

.platform-icon:has(img)>span {
    visibility: hidden
}

.topic {
    flex: 1;
    min-width: 0
}

.topic-link {
    display: block
}

.item-time {
    display: block;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.6;
    margin-top: 3px;
    overflow-wrap: anywhere
}

.visibility-note {
    color: #986d00;
    font-weight: 600
}

.api-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 20px
}

.api-grid .panel {
    margin: 0
}

.api-grid+.panel {
    margin-top: 20px
}

.api-grid h2:not(:first-of-type) {
    margin-top: 24px
}

.api-platform-table {
    max-height: 360px;
    overflow: auto
}

.api-platform-table th {
    position: sticky;
    top: 0;
    z-index: 1
}

/* ==========================================================================
   接口手册：请求代码示例视窗 (高对比度深色专业代码框，彻底解决文字看不清问题)
   ========================================================================== */
.api-example {
    overflow: hidden;
    border: 1px solid #1e293b;
    border-radius: 12px;
    background: #0f172a;
    box-shadow: none;
}

.api-example-tabs {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid #1e293b;
    background: #1e293b;
    padding: 6px 8px;
    gap: 4px;
}

.api-example-tabs button {
    padding: 6px 14px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 550;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
}

.api-example-tabs button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.api-example-tabs button.active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-weight: 600;
}

.api-example-body {
    position: relative;
    background: #0f172a;
}

.api-example-body .code {
    min-height: 140px;
    margin: 0;
    padding: 20px 96px 20px 20px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #38bdf8;
    /* 清晰高亮代码颜色，对比度极高且不刺眼 */
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 复制代码按钮 */
.api-example-copy {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.15s ease;
}

.api-example-copy:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.code-copy {
    position: relative;
    display: block;
    width: 100%;
    padding-right: 62px;
    text-align: left;
    white-space: pre;
    line-height: 1.55;
    font-weight: 400;
    cursor: pointer
}

.code-copy:after {
    content: "复制";
    position: absolute;
    top: 13px;
    right: 15px;
    color: var(--accent);
    font-family: inherit;
    font-size: 10px
}

.code-copy:hover {
    border-color: #c8cdd6;
    background: #f2f4f7
}

.platform-codes {
    display: flex;
    gap: 7px;
    flex-wrap: wrap
}

.platform-codes code,
.panel p code {
    background: #f3f5f8;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 2px 6px;
    color: #445
}

/* ==========================================================================
   接口授权管理表单与列表 (Compact & Unified License Management Form)
   紧凑型单行/双行自适应排版，每个输入框按实际内容分配精准宽度，杜绝过宽过长与空隙过大
   ========================================================================== */
.license-form-compact {
    margin: 18px 0 8px;
    padding: 16px 18px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.form-compact-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.compact-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.compact-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-secondary);
    letter-spacing: 0.2px;
}

/* 授权名称：紧凑适中宽度 */
.compact-field.field-name {
    flex: 1 1 180px;
    max-width: 220px;
}

/* 授权域名：适中弹性宽度 */
.compact-field.field-domain {
    flex: 1 1 200px;
    max-width: 260px;
}

/* 有效期限：固定适宜宽度 */
.compact-field.field-duration {
    flex: 0 0 auto;
}

/* 防盗链开关：自适应紧凑按钮 */
.compact-field.field-encrypt {
    flex: 0 0 auto;
}

.compact-action {
    flex: 0 0 auto;
    margin-left: auto;
}

/* 统一单行输入框 */
.compact-field input[type="text"],
.compact-field input[type="number"],
.compact-field input:not([type]) {
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 500;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.compact-field input[type="text"]:focus,
.compact-field input[type="number"]:focus,
.compact-field input:not([type]):focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    outline: none;
}

/* 有效期限组合框容器 */
.compact-input-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.compact-input-group:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.compact-input-group input[type="number"] {
    height: 26px !important;
    padding: 0 2px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    text-align: center;
}

.field-duration .compact-input-group input[type="number"] {
    width: 42px !important;
}

.compact-input-group input[type="number"]:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.compact-unit {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
}

.compact-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 550;
    color: var(--ink-secondary);
    cursor: pointer;
    user-select: none;
    padding-left: 6px;
    margin-left: 2px;
    border-left: 1px solid var(--line);
    white-space: nowrap;
}

.compact-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

/* 防盗链加密开关盒子 */
.compact-toggle-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.compact-toggle-box:hover {
    border-color: #cbd5e1;
}

.compact-toggle-box:has(input:checked) {
    background: var(--soft);
    border-color: rgba(79, 70, 229, 0.35);
}

.compact-toggle-box input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.compact-toggle-box span {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-secondary);
    white-space: nowrap;
}

.compact-toggle-box:has(input:checked) span {
    color: var(--accent);
}

/* 生成接口 Key 主按钮 */
.compact-submit-btn {
    height: 36px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* 现有授权表格单元格样式 */
.domain-badge-btn {
    display: inline-flex;
    align-items: center;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.domain-badge-btn code {
    background: #f1f5f9;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 3px 8px;
    color: #475569;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    font-weight: 550;
    transition: all 0.15s ease;
}

.domain-badge-btn:hover code {
    background: var(--soft);
    border-color: rgba(79, 70, 229, 0.35);
    color: var(--accent);
}

.encrypt-toggle-btn {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.encrypt-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.encrypt-tag.on {
    background: rgba(79, 70, 229, 0.1);
    color: var(--accent);
    border: 1px solid rgba(79, 70, 229, 0.25);
}

.encrypt-tag.off {
    background: #f1f5f9;
    color: var(--muted);
    border: 1px solid var(--line);
}

.encrypt-toggle-btn:hover .encrypt-tag {
    transform: scale(1.04);
}

.encrypt-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 550;
    color: var(--ink-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.encrypt-checkbox-label input {
    accent-color: var(--accent);
}

@media(max-width: 900px) {
    .form-compact-row {
        gap: 10px;
    }

    .compact-field.field-name,
    .compact-field.field-domain {
        flex: 1 1 100%;
        max-width: none;
    }

    .compact-action {
        margin-left: 0;
        width: 100%;
    }

    .compact-submit-btn {
        width: 100%;
    }
}

/* ==========================================================================
   公共模式（首页第一屏与第二屏）柔和轻盈极简渐变设计 (Modern Minimalist Soft Gradient)
   参考图3视觉：
   1. 渐变底色：粉紫/浅蓝/暖白融合的自然光感背景，不刺眼，柔和通透
   2. 视觉层级：毛玻璃磨砂浮层、柔和圆角、细腻微光边框与轻量阴影
   3. 排版细节：精致胶囊徽章、清晰层级、平台名称自适应防截断
   4. 交互：全屏视口自适应 (min-height: 100vh)、右侧平台列表高度与左侧对齐、美化滚动条
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 基础容器与磨砂顶栏
   -------------------------------------------------------------------------- */
.public-header {
    display: none;
}

.public-mode {
    background: #f4f6fa;
    color: #1e293b;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* 顶部透明无界顶栏：去除白底背景与边框，与首屏和接口区域共用页面左右边界 */
.public-mode .public-header {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: 24px;
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.public-header-inner {
    max-width: none;
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--public-page-gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 品牌标志 */
.public-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.public-brand .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    display: grid;
    place-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.public-brand small {
    display: block;
    font-size: 8px;
    letter-spacing: 1.2px;
    color: #94a3b8;
    font-weight: 500;
}

/* 顶部管理入口胶囊按钮：默认隐藏隐形，保留占位与点击热区，仅在管理员鼠标移入该位置 (hover) 或键盘聚焦时平滑显现 */
.public-admin,
.public-mode .public-header .public-admin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 18px;
    border: 1px solid rgba(79, 70, 229, 0.2);
    background: rgba(255, 255, 255, 0.85);
    color: #4f46e5;
    border-radius: 980px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.06);
    /* 默认透明隐藏，但保留右侧原有布局位置与交互区域 */
    opacity: 0;
    pointer-events: auto;
    cursor: pointer;
    transform: scale(0.96);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* 当管理员鼠标悬停在按钮所在位置 (hover) 或键盘聚焦时平滑显现并高亮呈现 */
.public-admin:hover,
.public-mode .public-header .public-admin:hover,
.public-admin:focus-visible,
.public-mode .public-header .public-admin:focus-visible {
    opacity: 1;
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
    transform: scale(1) translateY(-1px);
}

body.public-mode.signed-in .public-header .public-admin {
    opacity: 1;
    transform: none;
}

/* ==========================================================================
   模式隔离规范 (Public vs Admin Mode Isolation)
   注意：必须限定在 body 上，避免 :not(.public-mode) 误匹配 html/main 等祖先元素
   ========================================================================== */
/* 1. 隐藏后台专用侧栏与冗余模块 (在前台 public-mode 下) */
body.public-mode .sidebar,
body.public-mode .topbar,
body.public-mode #notice,
body.public-mode #summary,
body.public-mode #browse-tools,
body.public-mode #content,
body.public-mode footer {
    display: none !important;
}

/* 2. 隐藏前台专用模块 (在后台 admin-mode 下严格隐藏) */
body.admin-mode .public-header,
body.admin-mode .heading,
body.admin-mode .public-hero-actions,
body.admin-mode .public-platforms,
body.admin-mode #public-platforms,
body.admin-mode .public-api-section,
body.admin-mode #public-api {
    display: none !important;
}

/* 3. 后台接口授权：本月 3 天限时特惠折扣日横幅提示 */
.admin-promo-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin: 0 0 16px;
    border: 1px solid rgba(147, 51, 234, 0.2);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(250, 245, 255, 0.95) 0%, rgba(243, 232, 255, 0.65) 100%);
    font-size: 13px;
    color: #4c1d95;
}

.promo-banner-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    background: #7c3aed;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.promo-banner-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    line-height: 1.5;
}

.promo-banner-content .promo-days-list {
    color: #6d28d9;
}

.promo-banner-content .promo-today {
    color: #b91c1c;
    background: #fee2e2;
    padding: 1px 6px;
    border-radius: 4px;
}

.public-mode .workspace {
    margin-left: 0;
}

.public-mode main {
    max-width: none;
    padding: 0;
}

/* --------------------------------------------------------------------------
   2. 第一屏：Hero 区域 (居中紧凑排版 + 动态柔美光晕背景)
   -------------------------------------------------------------------------- */
.public-mode .heading {
    position: relative;
    overflow: hidden;
    min-height: 100svh;
    margin: 0;
    padding: clamp(110px, 13vh, 140px) 0 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 85% 20%, rgba(224, 204, 250, 0.45) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 85%, rgba(186, 230, 253, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(254, 226, 226, 0.25) 0%, transparent 65%),
        linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f1f5f9 100%);
    color: #1e293b;
}

.public-mode .heading::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    z-index: 1;
    height: 120px;
    background: linear-gradient(90deg, #e1f2ff, #f5f8ff);
    -webkit-mask-image: linear-gradient(transparent, #000);
    mask-image: linear-gradient(transparent, #000);
    pointer-events: none;
}

/* 首屏动态背景光晕光效层：多层柔和呼吸漂移，零 CPU 占用 GPU 高性能渲染 */
.hero-bg-glows {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
    opacity: 0.85;
}

.glow-orb-1 {
    width: min(58vw, 680px);
    height: min(58vw, 680px);
    right: -6%;
    top: -8%;
    background: radial-gradient(circle at center, rgba(224, 204, 250, 0.75) 0%, rgba(192, 132, 252, 0.3) 45%, transparent 70%);
    filter: blur(50px);
    animation: floatGlow1 16s ease-in-out infinite alternate;
}

.glow-orb-2 {
    width: min(64vw, 750px);
    height: min(64vw, 750px);
    left: -10%;
    bottom: -12%;
    background: radial-gradient(circle at center, rgba(186, 230, 253, 0.7) 0%, rgba(125, 211, 252, 0.25) 50%, transparent 70%);
    filter: blur(60px);
    animation: floatGlow2 20s ease-in-out infinite alternate;
}

.glow-orb-3 {
    width: min(48vw, 540px);
    height: min(48vw, 540px);
    left: 38%;
    top: 28%;
    background: radial-gradient(circle at center, rgba(254, 226, 226, 0.5) 0%, rgba(253, 164, 175, 0.18) 45%, transparent 70%);
    filter: blur(55px);
    animation: floatGlow3 18s ease-in-out infinite alternate;
}

@keyframes floatGlow1 {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(-35px, 28px, 0) scale(1.08);
    }

    100% {
        transform: translate3d(25px, -20px, 0) scale(0.96);
    }
}

@keyframes floatGlow2 {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(40px, -35px, 0) scale(1.06);
    }

    100% {
        transform: translate3d(-25px, 25px, 0) scale(0.94);
    }
}

@keyframes floatGlow3 {
    0% {
        transform: translate3d(0, 0, 0) scale(0.96);
    }

    50% {
        transform: translate3d(-25px, -20px, 0) scale(1.05);
    }

    100% {
        transform: translate3d(30px, 18px, 0) scale(1);
    }
}

/* 背景装饰环缓慢漂移 */
.public-mode .heading:before {
    content: "";
    position: absolute;
    width: min(60vw, 720px);
    height: min(60vw, 720px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.5);
    animation: ambientRing 20s ease-in-out infinite alternate;
}

@keyframes ambientRing {
    0% {
        transform: translateY(-50%) translateX(0) scale(1);
    }

    50% {
        transform: translateY(calc(-50% - 8px)) translateX(-12px) scale(1.025);
    }

    100% {
        transform: translateY(calc(-50% + 6px)) translateX(10px) scale(1.01);
    }
}

@media (prefers-reduced-motion: reduce) {

    .public-mode .heading::before,
    .glow-orb {
        animation: none;
    }
}

/* 首屏内容与第二屏共用左右边界 */
.hero-container {
    position: relative;
    z-index: 2;
    max-width: none;
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--public-page-gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: calc(var(--space-sm) * 4);
}

/* Hero 左侧文字内容容器 */
.heading-content {
    max-width: 530px;
    flex: 0 0 530px;
}

/* 顶部徽章 (Eyebrow Badge)：淡紫粉晶透胶囊 */
.public-mode .heading .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 15px;
    border-radius: 980px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #4f46e5;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.public-mode .heading .eyebrow:before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4f46e5;
    box-shadow: 0 0 8px #6366f1;
}

/* Hero 大标题：深空优雅渐变字阶 */
.public-mode .heading h1 {
    font-size: clamp(40px, 4.8vw, 64px);
    line-height: 1.12;
    letter-spacing: -0.03em;
    font-weight: 800;
    margin: 0 0 16px;
    background: linear-gradient(135deg, #0f172a 0%, #334155 70%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hero 说明文案 */
.public-mode .heading p {
    color: #475569;
    font-size: clamp(14px, 1.15vw, 16px);
    line-height: 1.65;
    max-width: 480px;
    margin: 0 0 20px;
    font-weight: 450;
}

/* --------------------------------------------------------------------------
   左侧紧凑定价与联系方式胶囊栏 (Hero Pricing Bar)
   -------------------------------------------------------------------------- */
.hero-pricing-mount {
    margin: 0 0 22px;
}

.hero-pricing-bar {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 22px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 8px 24px rgba(100, 110, 140, 0.05), 0 2px 6px rgba(0, 0, 0, 0.02);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.2s ease;
}

.hero-pricing-bar:hover {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.08);
}

.pricing-price-group {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.pricing-price-group .price-symbol {
    font-size: 15px;
    font-weight: 700;
    color: #4f46e5;
}

.pricing-price-group .price-amount {
    font-size: 28px;
    font-weight: 850;
    color: #0f172a;
    line-height: 1;
    letter-spacing: -0.03em;
}

.pricing-price-group .price-unit {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-right: 4px;
}

.pricing-price-group .pricing-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 980px;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
    margin-right: 4px;
}

.pricing-price-group .badge-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ffffff;
}

.pricing-price-group .price-origin {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    text-decoration: line-through;
}

.pricing-contact-row {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: #64748b;
}

.pricing-email {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed rgba(99, 102, 241, 0.5);
    transition: all 0.15s ease;
}

.pricing-email:hover {
    color: #3730a3;
    border-bottom-style: solid;
    border-color: #4338ca;
}

/* 前台 Hero 操作按钮组 (仅在 public-mode 激活下呈现) */
.public-hero-actions {
    display: none;
}

.public-mode .public-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

/* 渐变深色主按钮 */
.public-hero-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 28px;
    border-radius: 980px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    border: 1px solid #0f172a;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.15);
    transition: all 0.2s ease;
}

.public-hero-primary:hover {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
    transform: translateY(-2px);
}

/* 极简透亮次按钮 */
.public-hero-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 980px;
    background: rgba(255, 255, 255, 0.75);
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(100, 110, 140, 0.06);
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.public-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    box-shadow: 0 6px 20px rgba(100, 110, 140, 0.12);
    transform: translateY(-2px);
}

/* 特性说明文字 */
.public-hero-actions>span {
    display: block;
    width: 100%;
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   3. 第一屏右侧：精选可调用平台卡片 (温润玻璃卡片)
   -------------------------------------------------------------------------- */
.public-platforms {
    display: none;
}

.public-mode .public-platforms {
    position: relative;
    z-index: 2;
    display: block;
    flex: 1 1 0;
    max-width: calc(var(--cover-size) * 14);
    padding: calc(var(--space-sm) * 3);
    border: 1px solid color-mix(in srgb, var(--paper) 85%, transparent);
    border-radius: 24px;
    background: color-mix(in srgb, var(--paper) 48%, transparent);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(32px) saturate(160%);
    -webkit-backdrop-filter: blur(32px) saturate(160%);
}

/* 平台图标散点展示：真实平台与补位图标都保留近、中、远层次 */
.public-platforms-grid {
    position: relative;
    height: calc(var(--cover-size) * 6);
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: radial-gradient(ellipse at center, color-mix(in srgb, var(--soft) 35%, transparent), transparent 72%);
}

.public-platform {
    position: absolute;
    top: var(--burst-y);
    left: var(--burst-x);
    width: var(--cover-size);
    height: var(--cover-size);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
    transform: translate(calc(-50% + var(--move-x, 0px)), calc(-50% + var(--move-y, 0px))) scale(calc(0.6 + var(--burst-depth) * 0.4));
    filter: blur(calc((1 - var(--burst-depth)) * var(--space-sm) * 0.25));
    opacity: calc(0.55 + var(--burst-depth) * 0.45);
    transition: transform 240ms ease;
    pointer-events: none;
}

.public-platform:not(.is-echo) {
    z-index: calc(var(--burst-depth) * 10);
}

.public-platform.is-echo {
    opacity: 0.62;
}

.public-platform .platform-icon {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: var(--paper);
    box-shadow: none;
}

.public-platform .platform-icon img {
    inset: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
}

.public-platform.is-echo .platform-icon img {
    inset: 4px;
    width: calc(100% - 8px);
    height: calc(100% - 8px);
}

/* 平台卡片底部统计与导航链接 */
.public-platforms-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    font-size: 11px;
}

.public-platforms-footer .footer-stats {
    color: #64748b;
}

.public-platforms-footer .footer-stats strong {
    color: #0f172a;
    font-weight: 700;
}

.public-platforms-footer .footer-link {
    color: #4f46e5;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.public-platforms-footer .footer-link:hover {
    color: #3730a3;
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   4. 第二屏：API 接口手册与在线沙箱 (全屏高体验·柔和渐变与极简文档)
   -------------------------------------------------------------------------- */
.public-api-section {
    position: relative;
    margin: 0;
    padding: clamp(70px, 9vh, 120px) max(5vw, 36px) 80px;
    padding-inline: var(--public-page-gutter);
    background:
        radial-gradient(ellipse at 15% 15%, rgba(224, 204, 250, 0.45) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 85%, rgba(186, 230, 253, 0.4) 0%, transparent 45%),
        linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%);
    color: #1e293b;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.public-api-section::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 160px;
    background: linear-gradient(90deg, #e1f2ff, #f5f8ff);
    -webkit-mask-image: linear-gradient(#000, transparent);
    mask-image: linear-gradient(#000, transparent);
    pointer-events: none;
}

.public-api-inner {
    max-width: 1360px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* 区域标题 */
.public-section-title {
    max-width: 680px;
    margin-bottom: 28px;
}

.public-section-title h2 {
    font-size: clamp(30px, 3.6vw, 44px);
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 800;
    margin: 0 0 10px;
    color: #0f172a;
}

.public-section-title p {
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* 分段控制器：柔和玻璃胶囊切换 */
.public-api-switch {
    display: inline-flex;
    gap: 3px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 980px;
    box-shadow: 0 2px 8px rgba(100, 110, 140, 0.05);
    margin-bottom: 24px;
    align-self: flex-start;
}

.public-api-switch button {
    padding: 7px 20px;
    border: 0;
    border-radius: 980px;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 550;
    cursor: pointer;
    transition: all 0.15s ease;
}

.public-api-switch button:hover:not(.active) {
    color: #1e293b;
}

.public-api-switch button.active {
    background: #1e293b;
    color: #ffffff;
    font-weight: 600;
}

/* 文档子分类 Tab */
.public-manual-switch {
    display: flex;
    gap: 8px;
    margin: -4px 0 20px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding-bottom: 12px;
}

.public-manual-switch button {
    padding: 6px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 550;
    cursor: pointer;
    transition: all 0.15s ease;
}

.public-manual-switch button:hover {
    color: #1e293b;
}

.public-manual-switch button.active {
    background: #ffffff;
    border-color: rgba(203, 213, 225, 0.8);
    color: #4f46e5;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(100, 110, 140, 0.05);
}

/* 文档与测试卡片面板 (柔和白底 + 细边框 + 微轻阴影) */
.public-api-section .panel {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 26px;
    color: #1e293b;
    box-shadow: 0 16px 40px rgba(100, 110, 140, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.public-api-section .panel h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 10px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.public-api-section .panel h2:not(:first-of-type) {
    margin-top: 22px;
}

.public-api-section .panel p {
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 15px;
}

.public-api-section .panel code,
.public-api-section .platform-codes code,
.public-api-section .panel p code {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 2px 6px;
    color: #475569;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    font-weight: 500;
}

/* 接口概览参数：恢复高质感柔和卡片 */
.public-api-section .api-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0 20px;
}

.public-api-section .api-facts div {
    padding: 12px 16px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(100, 110, 140, 0.03);
}

.public-api-section .api-facts span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 2px;
}

.public-api-section .api-facts strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

/* 表格：柔和发丝线与舒适字阶 */
.public-api-section table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.public-api-section th {
    padding: 10px 12px;
    background: transparent;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    text-align: left;
}

.public-api-section td {
    padding: 12px 12px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    color: #334155;
    font-size: 13px;
    line-height: 1.5;
}

.public-api-section td:first-child {
    font-weight: 500;
    color: #1e293b;
}

/* 状态指示胶囊：自然淡雅色调 */
.public-api-section .status-pill {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.public-api-section .status-pill.stale {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.25);
}

.public-api-section .status-pill.failed {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.25);
}

.public-api-section .status-pill.paused {
    background: #f1f5f9;
    color: #64748b;
    border-color: #cbd5e1;
}

/* 终端式代码视窗：精致深空灰代码窗 */
.public-api-section .api-example {
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 14px;
    background: #1e2430;
    margin-top: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.public-api-section .api-example-tabs {
    display: flex;
    overflow-x: auto;
    background: #151922;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 8px;
    gap: 4px;
}

.public-api-section .api-example-tabs button {
    padding: 6px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.public-api-section .api-example-tabs button:hover {
    color: #ffffff;
}

.public-api-section .api-example-tabs button.active {
    background: #2b3342;
    color: #ffffff;
    font-weight: 600;
}

.public-api-section .api-example-body {
    position: relative;
}

.public-api-section .api-example-body .code {
    background: transparent;
    border: 0;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.65;
    padding: 18px 90px 18px 18px;
    white-space: pre-wrap;
    margin: 0;
}

.public-api-section .api-example-copy {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 980px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.public-api-section .api-example-copy:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
}

/* 接口手册二级导航：左侧选分类，右侧只显示当前内容 */
.api-manual-detail-layout {
    display: grid;
    grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.api-manual-detail-layout>.panel {
    margin: 0;
}

.api-manual-detail-nav {
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
}

.api-manual-detail-nav button {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.api-manual-detail-nav button:hover {
    background: #f8fafc;
    color: var(--ink);
}

.api-manual-detail-nav button.active {
    border-color: rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.08);
    color: #4f46e5;
}

.api-manual-detail-nav strong,
.api-manual-detail-nav span {
    display: block;
}

.api-manual-detail-nav strong {
    font-size: 14px;
    color: inherit;
}

.api-manual-detail-nav span {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.35;
    color: var(--muted);
}

.api-manual-detail-content {
    min-width: 0;
}

.api-manual-detail-content [hidden] {
    display: none;
}

/* --------------------------------------------------------------------------
   4.1 频道 ID 速查面板 (解决全高覆盖、滚动条美化、文字截断问题)
   -------------------------------------------------------------------------- */
.public-api-section .api-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
    gap: 24px;
    align-items: stretch;
}

.public-api-section .api-platform-panel {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

/* --------------------------------------------------------------------------
   4.1 平台搜索与分类筛选工具栏 (通用组件：同时适用于后台接口手册与前台公共区域)
   -------------------------------------------------------------------------- */
.api-platform-toolbar,
.public-api-section .api-platform-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 14px;
}

/* 搜索框：精准垂直居中图标与文字 */
.api-platform-search-label,
.public-api-section .api-platform-search-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    padding: 0 14px;
    height: 38px;
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 10px;
    background: #ffffff;
    color: #64748b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    cursor: text;
    transition: all 0.18s ease;
}

.public-api-section .api-platform-search-label {
    flex: 0 1 420px;
}

.api-platform-search-label:focus-within,
.public-api-section .api-platform-search-label:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.api-platform-search-label .search-icon,
.public-api-section .api-platform-search-label .search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    line-height: 1;
    flex-shrink: 0;
    color: #94a3b8;
}

.api-platform-search-label .search-icon svg,
.public-api-section .api-platform-search-label .search-icon svg {
    display: block;
    width: 16px;
    height: 16px;
}

.api-platform-search-label input,
.public-api-section .api-platform-search-label input {
    width: 100%;
    min-width: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    font-size: 13px;
    color: #1e293b;
    line-height: 1.5;
}

.api-platform-search-label input:focus,
.public-api-section .api-platform-search-label input:focus {
    outline: none;
}

/* 平台分类自定义下拉菜单：现代极简苹果风格毛玻璃浮层 (Custom Dropdown Menu) */
.custom-select,
.public-api-section .custom-select {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.custom-select-trigger,
.public-api-section .custom-select-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 38px;
    padding: 0 14px 0 16px;
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 10px;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
}

.custom-select-trigger:hover,
.public-api-section .custom-select-trigger:hover {
    border-color: rgba(99, 102, 241, 0.4);
    color: #1e293b;
}

.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus-visible,
.public-api-section .custom-select.open .custom-select-trigger,
.public-api-section .custom-select-trigger:focus-visible {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    outline: none;
}

.custom-select-trigger .select-arrow,
.public-api-section .custom-select-trigger .select-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.custom-select.open .custom-select-trigger .select-arrow,
.public-api-section .custom-select.open .custom-select-trigger .select-arrow {
    transform: rotate(180deg);
    color: #4f46e5;
}

.custom-select-trigger .select-arrow svg,
.public-api-section .custom-select-trigger .select-arrow svg {
    display: block;
    width: 14px;
    height: 14px;
}

/* 下拉选项浮层菜单 (Popout Menu)：柔和白底、平滑圆角、微弥散阴影 */
.custom-select-menu,
.public-api-section .custom-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 130px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 12px 30px rgba(100, 110, 140, 0.14), 0 2px 6px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.97);
    transform-origin: top right;
    transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.custom-select.open .custom-select-menu,
.public-api-section .custom-select.open .custom-select-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* 选项条目 */
.custom-select-option,
.public-api-section .custom-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.12s ease;
}

.custom-select-option:hover,
.public-api-section .custom-select-option:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.custom-select-option.selected,
.public-api-section .custom-select-option.selected {
    background: rgba(99, 102, 241, 0.08);
    color: #4f46e5;
    font-weight: 600;
}

.custom-select-option .check-mark,
.public-api-section .custom-select-option .check-mark {
    font-size: 12px;
    color: #4f46e5;
    font-weight: 700;
}

.api-platform-empty {
    padding: 24px 0;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* 频道 ID 滚动区域：撑满剩余高度，美化原生细长灰色滚动条 */
.public-api-section .api-platform-ids {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    max-height: 440px;
    overflow-y: auto;
    padding-right: 6px;
}

/* 自定义滚动条风格 (苹果风格极细胶囊) */
.public-api-section .api-platform-ids::-webkit-scrollbar,
.public-api-section .api-preview-output::-webkit-scrollbar {
    width: 6px;
}

.public-api-section .api-platform-ids::-webkit-scrollbar-track,
.public-api-section .api-preview-output::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
}

.public-api-section .api-platform-ids::-webkit-scrollbar-thumb,
.public-api-section .api-preview-output::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
    border-radius: 8px;
}

.public-api-section .api-platform-ids::-webkit-scrollbar-thumb:hover,
.public-api-section .api-preview-output::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.5);
}

/* 单个平台 item 外层卡片：保留精致发丝线框、白色背景与微轻阴影 */
.public-api-section .api-platform-ids>span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 22px;
    padding: 8px 14px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.15s ease;
}

.public-api-section .api-platform-ids>span:hover {
    background: #f8fafc;
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.06);
}

.public-api-section .api-platform-ids strong {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.35;
    word-break: break-word;
}

/* 平台内层元信息容器：彻底无边框、无背景、纯净内联排版 */
.public-api-section .api-platform-ids .api-platform-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.public-api-section .api-platform-ids .api-platform-meta code {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    color: #64748b !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}

.public-api-section .api-platform-availability {
    font-style: normal;
    font-size: 11px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.public-api-section .api-platform-availability:before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #f59e0b;
}

.public-api-section .api-platform-availability.available {
    color: #059669;
}

.public-api-section .api-platform-availability.available:before {
    background: #10b981;
}

.public-api-section .api-platform-availability.historical {
    color: #b45309;
}

.public-api-section .api-platform-availability.unavailable {
    color: #94a3b8;
}

.public-api-section .api-platform-availability.unavailable:before {
    background: #cbd5e1;
}

/* --------------------------------------------------------------------------
   5. API 在线调试沙箱模式 (与文档保持全屏高质感)
   -------------------------------------------------------------------------- */
.api-tester-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
    gap: 24px;
    align-items: stretch;
}

.api-test-form {
    display: flex;
    flex-direction: column;
}

.api-test-form .field {
    margin: 0 0 14px;
    color: #334155;
    font-size: 12px;
    font-weight: 550;
}

.api-test-form .field[hidden] {
    display: none;
}

.api-test-form .api-test-select,
.api-test-form .api-test-select .custom-select-trigger,
.api-test-form .api-test-select .custom-select-menu {
    width: 100%;
}

.api-test-form .field input {
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 10px;
    background: #ffffff;
    color: #1e293b;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(100, 110, 140, 0.03);
    transition: all 0.15s ease;
}

.api-test-form .field input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    outline: none;
}

.api-test-form .field small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    font-weight: 400;
}

.api-test-form .button.primary {
    margin-top: 8px;
    align-self: flex-start;
    padding: 10px 24px;
    border-radius: 980px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    border: 0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
    transition: all 0.15s ease;
}

.api-test-form .button.primary:hover {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
    transform: translateY(-1px);
}

.api-test-form>small {
    margin-top: 18px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.6;
}

/* 沙箱结果视窗 */
.api-test-result {
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

#api-test-path {
    overflow-wrap: anywhere;
}

.api-test-result .panel-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.api-test-result .api-preview-output {
    flex: 1;
    min-height: 350px;
    max-height: 540px;
    overflow: auto;
    margin: 0;
    padding: 18px;
    border-radius: 12px;
    background: #1e2430;
    border: 1px solid rgba(15, 23, 42, 0.15);
    color: #7dd3fc;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.65;
    white-space: pre-wrap;
    tab-size: 2;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* --------------------------------------------------------------------------
   6. 响应式与移动端适配
   -------------------------------------------------------------------------- */
@media(max-width: 1050px) {

    /* 平板端：上下堆叠时让内容决定高度 */
    .public-mode .heading {
        min-height: 100svh;
        padding: 80px 0 24px;
    }

    .hero-container {
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        gap: calc(var(--space-sm) * 3);
    }

    .public-mode .heading .hero-container,
    .public-mode .heading .heading-content {
        max-width: none;
        width: 100%;
    }

    .public-mode .heading .heading-content {
        flex: none;
    }

    .public-mode .public-platforms {
        width: 100%;
        max-width: none;
        flex: none;
        margin: 0;
    }

    .public-platforms-grid {
        height: 288px;
    }
}

@media(max-width: 900px) {
    .api-manual-detail-layout {
        grid-template-columns: 1fr;
    }

    .api-manual-detail-nav {
        position: static;
        flex-direction: row;
        overflow-x: auto;
    }

    .api-manual-detail-nav button {
        flex: 1 0 170px;
    }

    .public-api-section .api-grid,
    .api-tester-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .public-api-section .api-platform-ids {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 320px;
    }

    .api-test-result {
        min-height: 360px;
    }

    .api-test-result .api-preview-output {
        min-height: 230px;
    }
}

@media(max-width: 760px) {

    .public-platforms-grid {
        height: 224px;
    }

    .public-api-section .api-platform-toolbar {
        flex-wrap: wrap;
    }

    .public-api-section .api-platform-search-label {
        flex: 1 1 100%;
    }

    .public-api-section .api-platform-ids {
        grid-template-columns: 1fr;
    }

    /* 移动端顶栏与栅格：自适应两侧间距，保持透明极简 */
    .public-mode .public-header {
        top: 14px;
        height: 48px;
    }

    .public-mode {
        --public-page-gutter: calc(var(--space-sm) * 2);
    }

    .public-brand {
        font-size: 15px;
    }

    .public-brand .brand-mark {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .public-mode .heading {
        padding: 90px 0 50px;
    }

    .public-mode .heading h1 {
        font-size: clamp(34px, 8.5vw, 42px);
        letter-spacing: -0.025em;
    }

    .public-hero-actions {
        flex-direction: row;
        gap: 10px;
    }

    .public-hero-primary,
    .public-hero-secondary {
        width: 45%;
    }

    .public-mode .public-platforms {
        padding: 16px;
    }

    .public-api-section {
        padding: 50px 18px 50px;
        padding-inline: var(--public-page-gutter);
    }

    .public-api-section .panel {
        padding: 20px 16px;
    }

    .public-section-title h2 {
        font-size: 28px;
        letter-spacing: -0.02em;
    }
}
