/* creator-dashboard 数据看板 v2 — 贴近官方创作者后台 */
.cd-page { padding: 24px 28px 48px; color: #1f2937; background: #f5f6f8; min-height: 100%; }
.cd-page-head { margin-bottom: 20px; }
.cd-page-title { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.cd-page-desc { font-size: 13px; color: #6b7280; margin: 0; }

.cd-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.cd-card-select { min-width: 220px; padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 14px; background: #fff; }
.cd-period { display: inline-flex; background: #eef2ff; border-radius: 8px; padding: 3px; }
.cd-period button { border: 0; background: transparent; padding: 6px 14px; font-size: 13px; color: #6b7280; cursor: pointer; border-radius: 6px; }
.cd-period button.is-active { background: #fff; color: #3b82f6; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.cd-tab { display: inline-flex; gap: 4px; margin-left: auto; }
.cd-tab button { border: 1px solid #e5e7eb; background: #fff; padding: 7px 16px; font-size: 13px; color: #374151; cursor: pointer; border-radius: 8px; }
.cd-tab button.is-active { background: #fff5f6; border-color: #ff2442; color: #ff2442; font-weight: 600; }

.cd-loading { padding: 60px; text-align: center; color: #9ca3af; font-size: 14px; }
.cd-error { padding: 32px; text-align: center; color: #dc2626; background: #fef2f2; border-radius: 12px; }
.cd-empty { padding: 48px; text-align: center; color: #9ca3af; font-size: 14px; }
.cd-empty-sm { padding: 24px; text-align: center; color: #9ca3af; font-size: 13px; }

/* 面板 */
.cd-panel { background: #fff; border-radius: 14px; padding: 20px 24px; box-shadow: 0 1px 3px rgba(0,0,0,.05); margin-bottom: 16px; }
.cd-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.cd-sec-bar { display: inline-block; width: 3px; height: 16px; background: #3b82f6; border-radius: 2px; margin-right: 8px; vertical-align: middle; }
.cd-sec-title { font-size: 16px; font-weight: 600; margin: 0; display: inline; vertical-align: middle; }
.cd-sec-title.inline { margin-bottom: 14px; }

/* 账号诊断 */
.cd-diag-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .cd-diag-layout { grid-template-columns: 1fr; } }
.cd-diag-chart { text-align: center; }
.cd-chart-legend { display: flex; justify-content: center; gap: 20px; font-size: 12px; color: #6b7280; margin-bottom: 8px; }
.cd-chart-legend .sq { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.cd-chart-legend .sq.blue { background: #3b82f6; }
.cd-chart-legend .sq.pink { background: #fda4af; }
.cd-radar-svg { max-width: 300px; width: 100%; height: auto; }
.cd-diag-list { border-left: 1px solid #f3f4f6; padding-left: 16px; }
.cd-diag-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px dashed #f3f4f6; font-size: 13px; line-height: 1.5; }
.cd-diag-row:last-child { border-bottom: 0; }
.cd-diag-text { flex: 1; color: #374151; }
.cd-tip-link { border: 0; background: none; color: #3b82f6; font-size: 13px; cursor: pointer; white-space: nowrap; padding: 0; }
.cd-tip-link:hover { text-decoration: underline; }

/* 子 Tab */
.cd-subtabs { display: inline-flex; gap: 4px; background: #f3f4f6; border-radius: 8px; padding: 3px; }
.cd-subtab { border: 0; background: transparent; padding: 6px 14px; font-size: 13px; color: #6b7280; cursor: pointer; border-radius: 6px; }
.cd-subtab.is-active { background: #fff; color: #111827; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* KPI 卡（官方 6 卡横排） */
.cd-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cd-kpi { background: #fff; border: 1px solid #f3f4f6; border-radius: 10px; padding: 14px 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.cd-kpi:hover { border-color: #dbeafe; }
.cd-kpi.is-active { border-color: #3b82f6; box-shadow: 0 0 0 1px #3b82f6; }
.cd-kpi .name { font-size: 12px; color: #6b7280; margin-bottom: 6px; }
.cd-kpi .num { font-size: 22px; font-weight: 700; color: #111827; }
.cd-kpi .sub { font-size: 11px; color: #9ca3af; margin-top: 4px; }
.cd-kpi .delta { font-size: 12px; margin-top: 4px; color: #9ca3af; }
.cd-kpi .delta.up { color: #16a34a; }
.cd-kpi .delta.down { color: #dc2626; }
.cd-badge { display: inline-block; font-size: 10px; background: #dbeafe; color: #2563eb; padding: 1px 6px; border-radius: 4px; margin-left: 4px; vertical-align: middle; }

/* 趋势 */
.cd-trend-block { margin-top: 8px; }
.cd-trend-tabs { display: inline-flex; gap: 4px; }
.cd-trend-tab { border: 0; background: #f3f4f6; padding: 5px 12px; font-size: 12px; border-radius: 6px; cursor: pointer; color: #6b7280; }
.cd-trend-tab.is-active { background: #eff6ff; color: #2563eb; font-weight: 600; }
.cd-chart-svg, .cd-vbar-svg, .cd-hour-svg { width: 100%; height: auto; max-height: 260px; }

/* 双列小图 */
.cd-split-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #f3f4f6; }
@media (max-width: 720px) { .cd-split-charts { grid-template-columns: 1fr; } }
.cd-mini-chart h4 { font-size: 14px; font-weight: 600; margin: 0 0 12px; color: #374151; }

/* 环形图 */
.cd-donut-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cd-donut-svg { width: 140px; height: 140px; flex-shrink: 0; }
.cd-donut-legs { flex: 1; min-width: 120px; }
.cd-donut-leg { font-size: 12px; color: #374151; margin-bottom: 6px; }
.cd-donut-leg i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

/* 横条 */
.cd-hbar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; }
.cd-hbar-row .ttl { width: 48px; color: #6b7280; flex-shrink: 0; }
.cd-hbar-row .track { flex: 1; height: 8px; background: #f3f4f6; border-radius: 4px; overflow: hidden; }
.cd-hbar-row .fill { display: block; height: 100%; border-radius: 4px; }
.cd-hbar-row .pct { width: 36px; text-align: right; font-weight: 600; color: #374151; }

/* 兴趣气泡 */
.cd-bubble-cloud { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 120px; }
.cd-bubble { display: inline-block; background: #eff6ff; color: #2563eb; padding: 6px 14px; border-radius: 20px; white-space: nowrap; }

/* 粉丝概览 */
.cd-fans-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.cd-fans-stat { padding: 12px 0; }
.cd-fans-stat .lbl { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.cd-fans-stat .val { font-size: 26px; font-weight: 700; color: #111827; }
.cd-fans-stat.up .val { color: #ca8a04; }
.cd-fans-stat.down .val { color: #6b7280; }

/* 画像四象限 */
.cd-portrait-quad { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .cd-portrait-quad { grid-template-columns: 1fr; } }
.cd-portrait-cell { border: 1px solid #f3f4f6; border-radius: 12px; padding: 16px; min-height: 180px; }
.cd-portrait-cell h4 { font-size: 14px; font-weight: 600; margin: 0 0 12px; color: #374151; }

/* 内容分析顶栏 */
.cd-content-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.cd-main-tabs span { font-size: 15px; font-weight: 600; margin-right: 20px; color: #9ca3af; cursor: default; }
.cd-main-tabs span.is-active { color: #111827; border-bottom: 2px solid #ff2442; padding-bottom: 4px; }
.cd-main-tabs span.muted { opacity: .6; }

/* 表格 */
.cd-table-wrap { overflow-x: auto; }
.cd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cd-table th { text-align: right; padding: 8px 10px; font-size: 12px; color: #6b7280; font-weight: 600; border-bottom: 1px solid #f3f4f6; white-space: nowrap; }
.cd-table th:first-child, .cd-table th:nth-child(2) { text-align: left; }
.cd-table td { padding: 10px; border-bottom: 1px solid #f9fafb; text-align: right; white-space: nowrap; }
.cd-table td:first-child, .cd-table td:nth-child(2) { text-align: left; }
.cd-table-cover { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; }
.cd-note-row { cursor: pointer; }
.cd-note-row:hover { background: #fafafa; }
.cd-pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 13px; color: #6b7280; }
.cd-page-btn { border: 1px solid #e5e7eb; background: #fff; padding: 6px 14px; border-radius: 6px; cursor: pointer; margin-left: 6px; }
.cd-page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* 笔记详情弹窗 */
.cd-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 24px; }
.cd-modal { background: #fff; border-radius: 14px; max-width: 960px; width: 100%; max-height: 92vh; overflow: auto; padding: 24px; }
.cd-modal-close { border: 0; background: #f3f4f6; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; }
.cd-note-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.cd-note-meta { display: flex; gap: 14px; align-items: flex-start; }
.cd-note-cover { width: 88px; height: 88px; border-radius: 8px; object-fit: cover; }
.cd-note-meta h3 { margin: 0 0 6px; font-size: 16px; }
.cd-note-meta .tags { font-size: 12px; color: #3b82f6; margin: 0 0 4px; }
.cd-note-meta .time { font-size: 12px; color: #9ca3af; margin: 0; }
.cd-detail-tabs { display: flex; gap: 0; border-bottom: 1px solid #f3f4f6; margin-bottom: 20px; }
.cd-detail-tab { border: 0; background: none; padding: 10px 18px; font-size: 14px; color: #6b7280; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.cd-detail-tab.is-active { color: #ff2442; border-bottom-color: #ff2442; font-weight: 600; }
.cd-gran { display: inline-flex; gap: 4px; background: #f3f4f6; border-radius: 6px; padding: 2px; margin: 12px 0 4px; }
.cd-gran button { border: 0; background: transparent; padding: 5px 12px; font-size: 12px; border-radius: 4px; cursor: pointer; color: #6b7280; }
.cd-gran button.is-active { background: #fff; color: #111827; font-weight: 600; }
.cd-hint { font-size: 12px; color: #9ca3af; margin: 0 0 8px; }
.cd-source-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.cd-source-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #f3f4f6; font-size: 13px; }

/* 活跃粉丝 */
.cd-active-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 12px; }
.cd-active-item { display: flex; align-items: center; gap: 10px; background: #fafafa; border-radius: 10px; padding: 10px 12px; }
.cd-active-item img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.cd-active-item .nm { font-size: 13px; font-weight: 600; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-active-item .ct { font-size: 11px; color: #9ca3af; }

/* 操作按钮 */
.cd-actions { display: inline-flex; gap: 8px; margin-left: 12px; }
.cd-act-btn { border: 1px solid #e5e7eb; background: #fff; padding: 7px 14px; font-size: 13px; border-radius: 8px; cursor: pointer; color: #374151; }
.cd-act-btn:hover { background: #fff5f6; border-color: #ff2442; color: #ff2442; }

/* 名片聚合 */
.cd-agg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.cd-agg-card { background: #fff; border-radius: 14px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(0,0,0,.06); cursor: pointer; transition: box-shadow .15s; }
.cd-agg-card:hover { box-shadow: 0 4px 12px rgba(255,36,66,.12); }

/* AI 诊断报告 */
.cd-ai-report { font-size: 14px; line-height: 1.7; color: #374151; }
.cd-ai-report h2, .cd-ai-report h3, .cd-ai-report h4 { color: #111827; }
.cd-ai-report ul { padding-left: 20px; margin: 8px 0; }
.cd-ai-report li { margin: 4px 0; }
.cd-ai-report p { margin: 8px 0; }

/* 授权弹窗 */
.cd-auth-modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 24px; }
.cd-auth-box { background: #fff; border-radius: 14px; max-width: 520px; width: 100%; padding: 28px; }
.cd-auth-box h3 { margin: 0 0 12px; font-size: 18px; }
.cd-auth-box p { font-size: 13px; color: #6b7280; line-height: 1.6; margin: 8px 0; }
.cd-auth-box .actions { display: flex; gap: 12px; margin-top: 20px; }
.cd-auth-box .btn-primary { background: #ff2442; color: #fff; border: 0; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.cd-auth-box .btn-ghost { background: #f3f4f6; border: 0; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 14px; }

/* 兼容旧类名 */
.cd-metrics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.cd-metric { background: #fff; border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.cd-metric .name { font-size: 12px; color: #6b7280; margin-bottom: 6px; }
.cd-metric .num { font-size: 22px; font-weight: 700; color: #111827; }
.cd-radar-card { background: #fff; border-radius: 14px; padding: 20px 24px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 18px; }
.cd-chart-card { background: #fff; border-radius: 14px; padding: 20px 24px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 18px; }
.cd-portrait-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 18px; }
.cd-portrait-card { background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.cd-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; }
.cd-bar-row .ttl { width: 64px; color: #6b7280; }
.cd-bar-row .bar-bg { flex: 1; height: 8px; background: #f3f4f6; border-radius: 4px; overflow: hidden; }
.cd-bar-row .bar-fg { height: 100%; background: #ff2442; border-radius: 4px; }
.cd-bar-row .pct { width: 44px; text-align: right; color: #374151; font-weight: 600; }
