:root {
  --header-h: 72px;
  --topbar-h: 0px;
  --accent: #b91c1c;
  --accent-dark: #7f1d1d;
  --paper: #ffffff;
  --paper-card: #ffffff;
  --text: #1c1917;
  --muted: #57534e;
  --border: #e5e7eb;
  --shadow: rgba(28, 25, 23, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  color: var(--text);
  background: var(--paper);
  line-height: 1.65;
  padding-top: calc(var(--topbar-h) + var(--header-h));
}
.tpl-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1001;
  height: var(--topbar-h);
  background: linear-gradient(90deg, var(--accent-dark) 0%, #450a0a 100%);
  color: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  font-size: 12px;
  padding: 0 1rem;
}
.site-header {
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--paper-card);
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 4px 20px var(--shadow);
  display: flex;
  align-items: center;
}
.site-header__inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-logo {
  text-decoration: none;
  color: var(--accent-dark);
  font-size: 1.35rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.02em;
  min-height: 40px;
}
.site-logo:hover { color: var(--accent); }
.site-logo img { height: 40px; width: auto; max-width: 160px; object-fit: contain; display: none; }
.site-logo.is-with-logo img { display: block; }
#site-logo-text {
  display: inline-block;
  min-width: 8ch;
  white-space: nowrap;
}
.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: #374151;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.42rem 0.82rem;
  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), #ef4444);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}
.site-nav a:hover {
  background: rgba(185, 28, 28, 0.1);
  color: var(--accent-dark);
  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(185, 28, 28, 0.14);
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.18);
}
.site-nav--loading #nav-list { min-width: 360px; min-height: 34px; }
.site-nav--loading #nav-list::before {
  content: '';
  display: block;
  width: 100%;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(110deg, #ffffff 0%, #f3f4f6 45%, #ffffff 55%, #f3f4f6 100%);
  background-size: 220% 100%;
  animation: tpl1-shimmer 1.35s ease-in-out infinite;
}
.site-nav--loading ul::after { content: '加載導航…'; font-size: 0.82rem; color: var(--muted); padding-left: 0.5rem; }
.site-nav--error ul::after { content: attr(data-error); font-size: 0.82rem; color: #b45309; padding-left: 0.5rem; }
.nav-empty { color: var(--muted); font-size: 0.85rem; }
.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--paper-card);
  padding: 0.45rem 0.65rem;
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-dark);
}
@keyframes tpl1-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav--loading #nav-list { min-width: 0; }
  .site-nav--loading #nav-list::before { display: none; }
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--paper-card);
    border-bottom: 2px solid var(--accent);
    padding: 0.65rem 1rem;
    display: none;
    box-shadow: 0 12px 24px var(--shadow);
  }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav li { border-bottom: 1px solid var(--border); }
  .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(185, 28, 28, 0.35); }
  .site-nav a:hover { transform: none; background: rgba(185, 28, 28, 0.08); }
}
.site-article-detail {
  width: min(960px, 100% - 2rem);
  margin: 1.25rem auto 2rem;
  background: var(--paper-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 2px 12px var(--shadow);
  padding: 1.1rem 1.2rem 1.25rem;
}
.site-article-detail__back {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.45rem 0.8rem;
}
.site-article-detail__header { margin-top: 0.9rem; border-bottom: 1px dashed var(--border); padding-bottom: 0.8rem; }
.site-article-detail__title { margin: 0; font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.35; color: var(--accent-dark); }
.site-article-detail__meta { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--muted); }
.site-article-detail__body { margin-top: 1.1rem; font-size: 1rem; color: #292524; line-height: 1.85; word-break: break-word; }
.site-article-detail__body img { max-width: 100%; height: auto; border-radius: 4px; }
.site-article-detail__pager {
  margin-top: 1.4rem;
  border-top: 1px dashed var(--border);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.site-article-detail__pager-link {
  display: block;
  color: var(--accent-dark);
  text-decoration: none !important;
  font-size: 0.88rem;
  line-height: 1.5;
}
.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;
}
.tpl1-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.25rem;
  align-items: start;
}
.tpl1-main-col { min-width: 0; }
.tpl1-side-col {
  position: sticky;
  top: calc(var(--topbar-h) + var(--header-h) + 12px);
}
.tpl1-side-card {
  background: var(--paper-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.85rem 1rem 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 10px var(--shadow);
}
.tpl1-side-card__title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-dark);
  padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--accent);
}
.tpl1-side-card__body {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.65;
}
#tpl1-hot-list,
#tpl1-random-list {
  min-height: 210px;
}
.tpl1-side-loading {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: #9ca3af;
}
.tpl1-hot-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{border-bottom:none;padding-bottom:0}
.tpl1-hot-item__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;font-size:13px;line-height:1.45;font-weight:600}
.tpl1-hot-item:hover .tpl1-hot-item__title{color:#b91c1c}
.tpl1-random-item{display:flex;gap:8px;align-items:flex-start;text-decoration:none;color:inherit;padding-bottom:8px;border-bottom:1px dashed rgba(0,0,0,.08)}
.tpl1-random-item:last-child{border-bottom:none;padding-bottom:0}
.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}
.tpl1-random-item__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;font-size:13px;line-height:1.45;font-weight:600}
.tpl1-random-item:hover .tpl1-random-item__title{color:#b91c1c}
@media (max-width: 640px) {
  .tpl1-shell {
    grid-template-columns: 1fr;
  }
}
footer.site-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  background: #292524;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
  border-top: 3px solid var(--accent);
}
.site-footer__friend-title {
  margin: 0 0 0.4rem;
  color: #f5f5f4;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.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: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
  padding-bottom: 1px;
}
.site-footer__links a:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.7);
}
.site-footer__desc {
  margin: 0.85rem auto 0;
  max-width: 920px;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.75;
  font-size: 0.8rem;
}
/* runtime parity: avoid first-paint ad/customer-service flicker */
.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__placeholder {
  display: block;
  width: 100%;
  border-radius: 4px;
  background: #f3f4f6;
}
.site-banner-ad--sidebar-long { margin: 0 0 12px; min-height: 240px; }
.site-banner-ad--sidebar-long .site-banner-ad__placeholder {
  aspect-ratio: 1 / 2;
  min-height: 240px;
}
.site-banner-ad--sidebar-short { margin: 0 0 12px; }
.site-banner-ad--detail { margin: 18px 0; }

.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: 1200px) {
  .site-customer-service-fixed {
    right: 10px;
    bottom: 140px;
  }
  .site-customer-service-fixed__card { width: 160px; }
}
