/* ============================================================
   星见GEO 分享页风格 —— 对齐「美迪斯」参考页的品牌视觉
   配色：蓝 #0B5FFF / 橙 #FF6B35 / 深蓝 #0F172A
   ============================================================ */

:root {
  --primary: #0B5FFF;
  --primary-dark: #0040C7;
  --primary-light: #3B82F6;
  --accent: #FF6B35;
  --accent-dark: #E55A2B;
  --dark: #0F172A;
  --gray-900: #1E293B;
  --gray-700: #334155;
  --gray-500: #64748B;
  --gray-300: #CBD5E1;
  --gray-200: #E2E8F0;
  --gray-100: #F1F5F9;
  --gray-50: #F8FAFC;
  --bg: #EEF2F8;
  --card: #ffffff;
  --text: #1E293B;
  --heading: #0F172A;
  --muted: #64748B;
  --border: #E2E8F0;
  --border-soft: #F1F5F9;
  --callout-bg: #F1F5FF;
  --code-bg: #0F172A;
  --code-text: #E2E8F0;
  --shadow: 0 12px 40px -14px rgba(15, 23, 42, 0.22);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --maxw: 820px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono",
    "Courier New", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 50% -12%, #E4ECFB, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.85;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page { min-height: 100vh; }

/* ---------- 顶部品牌条 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
  color: var(--heading);
}
.brand-dot {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E") center / 14px no-repeat,
    linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 2px 6px rgba(11, 95, 255, 0.28);
}
.topbar a {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.topbar a:hover {
  background: var(--callout-bg);
  border-color: transparent;
}

/* ---------- 文档卡片 ---------- */
.doc {
  max-width: var(--maxw);
  margin: 26px auto 48px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ---------- Hero（深蓝渐变封面） ---------- */
.doc-hero {
  position: relative;
  overflow: hidden;
  padding: 54px 52px 42px;
  background: linear-gradient(135deg, #0A1A3F 0%, #0B5FFF 100%);
  color: #fff;
}
.doc-hero::before {
  content: "";
  position: absolute;
  right: 0; top: 0;
  width: 55%; height: 100%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.5;
  pointer-events: none;
}
.doc-hero::after {
  content: "";
  position: absolute;
  right: -70px; bottom: -70px;
  width: 240px; height: 240px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  pointer-events: none;
}
.hero-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  margin-bottom: 22px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.4px;
}
.doc-hero h1 {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  font-size: 32px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  word-break: break-word;
}
.doc-hero .meta {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  letter-spacing: 0.3px;
}

/* ---------- 正文排版 ---------- */
.content {
  padding: 14px 52px 8px;
}
.content > :first-child { margin-top: 20px; }

.content h1, .content h2, .content h3,
.content h4, .content h5, .content h6 {
  color: var(--heading);
  line-height: 1.4;
  font-weight: 750;
  scroll-margin-top: 80px;
}
.content h1 { font-size: 26px; margin: 1.8em 0 0.7em; }
.content h2 {
  font-size: 23px;
  margin: 1.9em 0 0.7em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
  position: relative;
}
.content h2::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 0.34em;
  bottom: 0.55em;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--primary), var(--primary-light));
}
.content h3 { font-size: 18px; margin: 1.5em 0 0.5em; color: var(--primary-dark); }
.content h4 { font-size: 16px; margin: 1.3em 0 0.5em; }

.content p { margin: 0.95em 0; }
.content a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid rgba(11, 95, 255, 0.3);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.content a:hover {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
}

.content ul, .content ol {
  padding-left: 1.5em;
  margin: 0.9em 0;
}
.content li { margin: 0.45em 0; }
.content ul li::marker { color: var(--primary); }
.content ol li::marker { color: var(--primary); font-weight: 600; }

/* ---------- 引用 / 提示框（橙色左边框） ---------- */
.content blockquote {
  margin: 1.3em 0;
  padding: 14px 18px;
  border-left: 4px solid var(--accent);
  background: #FFF6F1;
  border-radius: 0 10px 10px 0;
  color: #3a3026;
}
.content blockquote p { margin: 0.4em 0; }
.content blockquote p:first-child { margin-top: 0; }
.content blockquote p:last-child { margin-bottom: 0; }

/* ---------- 行内代码 / 代码块（深色） ---------- */
.content code {
  background: #EEF2FB;
  color: #0F172A;
  padding: 0.16em 0.42em;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.88em;
  border: 1px solid var(--border-soft);
}
.content pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 16px 18px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 1.2em 0;
  box-shadow: var(--shadow-sm);
}
.content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--code-text);
  font-size: 0.86em;
  line-height: 1.6;
}

/* ---------- 表格（蓝表头卡片） ---------- */
.content table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: 1.3em 0;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.content th, .content td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}
.content thead th {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.2px;
  border-bottom: none;
}
.content tbody tr:nth-child(even) { background: var(--gray-50); }
.content tbody tr:last-child td { border-bottom: none; }
.content tbody tr { transition: background 0.12s ease; }
.content tbody tr:hover { background: var(--callout-bg); }
.content td:not(:last-child), .content th:not(:last-child) {
  border-right: 1px solid var(--border-soft);
}

/* ---------- 图片 ---------- */
.content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  margin: 1.2em auto;
  box-shadow: var(--shadow-sm);
}

.content hr {
  border: none;
  height: 1px;
  margin: 2.4em 0;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ============================================================
   报告 / 方案专用组件
   ============================================================ */

/* 模式徽章 */
.badge { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 20px; }
.badge.llm { background: var(--callout-bg); color: var(--primary-dark); }
.badge.sim { background: #FFF1E8; color: var(--accent-dark); }

/* 综合评分 hero（诊断报告） */
.score-block {
  display: flex;
  align-items: center;
  gap: 36px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #D9E8FF 0%, #C3DBFF 100%);
  border: 1px solid #A9C9F5;
  border-radius: 16px;
  padding: 28px 30px;
  margin: 18px 0;
  box-shadow: 0 8px 24px rgba(11, 95, 255, 0.18);
}
.score-left { flex: 0 0 auto; min-width: 220px; }
.score-num {
  font-size: 76px;
  font-weight: 800;
  color: #0B5FFF;
  line-height: 1;
  letter-spacing: -2px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.score-num .score-max { font-size: 26px; font-weight: 700; color: #6B8FD6; letter-spacing: 0; }
.score-sub { color: #3E5C99; font-size: 14px; font-weight: 500; margin-top: 12px; }
.score-level { margin-top: 20px; display: flex; align-items: center; gap: 12px; }
.score-level .lv {
  display: inline-block;
  background: linear-gradient(135deg, #0B5FFF, #2563EB);
  color: #fff;
  padding: 8px 22px;
  border-radius: 22px;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 4px 14px rgba(11, 95, 255, 0.32);
}
.score-level-text { color: #4C6BA8; font-size: 14px; }
.score-right { flex: 1; min-width: 320px; display: flex; justify-content: center; align-items: center; }
.score-right canvas { max-width: 100%; }

/* 数据卡片（维度 / 场景 / 竞品 / 建议） */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.card .num { font-size: 28px; font-weight: 800; color: var(--primary); }
.card .lab { font-weight: 600; color: var(--heading); margin: 4px 0; }
.card p { margin: 6px 0; color: var(--muted); font-size: 13px; }

/* 窄屏（小手机）卡片改为单列，避免两列过窄 */
@media (max-width: 420px) {
  .cards { grid-template-columns: 1fr; }
}

/* 诊断四维度卡：与 doc-hero 同款深蓝渐变背景，分数柠檬黄，其余白色 */
.dim-cards .card {
  background: #E6F0FF;
  border: 1px solid #BBD4FF;
  box-shadow: 0 8px 22px rgba(11, 95, 255, 0.12);
}
.dim-cards .card .num { color: #0B5FFF; }
.dim-cards .card .lab { color: #0B2A66; }
.dim-cards .card p { color: #475569; }

/* 竞品 / 建议等普通卡片，复用浅蓝背景与维度卡保持一致 */
.soft-cards .card {
  background: #E6F0FF;
  border: 1px solid #BBD4FF;
  box-shadow: 0 8px 22px rgba(11, 95, 255, 0.12);
}

/* 平台提及率条 */
.plat-row { display: flex; align-items: center; gap: 10px; margin: 9px 0; }
.plat-row .pn { width: 96px; color: var(--muted); font-size: 14px; }
.plat-row .pbar { flex: 1; height: 10px; background: var(--gray-200); border-radius: 6px; overflow: hidden; }
.plat-row .pbar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.plat-row .pr { width: 46px; text-align: right; font-weight: 700; color: var(--heading); }

/* 关键词标签 */
.kw {
  display: inline-block;
  background: #0B5FFF;
  color: #fff;
  border-radius: 6px;
  padding: 3px 9px;
  margin: 3px;
  font-size: 15px;
}

/* 第十条 项目周期与执行内容（浅橙、每行一个） */
.roadmap-list { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.roadmap-item {
  background: #FFF3E6;
  border: 1px solid #FFD8A8;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 6px 18px rgba(255, 146, 43, 0.12);
}
.roadmap-item .lab { color: #B45309; font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.roadmap-item p { color: #8A5A1E; margin: 4px 0 0; line-height: 1.6; }

/* 业务评估判定胶囊 */
.vpill {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.v-good { background: #E7F6EC; color: #15803D; }
.v-mid  { background: #FFF1E8; color: #C2410C; }
.v-low  { background: #FDECEC; color: #B91C1C; }

/* 三、AI和GEO业务评估：维度列 + 判定/说明合并列（胶囊在上、说明在下两行） */
.biz-table { table-layout: fixed; }
.biz-table th, .biz-table td {
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* 评估维度列：长文字在列内换行 */
.biz-table td:first-child strong { display: inline-block; }
/* 判定/说明合并列 */
.biz-verdict-cell { vertical-align: top; }
.biz-verdict-cell .vpill { display: inline-block; }
.biz-note { margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.55; }

/* 数据性质声明 / 提示 */
.disclaimer { background: #FFF8EC; border: 1px solid #FFE2B8; color: #8A5A00; border-radius: 10px; padding: 12px 14px; font-size: 13px; margin: 16px 0; }
.note { background: var(--callout-bg); border: 1px solid #D6E4FF; border-radius: 10px; padding: 12px 14px; color: var(--primary-dark); font-size: 13px; margin: 16px 0; }

/* ---------- 加载态 ---------- */
.loading { text-align: center; padding: 60px 20px; }
.spinner { width: 42px; height: 42px; border: 4px solid var(--gray-200); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 16px; }
/* 行内小加载圈：自动识别提示前使用 */
.mini-spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--gray-200); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 页脚 ---------- */
.doc-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 52px 30px;
  margin-top: 28px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 13px;
}
.foot-mark {
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
}
.foot-text { letter-spacing: 0.2px; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .doc { margin: 12px; border-radius: 12px; }
  .doc-hero { padding: 38px 22px 30px; }
  .doc-hero h1 { font-size: 25px; }
  .content { padding: 8px 22px; }
  .content h2::before { left: -10px; }
  .score-block { gap: 22px; padding: 22px; }
  .score-num { font-size: 60px; }
  .score-left, .score-right { flex: 1 1 100%; min-width: 0; }
  .score-right { margin-top: 4px; }
  .doc-foot { padding: 20px 22px 26px; flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ---------- 竞品对标（与 score-block/biz-table 统一的蓝色语言） ---------- */
.bench-intro { color: var(--muted); font-size: 13.5px; line-height: 1.7; margin: 4px 0 14px; }
.bench-chart {
  background: linear-gradient(135deg, #EEF4FF 0%, #E3ECFF 100%);
  border: 1px solid #A9C9F5; border-radius: 16px; padding: 20px 22px;
  margin: 18px 0; box-shadow: 0 8px 24px rgba(11, 95, 255, .14);
}
.bench-chart-title { font-size: 15px; font-weight: 700; color: #0B2A66; margin-bottom: 10px; text-align: center; }
.bench-chart-box { position: relative; height: 360px; }
.bench-sum {
  color: var(--muted); font-size: 14px; line-height: 1.7; margin-top: 12px;
  background: #F5F8FF; border: 1px solid #D6E2FB; border-radius: 12px; padding: 14px 16px;
}
@media (max-width: 560px) {
  .bench-chart-box { height: 300px; }
  .bench-chart { padding: 16px 14px; }
}

/* ---------- 会员浮动分享按钮 ---------- */
.share-fab{
  position:fixed; right:20px; bottom:calc(20px + env(safe-area-inset-bottom)); z-index:999;
  width:56px; height:56px; border-radius:50%; border:none; cursor:pointer;
  background:linear-gradient(135deg,#4f46e5,#2563eb); color:#fff;
  box-shadow:0 10px 26px rgba(79,70,229,.42);
  display:flex; align-items:center; justify-content:center;
  transition:transform .15s ease, box-shadow .15s ease;
}
.share-fab:hover{ transform:translateY(-2px); box-shadow:0 14px 32px rgba(79,70,229,.52); }
.share-fab:active{ transform:scale(.94); }
.share-fab svg{ width:26px; height:26px; display:block; fill:#fff; }
.share-panel{
  position:fixed; right:16px; bottom:88px; z-index:1000;
  width:300px; max-width:calc(100vw - 32px);
  background:#fff; border-radius:18px; padding:16px 16px 14px;
  box-shadow:0 18px 50px rgba(15,23,42,.22);
  display:none; transform-origin:bottom right;
  animation:sp-pop .18s ease;
}
.share-panel.open{ display:block; }
.share-panel h4{ margin:0 0 4px; font-size:16px; color:#0B2A66; }
.share-panel .sp-sub{ margin:0 0 12px; font-size:12px; color:#64748b; }
.share-opt{
  display:flex; align-items:center; gap:10px; padding:11px 12px;
  border:1px solid #e6e8f0; border-radius:12px; margin-bottom:10px;
  cursor:pointer; transition:background .15s,border-color .15s;
}
.share-opt:last-child{ margin-bottom:0; }
.share-opt:hover{ background:#f4f6ff; border-color:#c7d0ff; }
.share-opt .so-ico{ width:36px; height:36px; border-radius:10px; flex:0 0 auto;
  display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:15px; }
.share-opt .so-main{ flex:1; min-width:0; }
.share-opt .so-name{ font-size:14px; font-weight:700; color:#111; }
.share-opt .so-url{ font-size:11px; color:#64748b; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.share-opt .so-copy{ flex:0 0 auto; font-size:12px; color:#4f46e5; font-weight:600; }
@keyframes sp-pop{ from{ opacity:0; transform:translateY(8px) scale(.96); } to{ opacity:1; transform:none; } }
.sp-toast{
  position:fixed; left:50%; top:50%; transform:translate(-50%,-50%); z-index:1100;
  background:rgba(15,23,42,.92); color:#fff; padding:10px 18px; border-radius:10px;
  font-size:14px; display:none; pointer-events:none;
}
.sp-toast.show{ display:block; animation:sp-toast 1.6s ease; }
@keyframes sp-toast{ 0%{opacity:0;} 15%{opacity:1;} 80%{opacity:1;} 100%{opacity:0;} }
@media (max-width:560px){
  .share-fab{ right:14px; bottom:calc(14px + env(safe-area-inset-bottom)); width:52px; height:52px; }
  .share-fab svg{ width:24px; height:24px; }
  .share-panel{ right:12px; left:12px; width:auto; bottom:74px; }
}
@media print{
  .share-fab, .share-panel, .sp-toast{ display:none !important; }
}

/* ---------- 深色模式（纯 CSS，跟随系统） ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --card: #121a2c;
    --text: #d6dceb;
    --heading: #f1f4fb;
    --muted: #93a0b8;
    --border: #243049;
    --border-soft: #1b2238;
    --callout-bg: #14203c;
    --shadow: 0 16px 46px -18px rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
  body { background: var(--bg); }
  .topbar { background: rgba(18, 26, 44, 0.78); }
  .content h3 { color: var(--primary-light); }
  .content thead th { background: linear-gradient(180deg, #1a3a8f, #0B5FFF); }
  .content tbody tr:nth-child(even) { background: #0f1626; }
  .content tbody tr:hover { background: #16224a; }
  .content blockquote { background: #2a1d14; color: #e8d8cc; }
}

/* ---------- 打印 ---------- */
@media print {
  body { background: #fff; }
  .topbar, .doc-foot { display: none; }
  .doc { box-shadow: none; border: none; margin: 0; max-width: 100%; }
  .doc-hero { background: #0A1A3F !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .content a { border-bottom: none; color: #000; }
  .content pre, .content code, .content table { box-shadow: none; }
}
