:root {
  --header-h: 64px;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2254f4;
  --line: #e5e7eb;
}
* { box-sizing: border-box; }
body.tpl--portal { margin: 0; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; padding-top: var(--header-h); }
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: var(--header-h); background: #fff; border-bottom: 1px solid var(--line); }
.site-header__inner { max-width: 1180px; margin: 0 auto; padding: 0 1rem; height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.site-logo { font-size: 1.05rem; font-weight: 800; color: var(--accent); text-decoration: none; display: inline-flex; align-items: center; gap: 0.45rem; }
.site-logo img { height: 36px; width: auto; max-width: 160px; object-fit: contain; display: none; }
.site-logo.is-with-logo img { display: block; }
.site-nav { flex: 1; display: flex; justify-content: flex-end; align-items: center; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 0.45rem; align-items: center; }
.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), #5b7cff);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}
.site-nav a:hover {
  color: var(--accent);
  background: rgba(34, 84, 244, 0.1);
  transform: translateY(-1px);
}
.site-nav a:hover::after,
.site-nav a:focus-visible::after { transform: scaleX(1); }
.site-nav a:focus-visible {
  outline: none;
  background: rgba(34, 84, 244, 0.14);
  box-shadow: 0 0 0 2px rgba(34, 84, 244, 0.2);
}
.site-nav--loading ul::after { content: "加载导航..."; font-size: 0.82rem; color: var(--muted); }
.site-nav--error ul::after { content: attr(data-error); font-size: 0.82rem; color: var(--accent); }
.nav-toggle { display: none; border: 1px solid var(--line); background: #fff; color: #374151; padding: 0.4rem 0.65rem; border-radius: 4px; cursor: pointer; font-size: 0.78rem; font-weight: 600; }

main { max-width: 1180px; margin: 0 auto; padding: 1rem 1rem 2rem; }
.tpl2-shell { display: grid; grid-template-columns: 1fr 300px; gap: 1rem; align-items: start; }
.tpl2-main-col { min-width: 0; }
.tpl2-side-col { min-width: 0; }
.tpl2-side-card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 0.9rem; margin-bottom: 1rem; }
.tpl2-side-card__title { margin: 0 0 0.65rem; font-size: 0.95rem; color: #111827; border-left: 3px solid var(--accent); padding-left: 0.45rem; }
.tpl2-side-card__body { margin: 0; }

.site-article-detail { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 1rem; }
.site-article-detail__back { margin-bottom: 0.8rem; border: 1px solid var(--line); background: #fff; color: #374151; border-radius: 4px; padding: 0.4rem 0.75rem; font-size: 0.82rem; cursor: pointer; }
.site-article-detail__title { margin: 0; font-size: 1.4rem; color: #111827; line-height: 1.35; }
.site-article-detail__meta { margin: 0.45rem 0 0; font-size: 0.8rem; color: var(--muted); }
.site-article-detail__body { margin-top: 0.9rem; font-size: 0.96rem; color: #1f2937; line-height: 1.8; }
.site-article-detail__body img { max-width: 100%; height: auto; border-radius: 4px; }
.site-article-detail__pager { margin-top: 1rem; border-top: 1px dashed var(--line); padding-top: 0.8rem; display: flex; flex-direction: column; gap: 0.45rem; }
.site-article-detail__pager-link { color: #4b5563; text-decoration: none !important; font-size: 0.86rem; }
.site-article-detail__pager-link:hover { color: var(--accent); text-decoration: none !important; }
.site-article-detail__pager-link.is-disabled { color: #9ca3af; cursor: default; pointer-events: none; }

.site-banner-ad { margin: 12px 0 18px; border-radius: 4px; overflow: hidden; border: none; background: transparent; }
.site-banner-ad[hidden] { display: none !important; }
.site-banner-ad__rich { display: block; width: 100%; padding: 0; background: transparent; line-height: 1.6; }
.site-banner-ad__link { display: block; text-decoration: none; color: inherit; }
.site-banner-ad__rich p { margin: 0; padding: 0; }
.site-banner-ad__rich img { display: block; width: 100% !important; height: auto !important; max-width: 100% !important; border: 0; outline: 0; }
.site-banner-ad__rich * { max-width: 100%; }
.site-banner-ad--sidebar-long { margin: 0 0 12px; }
.site-banner-ad--sidebar-short { margin: 0 0 12px; }
.site-banner-ad--detail { margin: 18px 0; }

#tpl1-hot-list,#tpl1-random-list { display: flex; flex-direction: column; gap: 8px; }
.tpl1-hot-item,.tpl1-random-item { display: block; text-decoration: none; color: inherit; padding-bottom: 8px; border-bottom: 1px dashed rgba(0,0,0,.08); }
.tpl1-hot-item:last-child,.tpl1-random-item:last-child { border-bottom: none; padding-bottom: 0; }
.tpl1-hot-item__title,.tpl1-random-item__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.45; font-weight: 600; }
.tpl1-hot-item:hover .tpl1-hot-item__title,.tpl1-random-item:hover .tpl1-random-item__title { color: var(--accent); }
.tpl1-random-item { display: flex; gap: 8px; align-items: flex-start; }
.tpl1-random-item__thumb { flex: 0 0 72px; width: 72px; height: 50px; border-radius: 3px; overflow: hidden; background: #f3f4f6; }
.tpl1-random-item__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

footer.site-footer { text-align: center; padding: 1.2rem 1rem; background: #fff; border-top: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); }
.site-footer__friend-title { margin: 0 0 0.4rem; color: #374151; font-weight: 700; }
.site-footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem 1rem; margin: 0; padding: 0; list-style: none; }
.site-footer__links a { color: #4b5563; text-decoration: none; border-bottom: 1px dashed #d1d5db; }
.site-footer__links a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.site-customer-service-fixed {
  position: fixed;
  right: max(14px, calc((100vw - 1180px) / 2 - 194px));
  bottom: 184px;
  z-index: 950;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}
.site-customer-service-fixed__card {
  width: 168px;
  padding: 12px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(20, 150, 212, 0.16);
  box-shadow: 0 16px 30px rgba(34, 52, 78, 0.1);
  color: #202a36;
}
.site-customer-service-fixed__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.site-customer-service-fixed__avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(20, 150, 212, 0.1);
  color: #1496d4;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.site-customer-service-fixed__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.site-customer-service-fixed__avatar svg {
  width: 18px;
  height: 18px;
  display: block;
}
.site-customer-service-fixed__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.site-customer-service-fixed__platform {
  font-size: 12px;
  line-height: 1.2;
  color: #738193;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-customer-service-fixed__title {
  font-size: 13px;
  line-height: 1.3;
  font-weight: 400;
  color: #202a36;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-customer-service-fixed__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.site-customer-service-fixed__field-label {
  font-size: 11px;
  line-height: 1.25;
  color: #738193;
}
.site-customer-service-fixed__field-value {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 400;
  color: #202a36;
  word-break: break-all;
  min-height: 20px;
}
.site-customer-service-fixed__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.site-customer-service-fixed__button {
  appearance: none;
  border: 0;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: transform .18s ease, opacity .18s ease;
}
.site-customer-service-fixed__button:hover { transform: translateY(-1px); }
.site-customer-service-fixed__button.is-copy {
  width: 44px;
  background: rgba(32, 42, 54, 0.08);
  color: #202a36;
}
.site-customer-service-fixed__button.is-copy[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}
.site-customer-service-fixed__button.is-contact {
  flex: 1 1 auto;
  background: #1496d4;
  color: #ffffff;
}
.site-customer-service-fixed__button.is-contact.is-whatsapp {
  background: #25D366;
}
.site-customer-service-fixed__copy-state {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: #738193;
  min-height: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav { position: absolute; top: var(--header-h); left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 0.65rem 1rem; display: none; }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; align-items: stretch; width: 100%; }
  .site-nav li { border-bottom: 1px solid #f3f4f6; }
  .site-nav a { display: block; padding: 0.7rem 0.2rem; border-radius: 0; }
  .site-nav a::after { left: 0; right: 0; bottom: 0; height: 1px; background: rgba(34, 84, 244, 0.35); }
  .site-nav a:hover { transform: none; background: rgba(34, 84, 244, 0.08); }
  .tpl2-shell { grid-template-columns: 1fr; }
  .site-customer-service-fixed { right: 10px; bottom: 140px; }
}
@media (max-width: 1200px) {
  .site-customer-service-fixed {
    right: 10px;
    bottom: 140px;
  }
  .site-customer-service-fixed__card { width: 160px; }
}
