/* ==========================================================================
   Sports Desk · 体育资讯站视觉
   方向：近黑底 + 荧光青柠强调，紧凑的编辑排版，强调时效与来源
   ========================================================================== */

:root {
  --bg: #0a0c0e;
  --bg-2: #111417;
  --card: #15181c;
  --card-hover: #1b1f24;
  --line: #23282e;
  --line-2: #303740;
  --text: #f0f3f5;
  --text-2: #a4aeb8;
  --text-3: #6d7780;
  --accent: #c8f542;
  --accent-dim: #8fa832;
  --live: #ff4d4d;
  --ad-line: #33401f;
  --ad-bg: #0f1208;
  --radius: 4px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter Tight', -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; }

.wrap { width: min(1240px, calc(100% - 32px)); margin-inline: auto; }

/* ---------- 顶部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(10, 12, 14, .96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  font-family: 'Archivo', sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.logo__mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: #0a0c0e;
  border-radius: 3px;
  font-size: 16px;
  font-weight: 800;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-3);
  font-size: 12.5px;
}

.header-right .live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--live);
  font-weight: 600;
}

.header-right .live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

/* 项目导航 */
.sport-nav {
  border-top: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.sport-nav::-webkit-scrollbar { display: none; }

.sport-nav__inner {
  display: flex;
  gap: 22px;
  padding: 0;
}

.sport-nav a {
  flex-shrink: 0;
  padding: 11px 0;
  font-family: 'Archivo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}

.sport-nav a:hover { color: var(--text); }

.sport-nav a.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- 页面标题 ---------- */
.page-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 24px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.page-head h1 {
  margin: 0;
  font-family: 'Archivo', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.page-head .count { color: var(--text-3); font-size: 13px; }

/* ---------- 广告位 ---------- */
.ad-slot {
  position: relative;
  display: grid;
  place-items: center;
  margin: 20px 0;
  background: var(--ad-bg);
  border: 1px dashed var(--ad-line);
  border-radius: var(--radius);
  overflow: hidden;
}

.ad-slot::before {
  content: attr(data-ad-label);
  font-family: 'Archivo', sans-serif;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #7d8f4a;
  text-align: center;
  padding: 0 12px;
}

.ad-slot[data-ad-state="filled"]::before,
.ad-slot[data-ad-state="loading"]::before { content: ''; }

.ad-slot[data-ad-state="filled"] {
  border: 0;
  background: transparent;
}

.ad-slot--banner { min-height: 100px; }
.ad-slot--banner-lg { min-height: 220px; }
.ad-slot--infeed { grid-column: 1 / -1; min-height: 100px; margin: 6px 0 20px; }
.ad-slot--sidebar { min-height: 600px; }
.ad-slot--article-top { min-height: 100px; }
.ad-slot--article-mid { min-height: 250px; }
.ad-slot--article-bottom { min-height: 100px; }

.ad-sticky, .ad-float { display: none; }
.ad-sticky[data-ad-active="1"], .ad-float[data-ad-active="1"] {
  display: grid;
  place-items: center;
  position: fixed;
  z-index: 150;
}

.ad-sticky[data-ad-active="1"] {
  left: 0; right: 0; bottom: 0;
  min-height: 60px;
  margin: 0;
  border-radius: 0;
  border-left: 0; border-right: 0;
}

.ad-float[data-ad-active="1"] {
  right: 16px; bottom: 16px;
  width: 300px; min-height: 250px;
}

.ad-float__close {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  background: rgba(0,0,0,.7);
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}

/* ---------- 头条 ---------- */
.lead-area {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  /* 两行等高：首条跨两行，右侧两条各占一行，避免首条过高时第二行留白 */
  grid-template-rows: 1fr 1fr;
  gap: 20px;
  margin-bottom: 26px;
}

.lead-area > .lead:first-child { grid-row: 1 / 3; }
.lead-area > .lead:nth-child(n+2) { grid-column: 2; }

.lead {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s, background .15s;
}

.lead:hover { border-color: var(--line-2); background: var(--card-hover); }

.lead__img {
  aspect-ratio: 16 / 9;
  background: var(--bg-2);
  overflow: hidden;
}

.lead__img img { width: 100%; height: 100%; object-fit: cover; }

.lead__img--placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1a1f24, #101316);
}

.lead__img--placeholder span {
  font-family: 'Archivo', sans-serif;
  font-size: 48px;
  font-weight: 800;
  color: var(--line-2);
}

.lead__body { padding: 16px 18px 18px; }

.kicker {
  display: inline-block;
  margin-bottom: 8px;
  font-family: 'Archivo', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}

.lead h2 {
  margin: 0 0 8px;
  font-family: 'Archivo', sans-serif;
  font-size: clamp(20px, 2.4vw, 27px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.015em;
}

.lead p {
  margin: 0 0 10px;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.6;
}

.lead .meta { color: var(--text-3); font-size: 12.5px; }

/* 头条区第 2、3 条竖排 */
.lead-area > .lead:nth-child(2) .lead__img,
.lead-area > .lead:nth-child(3) .lead__img { aspect-ratio: 16 / 10; }

.lead-area > .lead:nth-child(2) h2,
.lead-area > .lead:nth-child(3) h2 { font-size: 17px; }

.lead-area > .lead:nth-child(2) p,
.lead-area > .lead:nth-child(3) p { display: none; }

/* 首条跨两行，高度由右侧两条决定。若首条无图或文字较短，
   内容会挤在顶部、下方留出大片空白 —— 让文字区撑满剩余空间并垂直居中。 */
.lead-area > .lead:first-child {
  display: flex;
  flex-direction: column;
}

.lead-area > .lead:first-child .lead__img { flex-shrink: 0; }

.lead-area > .lead:first-child .lead__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 右侧两条内部改为纵向布局，让图片与文字填满分配的高度 */
.lead-area > .lead:nth-child(n+2) {
  display: flex;
  flex-direction: column;
}

.lead-area > .lead:nth-child(n+2) .lead__img { flex-shrink: 0; }

.lead-area > .lead:nth-child(n+2) .lead__body { flex: 1; }

/* 无图时不要让占位块撑满整个头条区域：那会留下一大片空白。
   给一个克制的高度，剩下的交给文字。 */
.lead-area > .lead .lead__img--placeholder {
  flex: 0 0 auto;
  min-height: 170px;
  aspect-ratio: auto;
}

.lead-area > .lead:nth-child(n+2) .lead__img--placeholder { min-height: 120px; }

/* ---------- 骨架屏 ----------
   数据回来之前先占住版面，避免慢网络下首屏一片空白 */
.skeleton {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.skeleton__thumb {
  aspect-ratio: 16 / 10;
  background: linear-gradient(90deg, var(--bg-2) 25%, #1e2429 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton__body { padding: 12px 13px 14px; }

.skeleton__line {
  height: 12px;
  margin-bottom: 8px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--bg-2) 25%, #1e2429 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton__line--title { height: 15px; }
.skeleton__line--short { width: 45%; }

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.lead-area .skeleton__thumb { aspect-ratio: auto; flex: 1; min-height: 120px; }
.lead-area .skeleton { display: flex; flex-direction: column; }

/* ---------- 加载与错误状态 ---------- */
.state-msg {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 56px 16px;
  text-align: center;
  color: var(--text-2);
}

.state-msg strong { color: var(--accent); font-size: 16px; }

.state-msg button {
  justify-self: center;
  margin-top: 4px;
  padding: 9px 22px;
  background: var(--accent);
  color: #0a0c0e;
  border: 0;
  border-radius: var(--radius);
  font-family: 'Archivo', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}

.state-msg button:hover { background: #d6ff5c; }

/* 无图时的兜底。
   早期版本放大来源首字母，但 Guardian 这类源首字母是 "T"，
   在卡片上看起来像标题被截断；纯装饰图形又像一块黑框。
   现在直接把来源名印上去 —— 观众一眼知道这条来自哪家媒体，
   信息量足够，也不再是"看不懂的色块"。 */
.thumb--failed,
.card__thumb--placeholder,
.lead__img--placeholder {
  display: grid !important;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(200, 245, 66, .05), rgba(200, 245, 66, 0) 55%),
    linear-gradient(135deg, #1a1f24, #101316);
}

.thumb--failed img { display: none; }

.card__thumb--placeholder span,
.lead__img--placeholder span { display: none; }

.thumb--failed::after,
.card__thumb--placeholder::after,
.lead__img--placeholder::after {
  content: attr(data-source);
  font-family: 'Archivo', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 6px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 头条区的占位块更大，来源名也相应放大 */
.lead__img--placeholder::after {
  font-size: 12px;
  padding: 8px 18px;
}

/* ---------- 新闻流 ---------- */
.section-bar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-bar h2 {
  margin: 0;
  font-family: 'Archivo', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.section-bar .count { color: var(--text-3); font-size: 12.5px; }

.feed {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 18px;
}

.feed > * { min-width: 0; }

.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s, background .15s;
}

.card:hover { border-color: var(--line-2); background: var(--card-hover); }

.card__thumb {
  aspect-ratio: 16 / 10;
  background: var(--bg-2);
  overflow: hidden;
}

.card__thumb img { width: 100%; height: 100%; object-fit: cover; }

.card__thumb--placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1a1f24, #101316);
}

.card__thumb--placeholder span {
  font-family: 'Archivo', sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: var(--line-2);
}

.card__body { padding: 12px 13px 14px; }

.card__tag {
  display: inline-block;
  margin-bottom: 6px;
  font-family: 'Archivo', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent-dim);
}

.card__title {
  margin: 0 0 8px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.card__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-3);
}

.card__source {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card__time { white-space: nowrap; flex-shrink: 0; }

/* ---------- 文章页 ---------- */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

.article-head { padding: 26px 0 0; }

.article-head h1 {
  margin: 10px 0 14px;
  font-family: 'Archivo', sans-serif;
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-3);
}

.article-meta .tag {
  padding: 3px 11px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--accent);
  font-family: 'Archivo', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.article-image {
  margin: 20px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

.article-image img { width: 100%; }

.article-summary {
  margin: 18px 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
}

.article-cta {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 22px 0;
  padding: 12px 24px;
  background: var(--accent);
  color: #0a0c0e;
  border-radius: var(--radius);
  font-family: 'Archivo', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.article-cta:hover { background: #d6ff5c; color: #0a0c0e; }

.article-note {
  margin: 20px 0;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
}

.sidebar .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.sidebar .panel h3 {
  margin: 0 0 12px;
  font-family: 'Archivo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
}

.sidebar .card { margin-bottom: 14px; }
.sidebar .card__thumb { aspect-ratio: 16 / 9; }
.sidebar .card__title { font-size: 13.5px; -webkit-line-clamp: 2; }

/* ---------- 分页 ---------- */
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 30px 0 8px;
}

.load-more {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 34px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-family: 'Archivo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.load-more:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0c0e;
}

.load-more:disabled {
  opacity: .55;
  cursor: default;
}

/* ---------- 状态提示 ---------- */
.state-msg {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding: 48px 0;
  text-align: center;
  color: var(--text-2);
}

.state-msg strong { color: var(--accent); font-size: 16px; }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 48px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 13px;
}

.site-footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 14px;
}

.footer-note {
  padding: 13px 15px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  line-height: 1.7;
}

/* ---------- 文档页 ---------- */
.page-doc { max-width: 860px; margin: 28px auto 10px; }

.page-doc h1 {
  margin: 0 0 6px;
  font-family: 'Archivo', sans-serif;
  font-size: clamp(23px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -.01em;
}

.page-doc .updated {
  margin: 0 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
  font-size: 12.5px;
}

.page-doc h2 {
  margin: 30px 0 8px;
  font-family: 'Archivo', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.page-doc p, .page-doc li {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.85;
}

.page-doc ul { padding-left: 20px; margin: 0 0 14px; }
.page-doc li { margin-bottom: 6px; }
.page-doc strong { color: var(--text); }
.page-doc a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .feed { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr) 280px; }
}

@media (max-width: 860px) {
  .lead-area { grid-template-columns: minmax(0, 1fr); }
  .lead-area > .lead:nth-child(n+2) { grid-column: 1; }
  .feed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .ad-float { display: none !important; }
  .ad-slot--sidebar { display: none !important; }
}

@media (max-width: 600px) {
  .wrap { width: calc(100% - 22px); }
  .feed { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .lead h2 { font-size: 19px; }
  .header-right { display: none; }
  .page-head h1 { font-size: 20px; }
  .ad-slot--banner { min-height: 90px; }
  .ad-slot--banner-lg { min-height: 160px; }
  body.has-sticky { padding-bottom: 64px; }
}

@media (prefers-reduced-motion: no-preference) {
  .feed .card, .lead { animation: rise .35s cubic-bezier(.2,.7,.3,1) backwards; }
  .feed .card:nth-child(1) { animation-delay: .01s; }
  .feed .card:nth-child(2) { animation-delay: .03s; }
  .feed .card:nth-child(3) { animation-delay: .05s; }
  .feed .card:nth-child(4) { animation-delay: .07s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
}
