/* ══════════════════════════════════════════════════════════════
   18-page-polish —— 逐页专业精修层（全站最后加载）
   覆盖：对话 / 我的仪表盘 / 团队仪表盘 / 看板 / 信息库 /
   个人信息库 / 记事本 / 通知 / 模板 / API 用量 / 全局一致性。
   全部变量驱动，六套主题自适应；不改任何 JS 行为。
   ══════════════════════════════════════════════════════════════ */

/* ───────────────────────── 0. 全局一致性 ───────────────────────── */
/* 面板内卡片统一"手工玻璃"质感：发丝边 + 顶部内高光 */
.panel .stat-card, .panel .dashboard-card, .panel .dashboard-live-card,
.panel .dashboard-discussion-card, .panel .team-chart-panel, .panel .member-card,
.panel .mc-card, .panel .library-post, .panel .library-composer,
.panel .library-filter-panel, .panel .briefing-box, .panel .notif-module,
.panel .account-card, .panel .business-line-card, .panel .api-usage-kpi,
.panel .api-usage-section, .panel .wft-card, .panel .kanban-kpi-tile {
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.045);
}
[data-theme="light"] .panel .stat-card, [data-theme="light"] .panel .dashboard-card,
[data-theme="cloud"] .panel .stat-card, [data-theme="cloud"] .panel .dashboard-card {
  box-shadow: var(--shadow-sm);
}

/* 空状态家族统一 */
.library-empty, .mc-empty, .kanban-column-empty, .feedback-view-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 34px 18px;
  color: var(--text3); font-size: 13px; text-align: center;
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 40%, transparent);
  margin: 8px;
}

/* 列表行的通用悬浮反馈 */
.library-doc-row:hover, .dashboard-event-row:hover,
.dashboard-hot-row:hover, .dashboard-latest-row:hover, .dashboard-long-row:hover {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}

/* 小型周期/筛选按钮 → 药丸 */
.filter-btn {
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border-radius: 999px; padding: 5px 13px;
  font-size: 12px; font-weight: 600; color: var(--text2);
  cursor: pointer; transition: all .15s;
}
.filter-btn:hover { color: var(--text); border-color: var(--border-strong); }
.filter-btn.active {
  background: var(--grad-primary); border-color: transparent; color: #fff;
  box-shadow: 0 3px 12px -2px color-mix(in srgb, var(--primary) 50%, transparent);
}

/* ───────────────────────── 1. 对话页 ───────────────────────── */
/* 气泡排版：标题/列表/代码/表格的阅读体验 */
.msg.assistant .bubble h2 {
  font-size: 15.5px; font-weight: 750; letter-spacing: -0.1px;
  margin: 16px 0 7px; padding-bottom: 6px;
  border-bottom: 1px solid var(--hairline);
}
.msg.assistant .bubble h2:first-child { margin-top: 2px; }
.msg.assistant .bubble h3 { font-size: 14px; font-weight: 700; margin: 12px 0 5px; }
.msg.assistant .bubble ul, .msg.assistant .bubble ol { margin: 7px 0 7px 20px; }
.msg.assistant .bubble li { margin: 3.5px 0; }
.msg.assistant .bubble li::marker { color: var(--primary-hover); }
.msg.assistant .bubble code {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary-hover);
  padding: 1.5px 6px; border-radius: 6px; font-size: 12.5px;
}
.msg.assistant .bubble pre code, .msg.assistant .bubble pre {
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid var(--hairline);
  border-radius: 10px; padding: 10px 12px;
}
.msg.assistant .bubble table {
  margin: 10px 0; font-size: 13px;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--hairline);
}
.msg.assistant .bubble th, .msg.assistant .bubble td {
  border: none; border-bottom: 1px solid var(--hairline);
  padding: 7px 12px;
}
.msg.assistant .bubble tr:last-child td { border-bottom: none; }
.msg.assistant .bubble th {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  font-weight: 700; font-size: 12px; letter-spacing: 0.3px;
}
.msg .time { font-variant-numeric: tabular-nums; }

/* 正在输入指示 */
.msg .typing, .typing { color: var(--primary-hover); }

/* 语音工具条：状态胶囊 */
.chat-voice-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text3);
  background: color-mix(in srgb, var(--surface2) 55%, transparent);
  border: 1px solid var(--hairline);
  border-radius: 999px; padding: 3px 10px;
}
.chat-voice-status.listening {
  color: var(--primary-hover);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  background: var(--primary-a08);
}
.chat-voice-status.error { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); background: color-mix(in srgb, var(--red) 8%, transparent); }

/* 会话项：时间更淡、删除按钮圆角 */
.session-item-delete { border-radius: 6px; }

/* ───────────────────────── 2. 我的仪表盘 ───────────────────────── */
.dashboard-headline { font-size: 34px; letter-spacing: -1px; }
.dashboard-score-card { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.dashboard-score-value {
  font-size: 38px; letter-spacing: -1.2px;
  background: linear-gradient(120deg, var(--text), var(--primary-hover));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* 实时动态：五个状态小卡 → 着色玻璃片 */
.dashboard-team-status {
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface2) 55%, transparent);
  padding: 10px 12px;
  transition: transform .15s, border-color .15s;
}
.dashboard-team-status:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.dashboard-team-status-dot { border-radius: 3px; box-shadow: 0 0 8px currentColor; }
.dashboard-team-status strong { font-size: 17px; font-variant-numeric: tabular-nums; }

/* 事件/动态行：时间用等宽数字 */
.dashboard-event-time, .dashboard-latest-meta, .dashboard-hot-copy span { font-variant-numeric: tabular-nums; }
.dashboard-event-status, .dashboard-event-origin { border-radius: 7px; }

/* 业务线卡：悬浮与量表 */
.business-line-card { transition: transform .18s, box-shadow .18s, border-color .18s; }
.business-line-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.business-line-meter { height: 5px; background: color-mix(in srgb, var(--bg) 50%, transparent); }
.business-line-fill { box-shadow: 0 0 10px color-mix(in srgb, var(--primary) 45%, transparent); }

/* 热门讨论排名章 */
.dashboard-hot-rank { border-radius: 8px; font-variant-numeric: tabular-nums; }

/* ───────────────────────── 3. 团队仪表盘 ───────────────────────── */
.team-chart-panel {
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.team-chart-title {
  font-size: 14px; font-weight: 750; letter-spacing: 0.1px;
  display: flex; align-items: center; gap: 8px;
}
.team-analytics-head { letter-spacing: -0.2px; }
.team-period-control { gap: 3px; }

/* 成员卡：头像环 + 统计小格 */
.member-avatar { border-radius: 14px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 28%, transparent); }
.member-name { font-weight: 700; letter-spacing: 0.1px; }
.member-role { color: var(--text3); }
.member-stats .stat {
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface2) 62%, transparent);
  border: 1px solid var(--hairline);
}

/* Mission Control 卡：状态柔色渐变 */
.mc-card { border-radius: var(--r-md); }
.mc-card.green  { border-color: color-mix(in srgb, var(--green) 26%, transparent);  background: linear-gradient(150deg, color-mix(in srgb, var(--green) 8%, var(--surface)) 0%, var(--surface) 72%); }
.mc-card.yellow { border-color: color-mix(in srgb, var(--yellow) 26%, transparent); background: linear-gradient(150deg, color-mix(in srgb, var(--yellow) 8%, var(--surface)) 0%, var(--surface) 72%); }
.mc-card.red    { border-color: color-mix(in srgb, var(--red) 26%, transparent);    background: linear-gradient(150deg, color-mix(in srgb, var(--red) 8%, var(--surface)) 0%, var(--surface) 72%); }
.mc-badge { border-radius: 999px; font-weight: 650; letter-spacing: 0.2px; }
.mc-section-head { font-size: 13.5px; font-weight: 750; letter-spacing: 0.2px; }
.mission-pill { border-radius: 999px; font-weight: 650; }

/* 节点卡：状态左边条 */
.node-card { border-radius: var(--r-md); border-left-width: 3.5px; }
.node-card.pending     { border-left-color: var(--yellow); }
.node-card.in_progress { border-left-color: var(--primary); }
.node-card.completed   { border-left-color: var(--green); }
.node-card.blocked     { border-left-color: var(--red); }
.node-card.stalled     { border-left-color: var(--orange); }
.node-title { font-weight: 650; }
.node-btn-complete, .node-btn-delete { border-radius: 7px; }

/* 简报盒 */
.briefing-box { overflow: hidden; }
.briefing-placeholder {
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface2) 45%, transparent);
}
.briefing-speech-btn { border-radius: 8px; }

/* ───────────────────────── 4. 看板 ───────────────────────── */
.kanban-column-header { font-size: 13px; }
.kanban-column-header .kanban-col-count, .kanban-column-header [class*="count"] {
  background: color-mix(in srgb, var(--surface2) 70%, transparent);
  border-radius: 999px; font-size: 11px; font-weight: 700;
}
.kanban-column-empty {
  border-style: dashed; border-color: var(--border-strong);
  background: transparent; font-size: 12px;
}
.kanban-column-body.drag-over {
  background: var(--primary-a08);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--primary) 35%, transparent);
}
.kanban-card-title { font-weight: 650; line-height: 1.45; }
.kanban-card-meta { color: var(--text3); }
.kanban-badge { border-radius: 999px; font-weight: 650; }
.kanban-comment-chip { border-radius: 999px; }

/* ───────────────────────── 5. 信息库 ───────────────────────── */
.library-post {
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 16px 18px;
  margin: 0 0 12px;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.library-post:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.library-avatar {
  border-radius: 10px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent);
}
.library-post-meta { color: var(--text3); font-variant-numeric: tabular-nums; }
.library-post-text { line-height: 1.75; }
.library-image-grid { border-radius: 12px; overflow: hidden; gap: 6px; }
.library-image-link { border-radius: 10px; overflow: hidden; }
.library-image-link img { transition: transform .3s ease; }
.library-image-link:hover img { transform: scale(1.03); }
.library-doc-row { border-radius: 9px; transition: background .15s; }
.library-comments {
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface2) 55%, transparent);
  border: 1px solid var(--hairline);
  padding: 6px 12px;
}
.library-comment-composer input { border-radius: 9px; }
.library-comment-composer button { border-radius: 9px; }
.library-post-delete { border-radius: 7px; }
.library-scope-button, .library-add-button { border-radius: 9px; }

/* ───────────────────────── 6. 个人信息库 ───────────────────────── */
.pl-toolbar select, .pl-toolbar input { height: 36px; }
.pl-search { border-radius: 10px; }
.pl-table-head {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text3);
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pl-view-toggle button { border-radius: 8px; }
.pl-view-toggle button.active { background: var(--primary-a12); color: var(--primary-hover); }
.pl-batch-bar {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, transparent);
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}
.pl-detail {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border-left: 1px solid var(--hairline);
  box-shadow: var(--shadow-lg);
}
.pl-private-badge {
  background: var(--primary-a08);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-radius: 999px; color: var(--primary-hover);
}

/* ───────────────────────── 7. 记事本 ───────────────────────── */
.cr-msg { gap: 10px; }
.cr-msg-avatar {
  border-radius: 12px;
  box-shadow: 0 0 0 1.5px var(--hairline), 0 2px 6px rgba(0,0,0,0.2);
}
.cr-msg-name { font-size: 12px; font-weight: 700; letter-spacing: 0.1px; }
.cr-msg-time { font-size: 10.5px; color: var(--text3); font-variant-numeric: tabular-nums; }
.cr-msg-content {
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface2) 72%, transparent);
  line-height: 1.7;
}
.cr-msg.own .cr-msg-content {
  background: var(--grad-primary-soft);
  border-color: color-mix(in srgb, var(--primary) 28%, transparent);
}
.cr-msg.system .cr-msg-content {
  border-radius: 999px;
  font-size: 12px;
}
.cr-msg.recalled .cr-recalled-placeholder {
  background: transparent;
  border-style: dashed;
  color: var(--text3);
  font-size: 12.5px;
  font-style: italic;
}
.cr-reply-quote {
  border-left: 2.5px solid var(--primary);
  background: var(--primary-a08);
  border-radius: 0 8px 8px 0;
}
.cr-msg-badge, .cr-system-badge { border-radius: 999px; font-weight: 650; }

/* 输入区：与对话页一致的悬浮组合框 */
.chatroom-input-area {
  border-top: none;
  background: transparent;
  padding: 10px 16px 16px;
}
.chatroom-input-stack, .chatroom-input-area .chatroom-input-box {
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.04);
}
.chatroom-input-area textarea, .chatroom-input-area input {
  background: transparent; border: none;
}
.chatroom-input-area textarea:focus, .chatroom-input-area input:focus {
  box-shadow: none; border: none;
}
.chatroom-meeting-banner {
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  background: linear-gradient(140deg, color-mix(in srgb, var(--primary) 12%, var(--surface)) 0%, var(--surface) 62%);
  box-shadow: 0 4px 20px -6px color-mix(in srgb, var(--primary) 35%, transparent);
}

/* ───────────────────────── 8. 通知 ───────────────────────── */
.notif-module {
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  overflow: hidden;
}
.notif-module-head {
  font-size: 13px; font-weight: 750; letter-spacing: 0.2px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--hairline);
}
.notif-module-list { padding: 8px; }
.notif-card { margin-bottom: 6px; }
.notif-card .notif-title { font-weight: 650; }
.notif-time { color: var(--text3); font-variant-numeric: tabular-nums; }
.notif-type-icon { border-radius: 9px; }

/* ───────────────────────── 9. 模板中心 / API 用量 ───────────────────────── */
.wft-card { position: relative; overflow: hidden; }
.wft-card::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--grad-primary); opacity: 0;
  transition: opacity .18s;
}
.wft-card:hover::before { opacity: 1; }
.api-usage-kpi { position: relative; }
.api-usage-kpi .num, .api-usage-kpi-value { font-variant-numeric: tabular-nums; }
.api-daily-chart {
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--surface);
}

/* ───────────────────────── 10. 面板进入动效（更顺滑） ───────────────────────── */
.panel.active { animation: pagePolishPanelIn .26s cubic-bezier(.22,.8,.32,1); }
@keyframes pagePolishPanelIn {
  from { opacity: 0; transform: translateY(10px) scale(.996); }
  to   { opacity: 1; transform: none; }
}
