:root {
  --primary: #0D9488;
  --primary-dark: #0F766E;
  --success: #27AE60;
  --warning: #E67E22;
  --danger: #E74C3C;
  --purple: #7C3AED;
  --bg: #F0FDFA;
  --card: #FFFFFF;
  --text: #2C3E50;
  --text-light: #7F8C8D;
  --border: #DCE0E4;
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "PingFang SC","Microsoft YaHei",Arial,sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ====== Header ====== */
.header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 28px; }
.logo-text { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.logo-sub { font-size: 11px; opacity: 0.75; margin-top: 2px; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.free-badge { background: rgba(255,255,255,0.15); border-radius: 12px; padding: 4px 10px; font-size: 12px; }

/* ====== Hero ====== */
.hero {
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--bg) 100%);
  padding: 36px 32px 20px; text-align: center; color: white;
}
.hero h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.hero p { font-size: 15px; opacity: 0.88; max-width: 560px; margin: 0 auto 20px; line-height: 1.6; }
.hero-stats { display: flex; gap: 32px; justify-content: center; flex-wrap: wrap; }
.stat { text-align: center; }
.stat .num { font-size: 26px; font-weight: 700; }
.stat .label { font-size: 12px; opacity: 0.75; margin-top: 2px; }

/* ====== Main Layout ====== */
.main { max-width: 1280px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: 400px 1fr; gap: 20px; align-items: start; }

/* ====== Input Panel ====== */
.input-panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: sticky; top: 72px; }
.panel-tabs { display: flex; border-bottom: 1px solid var(--border); }
.tab { flex: 1; padding: 13px; text-align: center; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-light); border-bottom: 2px solid transparent; transition: all 0.2s; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); background: #CCFBF1; }
.panel-body { padding: 16px; }

/* 对话模式 */
.chat-box { height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 10px; background: #FAFAFA; }
.msg { margin-bottom: 10px; display: flex; gap: 8px; }
.msg.user { flex-direction: row-reverse; }
.msg-bubble { max-width: 85%; padding: 9px 13px; border-radius: 12px; font-size: 13px; line-height: 1.6; }
.msg.ai .msg-bubble { background: white; border: 1px solid var(--border); color: var(--text); border-radius: 4px 12px 12px 12px; }
.msg.user .msg-bubble { background: var(--primary); color: white; border-radius: 12px 4px 12px 12px; }
.msg-avatar { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; background: #CCFBF1; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input { flex: 1; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; outline: none; resize: none; font-family: inherit; }
.chat-input:focus { border-color: var(--primary); }

/* 快捷模板 */
.templates { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tpl-btn { padding: 5px 10px; border: 1.5px solid var(--border); border-radius: 16px; font-size: 11px; cursor: pointer; background: white; color: var(--text-light); transition: all 0.2s; white-space: nowrap; }
.tpl-btn:hover { border-color: var(--primary); color: var(--primary); background: #CCFBF1; }

/* 表单模式 */
.form-group { margin-bottom: 12px; }
.form-label { font-size: 12px; color: var(--text-light); margin-bottom: 4px; display: block; font-weight: 500; }
.form-label span { color: var(--danger); }
.form-control { width: 100%; padding: 8px 11px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--text); background: var(--bg); outline: none; }
.form-control:focus { border-color: var(--primary); background: white; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-hint { font-size: 11px; color: var(--text-light); line-height: 1.6; margin-top: 5px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: #CCFBF1; }

/* ====== Result Panel ====== */
.result-panel { display: flex; flex-direction: column; gap: 16px; }

/* 方案Tab切换 */
.plan-tabs-bar {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.plan-tabs-bar .label { font-size: 13px; font-weight: 600; color: var(--text-light); margin-right: 4px; }
.plan-tab {
  padding: 8px 20px; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 2px solid var(--border); background: white; color: var(--text-light); transition: all 0.2s;
}
.plan-tab.active.econ { border-color: var(--success); background: #D1FAE5; color: #15803D; }
.plan-tab.active.recom { border-color: var(--primary); background: #CCFBF1; color: var(--primary-dark); }
.plan-tab.active.dense { border-color: var(--purple); background: #EDE9FE; color: #6B21A8; }
.plan-tab:hover { border-color: var(--primary); }
.plan-tabs-bar .actions { margin-left: auto; display: flex; gap: 8px; }

/* 评分卡 */
.score-card {
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
}
.score-card.econ { background: linear-gradient(135deg, #15803D, #27AE60); color: white; }
.score-card.recom { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: white; }
.score-card.dense { background: linear-gradient(135deg, #6B21A8, #7C3AED); color: white; }
.score-circle { width: 72px; height: 72px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.4); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.score-circle .num { font-size: 22px; font-weight: 700; }
.score-circle .lbl { font-size: 10px; opacity: 0.8; }
.score-info h3 { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.score-info .desc { font-size: 12px; opacity: 0.8; margin-bottom: 8px; }
.score-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.score-tag { background: rgba(255,255,255,0.2); border-radius: 10px; padding: 2px 9px; font-size: 11px; }

/* 指标卡 */
.metrics-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.metric-card { background: var(--card); border-radius: 10px; padding: 12px; box-shadow: var(--shadow); text-align: center; }
.metric-card .val { font-size: 20px; font-weight: 700; color: var(--primary); }
.metric-card .key { font-size: 11px; color: var(--text-light); margin-top: 3px; }

/* 投资估算 */
.invest-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.invest-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.invest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.invest-item { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.invest-item .lbl { font-size: 11px; color: var(--text-light); margin-bottom: 3px; }
.invest-item .val { font-size: 16px; font-weight: 700; }
.invest-item.highlight { background: #CCFBF1; }
.invest-item.highlight .val { color: var(--primary); font-size: 18px; }

/* 3方案对比表 */
.compare-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.compare-title { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: #F0FDFA; padding: 10px 14px; text-align: left; font-weight: 600; color: var(--text-light); font-size: 12px; }
th.recom-col { background: #CCFBF1; color: var(--primary); }
td { padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
td.recom-col { background: #F0FDFA; }
tr:last-child td { border-bottom: none; }
.val-good { color: var(--success); font-weight: 700; }
.badge-rec { background: var(--primary); color: white; border-radius: 8px; padding: 1px 6px; font-size: 10px; font-weight: 600; margin-left: 4px; vertical-align: middle; }

/* SVG预览 */
.svg-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.svg-card-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.svg-card-title { font-size: 14px; font-weight: 600; }
.svg-card-actions { display: flex; gap: 6px; }
.svg-wrap { overflow: auto; padding: 12px; background: #F8F9FA; min-height: 200px; }
.svg-wrap svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }

/* 功能区表格 */
.zone-table { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.zone-table-header { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 600; }
.zone-bar { height: 5px; background: var(--border); border-radius: 3px; margin-top: 3px; }
.zone-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.6s ease; }

/* 建议列表 */
.recs-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.recs-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.rec-item { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.5; }
.rec-item:last-child { border-bottom: none; }
/* 容量不足/规模建议：高亮，避免淹没在常规建议里 */
.rec-item.rec-danger { background: #FEF2F2; border-left: 3px solid #DC2626; padding: 10px 12px; border-radius: 6px; color: #991B1B; font-weight: 500; }
.rec-item.rec-warn { background: #FFFBEB; border-left: 3px solid #D97706; padding: 10px 12px; border-radius: 6px; color: #92400E; }

/* 空状态 / 加载 */
.empty-result { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 60px 20px; text-align: center; }
.empty-result .icon { font-size: 60px; opacity: 0.25; margin-bottom: 14px; }
.empty-result h3 { font-size: 15px; color: var(--text-light); margin-bottom: 6px; }
.empty-result p { font-size: 13px; color: var(--text-light); }
.loading { display: none; text-align: center; padding: 40px; }
.loading.show { display: block; }
.spinner { width: 38px; height: 38px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast { position: fixed; top: 72px; right: 24px; background: #2C3E50; color: white; padding: 11px 18px; border-radius: 8px; font-size: 13px; z-index: 999; transform: translateY(-20px); opacity: 0; transition: all 0.3s; pointer-events: none; }
.toast.show { transform: translateY(0); opacity: 1; }

/* ====== 免责声明弹窗 ====== */
.disclaimer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  z-index: 9999; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.disclaimer-box {
  background: white; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 560px; width: 92%; padding: 0; overflow: hidden;
}
.disclaimer-header {
  background: linear-gradient(135deg, #0F766E, #0D9488);
  color: white; padding: 22px 28px; display: flex; align-items: center; gap: 12px;
}
.disclaimer-header .icon { font-size: 32px; flex-shrink: 0; }
.disclaimer-header h2 { font-size: 18px; font-weight: 700; margin: 0; }
.disclaimer-header p { font-size: 12px; opacity: 0.8; margin: 4px 0 0; }
.disclaimer-body { padding: 22px 28px; }
.disclaimer-body .notice-box {
  background: #FEF9E7; border: 1.5px solid #F39C12; border-radius: 10px;
  padding: 14px 16px; margin-bottom: 16px; font-size: 13px; line-height: 1.7; color: #784212;
}
.disclaimer-body .notice-box strong { color: #922B21; }
.disclaimer-items { margin-bottom: 18px; }
.disclaimer-item {
  display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #F0F3F4;
  font-size: 13px; line-height: 1.6; color: #2C3E50;
}
.disclaimer-item:last-child { border-bottom: none; }
.disclaimer-item .num {
  width: 22px; height: 22px; border-radius: 50%; background: #0D9488;
  color: white; font-size: 11px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; margin-top: 1px;
}
.disclaimer-agree {
  display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px;
  background: #F0FDFA; border-radius: 10px; cursor: pointer; margin-bottom: 16px;
}
.disclaimer-agree input[type="checkbox"] { width: 17px; height: 17px; cursor: pointer; flex-shrink: 0; margin-top: 2px; accent-color: #0D9488; }
.disclaimer-agree label { font-size: 13px; line-height: 1.6; color: #2C3E50; cursor: pointer; }
.disclaimer-agree label strong { color: #E74C3C; }
.disclaimer-footer { padding: 0 28px 22px; }
.btn-disclaimer-confirm {
  width: 100%; padding: 13px; background: #0D9488; color: white;
  border: none; border-radius: 10px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; opacity: 0.45; pointer-events: none;
}
.btn-disclaimer-confirm.active { opacity: 1; pointer-events: auto; }
.btn-disclaimer-confirm.active:hover { background: #0F766E; }
.disclaimer-tip { text-align: center; margin-top: 8px; font-size: 11px; color: #99A3A4; }

/* 打印样式 - 底部免责文字 */
.report-disclaimer-footer {
  margin-top: 20px; padding: 10px 14px; background: #F8F9FA;
  border-top: 1px solid #DCE0E4; font-size: 11px; color: #7F8C8D;
  text-align: center; border-radius: 0 0 8px 8px; line-height: 1.6;
}
@media screen { .report-disclaimer-footer { display: none; } }
@media print {
  .report-disclaimer-footer { display: block !important; }
}

/* ===== 网站底部备案信息（法定要求：首页底部居中 + 超链工信部备案查询系统）===== */
.site-footer {
  margin: 26px auto 0; padding: 16px 12px 22px;
  text-align: center; font-size: 12px; color: #7F8C8D; line-height: 1.9;
  border-top: 1px solid #E4E8EB; max-width: 900px;
}
.site-footer a { color: #7F8C8D; text-decoration: none; }
.site-footer a:hover { color: #0D9488; text-decoration: underline; }
.site-footer .beian-gov { display: inline-flex; align-items: center; gap: 4px; }
.site-footer .copyright { color: #99A3A4; }
.site-footer .ghs-icon { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; }
@media print { .site-footer { display: block !important; } }

/* 打印样式 */
@media print {
  .header, .hero, .input-panel, .plan-tabs-bar .actions,
  .disclaimer-overlay { display: none !important; }
  .main { grid-template-columns: 1fr; }
  .result-panel { box-shadow: none; }
  body { background: white; }
}

/* 响应式 */
@media (max-width: 960px) {
  .main { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
  .invest-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 22px; }
  .input-panel { position: static; }
}

/* ============================================================
 * 多页站公共部件（门户 / 面包屑 / 工具导航）
 * 原单页内联样式已抽为本文件，全站共用；改一处即全站生效
 * ============================================================ */

/* ---- 返回工具矩阵面包屑 ---- */
.breadcrumb {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-light, #64748B);
  text-decoration: none; padding: 6px 12px 6px 10px;
  border: 1px solid var(--border, #E2E8F0); border-radius: 999px;
  background: #fff; transition: all .15s;
}
.breadcrumb:hover {
  color: var(--primary, #0D9488); border-color: var(--primary, #0D9488);
  background: rgba(13,148,136,.06); text-decoration: none;
}
.breadcrumb-wrap { padding: 14px 0 0; }

/* ---- 门户：供应链主线五站 ---- */
.portal-hero { text-align: center; padding: 48px 20px 30px; }
.portal-hero h1 { font-size: 30px; margin: 0 0 12px; }
.portal-hero .lead { font-size: 15px; color: var(--text-light, #64748B); line-height: 1.8; max-width: 680px; margin: 0 auto; }
.chain-hint { font-size: 13px; color: var(--text-light, #64748B); margin-top: 14px; }

.grid-tools {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 16px; padding: 22px 0 34px;
}
.tool-card {
  position: relative; background: #fff; border: 1px solid var(--border, #E2E8F0);
  border-radius: 14px; padding: 20px 18px 18px; text-decoration: none;
  color: inherit; display: flex; flex-direction: column; gap: 8px;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(15,23,42,.09); border-color: var(--primary, #0D9488); text-decoration: none; color: inherit; }
.tool-card.is-soon { opacity: .62; cursor: default; }
.tool-card.is-soon:hover { transform: none; box-shadow: none; border-color: var(--border, #E2E8F0); }
.tool-step {
  position: absolute; top: 14px; right: 14px; font-size: 11px; font-weight: 700;
  color: #fff; background: var(--primary, #0D9488); border-radius: 999px; padding: 2px 9px;
}
.tool-card.is-soon .tool-step { background: #94A3B8; }
.tool-icon { font-size: 26px; line-height: 1; }
.tool-name { font-size: 16px; font-weight: 700; }
.tool-desc { font-size: 13px; color: var(--text-light, #64748B); line-height: 1.7; flex: 1; }
.tool-cta { font-size: 12.5px; font-weight: 600; color: var(--primary, #0D9488); }
.tool-card.is-soon .tool-cta { color: #94A3B8; }

.portal-section { padding: 6px 0 4px; }
.portal-section h2 { font-size: 18px; margin: 0 0 4px; }
.portal-section .sub { font-size: 13px; color: var(--text-light, #64748B); margin: 0 0 2px; }

/* ---- Header logo 变为链接后可跳门户 ---- */
a.logo { color: inherit; text-decoration: none; }
a.logo:hover { color: inherit; text-decoration: none; opacity: .92; }

/* ---- 工具页顶栏（面包屑 + 当前工具名）---- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 32px 0; flex-wrap: wrap;
}
.topbar-title { font-size: 13px; color: var(--text-light, #64748B); }
@media (max-width: 640px) { .topbar { padding: 14px 16px 0; } }
