/* ============================================================
   陇东企服 GEO 优化系统 - 样式表
   ============================================================ */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --accent: #0ea5e9;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --border: #e2e8f0;
  --bg: #f6f8fc;
  --card: #ffffff;
  --sidebar: #111827;
  --sidebar-text: #cbd5e1;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.04);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex: 0 0 240px; background: var(--sidebar); color: var(--sidebar-text);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 20;
}
.brand { padding: 24px 20px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 38px;
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: 0 4px 14px rgba(79,70,229,.4);
}
.brand-name { font-size: 16px; color: #fff; font-weight: 700; line-height: 1.25; }
.brand-sub { font-size: 11px; color: #64748b; margin-top: 2px; letter-spacing: .3px; }
.nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.nav-label { font-size: 10px; letter-spacing: 1.5px; color: #64748b; padding: 14px 10px 8px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; margin-bottom: 3px;
  border: 0; background: transparent; color: var(--sidebar-text); border-radius: 9px;
  font-size: 13.5px; text-align: left; transition: .18s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.35); }
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; }
.nav-item .badge { margin-left: auto; font-size: 10px; background: rgba(255,255,255,.14); padding: 1px 6px; border-radius: 10px; }
.sidebar-foot { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot a { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #94a3b8; padding: 6px 8px; border-radius: 7px; }
.sidebar-foot a:hover { background: rgba(255,255,255,.06); color: #fff; }
.demo-note { font-size: 10px; color: #64748b; line-height: 1.5; padding: 8px; margin-top: 8px; background: rgba(255,255,255,.04); border-radius: 7px; }

.main { flex: 1; min-width: 0; }
.topbar {
  height: 68px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
  position: sticky; top: 0; z-index: 15;
}
.topbar-left h1 { font-size: 19px; font-weight: 700; letter-spacing: -.2px; }
.topbar-left p { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.domain-pill { display: flex; align-items: center; gap: 7px; background: var(--bg); border: 1px solid var(--border); padding: 7px 12px; border-radius: 20px; font-size: 12px; color: var(--text-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border); background: #fff; color: var(--text-2); border-radius: 9px;
  padding: 8px 14px; font-size: 12.5px; font-weight: 600; transition: .18s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn svg { width: 14px; height: 14px; }
.content { padding: 26px 28px 48px; max-width: 1500px; }
.page { display: none; }
.page.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ---------- Common ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 15px; font-weight: 700; }
.card-head .sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.card-body { padding: 20px; }
.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.section-title { font-size: 14px; font-weight: 700; margin: 26px 0 13px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ''; width: 3px; height: 14px; background: var(--primary); border-radius: 2px; }
.tag { display: inline-flex; align-items: center; font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 600; white-space: nowrap; }
.tag-green { background: var(--success-bg); color: var(--success); }
.tag-amber { background: var(--warning-bg); color: var(--warning); }
.tag-red { background: var(--danger-bg); color: var(--danger); }
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-gray { background: #f1f5f9; color: var(--text-2); }
.muted { color: var(--text-3); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.note-box { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 10px 14px; font-size: 12px; margin-bottom: 18px; display: flex; gap: 8px; align-items: flex-start; }
.note-box svg { flex: 0 0 15px; margin-top: 2px; }

/* ---------- KPI ---------- */
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi::after { content: ''; position: absolute; right: -25px; top: -25px; width: 90px; height: 90px; border-radius: 50%; background: var(--primary-light); opacity: .6; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.kpi-label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.kpi-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--primary-light); color: var(--primary); display: grid; place-items: center; }
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-value { font-size: 29px; font-weight: 800; letter-spacing: -1px; margin: 12px 0 2px; position: relative; z-index: 1; line-height: 1.2; }
.kpi-value small { font-size: 12px; font-weight: 600; color: var(--text-3); margin-left: 3px; }
.kpi-foot { font-size: 11.5px; display: flex; align-items: center; gap: 6px; position: relative; z-index: 1; }
.up { color: var(--success); font-weight: 700; }
.down { color: var(--danger); font-weight: 700; }

/* ---------- Score ring ---------- */
.score-wrap { display: flex; align-items: center; gap: 28px; }
.ring { position: relative; width: 148px; height: 148px; flex: 0 0 148px; }
.ring svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #eef2f7; stroke-width: 12; }
.ring-fg { fill: none; stroke: url(#ringGrad); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-num { font-size: 38px; font-weight: 800; letter-spacing: -2px; line-height: 1; }
.ring-label { font-size: 11px; color: var(--text-3); margin-top: 5px; }
.dim-list { flex: 1; min-width: 0; }
.dim { margin-bottom: 12px; }
.dim:last-child { margin-bottom: 0; }
.dim-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.dim-head strong { font-weight: 600; }
.dim-head span { color: var(--text-3); font-size: 11px; }
.bar { display: block; height: 6px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #6366f1, #0ea5e9); }
.bar-fill.warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-fill.bad { background: linear-gradient(90deg, #ef4444, #f87171); }

/* ---------- Trend chart ---------- */
.chart-box { position: relative; height: 190px; margin-top: 6px; }
.chart-box svg { width: 100%; height: 100%; overflow: visible; }
.grid-line { stroke: #eef2f7; stroke-width: 1; }
.axis-text { font-size: 10px; fill: var(--text-3); }
.area-path { fill: url(#areaGrad); }
.line-path { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.dot-circle { fill: #fff; stroke: var(--primary); stroke-width: 2.5; }
.dot-circle.last { fill: var(--primary); r: 5; }
.chart-tip { font-size: 11px; fill: var(--text-2); font-weight: 700; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; }
th { font-size: 11px; color: var(--text-3); font-weight: 700; text-align: left; padding: 11px 14px; background: #f8fafc; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; font-size: 12.5px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbff; }
.table-wrap { overflow-x: auto; }
.cell-title { font-weight: 600; color: var(--text); display: block; }
.cell-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.cell-link { color: var(--primary); font-size: 11px; }
.cell-link:hover { text-decoration: underline; }
.filter-bar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.search { position: relative; }
.search input { padding: 8px 12px 8px 32px; border: 1px solid var(--border); border-radius: 9px; font-size: 12.5px; width: 210px; outline: none; background: #fff; }
.search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-3); }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 7px 12px; font-size: 12px; color: var(--text-2); }
.chip.active { background: var(--primary-light); border-color: #c7d2fe; color: var(--primary); font-weight: 700; }
.mini-score { display: inline-flex; align-items: center; gap: 7px; }
.mini-score .bar { width: 48px; height: 5px; }

/* ---------- Platform cards ---------- */
.plat-card { padding: 17px 18px; position: relative; overflow: hidden; }
.plat-top { display: flex; align-items: center; gap: 10px; }
.plat-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; flex: 0 0 36px; }
.plat-name { font-weight: 700; font-size: 13.5px; }
.plat-vendor { font-size: 11px; color: var(--text-3); }
.plat-num { font-size: 25px; font-weight: 800; margin: 14px 0 1px; letter-spacing: -.5px; }
.plat-num small { font-size: 11px; font-weight: 500; color: var(--text-3); }
.plat-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); align-items: center; }
.rate-row { margin-top: 12px; }

/* ---------- Activity ---------- */
.activity { list-style: none; }
.activity li { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f1f5f9; font-size: 12.5px; }
.activity li:last-child { border-bottom: 0; }
.act-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: 0 0 8px; background: var(--primary); }
.act-dot.score { background: #8b5cf6; } .act-dot.citation { background: var(--success); }
.act-dot.issue { background: var(--warning); } .act-dot.content { background: var(--accent); }
.act-time { margin-left: auto; color: var(--text-3); font-size: 11px; white-space: nowrap; }

/* ---------- Recommendation ---------- */
.rec { display: flex; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.rec:last-child { border-bottom: 0; }
.rec-check { width: 20px; height: 20px; border-radius: 6px; border: 2px solid #cbd5e1; flex: 0 0 20px; margin-top: 2px; display: grid; place-items: center; }
.rec-check.done { background: var(--success); border-color: var(--success); color: #fff; font-size: 12px; }
.rec-check.doing { border-color: var(--warning); background: var(--warning-bg); }
.rec-body { flex: 1; min-width: 0; }
.rec-title { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.rec-desc { font-size: 12px; color: var(--text-2); line-height: 1.6; }
.rec-meta { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; align-items: center; }
.rec-action { font-size: 11px; color: var(--primary); background: var(--primary-light); padding: 3px 9px; border-radius: 6px; }

/* ---------- Generator ---------- */
.gen-grid { display: grid; grid-template-columns: 340px 1fr; gap: 18px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 11.5px; font-weight: 700; color: var(--text-2); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; font-size: 12.5px;
  outline: none; background: #fff; color: var(--text); font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.field textarea { resize: vertical; min-height: 64px; }
.check-list { display: grid; gap: 7px; margin-top: 4px; }
.check-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; }
.check-item input { width: 15px; height: 15px; accent-color: var(--primary); }
.check-item span { color: var(--text-3); font-size: 10.5px; margin-left: auto; }
.output {
  background: #0f172a; color: #a5f3fc; border-radius: 11px; padding: 17px; font-size: 11.5px; line-height: 1.7;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-word;
  min-height: 340px; max-height: 480px; overflow: auto;
}
.output-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.output-head span { font-size: 12px; color: var(--text-2); font-weight: 700; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 5px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 9px 14px; font-size: 12.5px; color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Deploy guide ---------- */
.guide-step { display: flex; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.guide-step:last-child { border-bottom: 0; }
.step-num { width: 26px; height: 26px; border-radius: 8px; background: var(--primary-light); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: 0 0 26px; }
.step-title { font-weight: 700; font-size: 13px; margin-bottom: 3px; }
.step-desc { font-size: 12px; color: var(--text-2); }
code { background: #f1f5f9; padding: 2px 6px; border-radius: 5px; font-size: 11.5px; font-family: ui-monospace, Consolas, monospace; color: #be185d; }
.path-box { margin-top: 9px; background: #f8fafc; border: 1px dashed var(--border); border-radius: 8px; padding: 10px 12px; font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: var(--text-2); line-height: 1.8; }

/* ---------- AI content page ---------- */
.ai-page { background: #fff; }
.ai-hero { background: linear-gradient(135deg, #1e1b4b, #312e81 55%, #0c4a6e); color: #fff; padding: 58px 24px 50px; text-align: center; }
.ai-hero .kicker { display: inline-block; font-size: 11px; letter-spacing: 2px; border: 1px solid rgba(255,255,255,.3); padding: 4px 12px; border-radius: 20px; margin-bottom: 18px; color: #c7d2fe; }
.ai-hero h1 { font-size: 32px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 12px; }
.ai-hero p { max-width: 680px; margin: 0 auto; color: #cbd5e1; font-size: 14px; }
.ai-hero .meta { margin-top: 18px; font-size: 12px; color: #a5b4fc; }
.ai-container { max-width: 1000px; margin: 0 auto; padding: 36px 22px 60px; }
.ai-section { margin-bottom: 36px; }
.ai-section h2 { font-size: 21px; font-weight: 800; margin-bottom: 6px; padding-bottom: 10px; border-bottom: 2px solid var(--primary-light); }
.ai-section .lead { font-size: 12.5px; color: var(--text-3); margin-bottom: 18px; }
.entity-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.entity-item { background: #fff; padding: 14px 18px; }
.entity-item dt { font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
.entity-item dd { font-size: 13px; font-weight: 600; }
.qa-item { border: 1px solid var(--border); border-radius: 11px; padding: 16px 18px; margin-bottom: 11px; background: #fff; }
.qa-item h3 { font-size: 14px; font-weight: 700; margin-bottom: 7px; }
.qa-item h3::before { content: 'Q '; color: var(--primary); }
.qa-item p { font-size: 13px; color: var(--text-2); }
.qa-item p::before { content: 'A '; color: var(--success); font-weight: 700; }
.ai-back { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--primary); margin-bottom: 20px; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 24px; right: 24px; background: #111827; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 12.5px; z-index: 100; opacity: 0; transform: translateY(10px); transition: .25s; pointer-events: none; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
.mobile-toggle { display: none; }
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .gen-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -240px; transition: .25s; }
  .sidebar.open { left: 0; }
  .mobile-toggle { display: inline-grid; }
  .content { padding: 20px 16px 40px; }
  .topbar { padding: 0 16px; }
  .g3, .g2 { grid-template-columns: 1fr; }
  .score-wrap { flex-direction: column; align-items: stretch; }
  .ring { margin: 0 auto; }
  .entity-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: 1fr; }
  .domain-pill { display: none; }
}
