* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "Segoe UI", "PingFang SC", sans-serif; background: #f8f7fc; color: #1f2937; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; background: linear-gradient(90deg, #7c3aed, #8b5cf6); color: #fff; box-shadow: 0 2px 8px rgba(124,58,237,.18); }
.logo { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.logo .logo-icon { cursor: pointer; font-size: 22px; transition: .2s; }
.logo .logo-icon:hover { opacity: .8; }
.logo-sub { font-size: 12px; font-weight: 400; color: rgba(255,255,255,.75); margin-left: 4px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.3); }
.userbox { font-size: 13px; color: rgba(255,255,255,.9); display: flex; align-items: center; gap: 8px; }
.userbox button { margin-left: 6px; }
.userbox .user-label { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credits-badge { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 500; }
.credits-badge b { font-size: 14px; font-weight: 700; color: #fbbf24; }

.auth-wrap { display: flex; justify-content: center; align-items: center; min-height: 70vh; }
.auth-card { background: #fff; padding: 40px 32px; border-radius: 16px; width: 380px; box-shadow: 0 8px 30px rgba(124,58,237,.1); text-align: center; }
.auth-card h2 { margin-bottom: 12px; color: #1f2937; font-size: 20px; }
.auth-state-icon { font-size: 48px; margin-bottom: 16px; }
.auth-state-msg { font-size: 14px; color: #6b7280; margin-bottom: 8px; line-height: 1.6; }
.auth-state-sub { font-size: 12px; color: #9ca3af; margin-bottom: 20px; }
.auth-state-actions { margin-top: 8px; }
.auth-state-actions button { width: 100%; padding: 12px; background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: .2s; }
.auth-state-actions button:hover { opacity: .92; transform: translateY(-1px); }
.auth-state-spinner { width: 48px; height: 48px; border: 4px solid #ede9fe; border-top-color: #8b5cf6; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 20px; }
@keyframes spin { to { transform: rotate(360deg); } }

.dash { padding: 20px 24px; }
.cols { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.panel { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 1px 4px rgba(124,58,237,.06); border: 1px solid #ede9fe; }
.panel.grow { min-height: 520px; }
.panel-left { position: sticky; top: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.panel-head h3 { font-size: 16px; color: #4c1d95; }
.mini { padding: 6px 12px; background: #7c3aed; color: #fff; border: none; border-radius: 7px; cursor: pointer; font-size: 13px; transition: .15s; }
.mini:hover { background: #6d28d9; }
.btn-back { display: block; width: 100%; padding: 9px; margin-top: 12px; background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn-back:hover { background: #ede9fe; }

.brand-form input { width: 100%; padding: 9px; margin-bottom: 8px; border: 1px solid #ddd6fe; border-radius: 7px; font-size: 13px; }
.brand-form input:focus { outline: none; border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,.12); }
.brand-form button { width: 100%; padding: 9px; background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff; border: none; border-radius: 7px; cursor: pointer; }
.brand-form .form-row { display: flex; gap: 8px; }
.brand-form .btn-cancel { background: #9ca3af; }
.brand-form .btn-ai { background: linear-gradient(135deg, #06b6d4, #0891b2); margin-bottom: 8px; }
.brand-form .btn-ai:disabled { background: #9ca3af; cursor: not-allowed; }
.qmodal-tip { margin-top: 8px; font-size: 12px; color: #8b8b9e; line-height: 1.6; }
.check-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #6b7280; margin-bottom: 8px; }
.check-label input { width: auto; margin: 0; }
.form-row button { flex: 1; }

.brand-list { list-style: none; max-height: 400px; overflow-y: auto; }
.brand-list li { border: 1px solid #ede9fe; border-radius: 9px; margin-bottom: 9px; transition: .15s; }
.brand-list li:hover, .brand-list li.active { border-color: #8b5cf6; background: #f5f3ff; }
.brand-row { display: flex; align-items: center; }
.brand-info { flex: 1; padding: 12px; cursor: pointer; }
.brand-actions { display: flex; gap: 4px; padding-right: 10px; }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 16px; padding: 6px; border-radius: 6px; transition: .15s; }
.icon-btn:hover { background: #f3f4f6; }
.icon-btn.del:hover { background: #fef2f2; }
.brand-list .bn { font-weight: 600; }
.brand-list .bi { font-size: 12px; color: #6b7280; }

/* Tab */
.tab-bar { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid #ede9fe; overflow-x: auto; }
.tab { padding: 10px 16px; background: none; border: none; cursor: pointer; font-size: 13px; font-weight: 600; color: #6b7280; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tab.active { color: #7c3aed; border-bottom-color: #7c3aed; }
.tab-panel { min-height: 400px; }

.board .empty { color: #9ca3af; text-align: center; margin-top: 80px; }
.score-card { display: flex; gap: 24px; align-items: center; background: linear-gradient(135deg, #f5f3ff, #ede9fe); border-radius: 12px; padding: 20px; margin-bottom: 16px; border: 1px solid #ddd6fe; }
.score-big { font-size: 52px; font-weight: 800; color: #5b21b6; }
.grade { padding: 5px 14px; border-radius: 999px; background: #f5f3ff; color: #7c3aed; font-weight: 700; }
.grade-poor { background: #fef2f2; color: #dc2626; }
.grade-ok { background: #fef3c7; color: #d97706; }
.grade-good { background: #dbeafe; color: #2563eb; }
.grade-great { background: #f5f3ff; color: #7c3aed; }
.metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 16px; }
.metric { background: #fff; border-radius: 10px; padding: 14px; text-align: center; cursor: pointer; transition: .15s; border: 1px solid #ede9fe; }
.metric:hover { background: #f5f3ff; transform: translateY(-1px); border-color: #ddd6fe; }
.metric b { display: block; font-size: 22px; color: #7c3aed; }
.metric span { font-size: 12px; color: #6b7280; }
.row-actions { margin: 10px 0 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.row-actions button { padding: 9px 16px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; }
.btn-scan { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff; }
.btn-report { background: #7c3aed; color: #fff; }
.btn-download { background: #3b82f6; color: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border: 1px solid #e5e7eb; padding: 8px; text-align: left; }
th { background: #f9fafb; }
.badge-y { color: #059669; font-weight: 700; }
.badge-n { color: #9ca3af; }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.msg-ok { background: #ecfdf5; color: #059669; }
.msg-err { background: #fef2f2; color: #dc2626; }

/* Dashboard 总览 */
.overview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.overview-full { grid-column: 1 / -1; }
.ov-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.ov-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.ov-stat { text-align: center; padding: 18px 12px; background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.ov-stat .num { font-size: 32px; font-weight: 800; color: #5b21b6; }
.ov-stat .lbl { font-size: 13px; color: #6b7280; margin-top: 4px; }
.ov-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.ov-table td { padding: 10px 12px; }
.ov-table .tag-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #ede9fe; color: #7c3aed; font-size: 11px; margin: 1px 2px; }
.ov-grade-dist { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.ov-grade-dist span { padding: 6px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; }

/* 竞品对标 */
.comp-empty { text-align: center; margin-top: 60px; }
.comp-empty .bi { margin-top: 12px; }
.comp-layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; margin-bottom: 20px; }
.comp-radar { background: #f8fafc; border-radius: 12px; padding: 16px; display: flex; justify-content: center; }
.comp-side { display: flex; flex-direction: column; gap: 12px; }
.gap-box { padding: 16px; border-radius: 10px; background: #f3f4f6; font-size: 14px; font-weight: 600; }
.gap-pos { background: #ecfdf5; color: #059669; }
.gap-neg { background: #fef2f2; color: #dc2626; }
.comp-legend { display: flex; flex-direction: column; gap: 6px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-item .dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.comp-table { font-size: 13px; }
.comp-table .comp-main { background: #ecfdf5; font-weight: 600; }
.comp-table td b { color: #5b21b6; font-size: 15px; }

/* 趋势 */
.trend-chart-wrap { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.trend-chart-wrap h4 { font-size: 15px; margin-bottom: 12px; color: #374151; }
.trend-deltas { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }
.trend-delta { background: #f3f4f6; border-radius: 10px; padding: 14px; text-align: center; }
.trend-delta b { font-size: 20px; display: block; }
.trend-delta .up { color: #059669; }
.trend-delta .down { color: #dc2626; }
.trend-delta span { font-size: 12px; color: #6b7280; }

/* 优化建议 */
.sugg-list { display: flex; flex-direction: column; gap: 12px; }
.sugg-item { background: #fff; border-radius: 10px; padding: 16px 18px; border-left: 4px solid #e5e7eb; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.sugg-critical { border-left-color: #dc2626; background: #fef2f2; }
.sugg-high { border-left-color: #f59e0b; background: #fffbeb; }
.sugg-medium { border-left-color: #3b82f6; background: #eff6ff; }
.sugg-low { border-left-color: #10b981; background: #ecfdf5; }
.sugg-dim { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #f3f4f6; color: #6b7280; margin-right: 8px; font-weight: 600; }
.sugg-text { font-size: 14px; color: #374151; line-height: 1.6; margin-top: 6px; }
.sugg-score { font-size: 12px; color: #9ca3af; }

/* 关键词管理 */
.kw-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.kw-bar input { flex: 1; padding: 9px 12px; border: 1px solid #ddd6fe; border-radius: 7px; font-size: 13px; }
.kw-bar input:focus { outline: none; border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,.12); }
.kw-bar button { padding: 9px 16px; background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff; border: none; border-radius: 7px; cursor: pointer; font-weight: 600; }
.kw-list { display: flex; flex-direction: column; gap: 8px; }
.kw-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: #f9fafb; border-radius: 8px; border: 1px solid #e5e7eb; }
.kw-row .kw-word { font-weight: 600; font-size: 14px; }
.kw-row .kw-stats { font-size: 12px; color: #6b7280; }
.kw-row .kw-actions button { background: none; border: none; cursor: pointer; padding: 4px 8px; font-size: 14px; }
.kw-row .kw-actions button:hover { background: #fef2f2; border-radius: 6px; }
.kw-sync { margin-top: 14px; }
.kw-sync button { padding: 8px 16px; background: #3b82f6; color: #fff; border: none; border-radius: 7px; cursor: pointer; font-size: 13px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; justify-content: center; align-items: center; z-index: 100; }
.modal-card { background: #fff; padding: 24px; border-radius: 12px; width: 360px; box-shadow: 0 8px 30px rgba(0,0,0,.15); }
.modal-card h3 { margin-bottom: 16px; }
.modal-card input { width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid #d1d5db; border-radius: 7px; font-size: 14px; }
.modal-card .form-row { display: flex; gap: 8px; }
.modal-card .form-row button { flex: 1; padding: 10px; border: none; border-radius: 7px; cursor: pointer; font-weight: 600; }
.modal-card .form-row button:first-child { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff; }
.modal-card .btn-cancel { background: #9ca3af; color: #fff; }

/* 导航栏 */
.nav-bar { display: flex; gap: 4px; padding: 10px 24px; background: #fff; border-bottom: 1px solid #ede9fe; }
.nav-btn { padding: 8px 20px; background: none; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; color: #6b7280; transition: .2s; }
.nav-btn:hover { background: #f5f3ff; color: #5b21b6; }
.nav-btn.active { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff; }

/* AI 平台面板 */
.platform-summary { margin-bottom: 18px; }
.summary-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.summary-card { background: #f5f3ff; border-radius: 10px; padding: 16px; text-align: center; }
.summary-card b { display: block; font-size: 28px; color: #5b21b6; }
.summary-card.s-green { background: #f5f3ff; } .summary-card.s-green b { color: #7c3aed; }
.summary-card.s-yellow { background: #fef3c7; } .summary-card.s-yellow b { color: #d97706; }
.summary-card.s-blue { background: #eff6ff; } .summary-card.s-blue b { color: #2563eb; }

.platform-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.platform-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; transition: .2s; }
.platform-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.platform-card.pf-cfg-no { opacity: 0.75; }
.pf-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 8px; }
.pf-name { font-size: 16px; font-weight: 700; }
.pf-code { font-size: 11px; color: #9ca3af; background: #f3f4f6; padding: 2px 8px; border-radius: 4px; font-family: monospace; }
.pf-body { padding: 0 16px 12px; }
.pf-model { font-size: 12px; color: #6b7280; margin-bottom: 8px; }
.pf-status { display: flex; gap: 12px; font-size: 12px; margin-bottom: 6px; }
.pf-cfg { font-weight: 600; }
.pf-cfg-yes .pf-cfg { color: #059669; }
.pf-cfg-no .pf-cfg { color: #9ca3af; }
.pf-health { color: #6b7280; }
.pf-quota { font-size: 11px; color: #6b7280; margin-top: 4px; }
.pf-doc { display: inline-block; font-size: 12px; color: #3b82f6; text-decoration: none; margin-top: 4px; }
.pf-doc:hover { text-decoration: underline; }
.pf-footer { padding: 8px 16px; background: #fafafa; border-top: 1px solid #f3f4f6; font-size: 11px; color: #9ca3af; }

/* ========== Phase 1: 规划首页新样式 ========== */

/* Hero 总览卡 */
.hero-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 12px; }
.hero-card { background: #fff; border-radius: 14px; padding: 22px 20px; position: relative; overflow: hidden; box-shadow: 0 1px 4px rgba(124,58,237,.06); transition: .2s; cursor: default; border: 1px solid #ede9fe; }
.hero-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(124,58,237,.12); }
.hero-card::before { content:""; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.hc-brands::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.hc-scans::before { background: linear-gradient(90deg, #7c3aed, #8b5cf6); }
.hc-aivo::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.hc-health::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.hc-icon { font-size: 22px; margin-bottom: 4px; }
.hc-num { font-size: 32px; font-weight: 800; color: #5b21b6; line-height: 1.1; }
.hc-label { font-size: 13px; color: #6b7280; margin-top: 2px; }
.hc-sub { font-size: 11px; color: #9ca3af; margin-top: 2px; }

/* Sparkline 趋势小图 */
.sparkline-row { background: #fff; border-radius: 14px; padding: 12px 20px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(124,58,237,.06); display: flex; align-items: center; gap: 16px; border: 1px solid #ede9fe; }
.sparkline-row canvas { flex: 1; max-height: 60px; }
.sparkline-label { font-size: 12px; color: #6b7280; white-space: nowrap; }

/* 通知中心 Bell */
.notif-bell { position: fixed; top: 14px; right: 260px; z-index: 50; cursor: pointer; font-size: 22px; padding: 6px 10px; background: rgba(255,255,255,.2); border-radius: 50%; transition: .2s; }
.notif-bell:hover { background: rgba(255,255,255,.35); }
.bell-count { position: absolute; top: -2px; right: -2px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 999px; padding: 0 4px; }
.notif-panel { position: fixed; top: 54px; right: 60px; width: 380px; max-height: 480px; background: #fff; border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.15); z-index: 60; overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid #e5e7eb; font-weight: 600; }
.notif-list { max-height: 400px; overflow-y: auto; }
.notif-item { padding: 12px 18px; border-bottom: 1px solid #f3f4f6; cursor: pointer; transition: .15s; font-size: 13px; }
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #eff6ff; border-left: 3px solid #3b82f6; }
.notif-item .nf-time { font-size: 11px; color: #9ca3af; }
.notif-item .nf-type { font-size: 11px; padding: 1px 6px; border-radius: 4px; margin-right: 6px; font-weight: 600; }
.nf-scan { background: #ecfdf5; color: #059669; }
.nf-alert { background: #fef2f2; color: #dc2626; }
.nf-change { background: #fef3c7; color: #d97706; }
.nf-system { background: #f3f4f6; color: #6b7280; }

/* 首页两列布局 */
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.home-left, .home-right { display: flex; flex-direction: column; gap: 16px; }
.home-card { background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 1px 4px rgba(124,58,237,.06); border: 1px solid #ede9fe; }
.home-card h4 { font-size: 15px; margin-bottom: 14px; color: #4c1d95; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card-head h4 { margin-bottom: 0; }
.card-badge { font-size: 11px; padding: 3px 10px; border-radius: 999px; background: #ede9fe; color: #7c3aed; font-weight: 600; }
.card-tabs { display: flex; gap: 2px; background: #f5f3ff; border-radius: 8px; padding: 2px; }
.ctab { padding: 5px 12px; border: none; background: none; border-radius: 6px; cursor: pointer; font-size: 12px; color: #6b7280; font-weight: 600; transition: .15s; }
.ctab.active { background: #fff; color: #5b21b6; box-shadow: 0 1px 2px rgba(124,58,237,.1); }

/* 快捷操作 */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qa-btn { padding: 12px 14px; border: none; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600; transition: .2s; }
.qa-btn:hover { transform: translateY(-1px); }
.qa-scan { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff; }
.qa-add { background: linear-gradient(135deg, #a78bfa, #8b5cf6); color: #fff; }
.qa-report { background: #7c3aed; color: #fff; }
.qa-platform { background: #f5f3ff; color: #5b21b6; }

/* 排行榜 */
.lb-list { max-height: 360px; overflow-y: auto; }
.lb-item { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid #f3f4f6; cursor: pointer; transition: .15s; }
.lb-item:hover { background: #f8fafc; padding-left: 6px; border-radius: 6px; }
.lb-rank { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; margin-right: 12px; flex-shrink: 0; }
.lb-r1 { background: #ede9fe; color: #7c3aed; }  .lb-r2 { background: #f5f3ff; color: #8b5cf6; } .lb-r3 { background: #fef2f2; color: #dc2626; }
.lb-rn { background: #f9fafb; color: #9ca3af; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-meta { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.lb-score { text-align: right; flex-shrink: 0; }
.lb-score .lb-num { font-size: 18px; font-weight: 800; color: #5b21b6; }
.lb-score .lb-grade { font-size: 11px; padding: 1px 8px; border-radius: 999px; }
.lb-empty { color: #9ca3af; font-size: 14px; padding: 30px 0; text-align: center; }

/* AIVO 进度条（排行榜内） */
.lb-bar-wrap { margin-top: 4px; }
.lb-bar { height: 5px; border-radius: 3px; background: #f3f4f6; overflow: hidden; }
.lb-bar-fill { height: 100%; border-radius: 3px; transition: width .4s; }
.lb-bar-great { background: #8b5cf6; }
.lb-bar-good { background: #3b82f6; }
.lb-bar-ok { background: #f59e0b; }
.lb-bar-poor { background: #ef4444; }

/* 等级分布条 */
.grade-bars { display: flex; flex-direction: column; gap: 10px; }
.grade-bar-item { display: flex; align-items: center; gap: 10px; }
.gbi-label { width: 56px; font-size: 13px; font-weight: 600; color: #374151; text-align: right; }
.gbi-bar { flex: 1; height: 10px; border-radius: 5px; background: #f5f3ff; overflow: hidden; }
.gbi-fill { height: 100%; border-radius: 5px; transition: width .5s; }
.gb-great { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.gb-good { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.gb-ok { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.gb-poor { background: linear-gradient(90deg, #ef4444, #f87171); }
.gbi-count { width: 30px; font-size: 14px; font-weight: 700; text-align: right; color: #5b21b6; }

/* 系统健康面板 */
.health-dots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.health-dot-item { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #f9fafb; border-radius: 8px; font-size: 12px; }
.health-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.health-dot.healthy { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,.4); }
.health-dot.unhealthy { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,.4); }
.health-dot.unknown { background: #9ca3af; }

/* 雷达图容器 */
.radar-wrap { display: flex; justify-content: center; padding: 8px 0; }
.radar-wrap canvas { max-width: 100%; }

/* 租户用量 */
.usage-bars { display: flex; flex-direction: column; gap: 12px; }
.usage-row { display: flex; align-items: center; gap: 12px; }
.usage-label { width: 60px; font-size: 12px; color: #6b7280; text-align: right; }
.usage-bar-wrap { flex: 1; height: 8px; border-radius: 4px; background: #f5f3ff; overflow: hidden; }
.usage-bar-fill { height: 100%; border-radius: 4px; transition: width .5s; }
.usage-bar-fill.low { background: #8b5cf6; }
.usage-bar-fill.mid { background: #f59e0b; }
.usage-bar-fill.high { background: #ef4444; }
.usage-pct { min-width: 42px; font-size: 12px; font-weight: 700; text-align: right; }

/* 批量扫描浮窗 */
.qmodal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100; display: flex; align-items: center; justify-content: center; }
.qmodal { background: #fff; border-radius: 16px; padding: 28px; width: 480px; max-height: 80vh; overflow-y: auto; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.qmodal h3 { margin-bottom: 16px; }
.qmodal .brand-check-list { max-height: 300px; overflow-y: auto; margin-bottom: 16px; }
.qmodal .bcl-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f3f4f6; font-size: 14px; }
.qmodal .bcl-item input { width: auto; }
.qmodal .qmodal-actions { display: flex; gap: 8px; }
.qmodal .qmodal-actions button { flex: 1; padding: 10px; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; }
.qmodal .btn-primary { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff; }
.qmodal .btn-cancel { background: #9ca3af; color: #fff; }

/* 新建品牌浮窗 */
.quick-add-form { display: flex; flex-direction: column; gap: 8px; }
.quick-add-form input { padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; }

/* 扫描进度条 */
.scan-progress-wrap { padding: 20px; }
.sp-header { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: #374151; }
.sp-bar-wrap { height: 8px; border-radius: 4px; background: #f3f4f6; overflow: hidden; margin-bottom: 12px; }
.sp-bar { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #8b5cf6, #7c3aed); transition: width 0.3s ease; width: 0%; }
.sp-bar.querying { animation: sp-pulse 1.5s ease-in-out infinite; }
@keyframes sp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.sp-info { font-size: 13px; color: #6b7280; margin-bottom: 8px; }
.sp-platform { font-size: 12px; color: #6b7280; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sp-platform-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; background: #f3f4f6; border-radius: 6px; font-size: 11px; color: #4b5563; border: 1px solid #e5e7eb; }
.sp-results { max-height: 200px; overflow-y: auto; font-size: 12px; }
.sp-result-row { padding: 4px 0; border-bottom: 1px solid #f3f4f6; }

/* 扫描完成面板 */
.sp-complete-panel { margin-top: 16px; }
.sp-complete-header { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.sp-complete-stat { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px; text-align: center; }
.sp-complete-stat--aivo { border-color: #99f6e4; background: #f0fdfa; }
.sp-complete-stat-value { font-size: 24px; font-weight: 700; line-height: 1.1; }
.sp-complete-stat-label { font-size: 12px; color: #6b7280; margin-top: 4px; }
.sp-complete-platforms { display: flex; flex-direction: column; gap: 14px; }
.sp-complete-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; }
.sp-complete-card-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #f8fafc; border-bottom: 1px solid #f1f5f9; }
.sp-complete-card-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #1e293b; }
.sp-complete-card-icon { font-size: 16px; }
.sp-complete-card-meta { display: flex; gap: 8px; align-items: center; }
.sp-complete-card-tag { font-size: 11px; padding: 2px 8px; background: #f1f5f9; color: #475569; border-radius: 6px; }
.sp-complete-card-bar { height: 4px; background: #f1f5f9; margin: 0 16px; margin-top: 10px; border-radius: 2px; overflow: hidden; }
.sp-complete-card-bar-fill { height: 100%; border-radius: 2px; transition: width 0.8s ease; }
.sp-complete-details { padding: 10px 16px; max-height: 200px; overflow-y: auto; }
.sp-complete-detail-row { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f1f5f9; font-size: 12px; }
.sp-complete-detail-row:last-child { border-bottom: none; }
.sp-complete-detail-icon { flex-shrink: 0; font-size: 12px; margin-top: 1px; }
.sp-complete-detail-keyword { font-weight: 600; color: #334155; min-width: 80px; flex-shrink: 0; }
.sp-complete-detail-sentiment { flex-shrink: 0; font-size: 11px; padding: 1px 6px; border-radius: 4px; font-weight: 500; }
.sp-sentiment--pos { background: #d1fae5; color: #065f46; }
.sp-sentiment--neg { background: #fee2e2; color: #991b1b; }
.sp-sentiment--neu { background: #f3f4f6; color: #475569; }
.sp-complete-detail-context { color: #64748b; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 768px) {
  .sp-complete-header { grid-template-columns: repeat(2, 1fr); }
  .sp-complete-card-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 优化方案卡片 */
.plan-hero { display: flex; justify-content: space-between; align-items: flex-start; background: linear-gradient(135deg, #f5f3ff, #ede9fe); border-radius: 12px; padding: 20px; margin-bottom: 16px; gap: 16px; border: 1px solid #ddd6fe; }
.ph-title { font-size: 18px; font-weight: 700; color: #5b21b6; }
.ph-summary { font-size: 13px; color: #6b7280; margin-top: 4px; }
.ph-right { display: flex; gap: 12px; flex-shrink: 0; }
.ph-stat { text-align: center; padding: 8px 14px; background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(124,58,237,.08); }
.ph-stat b { display: block; font-size: 20px; color: #7c3aed; }
.plan-progress-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.ppb-track { flex: 1; height: 6px; border-radius: 3px; background: #f5f3ff; overflow: hidden; }
.ppb-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #8b5cf6, #7c3aed); transition: width .5s; }
.ppb-label { font-size: 12px; color: #6b7280; white-space: nowrap; }
.plan-stages { display: flex; gap: 8px; margin-bottom: 16px; }
.ps-item { padding: 6px 14px; background: #f5f3ff; border-radius: 8px; font-size: 12px; color: #6b7280; }
.ps-item b { color: #5b21b6; }
.plan-task { background: #fff; border: 1px solid #ede9fe; border-radius: 10px; padding: 16px; margin-bottom: 10px; border-left: 4px solid #ede9fe; }
.task-quick_win { border-left-color: #8b5cf6; }
.task-mid_term { border-left-color: #f59e0b; }
.task-long_term { border-left-color: #7c3aed; }
.task-status-completed { opacity: .6; background: #f9fafb; }
.pt-header { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.pt-stage { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.pt-diff { font-size: 11px; color: #6b7280; }
.pt-gain { font-size: 12px; font-weight: 700; color: #7c3aed; margin-left: auto; }
.pt-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; color: #1f2937; }
.pt-desc { font-size: 12px; color: #6b7280; margin-bottom: 8px; }
.pt-steps ol { padding-left: 18px; font-size: 12px; color: #6b7280; }
.pt-steps li { margin: 3px 0; }
.pt-footer { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 11px; color: #9ca3af; padding-top: 8px; border-top: 1px solid #f5f3ff; }

/* 路线图 */
.roadmap-timeline { display: flex; flex-direction: column; gap: 16px; }
.rm-stage { padding: 14px; background: #f9fafb; border-radius: 10px; border: 1px solid #e5e7eb; }
.rms-header { font-size: 14px; font-weight: 600; margin-bottom: 8px; display: flex; justify-content: space-between; }
.rm-task { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid #f3f4f6; font-size: 13px; }

/* ===== 竞品声量份额 Share of Voice ===== */
.sov-card { margin: 14px 0; padding: 16px 18px; background: #fff; border: 1px solid #ede9fe;
  border-left: 4px solid #8b5cf6; border-radius: 12px; box-shadow: 0 1px 4px rgba(124,58,237,.06); }
.sov-unmeasurable { border-left-color: #f59e0b; }
.sov-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sov-title { font-size: 15px; font-weight: 700; color: #374151; }
.sov-badge { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 20px; }
.sov-badge-good { background: #dcfce7; color: #15803d; }
.sov-badge-warn { background: #fef3c7; color: #b45309; }
.sov-badge-bad  { background: #fee2e2; color: #b91c1c; }
.sov-summary { font-size: 13px; color: #4b5563; margin-bottom: 12px; }
.sov-up { color: #15803d; font-size: 16px; }
.sov-down { color: #b91c1c; font-size: 16px; }
.sov-bars { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.sov-row { display: grid; grid-template-columns: 140px 1fr 40px; align-items: center; gap: 10px; }
.sov-row-me .sov-name { font-weight: 700; color: #7c3aed; }
.sov-name { font-size: 13px; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sov-bar-wrap { background: #f3f4f6; border-radius: 6px; height: 16px; overflow: hidden; }
.sov-bar { height: 100%; background: linear-gradient(90deg, #cbd5e1, #94a3b8); border-radius: 6px; transition: width .4s ease; }
.sov-bar-me { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }
.sov-hits { font-size: 13px; font-weight: 600; color: #6b7280; text-align: right; }
.sov-kw { font-size: 12px; color: #6b7280; margin: 6px 0; line-height: 1.9; }
.sov-kw code { background: #f5f3ff; color: #6d28d9; padding: 2px 7px; border-radius: 4px;
  margin-right: 5px; font-size: 12px; display: inline-block; }
.sov-reason { font-size: 13px; color: #92400e; margin-bottom: 6px; }
.sov-tip { font-size: 12px; color: #9ca3af; margin-top: 8px; line-height: 1.7; }
.sov-scope { font-size: 11px; color: #b0b7c3; margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed #e5e7eb; line-height: 1.6; }

@media (max-width: 768px) {
  .sov-row { grid-template-columns: 90px 1fr 32px; gap: 6px; }
  .sov-name { font-size: 12px; }
}

/* Responsive */
@media (max-width: 768px) {
  .cols { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: 1fr; }
  .ov-stats { grid-template-columns: repeat(2, 1fr); }
  .comp-layout { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2,1fr); }
  .trend-deltas { grid-template-columns: repeat(2,1fr); }
  .panel-left { position: static; }
  .summary-row { grid-template-columns: repeat(2, 1fr); }
  .platform-cards { grid-template-columns: 1fr; }
  .hero-cards { grid-template-columns: repeat(2, 1fr); }
  .home-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .health-dots { grid-template-columns: repeat(2, 1fr); }
  .notif-panel { width: 320px; right: 10px; }
  .notif-bell { right: 120px; }
}

/* ══════ 任务产出 Markdown 预览（P0：执行结果可回看） ══════ */
#mdBody h1, #mdBody h2, #mdBody h3, #mdBody h4, #mdBody h5, #mdBody h6 { margin: 18px 0 10px; line-height: 1.35; color: #111827; }
#mdBody h1 { font-size: 22px; } #mdBody h2 { font-size: 19px; } #mdBody h3 { font-size: 16px; }
#mdBody h4, #mdBody h5, #mdBody h6 { font-size: 14px; }
#mdBody p { margin: 10px 0; }
#mdBody ul { margin: 10px 0; padding-left: 22px; }
#mdBody li { margin: 5px 0; }
#mdBody blockquote { margin: 10px 0; padding: 8px 14px; background: #f9fafb; border-left: 3px solid #d1d5db; color: #6b7280; }
#mdBody code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; }
#mdBody pre { background: #0f172a; color: #e5e7eb; padding: 14px 16px; border-radius: 8px; overflow: auto; font-size: 12.5px; font-family: ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; }
#mdBody hr { margin: 18px 0; border: 0; border-top: 1px solid #e5e7eb; }
#mdBody strong { font-weight: 600; }
