/* ============================================
   TechDigest - 科技数码文案聚合网站 v3
   深色科技风主题 · 精修版
   ============================================ */

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2235;
    --bg-card: #162032;
    --bg-hover: #1e2d42;
    --border-color: #1e3a5f;
    --border-light: #2a3f5f;
    --text-primary: #e8edf5;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    --accent-pink: #ec4899;
    --gradient-hero: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 50%, #ec4899 100%);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.25s ease;
    --sidebar-width: 300px;
    --history-width: 300px;
    --topbar-height: 56px;
    --content-max-width: 1260px;
    /* 侧栏两阶段拖拽基准常量（与 js/app.js 的 SB 常量一一对应，改一处需改两处） */
    --sidebar-margin-left: 40px;
    --sidebar-default-width: 300px;
    --sidebar-default-ml: 40px;
    --resizer-width: 10px;
}

/* ================= 浅色主题（默认） ================= */
/* 老板偏好浅色：默认 data-theme=light。变量覆盖后，绝大多数组件（用语义变量）自动翻转。 */
html[data-theme="light"] {
    --bg-primary: #f4f6fb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef1f7;
    --bg-card: #ffffff;
    --bg-hover: #e8edf4;
    --border-color: #d4dce8;
    --border-light: #c2cee0;
    --text-primary: #1b2435;
    --text-secondary: #55617a;
    --text-muted: #8b96ab;
    --shadow-sm: 0 1px 3px rgba(20,30,50,0.08);
    --shadow-md: 0 4px 12px rgba(20,30,50,0.12);
    --shadow-lg: 0 8px 30px rgba(20,30,50,0.16);
}
/* 少量硬编码深色面板的浅色覆盖 */
html[data-theme="light"] .top-bar { background: rgba(255,255,255,0.86); }
html[data-theme="light"] .loading-overlay { background: rgba(244,246,251,0.92); }
html[data-theme="light"] .ai-edit-pane { background: rgba(232,237,244,0.7); }
html[data-theme="light"] .ai-chat-panel { background: rgba(232,237,244,0.6); }
html[data-theme="light"] .ai-chat-input { background: #ffffff; }
html[data-theme="light"] .ai-proof-panel { background: rgba(232,237,244,0.6); }
html[data-theme="light"] .ai-proof-item { background: rgba(232,237,244,0.7); }
html[data-theme="light"] .ai-proof-note-input { background: #ffffff; }
html[data-theme="light"] .ai-cite:hover { color: #06222b; }
/* 浅色下滚动条更柔和 */
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c2cee0; }
html[data-theme="light"] ::-webkit-scrollbar-track { background: #eef1f7; }

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 15px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--accent-cyan); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-blue); }

button {
    cursor: pointer; border: none; outline: none;
    font-family: inherit; font-size: inherit; transition: var(--transition);
}
ul { list-style: none; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ==================== Top Bar ==================== */
.top-bar {
    position: sticky; top: 0; z-index: 100;
    height: var(--topbar-height);
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
}
.logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.3rem; font-weight: 700;
    background: var(--gradient-hero);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo i { font-size: 1.5rem; -webkit-text-fill-color: var(--accent-cyan); }
.top-bar-right { display: flex; align-items: center; gap: 16px; }
.update-time { font-size: 0.8rem; color: var(--text-muted); }
.refresh-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bg-tertiary); color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color);
}
.refresh-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--accent-cyan); }
.refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.spinning { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.auto-pulse { animation: spin 2.6s linear infinite; opacity: .62; }

/* ==================== Main Layout ==================== */
.main-container {
    display: flex;
    justify-content: flex-start;
    min-height: calc(100vh - var(--topbar-height));
    /* 按【默认尺寸】算居中留白，与当前侧栏宽度无关 → 拖拽时左留白恒定 → 分隔条严格跟手 1:1；
       默认状态下视觉与原 justify-content:center 完全一致 */
    padding-left: max(0px, calc((100% - (var(--sidebar-default-ml) + var(--sidebar-default-width) + var(--resizer-width) + var(--content-max-width))) / 2));
}

/* ==================== Sidebar ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column;
    position: sticky; top: var(--topbar-height);
    height: calc(100vh - var(--topbar-height));
    overflow-y: auto; flex-shrink: 0;
    margin-left: var(--sidebar-margin-left);
    transition: width .18s ease, margin-left .18s ease;
}
/* 侧栏 / 内容 可拖动分隔条（两阶段缩放：左拖先吃左边距，右拖只恢复默认） */
.sidebar-resizer {
    width: var(--resizer-width); flex-shrink: 0; cursor: col-resize; touch-action: none;
    background: transparent; position: relative; z-index: 6;
    margin-left: calc(var(--resizer-width) / -2); margin-right: calc(var(--resizer-width) / -2);
}
.sidebar-resizer::after {
    content: ''; position: absolute; top: 0; bottom: 0; left: 50%;
    width: 2px; transform: translateX(-50%);
    background: var(--border-color); transition: background .15s, box-shadow .15s;
}
.sidebar-resizer:hover::after,
.sidebar-resizer.active::after {
    background: var(--accent-purple);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.55);
}
/* 抓握点：hover 才出现，提示可拖 */
.sidebar-resizer::before {
    content: ''; position: absolute; top: 50%; left: 50%; width: 4px; height: 34px;
    transform: translate(-50%, -50%); border-radius: 3px; opacity: 0; transition: opacity .15s;
    background: repeating-linear-gradient(to bottom, var(--accent-purple) 0 3px, transparent 3px 7px);
}
.sidebar-resizer:hover::before,
.sidebar-resizer.active::before { opacity: .9; }
/* 到达边界时用光标语义提示"只能往哪边拖" */
.sidebar-resizer.at-max { cursor: w-resize; }   /* 已是默认，只能向左收窄 */
.sidebar-resizer.at-min { cursor: e-resize; }   /* 已到最窄，只能向右恢复 */
.sidebar-resizer.at-max::after,
.sidebar-resizer.at-min::after { background: var(--accent-orange); }
.sidebar-resizer:focus-visible { outline: 2px solid var(--accent-purple); outline-offset: 2px; }
/* 拖拽中的实时尺寸气泡 */
.sidebar-resizer-badge {
    position: absolute; top: 50%; left: 14px; transform: translateY(-50%); white-space: nowrap;
    padding: 4px 8px; border-radius: 6px; font-size: .72rem; font-variant-numeric: tabular-nums;
    background: var(--bg-card); border: 1px solid var(--accent-purple); color: var(--text-primary);
    box-shadow: var(--shadow-md); pointer-events: none; z-index: 7;
}
html.sb-dragging { cursor: col-resize; }
html.sb-dragging, html.sb-dragging * { user-select: none !important; }
html.sb-dragging .sidebar { transition: none !important; }     /* 拖拽中禁用过渡，否则会"追不上"手 */
.sidebar-nav { flex: 1; padding: 16px 8px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-radius: var(--radius-md);
    cursor: pointer; color: var(--text-secondary);
    font-size: 0.92rem; font-weight: 500;
    border: 1px solid transparent; transition: var(--transition);
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
    background: var(--bg-tertiary); color: var(--accent-cyan);
    border-color: var(--border-color);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.08);
}
.nav-item i { width: 22px; text-align: center; font-size: 1.1rem; }
.nav-item-disabled {
    cursor: not-allowed; opacity: 0.5; pointer-events: none;
}
.nav-item-disabled i { width: 22px; text-align: center; font-size: 1.1rem; }
.nav-item-disabled span { }
.badge-coming {
    font-size: 0.62rem; padding: 2px 8px; border-radius: 10px;
    background: rgba(139, 92, 246, 0.2); color: var(--accent-purple);
    margin-left: auto; white-space: nowrap;
}
.badge-live {
    font-size: 0.62rem; padding: 2px 8px; border-radius: 10px;
    background: rgba(16, 185, 129, 0.18); color: #34d399;
    margin-left: auto; white-space: nowrap;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

/* ==================== 风格分析面板 ==================== */
.style-panel { max-width: var(--content-max-width); }
.style-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; margin-bottom: 22px;
}
.panel-title {
    font-size: 1.35rem; font-weight: 700; color: var(--text-primary);
    display: flex; align-items: center; gap: 10px; margin: 0;
}
.panel-title i { color: var(--accent-purple); }
.panel-sub { margin: 6px 0 0; font-size: 0.82rem; color: var(--text-secondary); }
.panel-sub strong { color: var(--accent-cyan); }
.style-empty { text-align: center; padding: 80px 20px; color: var(--text-muted); font-size: 0.9rem; }

.style-overview {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px;
}
.ov-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 16px 18px;
}
.ov-num { font-size: 1.5rem; font-weight: 700; color: var(--accent-cyan); line-height: 1.2; }
.ov-num .ov-unit { font-size: 0.85rem; color: var(--text-muted); margin-left: 2px; font-weight: 500; }
.ov-label { font-size: 0.72rem; color: var(--text-muted); margin-top: 6px; }

.style-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
.style-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 18px 20px;
}
.card-title {
    font-size: 1rem; font-weight: 600; color: var(--text-primary);
    display: flex; align-items: center; gap: 8px; margin: 0 0 2px;
}
.card-title i { color: var(--accent-purple); }
.card-hint { font-size: 0.72rem; color: var(--text-muted); margin: 0 0 14px; }

.word-cloud {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
    padding: 8px 4px; line-height: 1.6;
}
.cloud-word {
    font-weight: 700; cursor: default; transition: transform 0.15s ease, opacity 0.15s ease;
    opacity: 0.92;
}
.cloud-word:hover { transform: scale(1.08); opacity: 1; }

.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label {
    width: 96px; flex-shrink: 0; font-size: 0.8rem; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right;
}
.bar-track {
    flex: 1; height: 10px; background: var(--bg-tertiary);
    border-radius: 6px; overflow: hidden;
}
.bar-fill {
    height: 100%; border-radius: 6px; min-width: 3px;
    transition: width 0.5s ease;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(0,0,0,0.10));
}
.bar-val { width: 42px; flex-shrink: 0; font-size: 0.78rem; color: var(--text-muted); text-align: left; }

@media (max-width: 880px) {
    .style-overview { grid-template-columns: repeat(2, 1fr); }
    .style-grid { grid-template-columns: 1fr; }
}
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border-color); }
.sidebar-stats { display: flex; gap: 8px; }
.stat-item {
    flex: 1; text-align: center; padding: 10px 6px;
    background: var(--bg-tertiary); border-radius: var(--radius-sm);
}
.stat-num { display: block; font-size: 1.2rem; font-weight: 700; color: var(--accent-cyan); }
.stat-label { font-size: 0.7rem; color: var(--text-muted); }

/* ==================== Content ==================== */
.content {
    flex: 1;
    max-width: var(--content-max-width);
    padding: 28px 36px;
    overflow-y: auto;
}

/* ==================== Sub Tabs ==================== */
.social-hotboard { max-width: 1050px; }
.tech-hotboard { max-width: 1200px; }
.sub-tabs {
    display: flex; gap: 6px; margin-bottom: 24px;
    background: var(--bg-secondary); padding: 5px;
    border-radius: var(--radius-md); border: 1px solid var(--border-color);
    max-width: 580px;
}
.sub-tab {
    flex: 1; padding: 10px 18px; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-secondary);
    font-size: 0.85rem; font-weight: 500;
    display: flex; align-items: center; justify-content: center; gap: 7px;
}
.sub-tab:hover { color: var(--text-primary); }
.sub-tab.active { background: var(--bg-tertiary); color: var(--accent-cyan); box-shadow: var(--shadow-sm); }

/* ==================== Platform Buttons ==================== */
.platform-buttons {
    display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap;
}
.platform-btn {
    padding: 9px 18px; border-radius: var(--radius-md);
    background: var(--bg-secondary); color: var(--text-secondary);
    font-size: 0.83rem; font-weight: 500;
    border: 1px solid var(--border-color);
    display: flex; align-items: center; gap: 7px;
}
.platform-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.platform-btn.active { color: #fff; border-color: transparent; box-shadow: var(--shadow-md); }
.platform-btn.weibo.active { background: linear-gradient(135deg, #e6162d, #ff6b6b); }
.platform-btn.douyin.active { background: linear-gradient(135deg, #111, #333); border-color: #555; }
.platform-btn.toutiao.active { background: linear-gradient(135deg, #e13b3f, #ff6b6b); }
.platform-btn.baidu.active { background: linear-gradient(135deg, #2932e1, #6b7fff); }
.platform-btn.zhihu.active { background: linear-gradient(135deg, #0084ff, #2e9bff); }

/* ==================== Hot List (竖排) ==================== */
.hot-list-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    min-height: 300px; position: relative; overflow: hidden;
}
.hot-list { padding: 4px 0; }
.hot-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 18px;
    border-bottom: 1px solid rgba(30, 58, 95, 0.25);
    transition: var(--transition);
}
.hot-item:last-child { border-bottom: none; }
.hot-item:hover { background: var(--bg-hover); }
.hot-rank {
    width: 26px; height: 26px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700; color: var(--text-muted);
    background: var(--bg-tertiary); border-radius: 6px;
}
.hot-rank.top3 { color: #fff; background: var(--gradient-hero); }
.hot-content {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 8px;
}
.hot-title {
    font-size: 0.88rem; font-weight: 500; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.hot-title:hover { color: var(--accent-cyan); }
.hot-tag {
    font-size: 0.66rem; padding: 2px 8px; border-radius: 10px;
    white-space: nowrap; flex-shrink: 0;
}
.hot-tag.tag-new { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.hot-tag.tag-hot { background: rgba(239,68,68,0.15); color: var(--accent-red); }
.hot-tag.tag-rising { background: rgba(245,158,11,0.15); color: var(--accent-orange); }
.hot-tag.tag-ad { background: rgba(100,116,139,0.15); color: var(--text-muted); }

/* ===== 社媒榜单来源条 + 原帖/搜索操作 ===== */
.social-source-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 0 0 12px; padding: 9px 14px; border-radius: var(--radius-md);
    background: var(--bg-tertiary); border: 1px solid var(--border-color); font-size: .78rem;
}
.social-source-label { color: var(--text-muted); }
.social-source-link {
    display: inline-flex; align-items: center; gap: 5px; font-weight: 600;
    color: var(--accent-purple); padding: 2px 8px; border-radius: 6px;
    border: 1px solid rgba(139,92,246,.32); background: rgba(139,92,246,.08);
}
.social-source-link:hover { background: rgba(139,92,246,.16); color: var(--accent-purple); }
.social-source-note { color: var(--text-muted); }
.social-source-count { margin-left: auto; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.hot-content { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hot-hot { flex-shrink: 0; font-size: .70rem; color: var(--accent-orange); }
.hot-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; opacity: 0; transform: translateX(4px); transition: opacity .15s, transform .15s; }
.hot-item:hover .hot-actions, .hot-item:focus-within .hot-actions { opacity: 1; transform: none; }
@media (hover: none) { .hot-actions { opacity: 1; transform: none; } }
.hot-open {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
    font-size: .72rem; color: var(--accent-cyan);
    border: 1px solid rgba(6,182,212,.34); background: rgba(6,182,212,.08);
}
.hot-open:hover { background: rgba(6,182,212,.18); }
.hot-open.is-search { color: var(--accent-orange); border-color: rgba(245,158,11,.34); background: rgba(245,158,11,.08); }
.hot-open.is-search:hover { background: rgba(245,158,11,.18); }
.hot-icon-btn {
    width: 26px; height: 26px; border-radius: 6px; background: transparent;
    border: 1px solid var(--border-color); color: var(--text-muted); font-size: .72rem;
}
.hot-icon-btn:hover { color: var(--accent-purple); border-color: var(--accent-purple); }
.hot-empty-note {
    text-align: center; padding: 40px 20px; color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==================== Loading & Error & Empty ==================== */
.loading-overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(17,24,39,0.9); z-index: 10; gap: 16px; padding: 24px;
}
.spinner { width: 36px; height: 36px; border: 3px solid var(--border-color); border-top-color: var(--accent-cyan); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* ==================== 加载进度条（科技资讯热点看板） ==================== */
.progress-card {
    width: min(460px, 86%); display: flex; flex-direction: column; gap: 12px;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 22px 24px; box-shadow: var(--shadow-lg);
}
.progress-track {
    position: relative; width: 100%; height: 10px; border-radius: 999px;
    background: var(--bg-secondary); overflow: hidden;
    border: 1px solid var(--border-color);
}
.progress-fill {
    position: absolute; left: 0; top: 0; bottom: 0; width: 0;
    border-radius: 999px; overflow: hidden; will-change: width;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan), var(--accent-purple));
    background-size: 200% 100%;
    animation: progress-hue 3.2s ease-in-out infinite;
    /* 0.45s 缓动，叠加每 200ms 涓流推进，过渡与进度首尾相接成连续流动 */
    transition: width .45s cubic-bezier(.22, .61, .36, 1);
}
@keyframes progress-hue { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
/* 流光：即使宽度一帧没变，用户也能看到"在动" */
.progress-fill::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
    transform: translateX(-100%); animation: progress-sheen 1.5s ease-in-out infinite;
}
@keyframes progress-sheen { to { transform: translateX(100%); } }
/* 总大小未知：不再劫持 width（原 .indeterminate 做法），只叠加更快的流光 */
.progress-track.unknown-total .progress-fill::after { animation-duration: .9s; }
/* 阶段步进指示器 */
.progress-steps { display: flex; gap: 14px; font-size: .72rem; color: var(--text-muted); }
.progress-step i { font-size: .4rem; margin-right: 4px; vertical-align: middle; }
.progress-step.done { color: var(--accent-green); }
.progress-step.active { color: var(--accent-cyan); font-weight: 700; }
.progress-step.active i { animation: spin 1s linear infinite; }
/* 服务端分块压缩传输（拿不到总大小）时的不确定动画：反复扫动，表明仍在下载而非卡死 */
.progress-track.indeterminate .progress-fill {
    width: 38% !important; transition: none;
    animation: progress-indeterminate 1.2s ease-in-out infinite;
}
@keyframes progress-indeterminate {
    0%   { left: -38%; }
    100% { left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .progress-fill, .progress-fill::after { animation: none !important; }
    .progress-fill { transition: width .2s linear; }
}
.progress-meta {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.progress-label {
    font-size: 0.86rem; color: var(--text-secondary); line-height: 1.4;
}
.progress-percent {
    font-size: 0.92rem; font-weight: 700; color: var(--accent-cyan);
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.progress-bytes {
    font-size: 0.76rem; color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.error-message {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 40px 20px; color: var(--accent-red); flex-direction: column;
}
.error-message i { font-size: 2rem; }
.error-message button { margin-top: 8px; padding: 8px 20px; border-radius: var(--radius-sm); background: var(--accent-red); color: #fff; }
.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 60px 20px; color: var(--text-muted); gap: 12px;
}
.empty-state i { font-size: 3rem; }

/* ==================== Tech Controls ==================== */
.tech-controls {
    display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px;
}
.source-filter { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-label { font-size: 0.78rem; color: var(--text-muted); margin-right: 2px; }
.source-tag {
    padding: 5px 12px; border-radius: 20px; font-size: 0.75rem;
    background: var(--bg-secondary); color: var(--text-secondary);
    border: 1px solid var(--border-color); cursor: pointer; transition: var(--transition);
}
.source-tag:hover { background: var(--bg-hover); color: var(--text-primary); }
.source-tag.active { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }
.tech-search { max-width: 320px; }
.search-input {
    width: 100%; padding: 9px 14px; border-radius: var(--radius-md);
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    color: var(--text-primary); font-size: 0.85rem; outline: none; transition: var(--transition);
}
.search-input:focus { border-color: var(--accent-cyan); box-shadow: 0 0 0 3px rgba(6,182,212,0.1); }
.search-input::placeholder { color: var(--text-muted); }

/* ==================== Tech List ==================== */
.tech-list-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    min-height: 300px; position: relative; overflow: hidden; padding: 14px;
}
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 12px;
}
.tech-card {
    background: var(--bg-card); border-radius: var(--radius-md);
    padding: 15px; border: 1px solid var(--border-color);
    transition: var(--transition); display: flex; flex-direction: column; gap: 8px;
}
.tech-card:hover { border-color: var(--accent-cyan); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.tech-card-header { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tech-source-badge { font-size: 0.66rem; padding: 2px 8px; border-radius: 4px; color: #fff; font-weight: 600; }
.tech-time { font-size: 0.7rem; color: var(--text-muted); margin-left: auto; }
/* 热门度徽章 / 热度分 */
.tech-hot-badge {
    font-size: 0.62rem; padding: 2px 7px; border-radius: 4px; font-weight: 700; letter-spacing: .5px;
    background: linear-gradient(135deg, #ff8a00, #ff5e3a); color: #fff; box-shadow: 0 1px 4px rgba(255,94,58,.35);
}
.tech-hot-badge.explode { background: linear-gradient(135deg, #ff3b3b, #ff0050); box-shadow: 0 1px 6px rgba(255,0,80,.45); }
.tech-heat { font-size: 0.66rem; color: #ff7a18; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: rgba(255,122,24,.1); }
.tech-sort { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hot-only { display: inline-flex; align-items: center; gap: 5px; font-size: 0.74rem; color: var(--text-secondary); cursor: pointer; margin-left: 4px; user-select: none; }
.hot-only input { accent-color: var(--accent-blue); cursor: pointer; }
.tech-card-title { font-size: 0.9rem; font-weight: 600; line-height: 1.45; }
.tech-card-title a {
    color: var(--text-primary);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tech-card-title a:hover { color: var(--accent-cyan); }
.tech-card-desc {
    font-size: 0.78rem; color: var(--text-secondary); line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tech-card-desc-empty { color: var(--text-muted); font-style: italic; }
.tech-card-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tech-tag { font-size: 0.65rem; padding: 2px 7px; border-radius: 4px; background: rgba(59,130,246,0.12); color: var(--accent-blue); }
.tech-tag-default { background: rgba(100,116,139,0.15); color: var(--text-muted); }
.tech-load-more {
    text-align: center; margin-top: 16px;
}
.tech-load-more button {
    padding: 10px 32px; border-radius: var(--radius-md);
    background: var(--bg-tertiary); color: var(--accent-cyan);
    border: 1px solid var(--border-color); font-size: 0.85rem;
}
.tech-load-more button:hover { background: var(--bg-hover); border-color: var(--accent-cyan); }
.tech-load-more button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ==================== Placeholder ==================== */
.placeholder-panel { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.placeholder-content { text-align: center; max-width: 500px; }
.placeholder-icon {
    width: 100px; height: 100px; margin: 0 auto 24px;
    background: var(--bg-tertiary); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--border-color);
}
.placeholder-icon i { font-size: 2.5rem; color: var(--accent-cyan); }
.placeholder-content h2 {
    font-size: 1.6rem; margin-bottom: 8px;
    background: var(--gradient-hero);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.placeholder-desc { color: var(--text-secondary); margin-bottom: 24px; }
.coming-soon-badge {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 24px;
    background: rgba(139,92,246,0.12); border: 1px solid rgba(139,92,246,0.3);
    border-radius: var(--radius-md); color: var(--accent-purple); margin-bottom: 32px;
}
.feature-preview { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.feature-item {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 16px 20px; background: var(--bg-tertiary); border-radius: var(--radius-md);
    border: 1px solid var(--border-color); min-width: 120px;
}
.feature-item i { font-size: 1.3rem; color: var(--accent-cyan); }
.feature-item span { font-size: 0.8rem; color: var(--text-secondary); }

/* ==================== AI Writer Panel ==================== */
.ai-writer-panel { padding: 0; }
.ai-writer-container { max-width: 100%; }

.ai-writer-header {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 0 16px; border-bottom: 1px solid var(--border-color); margin-bottom: 20px;
}
.ai-writer-header i { font-size: 1.6rem; color: var(--accent-cyan); }
.ai-writer-header h2 { font-size: 1.3rem; color: var(--text-primary); margin: 0; }
.ai-badge {
    margin-left: auto; font-size: 0.72rem; padding: 3px 12px; border-radius: 12px;
    background: rgba(139,92,246,0.15); color: var(--accent-purple);
}

.ai-writer-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.ai-input-section, .ai-control-section {
    display: flex; flex-direction: column; gap: 16px;
}

.ai-field { display: flex; flex-direction: column; gap: 6px; }
.ai-field-grow { flex: 1; display: flex; flex-direction: column; }
.ai-field-grow .ai-textarea-main { flex: 1; resize: vertical; }
.ai-label {
    font-size: 0.82rem; font-weight: 600; color: var(--text-secondary);
    display: flex; align-items: center; gap: 6px;
}
.ai-label i { color: var(--accent-cyan); width: 16px; text-align: center; }

/* 「信息来源 / 参考文献」输入区视觉提示，让用户一眼认出这是参考文献入口 */
.ai-field-ref {
    background: rgba(6,182,212,0.06);
    border: 1px solid rgba(6,182,212,0.35);
    border-left: 3px solid var(--accent-cyan);
    border-radius: var(--radius-md);
    padding: 12px 14px 14px;
}
.ai-field-ref .ai-label { color: var(--accent-cyan); }
.ai-field-ref .ai-textarea:focus { border-color: var(--accent-cyan); box-shadow: 0 0 0 3px rgba(6,182,212,0.12); }

/* 「联网搜索」开关 */
.ai-toggle {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.84rem; font-weight: 600; color: var(--text-primary);
    cursor: pointer; user-select: none;
}
.ai-toggle input { display: none; }
.ai-toggle-track {
    position: relative; width: 40px; height: 22px; border-radius: 999px;
    background: var(--border-color); transition: background .2s; flex-shrink: 0;
}
.ai-toggle-thumb {
    position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.ai-toggle input:checked + .ai-toggle-track { background: var(--accent-cyan); }
.ai-toggle input:checked + .ai-toggle-track .ai-toggle-thumb { transform: translateX(18px); }
.ai-toggle i { color: var(--accent-cyan); width: 16px; text-align: center; }

.ai-input {
    padding: 10px 14px; border-radius: var(--radius-md);
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    color: var(--text-primary); font-size: 0.88rem; outline: none; transition: var(--transition);
}
.ai-input:focus { border-color: var(--accent-cyan); box-shadow: 0 0 0 3px rgba(6,182,212,0.1); }
.ai-input::placeholder { color: var(--text-muted); }

.ai-textarea {
    padding: 10px 14px; border-radius: var(--radius-md);
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    color: var(--text-primary); font-size: 0.85rem; outline: none;
    resize: vertical; font-family: inherit; line-height: 1.6; transition: var(--transition);
}
.ai-textarea:focus { border-color: var(--accent-cyan); box-shadow: 0 0 0 3px rgba(6,182,212,0.1); }
.ai-textarea::placeholder { color: var(--text-muted); }
.ai-textarea-main { min-height: 180px; }
.ai-textarea-sm { min-height: 60px; }
.ai-char-count { font-size: 0.7rem; color: var(--text-muted); text-align: right; margin-top: -4px; }

/* 原文上传按钮 / 拖拽区 */
.ai-field-head { display: flex; align-items: center; gap: 8px; }
.ai-upload-btn {
    margin-left: auto; padding: 3px 10px; border: 1px dashed var(--accent-cyan);
    background: transparent; color: var(--accent-cyan); border-radius: 6px;
    font-size: 0.72rem; cursor: pointer; transition: background .15s, color .15s;
}
.ai-upload-btn:hover { background: var(--accent-cyan); color: #06222b; }
.ai-file-hidden { display: none; }
.ai-upload-status { margin-left: 8px; font-size: 0.7rem; color: var(--text-muted); }
.ai-dropzone { position: relative; flex: 1; display: flex; }
.ai-dropzone .ai-textarea-main { width: 100%; }
.ai-dropzone.dragover { outline: 2px dashed var(--accent-cyan); outline-offset: 2px; border-radius: var(--radius); }
.ai-dropzone-hint {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    gap: 8px; background: rgba(34,211,238,0.12); color: var(--accent-cyan);
    font-size: 0.9rem; font-weight: 600; border-radius: var(--radius); pointer-events: none;
}

/* 参数卡片 */
.ai-params-card {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 18px;
    display: flex; flex-direction: column; gap: 16px;
}
.ai-params-title {
    font-size: 0.95rem; color: var(--text-primary);
    display: flex; align-items: center; gap: 8px; margin: 0 0 4px;
}
.ai-params-title i { color: var(--accent-purple); }

/* Radio 按钮组 */
.ai-radio-group {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.ai-radio {
    display: flex; align-items: center; cursor: pointer;
    padding: 6px 13px; border-radius: 20px;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    font-size: 0.78rem; color: var(--text-secondary); transition: var(--transition);
    user-select: none;
}
.ai-radio input { display: none; }
.ai-radio:hover { background: var(--bg-hover); color: var(--text-primary); }
.ai-radio.active {
    background: rgba(6,182,212,0.15); border-color: var(--accent-cyan);
    color: var(--accent-cyan); font-weight: 600;
}

/* 平台 / 文体预设 */
.ai-label-tip { margin-left: auto; font-size: 0.68rem; font-weight: 400; color: var(--text-muted); }
.ai-preset-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-preset-chip {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    padding: 7px 14px; border-radius: 8px;
    background: linear-gradient(135deg, rgba(34,211,238,0.12), rgba(34,211,238,0.04));
    border: 1px solid rgba(34,211,238,0.4); color: var(--accent-cyan);
    font-size: 0.76rem; font-weight: 600; transition: var(--transition);
}
.ai-preset-chip:hover { background: var(--accent-cyan); color: #06222b; }
.ai-preset-chip i { font-size: 0.82rem; }

/* API 设置卡片（BYOK：用户自带 key） */
.ai-api-card { gap: 12px; border-color: rgba(6,182,212,0.35); }
.ai-api-toggle {
    margin-left: auto; background: transparent; border: 1px solid var(--border-color);
    color: var(--text-muted); font-size: 0.72rem; padding: 2px 10px; border-radius: 12px; cursor: pointer;
    transition: var(--transition);
}
.ai-api-toggle:hover { color: var(--accent-cyan); border-color: var(--accent-cyan); }
.ai-api-status {
    font-size: 0.78rem; padding: 8px 12px; border-radius: var(--radius-sm);
    display: flex; align-items: center; gap: 7px; line-height: 1.4;
}
.ai-api-status.ok { background: rgba(34,197,94,0.12); color: var(--accent-green); border: 1px solid rgba(34,197,94,0.3); }
.ai-api-status.warn { background: rgba(234,179,8,0.1); color: #eab308; border: 1px solid rgba(234,179,8,0.25); }
.ai-key-row { display: flex; gap: 8px; align-items: center; }
.ai-key-row .ai-input { flex: 1; }
.ai-eye-btn {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: var(--radius-sm);
    background: var(--bg-tertiary); border: 1px solid var(--border-color); color: var(--text-secondary);
    cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.ai-eye-btn:hover { color: var(--accent-cyan); border-color: var(--accent-cyan); }
.ai-input-sub { margin-top: 8px; }
.ai-api-actions { display: flex; gap: 8px; }
.ai-api-actions .ai-action-btn.primary { background: var(--gradient-hero); color: #fff; border: none; }
.ai-api-actions .ai-action-btn.primary:hover { color: #fff; box-shadow: 0 4px 16px rgba(6,182,212,0.3); }
.ai-api-hint { font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; margin: 0; }

/* 站点默认 API 信息 */
.ai-api-default {
    background: rgba(6,182,212,0.06); border: 1px dashed rgba(6,182,212,0.35);
    border-radius: var(--radius-md); padding: 12px;
    display: flex; flex-direction: column; gap: 8px;
}
.ai-api-default-title {
    font-size: 0.82rem; font-weight: 600; color: var(--text-primary);
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.ai-api-default-title i { color: var(--accent-cyan); }
.ai-api-default-note {
    margin-left: auto; font-size: 0.7rem; color: var(--text-muted); font-weight: 400;
}
.ai-api-default-row {
    display: flex; justify-content: space-between; gap: 12px;
    font-size: 0.76rem; color: var(--text-secondary); line-height: 1.4;
}
.ai-api-default-row span:first-child { color: var(--text-muted); flex: 0 0 auto; }
.ai-api-default-row span:last-child { color: var(--text-primary); text-align: right; word-break: break-all; }

/* 生成按钮 */
.ai-generate-btn {
    width: 100%; padding: 14px; border-radius: var(--radius-md);
    background: var(--gradient-hero); color: #fff; font-size: 1rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    border: none; cursor: pointer; transition: var(--transition);
    box-shadow: 0 4px 20px rgba(6,182,212,0.3);
    margin-top: 4px;
}
.ai-generate-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 25px rgba(6,182,212,0.4); }
.ai-generate-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* 输出区 */
.ai-output-section {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); overflow: hidden;
    animation: fadeInUp 0.4s ease;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.ai-output-header {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px; border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}
.ai-output-header h3 {
    font-size: 0.9rem; color: var(--text-primary);
    display: flex; align-items: center; gap: 8px; margin: 0;
}
.ai-output-header h3 i { color: var(--accent-green); }
.ai-output-actions { display: flex; gap: 6px; margin-left: auto; }

/* 选项卡栏（紧贴 header 下方） */
.ai-output-tabbar {
    display: flex; gap: 0;
    padding: 0 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}
.ai-tab-btn {
    padding: 10px 18px; border: none;
    border-bottom: 2px solid transparent;
    background: transparent; color: var(--text-muted);
    font-size: 0.82rem; font-weight: 500; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    transition: var(--transition); border-radius: 0;
    margin-bottom: -1px;
}
.ai-tab-btn:hover { color: var(--text-primary); background: rgba(6,182,212,0.04); }
.ai-tab-btn.active {
    color: var(--accent-cyan); font-weight: 600;
    border-bottom-color: var(--accent-cyan);
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-top: 2px solid var(--accent-cyan);
}
.ai-tab-btn.active i { color: var(--accent-cyan); }
.ai-action-btn {
    padding: 6px 12px; border-radius: var(--radius-sm);
    background: var(--bg-secondary); color: var(--text-secondary);
    border: 1px solid var(--border-color); font-size: 0.75rem;
    display: flex; align-items: center; gap: 5px; cursor: pointer; transition: var(--transition);
}
.ai-action-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--accent-cyan); }

.ai-output-content { padding: 20px 24px; }
.ai-output-meta {
    display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px;
    font-size: 0.75rem; color: var(--text-muted);
}
.ai-output-meta span { display: flex; align-items: center; gap: 4px; }
.ai-output-meta i { font-size: 0.7rem; }
.ai-fact-badge {
    display: inline-flex; align-items: center; gap: 4px; margin-left: 2px;
    padding: 2px 8px; border-radius: 999px;
    background: rgba(16, 185, 129, 0.12); color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35); font-weight: 600;
}
.ai-output-title h2 {
    font-size: 1.3rem; font-weight: 700; color: var(--text-primary);
    margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color);
    line-height: 1.4;
}
.ai-output-body { line-height: 1.8; color: var(--text-secondary); }
.ai-output-body h2 {
    font-size: 1.1rem; font-weight: 600; color: var(--text-primary);
    margin: 20px 0 10px;
}
.ai-output-body h3 {
    font-size: 0.95rem; font-weight: 600; color: var(--text-primary);
    margin: 16px 0 8px;
}
.ai-output-body p { margin-bottom: 10px; }
.ai-output-body li { margin-left: 20px; margin-bottom: 4px; list-style: disc; }
.ai-output-plain p { text-indent: 2em; margin-bottom: 12px; }

/* 原文抽图注入正文 —— 配图块 */
.ai-output-image {
    margin: 16px 0;
    text-align: center;
}
.ai-output-image img {
    max-width: 100%;
    max-height: 420px;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
    background: #f3f4f6;
    display: inline-block;
}
.ai-output-image-cap {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted, #8a94a6);
}
.ai-img-badge {
    color: var(--accent-cyan);
    background: rgba(56, 189, 248, 0.12);
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.ai-caption-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 2px;
    font-size: 0.78rem;
    color: var(--text-muted, #8a94a6);
    cursor: pointer;
    user-select: none;
}
.ai-caption-toggle input { width: 14px; height: 14px; accent-color: var(--accent-cyan); cursor: pointer; }

/* 生成中：末尾闪烁打字光标，强化流式打字观感（按 tab 独立控制） */
.ai-output-body.generating::after {
    content: '▋';
    display: inline-block;
    margin-left: 2px;
    color: var(--accent-cyan);
    font-weight: 400;
    animation: ai-caret-blink 1s steps(1) infinite;
}
@keyframes ai-caret-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
.ai-output-char-count {
    text-align: right; margin-top: 16px; padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem; color: var(--text-muted);
}

/* 数据来源 / 引用 */
.ai-sources-box {
    margin-top: 16px; padding: 14px 16px;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius); border-left: 3px solid var(--accent-cyan);
}
.ai-sources-title {
    font-size: 0.85rem; font-weight: 600; color: var(--text-primary);
    margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.ai-sources-title i { color: var(--accent-cyan); }
.ai-sources-list { margin: 0 0 10px; padding-left: 20px; }
.ai-sources-list li { margin-bottom: 4px; font-size: 0.8rem; word-break: break-all; }
.ai-sources-list a { color: var(--accent-cyan); text-decoration: none; }
.ai-sources-list a:hover { text-decoration: underline; }
.ai-source-item.ai-source-failed a { color: var(--text-muted); text-decoration: line-through; opacity: 0.75; }
.ai-source-fail-note { margin-left: 6px; font-size: 0.72rem; color: #f87171; font-weight: 600; }
.ai-sources-note {
    font-size: 0.72rem; color: var(--text-muted); line-height: 1.6;
    display: flex; gap: 6px; align-items: flex-start;
}
.ai-sources-note i { margin-top: 2px; flex-shrink: 0; }

/* 学术化内联引用与 tooltip */
.ai-output-content { position: relative; }
.ai-cite-seg {
    display: inline;
    border-radius: 3px;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.ai-cite-seg.ai-cite-active {
    background-color: rgba(34, 211, 238, 0.14);
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.18);
}
.ai-cite {
    display: inline-block;
    margin-left: 2px;
    padding: 0 4px;
    font-size: 0.72em;
    font-weight: 600;
    color: var(--accent-cyan);
    background: rgba(34, 211, 238, 0.08);
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    vertical-align: super;
    line-height: 1;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.ai-cite:hover {
    background: rgba(34, 211, 238, 0.25);
    color: #fff;
}
.ai-cite-unsure {
    color: var(--text-muted);
    background: rgba(255, 160, 0, 0.12);
}
.ai-cite-unsure:hover {
    background: rgba(255, 160, 0, 0.25);
    color: #fff;
}
.ai-source-active {
    background-color: rgba(34, 211, 238, 0.10);
    border-radius: 4px;
}
.ai-cite-tooltip {
    position: absolute;
    z-index: 100;
    pointer-events: none;
    transform: translateX(-50%);
    max-width: 420px;
    min-width: 120px;
}
.ai-cite-tooltip-inner {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 8px 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
    font-size: 0.78rem;
}
.ai-cite-tooltip-inner::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid var(--border-color);
}
.ai-cite-tooltip-badge {
    flex-shrink: 0;
    display: inline-block;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(34, 211, 238, 0.15);
    color: var(--accent-cyan);
    font-weight: 600;
}
.ai-cite-tooltip-source {
    color: var(--text-secondary);
    word-break: break-all;
}

/* 表单提示文字 */
.ai-hint {
    display: block; margin-top: 6px;
    font-size: 0.72rem; color: var(--text-muted); line-height: 1.5;
}

/* ===== AI 历史记录抽屉（右侧） ===== */
.ai-history-toggle {
    position: fixed; right: 0; top: 50%; transform: translateY(-50%);
    z-index: 1200; width: 44px; height: 56px;
    background: var(--accent-cyan); color: #06222b;
    border: none; border-radius: 12px 0 0 12px;
    cursor: pointer; box-shadow: -4px 0 16px rgba(0,0,0,0.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; transition: width .2s ease;
}
.ai-history-toggle:hover { width: 50px; }
.ai-history-badge {
    position: absolute; top: -6px; right: -6px;
    background: var(--color-danger, #ef4444); color: #fff;
    min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 9px; font-size: 0.65rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.ai-history-backdrop {
    position: fixed; inset: 0; z-index: 1250;
    background: rgba(0,0,0,0.35); backdrop-filter: blur(1px);
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.ai-history-backdrop.open { opacity: 1; pointer-events: auto; }
.ai-history-drawer {
    position: fixed; top: var(--topbar-height); right: 0; bottom: 0;
    width: var(--history-width); max-width: 86vw; z-index: 1300;
    background: var(--bg-secondary); border-left: 1px solid var(--border-color);
    box-shadow: -8px 0 32px rgba(0,0,0,0.35);
    transform: translateX(100%); transition: transform .28s ease;
    display: flex; flex-direction: column;
}
.ai-history-drawer.open { transform: translateX(0); }
.ai-history-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--border-color);
}
.ai-history-header h3 {
    font-size: 0.95rem; margin: 0; display: flex; align-items: center; gap: 8px;
    color: var(--text-primary);
}
.ai-history-header h3 i { color: var(--accent-cyan); }
.ai-history-actions { display: flex; align-items: center; gap: 8px; }
/* 历史筛选：全部 / 文案 / 插图 */
.ai-history-filter {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 12px; border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}
.ai-history-filter button {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 6px 8px; border-radius: 8px; cursor: pointer;
    background: transparent; border: 1px solid var(--border-color);
    color: var(--text-secondary); font-size: 0.78rem; font-weight: 500;
    transition: var(--transition);
}
.ai-history-filter button:hover { color: var(--text-primary); border-color: var(--border-light); }
.ai-history-filter button.active {
    color: #06121f; background: var(--gradient-hero); border-color: transparent;
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.35);
}
.ai-history-clear {
    background: transparent; border: 1px solid var(--border-color);
    color: var(--text-muted); border-radius: 6px; padding: 3px 8px;
    font-size: 0.72rem; cursor: pointer;
}
.ai-history-clear:hover { color: var(--color-danger, #ef4444); border-color: var(--color-danger, #ef4444); }
.ai-history-close {
    background: transparent; border: none; color: var(--text-muted);
    font-size: 1rem; cursor: pointer;
}
.ai-history-close:hover { color: var(--text-primary); }
.ai-history-list {
    flex: 1; overflow-y: auto; padding: 10px;
}
.ai-history-item {
    position: relative; padding: 12px 12px 12px 14px; margin-bottom: 10px;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    border-radius: var(--radius); cursor: pointer; transition: border-color .15s;
}
.ai-history-item:hover { border-color: var(--accent-cyan); }
.ai-history-item.is-image { border-color: rgba(139, 92, 246, 0.4); }
.ai-history-item.is-image:hover { border-color: var(--accent-purple); }
.ai-history-item.is-image .ai-history-item-title i { color: var(--accent-purple); margin-right: 6px; }
.ai-history-item-title {
    font-size: 0.84rem; font-weight: 600; color: var(--text-primary);
    margin-bottom: 6px; padding-right: 28px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; line-height: 1.4;
}
.ai-history-item-meta {
    display: flex; flex-wrap: wrap; gap: 8px;
    font-size: 0.68rem; color: var(--text-muted);
}
.ai-history-item-meta span {
    background: var(--bg-card); padding: 2px 6px; border-radius: 4px;
}
.ai-history-del {
    position: absolute; top: 10px; right: 10px;
    background: transparent; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 0.8rem; padding: 2px;
}
.ai-history-del:hover { color: var(--color-danger, #ef4444); }
.ai-history-empty {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 12px;
    color: var(--text-muted); text-align: center; padding: 30px;
}
.ai-history-empty i { font-size: 2rem; opacity: .5; }
.ai-history-empty p { font-size: 0.78rem; line-height: 1.6; }

/* 空状态 */
.ai-empty-state {
    text-align: center; padding: 40px 20px;
    background: var(--bg-secondary); border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
}
.ai-empty-icon {
    width: 72px; height: 72px; margin: 0 auto 16px;
    background: var(--bg-tertiary); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--border-color);
}
.ai-empty-icon i { font-size: 2rem; color: var(--accent-cyan); }
.ai-empty-state h3 { font-size: 1.1rem; color: var(--text-primary); margin-bottom: 8px; }
.ai-empty-state > p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; }
.ai-tips { display: flex; flex-direction: column; gap: 10px; max-width: 480px; margin: 0 auto; text-align: left; }
.ai-tip-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px; background: var(--bg-tertiary);
    border-radius: var(--radius-sm); font-size: 0.82rem; color: var(--text-secondary);
}
.ai-tip-item i { color: var(--accent-orange); margin-top: 2px; flex-shrink: 0; }

/* ==================== PPT Panel ==================== */
.ppt-panel { padding: 0; }
.ppt-container { max-width: 100%; }

.ppt-header {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 0 16px; border-bottom: 1px solid var(--border-color); margin-bottom: 20px;
}
.ppt-header i { font-size: 1.6rem; color: #D24726; }
.ppt-header h2 { font-size: 1.3rem; color: var(--text-primary); margin: 0; }
.ppt-badge {
    margin-left: auto; font-size: 0.72rem; padding: 3px 12px; border-radius: 12px;
    background: rgba(210,71,38,0.15); color: #D24726;
}

.ppt-body {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 20px;
}
.ppt-input-section, .ppt-control-section {
    display: flex; flex-direction: column; gap: 16px;
}

.ppt-field { display: flex; flex-direction: column; gap: 6px; }
.ppt-label {
    font-size: 0.82rem; font-weight: 600; color: var(--text-secondary);
    display: flex; align-items: center; gap: 6px;
}
.ppt-label i { color: #D24726; width: 16px; text-align: center; }

.ppt-input {
    padding: 10px 14px; border-radius: var(--radius-md);
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    color: var(--text-primary); font-size: 0.88rem; outline: none; transition: var(--transition);
}
.ppt-input:focus { border-color: #D24726; box-shadow: 0 0 0 3px rgba(210,71,38,0.1); }
.ppt-input::placeholder { color: var(--text-muted); }

.ppt-textarea {
    padding: 10px 14px; border-radius: var(--radius-md);
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    color: var(--text-primary); font-size: 0.84rem; outline: none;
    resize: vertical; font-family: inherit; line-height: 1.6; transition: var(--transition);
    min-height: 220px;
}
.ppt-textarea:focus { border-color: #D24726; box-shadow: 0 0 0 3px rgba(210,71,38,0.1); }
.ppt-textarea::placeholder { color: var(--text-muted); }
.ppt-char-count { font-size: 0.7rem; color: var(--text-muted); text-align: right; margin-top: -4px; }

/* 输入方式切换 */
.ppt-input-tabs { display: flex; gap: 6px; }
.ppt-input-tab {
    flex: 1; padding: 8px 12px; border-radius: var(--radius-sm);
    background: var(--bg-secondary); color: var(--text-secondary);
    border: 1px solid var(--border-color); font-size: 0.8rem;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    cursor: pointer; transition: var(--transition);
}
.ppt-input-tab:hover { background: var(--bg-hover); color: var(--text-primary); }
.ppt-input-tab.active { background: rgba(210,71,38,0.12); border-color: #D24726; color: #D24726; }

/* 上传区 */
.ppt-upload-zone {
    background: var(--bg-secondary); border: 2px dashed var(--border-color);
    border-radius: var(--radius-md); padding: 30px; text-align: center;
    cursor: pointer; transition: var(--transition); min-height: 140px;
    display: flex; align-items: center; justify-content: center;
}
.ppt-upload-zone:hover { border-color: #D24726; background: rgba(210,71,38,0.04); }
.ppt-upload-icon { font-size: 2rem; color: var(--text-muted); margin-bottom: 10px; }
.ppt-upload-zone p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 4px; }
.ppt-upload-hint { font-size: 0.72rem; color: var(--text-muted); }
.ppt-upload-done {
    display: flex; align-items: center; gap: 10px;
    color: var(--accent-green); font-size: 0.9rem; font-weight: 600;
}
.ppt-upload-done i { font-size: 1.3rem; }
.ppt-upload-remove {
    width: 22px; height: 22px; border-radius: 50%; background: rgba(239,68,68,0.15);
    color: var(--accent-red); font-size: 0.7rem; display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: none; margin-left: auto;
}

/* 参数卡片 */
.ppt-params-card {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 18px;
    display: flex; flex-direction: column; gap: 16px;
}
.ppt-params-title {
    font-size: 0.95rem; color: var(--text-primary);
    display: flex; align-items: center; gap: 8px; margin: 0 0 4px;
}
.ppt-params-title i { color: #D24726; }

/* PPT Radio 按钮 */
.ppt-radio-group { display: flex; flex-wrap: wrap; gap: 6px; }
.ppt-radio {
    display: flex; align-items: center; cursor: pointer;
    padding: 6px 13px; border-radius: 20px;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    font-size: 0.78rem; color: var(--text-secondary); transition: var(--transition);
    user-select: none;
}
.ppt-radio input { display: none; }
.ppt-radio:hover { background: var(--bg-hover); color: var(--text-primary); }
.ppt-radio.active { background: rgba(210,71,38,0.12); border-color: #D24726; color: #D24726; font-weight: 600; }

/* 主题网格 */
.ppt-theme-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ppt-theme-item {
    text-align: center; cursor: pointer; padding: 6px; border-radius: var(--radius-sm);
    border: 2px solid transparent; transition: var(--transition);
}
.ppt-theme-item:hover { border-color: var(--border-light); }
.ppt-theme-item.active { border-color: #D24726; background: rgba(210,71,38,0.06); }
.ppt-theme-preview {
    width: 100%; height: 36px; border-radius: 4px; margin-bottom: 6px;
}
.ppt-theme-item span { font-size: 0.7rem; color: var(--text-secondary); }
.ppt-theme-item.active span { color: #D24726; font-weight: 600; }

/* Checkbox */
.ppt-check-group { display: flex; gap: 16px; flex-wrap: wrap; }
.ppt-check {
    display: flex; align-items: center; gap: 6px; font-size: 0.8rem;
    color: var(--text-secondary); cursor: pointer; user-select: none;
}
.ppt-check input { accent-color: #D24726; }

/* 生成按钮 */
.ppt-generate-btn {
    width: 100%; padding: 14px; border-radius: var(--radius-md);
    background: linear-gradient(135deg, #D24726, #EA580C); color: #fff;
    font-size: 1rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    border: none; cursor: pointer; transition: var(--transition);
    box-shadow: 0 4px 20px rgba(210,71,38,0.3); margin-top: 4px;
}
.ppt-generate-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 25px rgba(210,71,38,0.4); }
.ppt-generate-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* 下载按钮 */
.ppt-download-btn {
    width: 100%; padding: 14px; border-radius: var(--radius-md);
    background: linear-gradient(135deg, #059669, #10B981); color: #fff;
    font-size: 1rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    border: none; cursor: pointer; transition: var(--transition);
    box-shadow: 0 4px 20px rgba(5,150,105,0.3);
}
.ppt-download-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 25px rgba(5,150,105,0.4); }
.ppt-download-btn:disabled {
    opacity: 0.45; cursor: not-allowed; transform: none;
    background: var(--bg-tertiary); color: var(--text-muted);
    box-shadow: none; border: 1px solid var(--border-color);
}

/* 生成状态提示 */
.ppt-status-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: rgba(5,150,105,0.08);
    border: 1px solid rgba(5,150,105,0.25); border-radius: var(--radius-sm);
    font-size: 0.8rem; color: #10B981;
}
.ppt-status-bar i { font-size: 0.9rem; }

/* 预览提示条 */
.ppt-preview-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px; background: var(--bg-secondary);
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    font-size: 0.82rem; color: var(--text-secondary);
}
.ppt-preview-bar i { color: var(--accent-cyan); }
.ppt-preview-count { margin-left: auto; font-size: 0.78rem; color: #D24726; white-space: nowrap; }

/* ==================== PPT Three-Column Panel ==================== */
.ppt-outline-gen-btn {
    width: 100%; padding: 10px; border-radius: var(--radius-md);
    background: linear-gradient(135deg, #D24726, #EA580C); color: #fff;
    border: none; font-size: 0.82rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    cursor: pointer; transition: var(--transition); margin-top: 4px;
    box-shadow: 0 2px 12px rgba(210,71,38,0.25);
}
.ppt-outline-gen-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(210,71,38,0.35); }
.ppt-outline-gen-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.ppt-body-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    align-items: stretch;
}
.ppt-col {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); overflow: hidden;
    display: flex; flex-direction: column;
}
.ppt-col-header {
    padding: 10px 14px; border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary); font-size: 0.82rem; font-weight: 600;
    color: var(--text-primary); display: flex; align-items: center; gap: 8px;
}
.ppt-col-header i { color: #D24726; }
.ppt-col-input { padding: 10px; gap: 8px; }
.ppt-col-params { padding: 10px; gap: 8px; }
.ppt-col-outline { flex: 1; }

.ppt-label-sm { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; margin-bottom: 2px; }

.ppt-textarea-3col {
    min-height: 180px; font-size: 0.78rem;
}

/* 三栏折叠大纲列表 */
.ppt-col-outline .ppt-outline-list {
    padding: 6px; display: flex; flex-direction: column; gap: 6px;
    max-height: calc(100vh - 300px); overflow-y: auto;
}
.ppt-col-outline .outline-slide {
    background: var(--bg-primary); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); overflow: hidden;
}
.ppt-col-outline .outline-slide-header {
    cursor: pointer; user-select: none;
}
.ppt-col-outline .outline-slide-header:hover { background: var(--bg-hover); }
.outline-toggle {
    color: var(--text-muted); font-size: 0.7rem; margin-left: auto; margin-right: 4px;
    transition: transform 0.2s;
}
.outline-num {
    width: 22px; height: 22px; border-radius: 50%;
    background: #D24726; color: #fff; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.outline-title-input {
    flex: 1; padding: 5px 8px; border-radius: 3px;
    background: transparent; border: 1px solid transparent;
    color: var(--text-primary); font-size: 0.78rem; font-weight: 600;
    outline: none; font-family: inherit; min-width: 0;
}
.outline-title-input:focus { border-color: #D24726; background: var(--bg-secondary); }
.outline-points { padding: 3px 6px 6px 10px; }
.outline-point { display: flex; align-items: flex-start; gap: 4px; margin: 2px 0; }
.outline-bullet { color: #D24726; font-size: 0.9rem; line-height: 1.8; }
.outline-point-input {
    flex: 1; padding: 3px 6px; border-radius: 3px;
    background: transparent; border: 1px solid transparent;
    color: var(--text-secondary); font-size: 0.75rem;
    outline: none; resize: none; font-family: inherit; line-height: 1.5;
    min-height: 24px; overflow: hidden;
}
.outline-point-input:focus { border-color: var(--accent-cyan); background: var(--bg-secondary); }
.outline-points-textarea {
    width: 100%; padding: 8px 10px; border-radius: 4px;
    background: var(--bg-primary); border: 1px solid var(--border-color);
    color: var(--text-secondary); font-size: 0.78rem;
    outline: none; resize: vertical; font-family: inherit;
    line-height: 1.7; min-height: 80px;
}
.outline-points-textarea:focus { border-color: var(--accent-cyan); }
.outline-btn-del {
    width: 20px; height: 20px; border-radius: 50%; background: transparent;
    color: var(--text-muted); font-size: 0.65rem; display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: none; flex-shrink: 0;
}
.outline-btn-del:hover { background: rgba(239,68,68,0.12); color: #ef4444; }
.outline-btn-del-sm {
    width: 18px; height: 18px; border-radius: 50%; background: transparent;
    color: var(--text-muted); font-size: 0.6rem; display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: none; flex-shrink: 0;
}
.outline-btn-del-sm:hover { background: rgba(239,68,68,0.12); color: #ef4444; }
.outline-btn-add {
    display: flex; align-items: center; gap: 3px; margin: 2px 0;
    padding: 3px 8px; border-radius: 3px;
    background: transparent; border: 1px dashed var(--border-color);
    color: var(--text-muted); font-size: 0.72rem; cursor: pointer;
}
.outline-btn-add:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.outline-btn-add-section {
    width: 100%; padding: 6px; border-radius: var(--radius-sm);
    background: transparent; border: 1px dashed var(--border-color);
    color: var(--text-muted); font-size: 0.75rem; display: flex; align-items: center; justify-content: center; gap: 4px;
    cursor: pointer;
}
.outline-btn-add-section:hover { border-color: #D24726; color: #D24726; }

/* ==================== AI 生成插图 ==================== */
.ai-image-panel { padding: 0; }
.ai-image-container { max-width: 100%; }
.ai-image-header {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 20px; border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(168,85,247,0.08), rgba(6,182,212,0.06));
}
.ai-image-header i { font-size: 1.6rem; color: var(--accent-purple); }
.ai-image-header h2 { font-size: 1.3rem; color: var(--text-primary); margin: 0; }
.ai-image-header .ai-badge { margin-left: auto; }

.ai-image-body {
    display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 20px;
    padding: 20px; align-items: start;
}
.ai-image-input-section { display: flex; flex-direction: column; gap: 16px; }
.ai-image-result-section { display: flex; flex-direction: column; gap: 16px; }

/* 从 AI 文案导入按钮 */
.ai-import-btn {
    margin-left: auto; padding: 5px 10px; font-size: 0.72rem;
    border-radius: var(--radius-sm); border: 1px solid var(--accent-purple);
    background: rgba(168,85,247,0.1); color: var(--accent-purple);
    cursor: pointer; transition: var(--transition);
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.ai-import-btn:hover:not(:disabled) { background: var(--accent-purple); color: #fff; }
.ai-import-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.ai-hint { font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; margin-top: -2px; }
.ai-hint strong { color: var(--accent-purple); font-weight: 600; }

/* 风格网格 */
.ai-image-style-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ai-image-style-chip {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px;
    border-radius: var(--radius-sm); border: 1px solid var(--border-color);
    background: var(--bg-tertiary); color: var(--text-secondary);
    font-size: 0.8rem; cursor: pointer; transition: var(--transition); text-align: left;
}
.ai-image-style-chip i { color: var(--text-muted); width: 16px; text-align: center; }
.ai-image-style-chip:hover { border-color: var(--accent-purple); color: var(--text-primary); }
.ai-image-style-chip.active {
    border-color: var(--accent-purple); background: rgba(168,85,247,0.14);
    color: var(--accent-purple); box-shadow: 0 0 0 3px rgba(168,85,247,0.12);
}
.ai-image-style-chip.active i { color: var(--accent-purple); }

/* 结果区 */
.ai-image-results {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 16px; min-height: 320px;
    display: flex; flex-direction: column; gap: 14px;
}
.ai-image-loading {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
    color: var(--text-secondary); min-height: 280px; text-align: center;
}
.spinner {
    width: 44px; height: 44px; border-radius: 50%;
    border: 4px solid rgba(168,85,247,0.2); border-top-color: var(--accent-purple);
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-image-error {
    background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.35);
    color: #f87171; border-radius: var(--radius-md); padding: 12px 14px;
    font-size: 0.82rem; line-height: 1.5; display: flex; gap: 8px; align-items: flex-start;
}
.ai-image-error i { margin-top: 2px; flex: 0 0 auto; }

/* 4 图网格 */
.ai-image-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.ai-image-card {
    position: relative; border-radius: var(--radius-md); overflow: hidden;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    display: flex; flex-direction: column;
}
.ai-image-card img {
    width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; background: var(--bg-tertiary);
}
.ai-image-card-actions { padding: 8px; display: flex; justify-content: center; border-top: 1px solid var(--border-color); }
.ai-image-dl {
    flex: 1; text-decoration: none; text-align: center; padding: 8px;
    border-radius: var(--radius-sm); background: var(--gradient-hero); color: #fff;
    font-size: 0.78rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: var(--transition);
}
.ai-image-dl:hover { box-shadow: 0 4px 14px rgba(6,182,212,0.3); }
.ai-image-card-idx {
    position: absolute; top: 8px; left: 8px; z-index: 2;
    background: rgba(0,0,0,0.55); color: #fff; font-size: 0.7rem; font-weight: 700;
    width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.ai-image-empty {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    color: var(--text-muted); min-height: 280px; text-align: center;
}
.ai-image-empty i { font-size: 2.6rem; opacity: 0.4; }
.ai-image-empty p { font-size: 0.82rem; line-height: 1.6; margin: 0; }

/* 进度条（逐张生成实时反馈） */
.ai-image-progress { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.ai-image-progress-bar {
    width: 100%; height: 10px; border-radius: 999px; overflow: hidden;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
}
.ai-image-progress-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
    transition: width 0.5s ease;
    box-shadow: 0 0 12px rgba(168,85,247,0.5);
}
.ai-image-progress-text {
    margin: 0; font-size: 0.8rem; color: var(--text-secondary);
    display: flex; align-items: center; gap: 6px;
}
.spinning-slow { animation: spin 2.4s linear infinite; color: var(--accent-purple); }

/* 等待中的骨架占位 */
.ai-image-skeleton {
    aspect-ratio: 3 / 4; width: 100%; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 10px;
    background: linear-gradient(110deg, var(--bg-tertiary) 30%, rgba(168,85,247,0.08) 50%, var(--bg-tertiary) 70%);
    background-size: 220% 100%; animation: aiShimmer 1.4s ease-in-out infinite; color: var(--text-muted); font-size: 0.78rem;
}
.ai-image-skeleton .spinner { width: 30px; height: 30px; border-width: 3px; }
@keyframes aiShimmer {
    0% { background-position: 120% 0; }
    100% { background-position: -120% 0; }
}

/* 单图失败 */
.ai-image-card-err {
    aspect-ratio: 3 / 4; width: 100%; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 8px; padding: 10px;
    background: rgba(239,68,68,0.08); color: #f87171; font-size: 0.78rem; text-align: center;
}
.ai-image-card-err i { font-size: 1.4rem; }

/* ==================== Responsive ==================== */
@media (max-width: 900px) {
    .ai-image-body { grid-template-columns: 1fr; }
    .ai-image-style-grid { grid-template-columns: repeat(2, 1fr); }
    .ai-image-grid { grid-template-columns: repeat(2, 1fr); }
    .main-container { flex-direction: column; }
    .sidebar {
        width: 100%; height: auto; position: relative; top: 0;
        flex-direction: row; border-right: none; border-bottom: 1px solid var(--border-color); padding: 8px;
    }
    .sidebar-nav { flex-direction: row; gap: 8px; padding: 4px; overflow-x: auto; }
    .nav-item { padding: 10px 14px; font-size: 0.8rem; white-space: nowrap; }
    .sidebar-footer { display: none; }
    .content { padding: 16px; max-width: 100%; }
    .tech-grid { grid-template-columns: 1fr; }
    .sub-tabs { max-width: 100%; }
    .ai-writer-body { grid-template-columns: 1fr; }
    .ppt-body { grid-template-columns: 1fr; }
    .ppt-theme-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 500px) {
    .sub-tabs { flex-direction: column; }
    .platform-buttons { flex-direction: column; }
    .platform-btn { width: 100%; justify-content: center; }
}

/* ================= 编辑 / 对话修改 / 校对 面板 ================= */
.ai-action-btn.active { color: var(--accent-cyan); border-color: var(--accent-cyan); background: rgba(6,182,212,0.08); }

/* 编辑态 */
.ai-edit-area { padding: 4px 0 8px; }
.ai-edit-row { margin-bottom: 10px; }
.ai-edit-row.ai-edit-main { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ai-edit-pane { display: flex; flex-direction: column; border: 1px solid var(--border-light); border-radius: 10px; overflow: hidden; background: rgba(15,28,46,0.6); }
.ai-edit-pane-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; font-size: 0.78rem; color: var(--text-secondary); background: rgba(6,182,212,0.05); border-bottom: 1px solid var(--border-light); }
.ai-edit-pane-head .ai-action-btn { padding: 3px 8px; font-size: 0.72rem; }
.ai-edit-textarea { width: 100%; min-height: 360px; border: none; resize: vertical; padding: 12px; background: transparent; color: var(--text-primary); font-size: 0.9rem; line-height: 1.7; font-family: inherit; outline: none; }
.ai-edit-preview { max-height: 460px; overflow: auto; padding: 12px; }
.ai-edit-preview .ai-output-body { color: var(--text-secondary); }
.ai-edit-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.ai-edit-actions .primary { background: var(--gradient-hero); color: #fff; border: none; }
.ai-edit-actions .primary:hover { box-shadow: 0 4px 16px rgba(6,182,212,0.3); }
.ai-edit-hint { font-size: 0.74rem; color: var(--text-secondary); }
@media (max-width: 760px) { .ai-edit-row.ai-edit-main { grid-template-columns: 1fr; } }

/* 对话修改 */
.ai-chat-panel { margin-top: 14px; border: 1px solid var(--border-light); border-radius: 12px; background: rgba(15,28,46,0.5); overflow: hidden; }
.ai-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; font-size: 0.85rem; color: var(--text-primary); background: rgba(6,182,212,0.06); border-bottom: 1px solid var(--border-light); }
.ai-chat-head i { color: var(--accent-cyan); margin-right: 6px; }
.ai-chat-clear { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 0.74rem; }
.ai-chat-clear:hover { color: var(--accent-cyan); }
.ai-chat-list { max-height: 320px; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-chat-empty { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; }
.ai-chat-msg { max-width: 88%; }
.ai-chat-msg .ai-chat-role { font-size: 0.7rem; color: var(--text-secondary); margin-bottom: 3px; }
.ai-chat-msg.user { align-self: flex-end; text-align: right; }
.ai-chat-msg.user .ai-chat-text { background: rgba(14,165,233,0.16); border: 1px solid rgba(14,165,233,0.3); }
.ai-chat-msg.assistant .ai-chat-text { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25); }
.ai-chat-text { display: inline-block; text-align: left; padding: 8px 12px; border-radius: 10px; font-size: 0.86rem; line-height: 1.6; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }
.ai-chat-input-row { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border-light); }
.ai-chat-input { flex: 1; min-height: 44px; max-height: 120px; resize: vertical; border: 1px solid var(--border-light); border-radius: 8px; padding: 8px 10px; background: rgba(15,28,46,0.6); color: var(--text-primary); font-size: 0.86rem; outline: none; font-family: inherit; }
.ai-chat-input:focus { border-color: var(--accent-cyan); }
.ai-chat-input-row .primary { background: var(--gradient-hero); color: #fff; border: none; align-self: flex-end; }

/* 校对面板 */
.ai-proof-panel { margin-top: 14px; border: 1px solid var(--border-light); border-radius: 12px; background: rgba(15,28,46,0.5); overflow: hidden; }
.ai-proof-head { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; font-size: 0.85rem; color: var(--text-primary); background: rgba(6,182,212,0.06); border-bottom: 1px solid var(--border-light); }
.ai-proof-head > div:first-child i { color: var(--accent-cyan); margin-right: 6px; }
.ai-proof-sum { display: block; margin-top: 4px; font-size: 0.78rem; color: var(--text-secondary); }
.ai-proof-sum .ok { color: var(--accent-green); }
.ai-proof-sum .doubt { color: #f59e0b; }
.ai-proof-sum .wrong { color: #ef4444; }
.ai-proof-sum .nocite { color: #ef4444; font-weight: 600; }
.ai-proof-head-actions { display: flex; gap: 8px; }
.ai-proof-note { padding: 6px 14px; font-size: 0.74rem; color: var(--text-secondary); background: rgba(245,158,11,0.08); }
.ai-proof-error { padding: 6px 14px; font-size: 0.78rem; color: #fca5a5; background: rgba(239,68,68,0.12); }
.ai-proof-list { max-height: 420px; overflow: auto; padding: 8px 14px; display: flex; flex-direction: column; gap: 8px; }
.ai-proof-item { border: 1px solid var(--border-light); border-radius: 10px; padding: 10px 12px; background: rgba(15,28,46,0.6); }
.ai-proof-item-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-proof-cat { font-size: 0.68rem; padding: 2px 8px; border-radius: 999px; background: rgba(6,182,212,0.15); color: var(--accent-cyan); border: 1px solid rgba(6,182,212,0.3); }
.ai-proof-cat.cat-价格 { background: rgba(236,72,153,0.15); color: #f472b6; border-color: rgba(236,72,153,0.3); }
.ai-proof-cat.cat-日期 { background: rgba(139,92,246,0.15); color: #a78bfa; border-color: rgba(139,92,246,0.3); }
.ai-proof-cat.cat-型号, .ai-proof-cat.cat-版本 { background: rgba(16,185,129,0.15); color: #34d399; border-color: rgba(16,185,129,0.3); }
.ai-proof-val { font-weight: 600; color: var(--text-primary); font-size: 0.92rem; }
.ai-proof-cite { font-size: 0.74rem; color: var(--text-secondary); }
.ai-proof-cite a { color: var(--accent-cyan); }
.ai-proof-cite.nocite { color: #ef4444; font-weight: 600; }
.ai-proof-ctx { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.6; margin: 6px 0; padding-left: 8px; border-left: 2px solid var(--border-light); }
.ai-proof-item-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ai-proof-status { display: flex; gap: 6px; }
.ai-proof-st { font-size: 0.72rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border-light); background: transparent; color: var(--text-secondary); cursor: pointer; }
.ai-proof-st.ok.on { background: rgba(16,185,129,0.2); color: #34d399; border-color: rgba(16,185,129,0.4); }
.ai-proof-st.doubt.on { background: rgba(245,158,11,0.2); color: #fbbf24; border-color: rgba(245,158,11,0.4); }
.ai-proof-st.wrong.on { background: rgba(239,68,68,0.2); color: #f87171; border-color: rgba(239,68,68,0.4); }
.ai-proof-st.on { box-shadow: inset 0 0 0 1px currentColor; }
.ai-proof-note-input { flex: 1; min-width: 140px; border: 1px solid var(--border-light); border-radius: 8px; padding: 4px 8px; background: rgba(15,28,46,0.6); color: var(--text-primary); font-size: 0.76rem; outline: none; }
.ai-proof-note-input:focus { border-color: var(--accent-cyan); }
.ai-proof-empty { padding: 14px; font-size: 0.8rem; color: var(--text-secondary); }

/* ================= 顶部栏退出按钮 ================= */
.logout-btn {
    background: transparent; border: 1px solid var(--border-color);
    color: var(--text-secondary); width: 34px; height: 34px; border-radius: 8px;
    cursor: pointer; transition: var(--transition); font-size: 0.9rem;
}
.logout-btn:hover { color: var(--accent-pink); border-color: var(--accent-pink); }
/* 主题切换按钮（浅色/深色） */
.theme-btn {
    background: transparent; border: 1px solid var(--border-color);
    color: var(--text-secondary); width: 34px; height: 34px; border-radius: 8px;
    cursor: pointer; transition: var(--transition); font-size: 0.9rem;
}
.theme-btn:hover { color: var(--accent-cyan); border-color: var(--accent-cyan); }

/* ================= 登录遮罩（玻璃拟态 + 渐变炫光） ================= */
.login-overlay {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(1200px 600px at 20% 10%, rgba(139,92,246,0.30), transparent 60%),
        radial-gradient(1000px 500px at 90% 90%, rgba(6,182,212,0.24), transparent 55%),
        linear-gradient(160deg, #0a0714 0%, #0a0e1c 45%, #120a22 100%);
    overflow: hidden;
}
/* 第三层光晕（紫色为主，更炫酷，参考通义千问紫系） */
.login-aurora {
    position: absolute; inset: -10%; z-index: 1; pointer-events: none;
    background:
        radial-gradient(560px 560px at 50% 42%, rgba(139,92,246,0.18), transparent 62%),
        radial-gradient(420px 420px at 72% 28%, rgba(6,182,212,0.14), transparent 60%),
        radial-gradient(360px 360px at 28% 72%, rgba(236,72,153,0.12), transparent 60%);
    animation: loginFloat 14s ease-in-out infinite;
}
@keyframes loginFloat { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-18px) scale(1.06); } }
.login-overlay::before {
    content: ''; position: absolute; width: 560px; height: 560px; border-radius: 50%;
    background: conic-gradient(from 0deg, #8b5cf6, #06b6d4, #ec4899, #a855f7, #8b5cf6);
    filter: blur(95px); opacity: 0.30; top: -130px; left: -90px;
    animation: loginSpin 18s linear infinite;
}
.login-overlay::after {
    content: ''; position: absolute; width: 500px; height: 500px; border-radius: 50%;
    background: conic-gradient(from 180deg, #06b6d4, #8b5cf6, #a855f7, #06b6d4);
    filter: blur(95px); opacity: 0.24; bottom: -150px; right: -70px;
    animation: loginSpin 22s linear infinite reverse;
}
@keyframes loginSpin { to { transform: rotate(360deg); } }
.login-card {
    position: relative; z-index: 2; width: 420px; max-width: 92vw;
    padding: 38px 36px 30px; border-radius: 22px; text-align: center;
    background: rgba(17, 24, 39, 0.55);
    border: 1px solid rgba(139, 92, 246, 0.35);
    backdrop-filter: blur(18px) saturate(140%);
    box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 46px rgba(139,92,246,0.20);
    animation: loginIn .5s ease both;
}
@keyframes loginIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.login-logo {
    display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px;
    font-size: 1.3rem; font-weight: 700; color: var(--text-primary);
}
.login-logo i { color: var(--accent-cyan); font-size: 1.5rem; }
.login-card h2 {
    margin: 0 0 6px; font-size: 1.35rem; color: var(--text-primary);
    background: var(--gradient-hero); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.login-sub { margin: 0 0 22px; font-size: 0.82rem; color: var(--text-secondary); }
.login-field {
    display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
    padding: 0 12px; height: 46px; border-radius: 12px;
    background: rgba(10, 14, 23, 0.6); border: 1px solid var(--border-color);
    transition: border-color .15s, box-shadow .15s;
}
.login-field:focus-within { border-color: var(--accent-cyan); box-shadow: 0 0 0 3px rgba(6,182,212,0.12); }
.login-field i { color: var(--text-muted); font-size: 0.95rem; }
.login-field input {
    flex: 1; border: none; background: transparent; outline: none;
    color: var(--text-primary); font-size: 0.92rem; height: 100%;
}
.login-field input::placeholder { color: var(--text-muted); }
.login-err {
    display: flex; align-items: center; gap: 6px; justify-content: center;
    color: #f87171; font-size: 0.78rem; margin-bottom: 12px;
}
.login-btn {
    width: 100%; height: 46px; margin-top: 6px; border: none; cursor: pointer;
    border-radius: 12px; font-size: 0.98rem; font-weight: 600; letter-spacing: 2px;
    color: #fff; background: var(--gradient-hero);
    box-shadow: 0 8px 24px rgba(139,92,246,0.35); transition: transform .12s, box-shadow .15s;
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(139,92,246,0.45); }
.login-btn:active { transform: translateY(0); }
.login-guest {
    width: 100%; margin-top: 14px; background: transparent; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 0.76rem; transition: color .15s;
}
.login-guest:hover { color: var(--text-secondary); text-decoration: underline; }

/* ================= 浅色主题下的登录页（默认）：更浅、更透气、紫系炫光 ================= */
html[data-theme="light"] .login-overlay {
    background:
        radial-gradient(900px 520px at 12% 0%, rgba(139,92,246,0.26), transparent 60%),
        radial-gradient(820px 480px at 100% 100%, rgba(6,182,212,0.20), transparent 55%),
        radial-gradient(680px 420px at 82% 12%, rgba(236,72,153,0.16), transparent 55%),
        linear-gradient(160deg, #f6f4ff 0%, #eef3fb 48%, #f4ecff 100%);
}
html[data-theme="light"] .login-aurora {
    background:
        radial-gradient(640px 560px at 50% 40%, rgba(139,92,246,0.16), transparent 62%),
        radial-gradient(440px 420px at 74% 26%, rgba(6,182,212,0.13), transparent 60%),
        radial-gradient(380px 360px at 26% 74%, rgba(236,72,153,0.11), transparent 60%),
        linear-gradient(rgba(139,92,246,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139,92,246,0.05) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 28px 28px, 28px 28px;
}
html[data-theme="light"] .login-overlay::before {
    background: conic-gradient(from 0deg, #8b5cf6, #06b6d4, #ec4899, #a855f7, #8b5cf6);
    opacity: 0.38; filter: blur(105px);
}
html[data-theme="light"] .login-overlay::after {
    background: conic-gradient(from 180deg, #06b6d4, #8b5cf6, #a855f7, #06b6d4);
    opacity: 0.32; filter: blur(105px);
}
html[data-theme="light"] .login-card {
    width: 440px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(139, 92, 246, 0.40);
    box-shadow: 0 24px 70px rgba(76, 29, 149, 0.18), 0 0 50px rgba(139, 92, 246, 0.16);
}
html[data-theme="light"] .login-field {
    background: rgba(255, 255, 255, 0.85); border: 1px solid rgba(139, 92, 246, 0.25);
}
html[data-theme="light"] .login-field:focus-within { border-color: var(--accent-purple); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16); }

/* 移动端隐藏可拖动分隔条，并让侧栏/内容纵向堆叠、恢复默认布局 */
@media (max-width: 900px) {
    .main-container { flex-direction: column; padding-left: 0; }
    .sidebar { margin-left: 0; width: 100%; position: static; height: auto; }
    .sidebar-resizer { display: none; }
}

/* ============ 登录页 v2：紫系主导 + 浮动光球 + 科技网格 + 卡片流光 ============ */
.login-overlay { perspective: 1000px; }

/* 1) 透视科技网格：底部向远处收敛 + 缓慢滚动，营造"数据平面"纵深感 */
.login-grid {
    position: absolute; left: -25%; right: -25%; bottom: -6%; height: 78%; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(124,58,237,.20) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124,58,237,.20) 1px, transparent 1px);
    background-size: 48px 48px;
    transform: rotateX(66deg) translateZ(-60px);
    transform-origin: 50% 100%;
    -webkit-mask-image: linear-gradient(to top, #000 6%, rgba(0,0,0,.35) 45%, transparent 82%);
            mask-image: linear-gradient(to top, #000 6%, rgba(0,0,0,.35) 45%, transparent 82%);
    animation: lpGrid 8s linear infinite;
    will-change: background-position;
}
@keyframes lpGrid { to { background-position: 0 48px, 48px 0; } }

/* 2) 浮动光球：6 个不同尺寸/轨迹/时长，紫→白高光渐变 + 外发光 */
.login-orbs { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.orb {
    position: absolute; border-radius: 50%; opacity: .8;
    background: radial-gradient(circle at 32% 28%,
        rgba(255,255,255,.95) 0%, rgba(196,132,252,.62) 38%, rgba(124,58,237,.18) 68%, transparent 72%);
    box-shadow: 0 0 38px rgba(139,92,246,.55), inset 0 0 20px rgba(255,255,255,.38);
    animation: lpOrb var(--dur) ease-in-out var(--delay) infinite;
    will-change: transform;
}
.orb-1 { width: 92px; height: 92px; left:  7%; top: 16%; --dur: 15s; --delay: 0s;   }
.orb-2 { width: 54px; height: 54px; left: 20%; top: 68%; --dur: 19s; --delay: -3s;  }
.orb-3 { width: 128px;height: 128px;right: 10%; top: 12%; --dur: 23s; --delay: -7s; opacity: .58; }
.orb-4 { width: 40px; height: 40px; right: 22%; top: 58%; --dur: 13s; --delay: -1.5s;}
.orb-5 { width: 70px; height: 70px; left:  46%; top:  6%; --dur: 27s; --delay: -11s; opacity: .5; }
.orb-6 { width: 30px; height: 30px; left:  62%; bottom: 12%; --dur: 11s; --delay: -5s; }
@keyframes lpOrb {
    0%,100% { transform: translate3d(0,0,0) scale(1); }
    30%     { transform: translate3d(22px,-30px,0) scale(1.10); }
    60%     { transform: translate3d(-16px,18px,0) scale(.92); }
}

/* 3) 扫光束：一道倾斜紫光横掠全屏 */
.login-beam {
    position: absolute; top: -30%; width: 190px; height: 160%; z-index: 1; pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(168,85,247,.20), rgba(255,255,255,.10), rgba(168,85,247,.20), transparent);
    filter: blur(14px); transform: rotate(14deg);
    animation: lpBeam 8.5s ease-in-out infinite; will-change: left, opacity;
}
@keyframes lpBeam { 0%,100% { left: 8%;  opacity: .22; } 50% { left: 86%; opacity: .62; } }

/* 4) 卡片：紫边玻璃 + 旋转环形流光 + 斜向掠光 */
.login-card { overflow: hidden; isolation: isolate; }
.login-card > * { position: relative; z-index: 2; }
.login-card-ring {
    position: absolute; left: 50%; top: 50%; width: 190%; aspect-ratio: 1; z-index: 0;
    transform: translate(-50%,-50%); pointer-events: none;
    background: conic-gradient(from 0deg, transparent 0 58%,
        rgba(168,85,247,.85) 72%, rgba(255,255,255,.95) 79%, rgba(34,211,238,.55) 85%, transparent 92%);
    -webkit-mask: radial-gradient(closest-side, transparent 69%, #000 73%, #000 100%);
            mask: radial-gradient(closest-side, transparent 69%, #000 73%, #000 100%);
    animation: lpRing 5.5s linear infinite; will-change: transform;
}
@keyframes lpRing { to { transform: translate(-50%,-50%) rotate(360deg); } }
.login-card-shine {
    position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
    background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,.16) 46%, transparent 60%);
    transform: translateX(-125%); animation: lpShine 6s ease-in-out 1.4s infinite; will-change: transform;
}
@keyframes lpShine { 0% { transform: translateX(-125%); } 55%,100% { transform: translateX(125%); } }

/* 5) Logo 脉冲环 */
.login-logo-badge { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; }
.login-logo-pulse {
    position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(168,85,247,.7);
    animation: lpPulse 2.6s ease-out infinite;
}
@keyframes lpPulse { 0% { transform: scale(.68); opacity: .95; } 100% { transform: scale(1.75); opacity: 0; } }

/* 6) 按钮：紫系流动渐变 + hover 掠光 */
.login-btn {
    position: relative; overflow: hidden;
    background: linear-gradient(120deg, #7c3aed 0%, #a855f7 42%, #c084fc 68%, #7c3aed 100%);
    background-size: 220% 100%; animation: lpBtn 6s ease infinite;
    box-shadow: 0 10px 28px rgba(124,58,237,.42);
}
@keyframes lpBtn { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.login-btn::after {
    content: ''; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.42), transparent);
}
.login-btn:hover::after { transition: transform .6s ease; transform: translateX(100%); }
.login-btn.busy { pointer-events: none; opacity: .78; }

/* 7) 输入框/入场/访客提示 */
.login-field:focus-within { border-color: var(--accent-purple) !important; box-shadow: 0 0 0 3px rgba(168,85,247,.20), 0 0 22px rgba(168,85,247,.18) !important; }
.login-card h2, .login-sub, .login-field, .login-btn, .login-guest, .login-guest-note { animation: lpIn .5s cubic-bezier(.22,.61,.36,1) both; }
.login-card h2 { animation-delay: .06s; } .login-sub { animation-delay: .11s; }
.login-field:nth-of-type(1) { animation-delay: .16s; } .login-field:nth-of-type(2) { animation-delay: .21s; }
.login-btn { animation-delay: .27s; } .login-guest { animation-delay: .33s; } .login-guest-note { animation-delay: .37s; }
@keyframes lpIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.login-guest-note { margin-top: 10px; font-size: .70rem; color: var(--text-muted); opacity: .85; }
.login-guest-note i { color: var(--accent-orange); }

/* ---------- 浅色主题：更透气的半透明玻璃（老板默认主题） ---------- */
html[data-theme="light"] .login-card {
    background: linear-gradient(158deg, rgba(255,255,255,.80) 0%, rgba(250,246,255,.60) 58%, rgba(245,240,255,.72) 100%);
    border: 1px solid rgba(168,85,247,.42);
    -webkit-backdrop-filter: blur(28px) saturate(185%);
            backdrop-filter: blur(28px) saturate(185%);
    box-shadow: 0 28px 82px rgba(76,29,149,.20), 0 0 62px rgba(168,85,247,.18), inset 0 1px 0 rgba(255,255,255,.92);
}
html[data-theme="light"] .login-card-shine { background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,.62) 46%, transparent 60%); }
html[data-theme="light"] .login-grid { background-image:
    linear-gradient(rgba(124,58,237,.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,.13) 1px, transparent 1px); }
html[data-theme="light"] .orb { opacity: .62; box-shadow: 0 0 42px rgba(139,92,246,.34), inset 0 0 22px rgba(255,255,255,.62); }
html[data-theme="light"] .login-card h2 { background: linear-gradient(120deg, #7c3aed, #a855f7 55%, #22d3ee); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ---------- 性能与无障碍 ---------- */
@media (max-width: 640px) { .orb-3, .orb-5, .orb-6 { display: none; } .login-grid { opacity: .5; } .login-beam { display: none; } }
@media (prefers-reduced-motion: reduce) {
    .login-grid, .orb, .login-beam, .login-card-ring, .login-card-shine, .login-aurora,
    .login-overlay::before, .login-overlay::after, .login-btn, .login-logo-pulse,
    .login-card h2, .login-sub, .login-field, .login-guest, .login-guest-note { animation: none !important; }
}

/* ============================================================
   个人中心（需求③）—— profile-panel
   ============================================================ */
.profile-panel { display: flex; flex-direction: column; gap: 16px; padding: 20px; width: 100%; max-width: 1000px; margin: 0 auto; }

/* 头部：头像 + 身份 + 同步状态 + 操作 */
.profile-head {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    background: linear-gradient(120deg, rgba(139,92,246,.14), rgba(6,182,212,.08));
    border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 18px 20px;
}
.profile-avatar {
    width: 56px; height: 56px; flex: 0 0 56px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    box-shadow: 0 6px 18px rgba(139,92,246,.4); text-transform: uppercase;
}
.profile-id { flex: 1 1 200px; min-width: 0; }
.profile-id h2 { font-size: 1.2rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.profile-storage { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: .76rem; color: var(--text-secondary); }
.profile-storage.cloud { color: var(--accent-cyan); }
.profile-storage.local { color: var(--accent-orange); }
.profile-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-sync { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--text-muted); max-width: 320px; }
.profile-sync.busy { color: var(--accent-blue); }
.profile-sync.err { color: var(--accent-red); }

/* 通用按钮（个人中心） */
.profile-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-md);
    border: 1px solid var(--border-light); background: var(--bg-tertiary); color: var(--text-primary);
    font-size: .82rem; cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.profile-btn:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.profile-btn.primary { background: linear-gradient(120deg, var(--accent-purple), #a855f7); color: #fff; border-color: transparent; }
.profile-btn.primary:hover { filter: brightness(1.08); color: #fff; }
.profile-btn.ghost { background: transparent; }
.profile-btn.danger { color: var(--accent-red); border-color: rgba(239,68,68,.4); }
.profile-btn.danger:hover { background: rgba(239,68,68,.12); color: var(--accent-red); border-color: var(--accent-red); }

/* 访客提醒条 */
.profile-warn {
    display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-md);
    background: rgba(245,158,11,.10); border: 1px solid rgba(245,158,11,.35); color: var(--text-secondary);
    font-size: .82rem; line-height: 1.6;
}
.profile-warn i { color: var(--accent-orange); font-size: 1.15rem; margin-top: 2px; flex: 0 0 auto; }
.profile-warn strong { color: var(--text-primary); }

/* 卡片网格 */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.profile-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 16px; }
.profile-card h3 { font-size: .92rem; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; color: var(--text-primary); }
.profile-card h3 i { color: var(--accent-purple); }

.profile-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px dashed var(--border-light); font-size: .84rem; }
.profile-row:first-of-type { border-top: none; }
.profile-row > span:first-child { color: var(--text-secondary); white-space: nowrap; }
.profile-row select { max-width: 60%; }
.profile-val { color: var(--text-primary); font-weight: 600; text-align: right; }
.profile-mini { margin-left: 8px; font-size: .72rem; padding: 3px 9px; border-radius: var(--radius-sm); border: 1px solid var(--border-light); background: var(--bg-tertiary); color: var(--text-secondary); cursor: pointer; transition: var(--transition); }
.profile-mini:hover { color: var(--accent-cyan); border-color: var(--accent-cyan); }

.profile-check { display: flex; align-items: flex-start; gap: 8px; font-size: .8rem; color: var(--text-secondary); line-height: 1.5; cursor: pointer; }
.profile-check input { margin-top: 3px; accent-color: var(--accent-purple); }
.profile-check em { display: block; font-style: normal; font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

.profile-count { margin-left: auto; background: rgba(139,92,246,.18); color: var(--accent-purple); border-radius: 999px; padding: 0 8px; font-size: .72rem; font-weight: 700; }

/* 收藏列表 */
.profile-fav-empty { font-size: .82rem; color: var(--text-muted); padding: 10px 0; }
.profile-fav { list-style: none; display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow: auto; }
.profile-fav li { display: flex; align-items: center; gap: 8px; font-size: .82rem; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--bg-tertiary); }
.profile-fav li a { flex: 1 1 auto; min-width: 0; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-fav li a:hover { color: var(--accent-cyan); }
.profile-fav-src { flex: 0 0 auto; font-size: .68rem; color: var(--text-muted); background: var(--bg-secondary); padding: 1px 6px; border-radius: 4px; }
.profile-fav li button { flex: 0 0 auto; border: none; background: transparent; color: var(--text-muted); cursor: pointer; font-size: .85rem; }
.profile-fav li button:hover { color: var(--accent-red); }

/* 数据管理 */
.profile-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.profile-note { font-size: .74rem; color: var(--text-muted); line-height: 1.6; margin-top: 6px; }
.profile-note strong { color: var(--text-secondary); }

/* 导航项上的云端/本机徽标 */
.badge { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 999px; font-size: .6rem; font-weight: 700; line-height: 1.7; letter-spacing: .02em; }
.badge-cloud { background: rgba(6,182,212,.16); color: var(--accent-cyan); border: 1px solid rgba(6,182,212,.4); }
.badge-local { background: rgba(245,158,11,.16); color: var(--accent-orange); border: 1px solid rgba(245,158,11,.4); }

/* 分段控件（主题切换等） */
.seg { display: inline-flex; border: 1px solid var(--border-color); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { padding: 6px 14px; background: var(--bg-tertiary); color: var(--text-secondary); font-size: .8rem; border: none; cursor: pointer; transition: var(--transition); }
.seg button + button { border-left: 1px solid var(--border-color); }
.seg button.on { background: linear-gradient(120deg, var(--accent-purple), #a855f7); color: #fff; }
.seg button:hover:not(.on) { background: var(--bg-hover); color: var(--text-primary); }

/* 科技卡片上的收藏按钮 */
.tech-fav {
    width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; border: 1px solid var(--border-color);
    background: var(--bg-tertiary); color: var(--text-muted); cursor: pointer; font-size: .9rem;
    display: inline-flex; align-items: center; justify-content: center; transition: var(--transition);
}
.tech-fav:hover { color: var(--accent-orange); border-color: var(--accent-orange); }
.tech-fav.on { color: #fff; background: linear-gradient(135deg, var(--accent-orange), #f97316); border-color: transparent; box-shadow: 0 2px 8px rgba(245,158,11,.4); }

/* 浅色主题下个人中心的细微覆盖 */
html[data-theme="light"] .profile-head { background: linear-gradient(120deg, rgba(139,92,246,.10), rgba(6,182,212,.06)); }
html[data-theme="light"] .profile-warn { background: rgba(245,158,11,.08); }
