:root {
  --bg: #080b16;
  --bg-2: #0b1020;
  --text: #eef2ff;
  --muted: #8b93b8;
  --line: rgba(255, 255, 255, .11);
  --glass: rgba(255, 255, 255, .062);
  --glass-strong: rgba(20, 26, 48, .92);
  --accent: #7dd3fc;
  --accent-2: #818cf8;
  --shadow: 0 24px 70px rgba(0, 0, 0, .36);
}

* {
  box-sizing: border-box;
}

body.news-page {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans SC", Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background:
    radial-gradient(1100px 560px at 50% -12%, #1d2e5d 0%, rgba(15, 23, 49, .92) 45%, rgba(8, 11, 22, 0) 72%),
    radial-gradient(620px 360px at 15% 15%, rgba(125, 211, 252, .09), transparent 70%),
    radial-gradient(540px 420px at 88% 20%, rgba(129, 140, 248, .08), transparent 70%),
    linear-gradient(180deg, #080b16 0%, #0b1020 52%, #080b16 100%);
  background-attachment: fixed;
}

body.news-page::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .26;
  background-image:
    linear-gradient(rgba(255, 255, 255, .032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.news-container {
  width: min(1120px, calc(100% - 64px));
  margin: 0 auto;
}

.news-top-nav {
  padding-top: 34px;
}

.news-top-inner,
.category-tabs,
.detail-card,
.list-news-card,
.related-card {
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.news-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  gap: 18px;
  padding: 0 18px;
  border-radius: 18px;
}

.news-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.news-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  box-shadow: 0 0 22px rgba(125, 211, 252, .68);
  object-fit: contain;
}

.news-logo-text {
  font-size: 16px;
  letter-spacing: .01em;
}

.news-back {
  padding: 9px 18px;
  color: var(--accent);
  border: 1px solid rgba(125, 211, 252, .22);
  border-radius: 999px;
  background: rgba(125, 211, 252, .1);
  font-size: 13px;
  font-weight: 800;
}

.news-back:hover {
  background: rgba(125, 211, 252, .16);
}

.category-bar {
  margin-top: 16px;
}

.category-tabs {
  display: flex;
  gap: 8px;
  min-height: 58px;
  align-items: center;
  overflow-x: auto;
  padding: 8px;
  border-radius: 18px;
  white-space: nowrap;
}

.category-tab {
  flex: 0 0 auto;
  min-width: 72px;
  padding: 8px 18px;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.category-tab.is-active {
  color: var(--bg-2);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px rgba(125, 211, 252, .17);
}

.category-tab:hover:not(.is-active) {
  color: var(--accent);
  background: rgba(125, 211, 252, .12);
}

.news-main {
  padding: 20px 0 0;
  min-height: calc(100vh - 210px);
  overflow: hidden;
}

.refresh-container {
  position: relative;
  overflow: hidden;
  height: calc(100vh - 210px);
}

.scroll-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.scroll-content::-webkit-scrollbar {
  width: 4px;
}

.scroll-content::-webkit-scrollbar-track {
  background: transparent;
}

.scroll-content::-webkit-scrollbar-thumb {
  background: rgba(125, 211, 252, .2);
  border-radius: 2px;
}

.refresh-header {
  position: absolute;
  top: -60px;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  transition: transform .1s ease;
}

.refresh-header.is-pulling {
  transition: none;
}

.refresh-icon {
  font-size: 16px;
  transition: transform .3s ease;
}

.refresh-header.is-refreshing .refresh-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.list-news-card,
.related-card {
  display: flex;
  gap: 15px;
  padding: 15px;
  border-radius: 16px;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.list-news-card:hover,
.related-card:hover {
  border-color: rgba(125, 211, 252, .32);
  background: rgba(125, 211, 252, .08);
  transform: translateY(-2px);
}

.list-news-image,
.related-image {
  width: 138px;
  height: 94px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
}

.list-news-content,
.related-content {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: space-between;
}

.list-news-title,
.related-title-text {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 800;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.list-news-summary {
  display: -webkit-box;
  overflow: hidden;
  margin: 7px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.list-news-meta,
.related-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.source-pill {
  color: var(--accent);
}

.load-more {
  display: flex;
  justify-content: center;
  padding: 20px 0 4px;
}

.load-more button {
  padding: 10px 24px;
  color: var(--accent);
  border: 1px solid rgba(125, 211, 252, .22);
  border-radius: 999px;
  background: rgba(125, 211, 252, .1);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.load-more button:hover {
  background: rgba(125, 211, 252, .16);
}

.detail-card {
  padding: 24px;
  border-radius: 18px;
}

.detail-title {
  margin: 0 0 15px;
  color: var(--text);
  font-size: 26px;
  line-height: 1.42;
}

.detail-meta {
  margin-bottom: 20px;
}

.detail-meta span {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
}

.detail-meta .source-pill {
  background: rgba(125, 211, 252, .12);
}

.detail-hero {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 20px;
}

.detail-content {
  color: #d8def7;
  font-size: 16px;
  line-height: 1.85;
}

.detail-content p {
  margin: 0 0 15px;
  text-indent: 2em;
}

.detail-content img {
  display: block;
  max-width: 88%;
  height: auto;
  margin: 14px auto;
  border-radius: 12px;
}

.related-section {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.related-heading {
  margin: 0 0 15px;
  color: var(--text);
  font-size: 16px;
}

.related-list {
  display: grid;
  gap: 12px;
}

.news-footer {
  margin-top: 28px;
  padding: 0 0 28px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.news-footer a {
  color: var(--muted);
}

@media (max-width: 768px) {
  .news-container {
    width: min(100% - 28px, 620px);
  }

  .news-top-nav {
    padding-top: 22px;
  }

  .news-top-inner {
    min-height: 58px;
  }

  .news-back {
    padding: 8px 14px;
  }

  .list-news-card,
  .related-card {
    flex-direction: column;
  }

  .list-news-image,
  .related-image {
    width: 100%;
    height: 150px;
  }

  .detail-card {
    padding: 16px;
  }

  .detail-title {
    font-size: 20px;
  }

  .detail-content {
    font-size: 15px;
  }

  .refresh-container {
    height: calc(100vh - 180px);
  }
}

@media (max-width: 480px) {
  .news-container {
    width: min(100% - 22px, 420px);
  }

  .list-news-image,
  .related-image {
    height: 120px;
  }

  .list-news-title,
  .related-title-text {
    font-size: 14px;
  }

  .detail-title {
    font-size: 18px;
  }
}

/* Light theme variant shared with the home page */
:root {
  --bg: #f4fbff;
  --bg-2: #123142;
  --text: #173042;
  --muted: #66788a;
  --line: rgba(31, 92, 116, .16);
  --glass: rgba(255, 255, 255, .76);
  --glass-strong: rgba(255, 255, 255, .94);
  --accent: #0ea5a5;
  --accent-2: #5b7cfa;
  --shadow: 0 24px 60px rgba(57, 92, 115, .16);
}

body.news-page {
  color: var(--text);
  background:
    radial-gradient(940px 520px at 50% -12%, rgba(91, 124, 250, .22) 0%, rgba(255, 255, 255, 0) 68%),
    radial-gradient(680px 420px at 11% 18%, rgba(14, 165, 165, .18), transparent 70%),
    radial-gradient(560px 420px at 88% 18%, rgba(255, 107, 138, .12), transparent 72%),
    linear-gradient(180deg, #f8fdff 0%, #eef9f7 48%, #f6f2ff 100%);
  background-attachment: fixed;
}

body.news-page::before {
  opacity: .38;
  background-image:
    linear-gradient(rgba(31, 92, 116, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 92, 116, .06) 1px, transparent 1px);
}

.news-top-inner,
.category-tabs,
.detail-card,
.list-news-card,
.related-card {
  border-color: var(--line);
  background: var(--glass);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .72);
}

.news-logo-icon {
  box-shadow: 0 12px 28px rgba(14, 165, 165, .24);
}

.news-back,
.load-more button {
  color: #047b82;
  border-color: rgba(14, 165, 165, .22);
  background: rgba(14, 165, 165, .1);
}

.news-back:hover,
.load-more button:hover,
.category-tab:hover:not(.is-active),
.list-news-card:hover,
.related-card:hover {
  background: rgba(14, 165, 165, .1);
}

.category-tab {
  color: var(--muted);
}

.category-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 30px rgba(14, 165, 165, .2);
}

.list-news-card:hover,
.related-card:hover {
  border-color: rgba(14, 165, 165, .32);
}

.list-news-title,
.related-title-text,
.detail-title,
.related-heading {
  color: var(--text);
}

.list-news-summary,
.list-news-meta,
.related-meta,
.detail-meta,
.news-footer,
.news-footer a {
  color: var(--muted);
}

.source-pill {
  color: #047b82;
}

.detail-meta span {
  background: rgba(31, 92, 116, .08);
}

.detail-meta .source-pill {
  background: rgba(14, 165, 165, .12);
}

.detail-content {
  color: #304b5d;
}

.related-section {
  border-top-color: rgba(31, 92, 116, .12);
}

.list-news-card.no-image {
  min-height: 80px;
}

.list-news-card.no-image .list-news-content {
  justify-content: center;
}

.news-loading,
.news-error,
.news-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

.detail-source-link {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.detail-source-link a {
  color: var(--accent);
  text-decoration: underline;
}

.scroll-content::-webkit-scrollbar-thumb {
  background: rgba(14, 165, 165, .2);
}
