:root {
  --green-950: #063b2a;
  --green-900: #07563a;
  --green-800: #08784d;
  --green-700: #0b9460;
  --green-600: #1aa875;
  --green-100: #e4f5ed;
  --green-50: #f2faf6;
  --ink: #17251f;
  --muted: #66756e;
  --line: #e5eee9;
  --surface: #ffffff;
  --bg: #f6faf8;
  --shadow: 0 12px 34px rgba(11, 70, 47, .08);
  --content: 1080px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.65; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

/* 隐藏顶部无障碍跳转链接 */
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 1000; background: white; padding: 8px 14px; }
.skip-link:focus { left: 8px; }

/* ================= 页眉：展开态与紧凑态 ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 300;
  background: rgba(255,255,255,.985);
  border-bottom: 1px solid #dcebe3;
  box-shadow: 0 3px 14px rgba(6,59,42,.075);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow-anchor: none;
}
.header-main-row {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: 7px 18px 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "brand" "risk" "promo";
  gap: 3px;
}
.brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 35px;
  padding-bottom: 5px;
  border-bottom: 1px solid #dcebe3;
  text-decoration: none;
}
.brand-logo {
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
  border-radius: 7px;
}
.brand-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  line-height: 1.25;
}
.brand-copy strong {
  color: var(--green-950);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.25;
  white-space: nowrap;
}
.brand-copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  white-space: nowrap;
}
.header-promo-row {
  grid-area: promo;
  min-width: 0;
  max-height: 52px;
  padding: 0 2px;
  margin: -1px 0 0;
  text-align: center;
  overflow: hidden;
  opacity: 1;
}
.header-promo-row p {
  max-width: 760px;
  margin: 0 auto;
  color: #50675b;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 550;
}
.risk-button {
  grid-area: risk;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  margin-top: 2px;
  padding: 8px 14px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg,#0b9c66,#06633f);
  box-shadow: 0 4px 11px rgba(8,120,77,.18);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}
.risk-button span { flex: 0 0 auto; font-size: 18px; line-height: 1; }

/* 紧凑态：左侧品牌、右侧评估入口，中间以竖线清晰分隔。 */
.site-header.is-compact .header-main-row {
  grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
  grid-template-areas: "brand risk";
  align-items: center;
  column-gap: 9px;
  row-gap: 0;
  padding: 5px 10px;
}
.site-header.is-compact .brand {
  gap: 5px;
  min-height: 32px;
  padding: 0 9px 0 0;
  border: 0;
  border-right: 1px solid #cbded3;
  overflow: hidden;
}
.site-header.is-compact .brand-logo {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
  border-radius: 4px;
}
.site-header.is-compact .brand-copy { overflow: hidden; }
.site-header.is-compact .brand-copy strong {
  display: block;
  min-width: 0;
  font-size: clamp(10.5px, 3.1vw, 12.5px);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header.is-compact .brand-copy small,
.site-header.is-compact .header-promo-row { display: none !important; }
.site-header.is-compact .risk-button {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  margin: 0;
  padding: 6px 7px;
  gap: 0;
  border-radius: 8px;
  box-shadow: 0 2px 7px rgba(8,120,77,.14);
  font-size: clamp(11px, 3.4vw, 13.5px);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header.is-compact .risk-button span { display: none; }

/* 主要内容区 */
.page-shell { min-height: 70vh; max-width: var(--content); margin: 0 auto; padding: 22px 24px 58px; }
.loading-state, .empty-state { color: var(--muted); padding: 54px 20px; text-align: center; background: white; border: 1px solid var(--line); border-radius: 16px; }

/* 头图轮播 */
.home-feature-section { margin: 0 auto; }
.feature-carousel { width: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }
.feature-carousel::-webkit-scrollbar { display: none; }
.feature-track { display: flex; align-items: stretch; gap: 14px; }
.feature-slide { position: relative; flex: 0 0 100%; aspect-ratio: 16/9; border-radius: 0; overflow: hidden; scroll-snap-align: start; box-shadow: 0 6px 16px rgba(0,0,0,0.12); }
.feature-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.feature-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent 60%); }
.feature-copy-wrap { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 14px; }
.feature-title { color: #fff; font-size: 14px; font-weight: 700; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.feature-hint { display: flex; align-items: center; justify-content: center; padding: 12px 0 0; color: #83948a; font-size: 11px; }

/* 分类卡片：单列纵向，头图 -> 简介 -> 最多三篇文章 */
.home-categories-section { margin-top: 22px; }
.home-category-grid { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; grid-auto-flow: row !important; width: 100%; gap: 18px; }
.home-category-card {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 0 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 5px 16px rgba(0,0,0,.045);
}
.home-category-image-link { display: block; width: 100%; }
.home-category-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 400 / 172;
  overflow: hidden;
  background: #f3f8f5;
}
.home-category-cover img { display: block; width: 100%; height: 100%; object-fit: contain; }
.category-image-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-800);
  font-size: 20px;
  font-weight: 850;
  letter-spacing: .06em;
  background: linear-gradient(135deg,#e7f4ec,#cce8d8);
}
.home-category-cover img:not([src=""]) ~ .category-image-fallback { display: none; }
.home-category-cover.is-missing .category-image-fallback { display: flex; }
.home-category-info { padding: 13px 15px 8px; }
.home-category-desc { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.home-category-articles {
  list-style: none;
  margin: 0 15px;
  padding: 0;
  border-top: 1px solid var(--line);
}
.home-category-articles li { margin: 0; border-bottom: 1px solid #edf2ee; }
.home-category-articles li:last-child { border-bottom: 0; }
.home-category-articles a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 43px;
  padding: 9px 1px;
  color: #263c30;
  font-size: 13px;
  line-height: 1.5;
}
.home-category-articles a span { flex: 0 0 auto; color: var(--green-700); font-size: 21px; line-height: 1; }
.home-category-articles a:active { color: var(--green-800); }
.home-category-empty { margin: 0 15px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

/* 通用模块标题 */
.section { margin-top: 28px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 18px; color: var(--green-950); }

/* 文章列表网格 */
.article-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.article-card { display: flex; flex-direction: column; background: #fff; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.02); text-decoration: none; }
.article-card-body h3 { margin: 0; padding: 10px; font-size: 14px; color: var(--green-950); line-height: 1.4; }

/* 权威资料 */
.resource-list-wrap { background: #fff; border-radius: 14px; border: 1px solid var(--line); padding: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.02); }
.resource-list-wrap p { margin: 0 0 12px; font-size: 14px; }
.resource-list-wrap p:last-child { margin-bottom: 0; }
.resource-list-wrap a { color: var(--green-800); text-decoration: underline; text-underline-offset: 3px; }

/* 资讯动态 */
.merged-news-card { background: #fff; border-radius: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.04); padding: 0 16px; border: 1px solid var(--line); }
.merged-news-item { display: block; padding: 14px 0; text-decoration: none; }
.merged-news-item:last-child { border-bottom: none !important; }
.merged-news-item h3 { margin: 0; font-size: 14px; color: var(--green-950); font-weight: 600; line-height: 1.4; }

/* 友情链接 */
.friends-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.friend-logo-link { display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 10px; padding: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); border: 1px solid var(--line); text-decoration: none; }
.friend-logo-link img { width: 100%; height: auto; max-height: 36px; object-fit: contain; }

/* 首页搜索框 */
.home-search-panel { padding: 0; border: none; background: transparent; }
.search-form { display: flex; gap: 8px; }
.search-form input { flex: 1; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 22px; font-size: 14px; outline: none; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.search-form button { min-height: 44px; padding: 0 24px; background: var(--green-800); color: #fff; border: none; font-weight: bold; border-radius: 22px; cursor: pointer; box-shadow: 0 4px 10px rgba(8,120,77,0.2); }

/* 文章详情 */
.article-detail { max-width: 820px; margin: 0 auto; }
.article-content { font-size: 15px; line-height: 1.95; color: #27362e; overflow-wrap: anywhere; }
.article-content p { margin: 0 0 1.55em; white-space: pre-wrap; }
.article-content h2 { font-size: 19px; color: var(--green-900); margin: 1.8em 0 .7em; border-left: 4px solid var(--green-600); padding-left: 12px; font-weight: 800; }
.article-content h3 { font-size: 16px; color: var(--green-900); margin: 1.4em 0 .5em; font-weight: 800; }
.article-content ul, .article-content ol { padding-left: 1.45em; margin: 0 0 1.35em; }
.article-content li { padding-left: .18em; margin: .35em 0; }
.article-content a { color: #08784d; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.article-inline-image img { display: block; width: 100%; max-height: 620px; object-fit: contain; border-radius: 8px; }
.article-sources { margin: 24px 0 0; border: 1px solid #dcebe2; background: #f7fbf8; overflow: hidden; border-radius: 8px; }
.article-sources summary { cursor: pointer; padding: 14px 16px; color: var(--green-900); font-size: 13px; font-weight: 800; }
.article-sources summary::after { content: '+'; float: right; font-size: 20px; line-height: 1; color: var(--green-700); }
.article-sources[open] summary::after { content: '−'; }
.article-source-content { padding: 4px 16px 16px; border-top: 1px solid #e6f0ea; color: #52645a; font-size: 13px; }
.article-disclaimer { background: #f7faf8; border: 1px solid var(--line); color: #6e7c74; font-size: 12px; padding: 13px 15px; margin-top: 30px; border-radius: 8px; }

/* 底部版权 */
.site-footer { background: #083e2c; color: rgba(255,255,255,.85); text-align: center; }
.footer-inner { max-width: var(--content); margin: 0 auto; padding: 22px 24px 18px; }
.footer-note { margin: 0 0 11px; color: rgba(255,255,255,.76); font-size: 12px; line-height: 1.7; }
.copyright { margin: 0; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.58); font-size: 11px; }

/* 悬浮回到顶部 */
#back-to-top { position: fixed; right: 18px; bottom: 24px; z-index: 120; width: 44px; height: 44px; border: 1px solid #dcebe3; border-radius: 50%; background: #fff; color: var(--green-800); box-shadow: 0 4px 12px rgba(0,0,0,.1); display: grid; place-items: center; cursor: pointer; transition: transform .18s; }
#back-to-top[hidden] { display: none; }

/* 历史报告提示浮层 */
.history-report-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(150%); width: calc(100% - 32px); max-width: 400px; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 16px; border-radius: 14px; z-index: 9999; transition: transform .4s cubic-bezier(.175,.885,.32,1.275); display: flex; flex-direction: column; gap: 12px; }
.history-report-toast.show { transform: translateX(-50%) translateY(0); }
.history-report-toast p { margin: 0; font-size: 14px; color: var(--ink); font-weight: 600; }
.history-report-toast .toast-actions { display: flex; gap: 10px; }
.history-report-toast .btn-view, .history-report-toast .btn-close { flex: 1; text-align: center; padding: 10px; font-size: 14px; font-weight: 700; border: none; cursor: pointer; border-radius: 8px; }
.history-report-toast .btn-view { background: var(--green-800); color: #fff; text-decoration: none; }
.history-report-toast .btn-close { background: #f0f5f2; color: var(--green-900); }

/* 响应式：窄屏下两态页眉仍保持清晰，不显示汉堡菜单。 */
@media (max-width: 700px) {
  /* 两种页眉状态均使用上方统一规则；手机端只调整内容区边距。 */

  .page-shell { padding: 14px 12px 36px; }
  .home-category-grid { gap: 14px; }
  .home-category-info { padding: 11px 12px 7px; }
  .home-category-desc { font-size: 12px; }
  .home-category-articles { margin: 0 12px; }
  .home-category-articles a { min-height: 41px; font-size: 12px; }
  .article-grid { gap: 8px; }
  .article-card-body h3 { padding: 8px; font-size: 13px; }
  .resource-list-wrap { padding: 12px; }
  .resource-list-wrap p { font-size: 13px; margin-bottom: 10px; }
  .merged-news-item { padding: 12px 0; }
  .merged-news-item h3 { font-size: 13px; }
  .friends-grid { gap: 8px; }
  .friend-logo-link { padding: 8px; }
  .friend-logo-link img { max-height: 28px; }
  .article-content { font-size: 15px; line-height: 1.9; }
  .article-content h2 { font-size: 17px; }
  .footer-inner { padding: 20px 15px 16px; }
}

/* 窄屏优化：保留较大的品牌名与评估按钮字号，避免按钮溢出。 */
@media (max-width: 420px) {
  .site-header.is-compact .header-main-row {
    grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
    padding-left: 8px;
    padding-right: 8px;
    column-gap: 7px;
  }
  .site-header.is-compact .brand {
    gap: 4px;
    padding-right: 7px;
  }
  .site-header.is-compact .brand-logo {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }
  .site-header.is-compact .brand-copy strong {
    font-size: clamp(10.5px, 3.1vw, 12.5px);
  }
  .site-header.is-compact .risk-button {
    font-size: clamp(11px, 3.4vw, 13.5px);
    padding-left: 5px;
    padding-right: 5px;
  }
}

.home-category-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-auto-flow: row !important;
}
