/**
 * 门户详情富文本排版（资讯 / 产品 / 企业简介）
 * 引入：portal_template/*/public/head.html
 * 正文：class="content portal-article"
 * 直接使用门户主题变量：--ink --muted --line --soft --brand --brand2 --accent --paper
 * 均带兜底色，不另造 --pa-* 中间变量
 */

.portal-article {
  color: var(--ink, #1a221f);
  font-size: 16px;
  line-height: 1.9;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.portal-article > *:first-child {
  margin-top: 0;
}

.portal-article > *:last-child {
  margin-bottom: 0;
}

.portal-article p {
  margin: 0 0 1.05em;
  color: var(--ink, #1a221f);
  opacity: 0.92;
  text-align: justify;
  text-justify: inter-ideograph;
}

.portal-article h2,
.portal-article h3,
.portal-article h4 {
  color: var(--ink, #1a221f);
  font-weight: 800;
  line-height: 1.45;
  margin: 1.55em 0 0.7em;
  letter-spacing: 0.01em;
  opacity: 1;
}

.portal-article h2 {
  font-size: 1.35em;
  padding-bottom: 0.45em;
  border-bottom: 2px solid var(--line, #c9dbd3);
  position: relative;
}

.portal-article h2::before {
  content: "";
  display: inline-block;
  width: 0.28em;
  height: 0.95em;
  margin-right: 0.45em;
  border-radius: 2px;
  background: var(--brand, #0f5c4c);
  vertical-align: -0.08em;
}

.portal-article h3 {
  font-size: 1.15em;
  padding-left: 0.7em;
  border-left: 3px solid var(--brand, #0f5c4c);
}

.portal-article h4 {
  font-size: 1.05em;
  color: var(--brand2, var(--brand, #0a3f35));
}

.portal-article strong,
.portal-article b {
  color: var(--ink, #1a221f);
  font-weight: 800;
}

.portal-article em,
.portal-article i {
  color: var(--muted, #5a6b63);
  font-style: italic;
}

.portal-article span {
  color: inherit;
}

.portal-article a {
  color: var(--brand, #0f5c4c);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.portal-article a:hover {
  color: var(--accent, #c45c26);
}

/* 列表：浅底 + 左侧品牌条（不用 color-mix，兼容更好） */
.portal-article ul,
.portal-article ol {
  margin: 0.55em 0 1.25em;
  padding: 1em 1.05em 1em 1.2em;
  list-style: none !important;
  background: var(--soft, #eef6f3);
  border: 1px solid var(--line, #c9dbd3);
  border-radius: 12px;
  box-shadow: 0 6px 16px var(--shadow, rgba(15, 23, 42, 0.06));
}

.portal-article ul > li {
  position: relative;
  padding: 0.35em 0.35em 0.35em 1.05em;
  margin: 0.15em 0;
  border-radius: 8px;
}

.portal-article ul > li:hover {
  background: var(--paper, #fff);
}

.portal-article ul > li::before {
  content: "";
  position: absolute;
  left: 0.12em;
  top: 0.85em;
  width: 0.48em;
  height: 0.48em;
  border-radius: 50%;
  background: var(--brand, #0f5c4c);
  box-shadow: 0 0 0 3px var(--wash, rgba(15, 92, 76, 0.12));
}

.portal-article ol {
  counter-reset: portal-ol;
}

.portal-article ol > li {
  position: relative;
  padding: 0.4em 0.35em 0.4em 2em;
  margin: 0.2em 0;
  border-radius: 8px;
  counter-increment: portal-ol;
}

.portal-article ol > li:hover {
  background: var(--paper, #fff);
}

.portal-article ol > li::before {
  content: counter(portal-ol);
  position: absolute;
  left: 0.08em;
  top: 0.35em;
  width: 1.45em;
  height: 1.45em;
  border-radius: 999px;
  background: var(--paper, #fff);
  border: 1px solid var(--line, #c9dbd3);
  color: var(--brand, #0f5c4c);
  font-size: 0.78em;
  font-weight: 800;
  line-height: 1.4em;
  text-align: center;
}

.portal-article li > p {
  margin: 0.25em 0;
  opacity: 1;
}

.portal-article li > ul,
.portal-article li > ol {
  margin: 0.45em 0 0.15em;
  padding: 0.5em 0.75em 0.5em 1em;
  background: var(--paper, #fff);
  border: 1px dashed var(--line, #c9dbd3);
  border-left: 3px solid var(--brand-mid, var(--brand, #0f5c4c));
  border-radius: 10px;
  box-shadow: none;
}

.portal-article blockquote {
  margin: 1.2em 0;
  padding: 0.95em 1.1em;
  border-left: 4px solid var(--accent, #c45c26);
  background: var(--soft, #eef6f3);
  border-radius: 0 12px 12px 0;
  color: var(--muted, #5a6b63);
  font-size: 0.96em;
}

.portal-article blockquote p:last-child {
  margin-bottom: 0;
}

.portal-article .table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.2em 0;
}

.portal-article table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.95em;
  border: 1px solid var(--line, #c9dbd3);
  border-radius: 8px;
  background: var(--paper, #fff);
}

.portal-article thead,
.portal-article th {
  background: var(--soft, #eef6f3);
}

.portal-article th,
.portal-article td {
  padding: 0.7em 0.9em;
  border: 1px solid var(--line, #c9dbd3);
  text-align: left;
  vertical-align: top;
}

.portal-article th {
  color: var(--ink, #1a221f);
  font-weight: 800;
  white-space: nowrap;
}

.portal-article tbody tr:nth-child(even) {
  background: var(--soft, #f5f8fb);
}

.portal-article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.1em auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--shadow, rgba(15, 23, 42, 0.08));
}

.portal-article hr {
  border: 0;
  height: 1px;
  margin: 1.6em 0;
  background: var(--line, #c9dbd3);
}

.portal-article h3 + p {
  margin-top: 0.35em;
}

.portal-article h3 + ul,
.portal-article h3 + ol {
  margin-top: 0.55em;
}

.faq .portal-article,
.faq details .portal-article {
  font-size: 15px;
  line-height: 1.8;
}

/* 产品封面（详情 / 列表卡片） */
.detail-cover {
  margin: 14px 0 4px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--soft, #eef6f3);
  border: 1px solid var(--line, #c9dbd3);
  box-shadow: 0 8px 22px var(--shadow, rgba(15, 23, 42, 0.06));
}

.detail-cover img {
  display: block;
  width: 100%;
  max-height: min(420px, 56vw);
  object-fit: cover;
  background: var(--soft, #eef6f3);
}

.card-cover {
  aspect-ratio: var(--list-img-ratio, 3 / 2);
  margin: 0 0 12px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--soft, #eef6f3);
  border: 1px solid var(--line, #c9dbd3);
}

.card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.card:hover .card-cover img,
.tile:hover .card-cover img,
.cafe-card:hover .card-cover img,
.h-scroll a:hover .card-cover img {
  transform: scale(1.03);
}

/* 首页产品：tile / cafe / 横向卡片 */
.tile .card-cover,
.cafe-card .card-cover,
.h-scroll a .card-cover {
  margin-bottom: 12px;
}

.tile .card-cover,
.cafe-card .card-cover,
.h-scroll a .card-cover {
  aspect-ratio: var(--list-img-ratio, 3 / 2);
}

.h-scroll a .card-cover {
  width: 100%;
}

/* station 看板行内缩略图 */
.board-row .row-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--soft, #eef6f3);
  border: 1px solid var(--line, #c9dbd3);
  flex-shrink: 0;
}

.board-row .row-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.board-row.has-thumb {
  grid-template-columns: 72px 48px minmax(0, 1fr) 110px;
  align-items: center;
}

@media (max-width: 640px) {
  .board-row.has-thumb {
    grid-template-columns: 56px 40px minmax(0, 1fr) 72px;
  }

  .board-row .row-thumb {
    width: 40px;
    height: 40px;
  }
}

/* 详情底栏操作 */
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line, #c9dbd3);
}

.detail-actions a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line, #c9dbd3);
  background: var(--paper, #fff);
  color: var(--brand, #0f5c4c);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.detail-actions a:hover {
  background: var(--soft, #eef6f3);
  border-color: var(--brand, #0f5c4c);
  color: var(--brand2, var(--brand, #0a3f35));
  transform: translateY(-1px);
}

.detail-actions a.is-primary {
  background: var(--brand, #0f5c4c);
  border-color: var(--brand, #0f5c4c);
  color: var(--on-brand, #fff);
}

.detail-actions a.is-primary:hover {
  background: var(--brand2, var(--brand, #0a3f35));
  border-color: var(--brand2, var(--brand, #0a3f35));
  color: #fff;
}

.detail-actions a::before {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

@media (max-width: 640px) {
  .portal-article {
    font-size: 15px;
    line-height: 1.85;
  }

  .portal-article h2 {
    font-size: 1.22em;
  }

  .portal-article h3 {
    font-size: 1.08em;
  }

  .portal-article ul,
  .portal-article ol {
    padding-left: 0.95em;
    padding-right: 0.75em;
  }

  .detail-actions {
    gap: 8px;
  }

  .detail-actions a {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
    padding: 9px 12px;
  }
}
