:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #0f172a;
  --body: #5b6573;
  --muted: #8b95a5;
  --line: #e6ebf2;
  --brand: #2563eb;
  --brand-contrast: #ffffff;
  --accent: #b91c1c;
  --accent-soft: #fdf0d5;
  --gold: #d9a441;
  --radius: 14px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg: #232e42;
  --surface: #2c3950;
  --ink: #ffffff;
  --body: #c7d2e4;
  --muted: #93a2ba;
  --line: #3b4a63;
  --brand: #6ea8fe;
  --brand-contrast: #0f172a;
  --accent: #f87171;
  --accent-soft: #3a2330;
  --gold: #e8b96a;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; color: inherit; }
[hidden] { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- 页头 ---------- */
.news-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.news-header-inner {
  width: min(1080px, 100%);
  height: 64px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.news-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.news-brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent);
  overflow: hidden;
}
.news-brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.news-brand-name { font-size: 17px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.news-brand-badge {
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.news-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.news-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--body);
  font-size: 13px;
}
.news-nav-link:hover { background: var(--bg); color: var(--ink); }
.news-nav-link.is-active { background: var(--accent); color: #fff; }
.news-nav-link .icon { width: 15px; height: 15px; }
.news-theme {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.news-theme .icon-sun { display: none; }
.news-theme .icon-moon { display: block; }
[data-theme="dark"] .news-theme .icon-sun { display: block; }
[data-theme="dark"] .news-theme .icon-moon { display: none; }

/* ---------- 页面 ---------- */
.news-page {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 28px 20px 56px;
}
.news-banner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 18px;
  border-bottom: 3px solid var(--accent);
  margin-bottom: 18px;
}
.news-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}
.news-kicker .icon { width: 15px; height: 15px; }
.news-banner h1 {
  margin: 6px 0 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.15;
  letter-spacing: .02em;
}
.news-banner-text p { margin: 6px 0 0; color: var(--body); font-size: 14px; }
.news-banner-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

/* ---------- 轮播 ---------- */
.carousel {
  position: relative;
  height: clamp(220px, 38vw, 380px);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--accent);
  margin-bottom: 26px;
}
.carousel-track { position: absolute; inset: 0; }
.carousel-slide {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity .55s ease, transform 6s linear;
  pointer-events: none;
}
.carousel-slide.is-on { opacity: 1; transform: scale(1); pointer-events: auto; }
.carousel-slide.is-empty { background-image: none; background: linear-gradient(135deg, #7f1d1d, #b91c1c); }
.carousel-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .05) 30%, rgba(0, 0, 0, .68));
  pointer-events: none;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .38);
  color: #fff;
  transition: background .2s ease;
}
.carousel-btn:hover { background: rgba(0, 0, 0, .62); }
.carousel-btn.prev { left: 14px; }
.carousel-btn.next { right: 14px; }
.carousel-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 18px 22px;
  color: #fff;
  pointer-events: none;
}
.carousel-index {
  flex: none;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--gold);
  color: #4c0519;
  font: 700 12px/1.6 Consolas, monospace;
}
.carousel-caption p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}
.carousel-dots {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: flex;
  gap: 6px;
}
.carousel-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .45);
  transition: background .2s ease, width .2s ease;
}
.carousel-dots button.is-on { width: 22px; border-radius: 5px; background: #fff; }

/* ---------- 稿件列表 ---------- */
.news-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.news-list-head h2 { margin: 0; font-size: 18px; letter-spacing: .02em; }
.news-list-head h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 15px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: -2px;
}
.news-count { color: var(--muted); font-size: 12px; }

.news-list { display: grid; gap: 12px; }
.news-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color .2s ease, transform .2s ease;
}
.news-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.news-card-top { display: flex; align-items: center; gap: 8px; }
.news-tag {
  padding: 1px 8px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
}
.news-tag.tag-green { background: #ecfdf5; color: #047857; }
.news-tag.tag-blue { background: #eef4ff; color: #1d4ed8; }
[data-theme="dark"] .news-tag.tag-green { background: #14352b; color: #6ee7b7; }
[data-theme="dark"] .news-tag.tag-blue { background: #1d2f52; color: #93c5fd; }
.news-no { color: var(--muted); font: 700 11.5px/1 Consolas, monospace; }
.news-card p { margin: 0; color: var(--body); font-size: 14px; line-height: 1.7; word-break: break-word; }
.news-time { color: var(--muted); font-size: 11.5px; }

.news-list[data-layout="magazine"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.news-list[data-layout="magazine"] .news-card.is-lead {
  grid-column: 1 / -1;
  gap: 10px;
  padding: 24px 26px;
  border-left: 5px solid var(--accent);
  background: linear-gradient(135deg, var(--surface), var(--accent-soft));
}
.news-list[data-layout="magazine"] .news-card.is-lead p { color: var(--ink); font-size: 20px; font-weight: 700; line-height: 1.6; }
.news-list[data-layout="magazine"] .news-card.is-lead .news-tag { font-size: 12.5px; }

.news-list[data-layout="grid"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.news-list[data-layout="compact"] { gap: 0; border-top: 1px solid var(--line); }
.news-list[data-layout="compact"] .news-card {
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  padding: 12px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.news-list[data-layout="compact"] .news-card:hover { transform: none; border-color: var(--line); }
.news-list[data-layout="compact"] .news-no { grid-row: span 2; padding-top: 2px; font-size: 13px; }
.news-list[data-layout="compact"] .news-card-top { grid-column: 2; }
.news-list[data-layout="compact"] .news-card p { grid-column: 2; }

.news-empty {
  padding: 48px 0;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
}

/* ---------- 页脚 ---------- */
.news-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.news-footer-inner {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  color: var(--muted);
  font-size: 12px;
}
.news-footer-inner p { margin: 0; }
.news-footer-inner strong { color: var(--ink); }
.news-footer-inner span { margin-left: 6px; }
.news-footer-inner a { margin-left: auto; color: var(--brand); }

@media (max-width: 900px) {
  .news-list[data-layout="grid"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .news-header-inner { height: 58px; padding: 0 14px; gap: 10px; }
  .news-brand-badge { display: none; }
  .news-nav-link { padding: 0 8px; font-size: 12px; }
  .news-nav-link[href="news.html"] { display: none; }
  .news-page { padding: 18px 14px 40px; }
  .news-banner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .news-banner-meta { flex-direction: row; gap: 12px; }
  .carousel { height: 210px; margin-bottom: 20px; }
  .carousel-caption { padding: 12px 14px; }
  .carousel-caption p { font-size: 13px; }
  .carousel-btn { width: 34px; height: 34px; }
  .carousel-btn.prev { left: 8px; }
  .carousel-btn.next { right: 8px; }
  .carousel-dots { right: 14px; bottom: 14px; }
  .news-list[data-layout="magazine"],
  .news-list[data-layout="grid"] { grid-template-columns: minmax(0, 1fr); }
  .news-list[data-layout="magazine"] .news-card.is-lead { padding: 18px; }
  .news-list[data-layout="magazine"] .news-card.is-lead p { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .carousel-slide { transition: opacity .15s ease; transform: none; }
  .news-card { transition: none; }
  .news-card:hover { transform: none; }
}
