:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1b2230;
  --border: #262d36;
  --border-soft: #1e2530;
  --text: #e6edf3;
  --text-dim: #c2ccd6;
  --muted: #8b949e;
  --accent: #e5484d;
  --accent-soft: rgba(229, 72, 77, 0.12);
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --max: 1320px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(900px 400px at 12% -8%, rgba(59, 130, 246, 0.08), transparent 60%),
    radial-gradient(760px 360px at 92% -4%, rgba(229, 72, 77, 0.07), transparent 62%);
  background-attachment: fixed;
}

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

h1, h2, h3 { margin: 0; font-weight: 650; line-height: 1.35; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(13, 17, 23, 0.82);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.brand__mark {
  width: 10px;
  height: 20px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), #b93136);
}

.brand__name { font-size: 19px; font-weight: 700; letter-spacing: 0.5px; }

.topbar__meta {
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
}

.topbar__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
}

.search { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }

.search input {
  width: 240px;
  max-width: 40vw;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  outline: none;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}

.search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}

.search button {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.search button:hover { border-color: var(--accent); color: var(--text); }

/* ---------- 提示条 ---------- */

.notice {
  max-width: var(--max);
  margin: 14px auto 0;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(229, 72, 77, .35);
  background: var(--accent-soft);
  color: #ffb4b6;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.notice[hidden] { display: none; }

.notice__text { flex: 1; min-width: 0; }

.notice__close {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #ffb4b6;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s, color .15s;
}

.notice__close:hover { background: rgba(229, 72, 77, .28); color: #fff; }

/* ---------- 导航 ---------- */

.tabs {
  max-width: var(--max);
  margin: 16px auto 0;
  padding: 0 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tabs__link {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  transition: all .15s;
}

.tabs__link:hover { color: var(--text); border-color: #3a434f; }

.tabs__link.is-active {
  background: var(--accent-soft);
  border-color: rgba(229, 72, 77, .45);
  color: #ff8f92;
}

/* ---------- 主体布局 ---------- */

.app { max-width: var(--max); margin: 0 auto; padding: 22px 20px 60px; }

.channels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}

.ranks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
  align-items: start;
}

/* ---------- 头条区 ---------- */

.hero {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 22px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(140deg, var(--panel-2), var(--panel) 60%);
  align-items: stretch;
}

.hero__cover {
  position: relative;
  display: block;
  min-height: 220px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(135deg, #223046, #2a1c22);
}

.hero__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero__cover.is-empty::after {
  content: "封面暂不可用";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.hero__main { min-width: 0; display: flex; flex-direction: column; gap: 8px; }

.hero__title { font-size: 24px; letter-spacing: .5px; }
.hero__date { color: var(--muted); font-size: 13px; }

.hero__tip {
  color: var(--text-dim);
  font-size: 14px;
  padding: 8px 12px;
  border-left: 2px solid var(--accent);
  background: rgba(255, 255, 255, .03);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.brief {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 18px;
}

.brief__item {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 3px 0;
  font-size: 14px;
  color: var(--text-dim);
}

.brief__idx {
  color: var(--accent);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 18px;
  text-align: right;
  opacity: .85;
}

.brief__text {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.5;
}

.hero__more { margin-top: auto; font-size: 13px; color: var(--blue); }
.hero__more:hover { text-decoration: underline; }

/* ---------- 区块 ---------- */

.block, .rank {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px 18px 18px;
}

.block__head, .rank__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}

.block__title, .rank__title { font-size: 17px; position: relative; padding-left: 11px; }

.block__title::before, .rank__title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: var(--accent);
}

.block__sub { color: var(--muted); font-size: 13px; flex: 1; }
.block__more, .rank__more { color: var(--blue); font-size: 13px; white-space: nowrap; }
.block__more:hover, .rank__more:hover { text-decoration: underline; }

/* ---------- 卡片 ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  transition: border-color .15s, transform .15s, background .15s;
}

.card:hover {
  border-color: rgba(229, 72, 77, .5);
  transform: translateY(-2px);
  background: #1d2532;
}

.card__title {
  font-size: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card:hover .card__title { color: #ff9ea0; }

.card__summary {
  color: var(--muted);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.tag {
  padding: 1px 8px;
  border-radius: 4px;
  background: rgba(139, 148, 158, .14);
  color: var(--text-dim);
  font-size: 12px;
}

.tag--hot { background: var(--accent-soft); color: #ff8f92; }
.tag--accent { background: var(--blue-soft); color: #7db0ff; }
.card__time { font-variant-numeric: tabular-nums; }

/* ---------- 榜单 ---------- */

.rank__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  transition: background .15s;
}

.rank__row:hover { background: rgba(255, 255, 255, .04); }
.rank__row:hover .rank__text { color: #ff9ea0; }

.rank__no {
  width: 20px;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  flex-shrink: 0;
}

.rank__no--top { color: var(--accent); font-weight: 700; }

.rank__body { min-width: 0; flex: 1; display: flex; flex-direction: column; }

.rank__text {
  font-size: 14px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank__hot { font-size: 11px; color: var(--muted); }

/* ---------- 缩略图 ---------- */

.thumb {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #232c3d, #2b1f26);
  flex-shrink: 0;
}

.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb--mini { width: 54px; height: 38px; }
.thumb--md { width: 120px; height: 80px; }

/* ---------- 列表页 ---------- */

.page { display: flex; flex-direction: column; gap: 18px; }

.page__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.page__title { font-size: 24px; }
.page__count { color: var(--muted); font-size: 13px; }
.page__back { margin-left: auto; color: var(--blue); font-size: 13px; white-space: nowrap; }
.page__back:hover { text-decoration: underline; }

.items { display: flex; flex-direction: column; gap: 12px; }

.item {
  display: flex;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--panel);
  transition: border-color .15s, background .15s;
}

.item:hover { border-color: rgba(59, 130, 246, .45); background: var(--panel-2); }
.item:hover .item__title { color: #7db0ff; }
.item--external:hover { border-color: rgba(229, 72, 77, .45); }
.item--external:hover .item__title { color: #ff9ea0; }

.item__body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.item__title { font-size: 16px; }

.item__summary {
  color: var(--muted);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item__foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.item__time { font-variant-numeric: tabular-nums; }
.item__ext { margin-left: auto; color: var(--muted); }

.loadmore { display: flex; justify-content: center; padding: 8px 0 4px; }

.btn {
  display: inline-block;
  padding: 9px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.btn:hover { border-color: var(--blue); color: var(--text); }

/* ---------- 详情页 ---------- */

.page--detail { max-width: 860px; margin: 0 auto; }

.article {
  padding: 26px 28px 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.article__title { font-size: 27px; line-height: 1.4; }

.article__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

.article__time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.article__cover {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 20px;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #232c3d, #2b1f26);
}

.article__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.article__cover.is-empty::after {
  content: "图片暂不可用";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.article__body { font-size: 16px; line-height: 1.9; color: var(--text-dim); }
.article__body p { margin: 0 0 16px; }
.article__body--empty { color: var(--muted); font-size: 14px; }

.article__origin {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(229, 72, 77, .45);
  background: var(--accent-soft);
  color: #ff9ea0;
  font-size: 14px;
}

.article__origin:hover { background: rgba(229, 72, 77, .2); }

/* ---------- 搜索 ---------- */

.hits { display: flex; flex-direction: column; gap: 8px; }

.hits__title { font-size: 15px; color: var(--muted); margin-bottom: 4px; }
.hits__title span { color: var(--accent); }

.hit {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--panel);
  transition: border-color .15s, background .15s;
}

.hit:hover { border-color: rgba(59, 130, 246, .45); background: var(--panel-2); }
.hit:hover .hit__title { color: #7db0ff; }

.hit__title { flex: 1; min-width: 0; font-size: 15px; }
.hit__src { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------- 空态 ---------- */

.empty {
  padding: 60px 24px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

.empty__title { font-size: 17px; color: var(--text-dim); margin-bottom: 8px; }
.empty__hint { font-size: 13px; margin-bottom: 16px; }
.empty a { color: var(--blue); }

.block-empty {
  padding: 22px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.block-empty__title { color: var(--text-dim); font-size: 14px; }
.block-empty__hint { color: var(--muted); font-size: 12px; }

/* ---------- 骨架屏 ---------- */

.skel {
  border-radius: var(--radius-sm);
  background: linear-gradient(100deg, #171d26 30%, #1e2634 50%, #171d26 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skel--hero { height: 210px; border-radius: var(--radius); }
.skel--block { height: 190px; }
.skel--rank { height: 300px; }

@keyframes shimmer {
  0% { background-position: 140% 0; }
  100% { background-position: -40% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; }
  * { transition: none !important; }
}

/* ---------- 页脚 ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 22px 20px 34px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.footer__links { display: flex; gap: 16px; justify-content: center; margin-bottom: 8px; flex-wrap: wrap; }
.footer a:hover { color: var(--text-dim); text-decoration: underline; }

.footer__friends { margin: 14px 0 12px; }

.footer__friends .footer__links { gap: 8px 14px; margin-bottom: 0; }
.footer__friends .footer__links a { font-size: 13px; }

.footer__sale { margin: 0 0 10px; font-size: 13px; }
.footer__sale a { color: var(--accent); }
.footer__sale a:hover { text-decoration: underline; }

/* ---------- 响应式 ---------- */

@media (max-width: 1099px) {
  .hero { grid-template-columns: 320px minmax(0, 1fr); }
  .cards { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}

@media (max-width: 860px) {
  .topbar__inner { flex-wrap: wrap; gap: 12px; }
  .search { order: 3; width: 100%; margin-left: 0; }
  .search input { flex: 1; width: auto; max-width: none; }
  .topbar__meta { order: 2; margin-left: auto; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero__cover { min-height: 200px; }
  .brief { grid-template-columns: minmax(0, 1fr); }
  .channels { grid-template-columns: minmax(0, 1fr); }
  .ranks { grid-template-columns: minmax(0, 1fr); }
  .item { flex-direction: column; }
  .thumb--md { width: 100%; height: 160px; }
  .article { padding: 20px 18px 24px; }
  .article__title { font-size: 22px; }
  .page__title { font-size: 20px; }
  .hero__title { font-size: 21px; }
}

@media (max-width: 560px) {
  body { font-size: 14px; }
  .app { padding: 16px 14px 48px; }
  .topbar__inner { padding: 12px 14px; }
  .tabs { padding: 0 14px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .page__head { flex-wrap: wrap; }
  .page__back { margin-left: 0; }
}
