/* Homepage component layer.
   This file is intentionally loaded after the shared glass theme. It is the
   single source of truth for the visible PC portal cards and live blocks. */

body[data-page="home"] {
  /* Primitive tokens */
  --home-blue-900: #00557a;
  --home-blue-700: #006e97;
  --home-teal-900: #10433e;
  --home-teal-700: #0a665d;
  --home-warm-900: #56321f;
  --home-warm-700: #7a3f20;
  --home-slate-900: #003b52;
  --home-slate-600: #15546e;
  --home-slate-500: #15546e;
  --home-search-title: #002e3d;
  --home-search-copy: #0a4a63;
  --home-focus: rgba(0,172,235,.44);

  /* Semantic surface tokens */
  --home-live-border: rgba(94, 126, 158, .22);
  --home-live-shadow: 0 16px 36px rgba(45, 76, 105, .09), inset 0 1px 0 rgba(255, 255, 255, .82);
  --home-news-surface: rgba(237, 247, 255, .94);
  --home-news-border: rgba(50, 117, 181, .38);
  --home-products-surface: rgba(235, 248, 245, .95);
  --home-products-border: rgba(37, 126, 116, .36);
  --home-terms-surface: rgba(255, 243, 233, .95);
  --home-terms-border: rgba(159, 91, 52, .34);
  --home-forum-surface: rgba(255, 255, 255, .88);
}

body[data-page="home"] .hero-shell .search-panel .search-panel-title {
  color: var(--home-search-title) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

body[data-page="home"] .hero-shell .search-panel .search-panel-copy {
  color: var(--home-search-copy) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* PC portal cards */
body[data-page="home"]:not(.mobile-page) .portal-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

body[data-page="home"]:not(.mobile-page) .portal-card {
  position: relative !important;
  display: flex !important;
  box-sizing: border-box !important;
  height: 104px !important;
  min-height: 104px !important;
  padding: 14px 16px !important;
  align-items: center !important;
  gap: 12px !important;
  overflow: hidden !important;
  border-radius: 18px !important;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease !important;
}

body[data-page="home"]:not(.mobile-page) .portal-card .portal-head {
  display: flex !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  align-items: center !important;
  gap: 14px !important;
}

body[data-page="home"]:not(.mobile-page) .portal-card .portal-head > div:last-child {
  display: flex !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  align-items: baseline !important;
  gap: 12px !important;
}

body[data-page="home"]:not(.mobile-page) .portal-card .portal-icon {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  flex: 0 0 52px !important;
  border-radius: 14px !important;
}

body[data-page="home"]:not(.mobile-page) .portal-card .portal-icon svg {
  width: 26px !important;
  height: 26px !important;
}

body[data-page="home"]:not(.mobile-page) .portal-card strong {
  flex: 0 0 auto !important;
  max-width: 42% !important;
  margin: 0 !important;
  overflow: hidden !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-page="home"]:not(.mobile-page) .portal-card p {
  display: block !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  overflow: hidden !important;
  color: var(--home-slate-500) !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-page="home"]:not(.mobile-page) .portal-card .portal-actions {
  position: absolute !important;
  inset: 0 !important;
  z-index: 2 !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  pointer-events: none !important;
  transform: none !important;
  /* Reset the legacy glass-theme arrow-button placement: an abs-positioned
     overlay with align/justify-self (or a grid area) shrinks to fit-content
     instead of stretching, which collapses the whole-card click layer. */
  grid-area: auto !important;
  place-self: stretch !important;
}

body[data-page="home"]:not(.mobile-page) .portal-card .portal-actions a {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  border-color: transparent !important;
  border-radius: inherit !important;
  background: transparent !important;
  box-shadow: none !important;
  color: transparent !important;
  font-size: 0 !important;
  pointer-events: auto !important;
}

body[data-page="home"]:not(.mobile-page) .portal-card .portal-actions a::after,
body[data-page="home"]:not(.mobile-page) .portal-card .portal-actions a span {
  content: none !important;
  display: none !important;
}

body[data-page="home"]:not(.mobile-page) .portal-card .portal-actions a:focus-visible {
  outline: 3px solid var(--home-focus) !important;
  outline-offset: -3px !important;
}

body[data-page="home"]:not(.mobile-page) .portal-card:hover {
  transform: translateY(-2px) !important;
}

/* PC live blocks use explicit semantic classes; their appearance no longer
   depends on DOM order. */
body[data-page="home"]:not(.mobile-page) .live-strip .live-block {
  border-color: var(--home-live-border) !important;
  box-shadow: var(--home-live-shadow) !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-news {
  background: var(--home-news-surface) !important;
  border-color: var(--home-news-border) !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-products {
  background: var(--home-products-surface) !important;
  border-color: var(--home-products-border) !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-terms {
  background: var(--home-terms-surface) !important;
  border-color: var(--home-terms-border) !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-forum {
  background: var(--home-forum-surface) !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-head h3 {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-head h3::before {
  content: "" !important;
  display: block !important;
  width: 4px !important;
  height: 16px !important;
  flex: 0 0 4px !important;
  border-radius: 2px !important;
  background: currentColor !important;
  opacity: .9 !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-news h3 {
  color: var(--home-blue-900) !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-news .live-block-list a {
  color: var(--home-blue-700) !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-products h3 {
  color: var(--home-teal-900) !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-products .live-block-list a {
  color: var(--home-teal-700) !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-terms h3 {
  color: var(--home-warm-900) !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-terms .live-block-list a {
  color: var(--home-warm-700) !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-list a {
  font-size: 14px !important;
  font-weight: 700 !important;
  transition: color .16s ease, text-decoration-color .16s ease !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-list a:hover,
body[data-page="home"]:not(.mobile-page) .live-block-list a:focus-visible {
  color: var(--home-slate-900) !important;
  text-decoration: underline !important;
  text-decoration-color: currentColor !important;
  text-decoration-thickness: 1px !important;
  text-underline-offset: 3px !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-list .live-date {
  color: var(--home-slate-600) !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
}

/* Desktop live cards: give each line a clear reading rhythm without
   changing the compact mobile presentation. */
@media (min-width: 901px) {
  body[data-page="home"]:not(.mobile-page) .live-block {
    padding: 18px 18px 16px !important;
    gap: 12px !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-head {
    min-height: 23px !important;
    padding-bottom: 11px !important;
    border-bottom: 1px solid rgba(91, 124, 158, .16) !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-head h3 {
    font-size: 18px !important;
    letter-spacing: 0 !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-list {
    gap: 0 !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-list li {
    position: relative !important;
    min-height: 32px !important;
    box-sizing: border-box !important;
    padding: 6px 0 !important;
    align-items: center !important;
    gap: 8px !important;
    border-bottom: 1px solid rgba(91, 124, 158, .12) !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-list li:last-child,
  body[data-page="home"]:not(.mobile-page) .live-block-products .live-block-list li:nth-last-child(-n + 2),
  body[data-page="home"]:not(.mobile-page) .live-block-terms .live-block-list li:nth-last-child(-n + 2) {
    border-bottom-color: transparent !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-list li::before {
    display: none !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-list a {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    line-height: 1.55 !important;
    letter-spacing: 0 !important;
    color: #002e3d !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-products .live-block-list a,
  body[data-page="home"]:not(.mobile-page) .live-terms-list a {
    font-weight: 600 !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-list .live-date,
  body[data-page="home"]:not(.mobile-page) .live-block .live-empty {
    color: #002e3d !important;
  }

  /* Keep body copy consistent; distinguish the four sections through their
     headings and small leading marks instead of coloring every row. */
  body[data-page="home"]:not(.mobile-page) .live-block-news .live-block-head h3 {
    color: #3b82f6 !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-news .live-block-head h3::before {
    width: 4px !important;
    height: 18px !important;
    border-radius: 2px !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-products .live-block-head h3 {
    color: #14b8a6 !important;
    font-weight: 850 !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-products .live-block-head h3::before {
    width: 5px !important;
    height: 14px !important;
    border-radius: 7px !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-terms .live-block-head h3 {
    color: #f97316 !important;
    letter-spacing: .015em !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-terms .live-block-head h3::before {
    width: 7px !important;
    height: 7px !important;
    border-radius: 50% !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-forum .live-block-head h3 {
    color: #65a30d !important;
    font-weight: 750 !important;
    letter-spacing: .025em !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-forum .live-block-head h3::before {
    width: 14px !important;
    height: 3px !important;
    border-radius: 3px !important;
  }

  /* Override the earlier semantic link colors at the same specificity so
     every card's body copy uses one unified reading color. */
  body[data-page="home"]:not(.mobile-page) .live-block-news .live-block-list a,
  body[data-page="home"]:not(.mobile-page) .live-block-products .live-block-list a,
  body[data-page="home"]:not(.mobile-page) .live-block-terms .live-block-list a,
  body[data-page="home"]:not(.mobile-page) .live-block-forum .live-block-list a {
    color: #002e3d !important;
    font-weight: 400 !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-list .live-date {
    min-width: 72px !important;
    text-align: right !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
    font-variant-numeric: tabular-nums !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-products .live-block-list,
  body[data-page="home"]:not(.mobile-page) .live-terms-list {
    column-gap: 18px !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-products .live-block-list li,
  body[data-page="home"]:not(.mobile-page) .live-terms-list li {
    min-width: 0 !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-block-forum .live-block-list li {
    min-height: 34px !important;
  }
}

@media (max-width: 1100px) and (min-width: 769px) {
  body[data-page="home"]:not(.mobile-page) .portal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-page="home"]:not(.mobile-page) .live-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Search-only desktop entry; mobile keeps its independent composition. */
body[data-page="home"]:not(.mobile-page) .hero-shell {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
  padding: 30px 36px !important;
}

@media (min-width: 769px) {
  body[data-page="home"]:not(.mobile-page) .search-panel-heading {
    display: flex !important;
    align-items: baseline !important;
    gap: 14px !important;
    flex-wrap: wrap !important;
  }

  body[data-page="home"]:not(.mobile-page) .search-panel-heading .search-panel-title {
    margin: 0 !important;
    font-size: 32px !important;
    line-height: 1.35 !important;
    flex: 0 0 auto !important;
  }

  body[data-page="home"]:not(.mobile-page) .search-panel-heading .search-panel-copy {
    margin: 0 !important;
    flex: 0 1 auto !important;
    line-height: 1.45 !important;
  }

  body[data-page="home"]:not(.mobile-page) .search-panel .hero-search {
    margin-top: 14px !important;
  }
}

/* 首页 PC 四个实时板块：标题统一左对齐，左侧标记统一采用资讯板块的竖线规格。 */
body[data-page="home"]:not(.mobile-page) .live-block-head {
  justify-content: flex-start !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-head h3 {
  justify-content: flex-start !important;
  text-align: left !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-head h3::before {
  width: 4px !important;
  height: 18px !important;
  flex: 0 0 4px !important;
  border-radius: 2px !important;
}

/* 各板块此前有更高优先级的颜色标记规则，必须在同等优先级下统一规格，
   否则后面的通用规则会被行业资讯/产品/词条/社区各自的旧尺寸覆盖。 */
body[data-page="home"]:not(.mobile-page) .live-block-news .live-block-head h3::before,
body[data-page="home"]:not(.mobile-page) .live-block-products .live-block-head h3::before,
body[data-page="home"]:not(.mobile-page) .live-block-terms .live-block-head h3::before,
body[data-page="home"]:not(.mobile-page) .live-block-forum .live-block-head h3::before {
  width: 4px !important;
  height: 18px !important;
  flex: 0 0 4px !important;
  border-radius: 2px !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-products .live-block-list,
body[data-page="home"]:not(.mobile-page) .live-terms-list {
  text-align: left !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-products .live-block-list li,
body[data-page="home"]:not(.mobile-page) .live-terms-list li {
  justify-content: flex-start !important;
}

body[data-page="home"]:not(.mobile-page) .live-block-products .live-block-list a,
body[data-page="home"]:not(.mobile-page) .live-terms-list a {
  width: auto !important;
  text-align: left !important;
}
