/* =========================================================================
   a2607 — 「顶部横向卡片轮播」风格
   纯手写 CSS，不依赖任何框架。
   核心特征：
   1. 顶部头条区：overflow-x:auto + scroll-snap 横向滚动卡片带（纯 CSS，无 JS 轮播）
   2. 主体文章列表：3 列 CSS Grid 卡片网格（非传统竖直单列列表）
   3. 大圆角卡片，现代化配色（靛蓝 + 珊瑚橙点缀）
   ========================================================================= */

:root {
  --a7-ink:        #16182b;
  --a7-ink-soft:   #565a72;
  --a7-mute:       #8a8ea6;
  --a7-line:       #e7e8f2;
  --a7-bg:         #f4f5fa;
  --a7-card:       #ffffff;
  --a7-brand:      #4338ca;
  --a7-brand-2:    #6d5efc;
  --a7-accent:     #ff7a59;
  --a7-radius-lg:  22px;
  --a7-radius-md:  16px;
  --a7-radius-sm:  10px;
  --a7-shadow:     0 6px 24px rgba(22, 24, 43, 0.08);
  --a7-shadow-hover: 0 14px 34px rgba(67, 56, 202, 0.18);
  --a7-maxw:       1240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body.a7-body {
  background: var(--a7-bg);
  color: var(--a7-ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; }

.a7-wrap {
  max-width: var(--a7-maxw);
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* ───────────────────────── Header / Nav ───────────────────────── */
.a7-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--a7-line);
}

.a7-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}

.a7-brand {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--a7-brand), var(--a7-brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.a7-brand a { color: inherit; }

.a7-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  justify-content: flex-end;
}
.a7-nav::-webkit-scrollbar { display: none; }

.a7-nav a {
  flex-shrink: 0;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--a7-ink-soft);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.a7-nav a:hover,
.a7-nav a.is-active {
  background: var(--a7-brand);
  color: #fff;
}

/* ───────────────────────── 横向滚动卡片带（头条轮播） ───────────────────────── */
.a7-carousel-section {
  padding: 28px 0 8px;
}

.a7-carousel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--a7-ink);
  margin-bottom: 14px;
}

.a7-carousel-title::before {
  content: "";
  width: 6px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--a7-brand), var(--a7-accent));
  display: inline-block;
}

/* 核心：overflow-x auto + scroll-snap，纯 CSS 横向滚动，无需 JS 轮播插件 */
.a7-carousel {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 4px 20px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--a7-brand-2) transparent;
}

.a7-carousel::-webkit-scrollbar {
  height: 8px;
}
.a7-carousel::-webkit-scrollbar-thumb {
  background: var(--a7-brand-2);
  border-radius: 999px;
}
.a7-carousel::-webkit-scrollbar-track {
  background: transparent;
}

.a7-carousel-card {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: min(340px, 78vw);
  background: var(--a7-card);
  border-radius: var(--a7-radius-lg);
  overflow: hidden;
  box-shadow: var(--a7-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.a7-carousel-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--a7-shadow-hover);
}

.a7-carousel-card .a7-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #dfe1f7, #eef0fb);
}

.a7-carousel-card .a7-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.a7-carousel-card:hover .a7-thumb-wrap img {
  transform: scale(1.06);
}

.a7-carousel-card .a7-cat-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(22, 24, 43, 0.65);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.a7-carousel-card .a7-carousel-body {
  padding: 16px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.a7-carousel-card h2,
.a7-carousel-card h3 {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--a7-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.a7-carousel-card .a7-summary {
  margin-top: 8px;
  font-size: 13px;
  color: var(--a7-mute);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.a7-carousel-card .a7-meta {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--a7-mute);
}

/* ───────────────────────── 3 列 CSS Grid 文章网格 ───────────────────────── */
.a7-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--a7-ink);
  margin: 30px 0 16px;
}

.a7-section-title::before {
  content: "";
  width: 6px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--a7-brand), var(--a7-accent));
  display: inline-block;
}

.a7-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.a7-grid-card {
  background: var(--a7-card);
  border-radius: var(--a7-radius-md);
  overflow: hidden;
  box-shadow: var(--a7-shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
}

.a7-grid-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--a7-shadow-hover);
}

.a7-grid-card .a7-thumb-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #dfe1f7, #eef0fb);
}

.a7-grid-card .a7-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.a7-grid-card:hover .a7-thumb-wrap img {
  transform: scale(1.05);
}

.a7-grid-card .a7-grid-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.a7-grid-card .a7-cat {
  font-size: 12px;
  font-weight: 700;
  color: var(--a7-brand);
  margin-bottom: 6px;
}

.a7-grid-card h2,
.a7-grid-card h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--a7-ink);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.a7-grid-card .a7-summary {
  margin-top: 6px;
  font-size: 13px;
  color: var(--a7-mute);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.a7-grid-card .a7-meta {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--a7-mute);
  flex-wrap: wrap;
}

.a7-meta .a7-dot::before {
  content: "·";
  margin: 0 2px;
}

/* ───────────────────────── 面包屑 ───────────────────────── */
.a7-breadcrumb {
  margin: 18px 0 10px;
  font-size: 13px;
  color: var(--a7-mute);
}

.a7-breadcrumb a:hover { color: var(--a7-brand); }

.a7-breadcrumb .sep {
  margin: 0 6px;
  color: #c7c9dc;
}

/* ───────────────────────── 布局：主体 + 侧栏 ───────────────────────── */
.a7-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  padding: 10px 0 40px;
}

@media (min-width: 992px) {
  .a7-layout.has-aside {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

.a7-h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--a7-ink);
  padding-left: 14px;
  border-left: 5px solid var(--a7-brand);
  margin-bottom: 18px;
}

.a7-h1 .a7-h1-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--a7-mute);
  margin-left: 10px;
}

/* ───────────────────────── 分页 ───────────────────────── */
.a7-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 28px 0 6px;
}

.a7-pagination a,
.a7-pagination span.a7-page-current,
.a7-pagination span.a7-ellipsis {
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--a7-radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--a7-line);
  background: var(--a7-card);
  color: var(--a7-ink-soft);
  transition: all 0.2s ease;
}

.a7-pagination a:hover {
  background: var(--a7-brand);
  border-color: var(--a7-brand);
  color: #fff;
}

.a7-pagination span.a7-page-current {
  background: var(--a7-brand);
  border-color: var(--a7-brand);
  color: #fff;
}

.a7-pagination span.a7-ellipsis {
  border: none;
  background: transparent;
}

.a7-page-summary {
  text-align: center;
  font-size: 12px;
  color: var(--a7-mute);
  margin-top: 4px;
}

/* ───────────────────────── 侧栏 ───────────────────────── */
.a7-aside {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.a7-aside-box {
  background: var(--a7-card);
  border-radius: var(--a7-radius-md);
  padding: 18px;
  box-shadow: var(--a7-shadow);
}

.a7-aside-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--a7-ink);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.a7-aside-title::before {
  content: "";
  width: 5px;
  height: 15px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--a7-brand), var(--a7-accent));
  display: inline-block;
}

.a7-hot-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.a7-hot-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.a7-hot-rank {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #eceeff;
  color: var(--a7-brand);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.a7-hot-rank.top {
  background: linear-gradient(135deg, var(--a7-brand), var(--a7-accent));
  color: #fff;
}

.a7-hot-item .a7-hot-title {
  font-size: 13px;
  color: var(--a7-ink-soft);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.a7-hot-item .a7-hot-title:hover { color: var(--a7-brand); }

.a7-hot-item .a7-hot-time {
  display: block;
  font-size: 11px;
  color: var(--a7-mute);
  margin-top: 3px;
}

.a7-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.a7-tag-chip {
  padding: 5px 12px;
  border-radius: 999px;
  background: #f0f1fb;
  color: var(--a7-ink-soft);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.a7-tag-chip:hover {
  background: var(--a7-brand);
  color: #fff;
}

.a7-cat-links li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 4px;
  font-size: 13.5px;
  color: var(--a7-ink-soft);
  border-bottom: 1px dashed var(--a7-line);
}

.a7-cat-links li:last-child a { border-bottom: none; }
.a7-cat-links li a:hover { color: var(--a7-brand); }

/* ───────────────────────── 详情页 ───────────────────────── */
.a7-article {
  background: var(--a7-card);
  border-radius: var(--a7-radius-lg);
  box-shadow: var(--a7-shadow);
  overflow: hidden;
}

.a7-article-header {
  padding: 28px 30px 20px;
  border-bottom: 1px solid var(--a7-line);
}

.a7-article-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--a7-ink);
  line-height: 1.4;
}

.a7-article-meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--a7-mute);
}

.a7-article-meta a:hover { color: var(--a7-brand); }

.a7-article-cover {
  padding: 22px 30px 0;
}

.a7-article-cover img {
  width: 100%;
  height: auto;
  border-radius: var(--a7-radius-md);
  object-fit: cover;
}

.a7-article-body {
  padding: 24px 30px;
  font-size: 16px;
  line-height: 1.9;
  color: #2a2c40;
  word-break: break-word;
}

.a7-article-body img {
  border-radius: var(--a7-radius-sm);
  margin: 12px 0;
}

.a7-article-body p { margin: 0 0 16px; }

.a7-article-tags {
  padding: 18px 30px 26px;
  border-top: 1px solid var(--a7-line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.a7-article-tags .label {
  font-size: 12px;
  color: var(--a7-mute);
}

.a7-related-section {
  margin-top: 30px;
}

/* ───────────────────────── Footer ───────────────────────── */
.a7-footer {
  margin-top: auto;
  background: #16182b;
  color: #b7b9d1;
  padding: 30px 0;
}

.a7-footer .a7-friend-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 14px;
  font-size: 12.5px;
}

.a7-footer .a7-friend-links a:hover { color: #fff; }

.a7-footer .a7-copy {
  text-align: center;
  font-size: 12px;
  color: #6d7093;
}

/* ───────────────────────── 响应式 ───────────────────────── */
@media (max-width: 991px) {
  .a7-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .a7-grid {
    grid-template-columns: 1fr;
  }
  .a7-header-inner { height: 58px; }
  .a7-brand { font-size: 18px; }
  .a7-carousel-card { width: 84vw; }
  .a7-article-header,
  .a7-article-cover,
  .a7-article-body,
  .a7-article-tags {
    padding-left: 18px;
    padding-right: 18px;
  }
}
