/* 来自 redesign/index.html 的内联样式 */
/* ========== 首页专用：编辑式杂志布局 ========== */

/* 封面故事 */
.cover-story {
  padding: 32px 0 48px;
  border-bottom: 1px solid var(--line);
}
.cover-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 40px;
  align-items: stretch;
}
.cover-main {
  position: relative;
  display: block;
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 520px;
}
/* 轮播：所有幻灯片都绝对堆叠在 .cover-main 里（高度由 min-height 决定），
   靠 opacity 切换 —— 不用 display:none，避免切换时重新解码图片造成闪烁 */
.cover-slider { position: absolute; inset: 0; }
.cover-slide {
  position: absolute; inset: 0;
  display: block;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s var(--ease-out), visibility 0s linear .5s;
}
/* 无 JS 时第一张默认可见（CSS 兜底，不依赖脚本） */
.cover-slide:first-child,
.cover-slide.is-active {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
  z-index: 1;
}
.cover-slide img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s var(--ease-out);
}
.cover-slide:hover img { transform: scale(1.04); }

/* 控制条：图片上半部分是空的，圆点放左上、箭头放右上，永远不会压到标题 */
.cover-dots {
  position: absolute; top: 20px; left: 20px;
  display: flex; align-items: center; gap: 8px;
  z-index: 3;
}
.cover-dots .cover-dot {
  width: 26px; height: 4px;
  padding: 0; border: 0; cursor: pointer;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,.42);
  transition: background var(--dur) var(--ease), width var(--dur) var(--ease);
}
.cover-dots .cover-dot:hover { background: rgba(255,255,255,.72); }
.cover-dots .cover-dot.is-active { width: 40px; background: var(--brand-light); }
.cover-dots .cover-dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.cover-nav {
  position: absolute; top: 16px; right: 16px;
  display: flex; gap: 8px;
  z-index: 3;
}
.cover-nav .cover-nav-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: 1px solid rgba(255,255,255,.28); cursor: pointer;
  border-radius: 50%;
  color: #fff;
  background: rgba(17,24,39,.42);
  backdrop-filter: blur(6px);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.cover-nav .cover-nav-btn:hover { background: var(--brand); border-color: var(--brand); }
.cover-nav .cover-nav-btn:active { transform: scale(.94); }
.cover-nav .cover-nav-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* 降低动效偏好：不自动播放（由 JS 判断），切换也不做过渡 */
@media (prefers-reduced-motion: reduce) {
  .cover-slide { transition: none; }
  .cover-slide img { transition: none; }
  .cover-slide:hover img { transform: none; }
}
.cover-main-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.35) 45%, transparent 70%);
}
.cover-main-body {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 40px;
  color: #fff;
}
.cover-main-body .cover-cat {
  display: inline-block;
  font-size: 12px; font-weight: 800; letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brand-light);
  margin-bottom: 14px;
}
/* 封面标题 = 页面唯一的 h1。
   实测库里标题最长 77 字（8 篇超过 50 字），38px 下约 18 字/行 → 最多会到 5 行，
   会把绝对定位的这段文字顶出图片以外，所以夹到 3 行；text-wrap:balance 让分行更均匀。 */
.cover-main-body .cover-title {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.28;
  font-family: var(--font-serif);
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: -.5px;
  text-wrap: balance;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cover-main-body .cover-deck {
  font-size: 15px; line-height: 1.7;
  color: rgba(255,255,255,.82);
  max-width: 560px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cover-main-body .cover-meta {
  margin-top: 16px;
  font-size: 13px; color: rgba(255,255,255,.72);
  display: flex; align-items: center; gap: 12px;
}
.cover-main-body .cover-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: rgba(255,255,255,.45); }

.cover-side {
  display: flex; flex-direction: column;
  border-left: 1px solid var(--line);
  padding-left: 32px;
}
.cover-side-label {
  font-size: 11px; font-weight: 800; letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}
.cover-side-item {
  display: block;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-light);
}
.cover-side-item:last-child { border-bottom: 0; }
/* 悬停位移作用在内容上而不是整块：
   改 padding 会重排；改整块 transform 会把底部分隔线一起推走、左边留出缺口。
   只位移子元素则既走合成层、分隔线又原地不动。 */
.cover-side-item > * {
  transition: transform var(--dur) var(--ease-out);
}
.cover-side-item:hover > * { transform: translateX(8px); }
.cover-side-item .cs-cat {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  color: var(--brand);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.cover-side-item .cs-title {
  font-size: 17px; font-weight: 700; line-height: 1.45;
  font-family: var(--font-serif);
  color: var(--ink);
  transition: color var(--dur-fast) var(--ease);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.cover-side-item:hover .cs-title { color: var(--brand); }
.cover-side-item .cs-meta {
  margin-top: 8px;
  font-size: 12px; color: var(--ink-4);
}

/* 区块通用
   首页有 5 个大区块，靠留白把它们分成独立的"章节"；
   用 clamp 让桌面端更松、窄屏自动收紧 */
.mag-section {
  padding: clamp(48px, 6vw, 84px) 0;
  border-bottom: 1px solid var(--line);
}
.mag-section-last { border-bottom: 0; }
.mag-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 32px;
}
.mag-section-title {
  font-size: 14px; font-weight: 800; letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--ink);
  font-family: var(--font-sans);
  display: flex; align-items: center; gap: 12px;
}
.mag-section-title::before {
  content: ''; width: 28px; height: 2px; background: var(--brand);
}
.mag-section-more {
  font-size: 13px; font-weight: 600; color: var(--ink-3);
  transition: color var(--dur-fast) var(--ease);
}
.mag-section-more:hover { color: var(--brand); }

/* 编辑精选 4列 */
.editors-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.editors-card { display: block; }
.editors-card .ec-thumb {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  margin-bottom: 16px;
}
.editors-card .ec-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease-out);
}
.editors-card:hover .ec-thumb img { transform: scale(1.05); }
.editors-card .ec-cat {
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
  color: var(--brand); text-transform: uppercase;
  margin-bottom: 8px;
}
.editors-card h3 {
  font-size: 17px; font-weight: 700; line-height: 1.4;
  font-family: var(--font-serif);
  color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--dur-fast) var(--ease);
}
.editors-card:hover h3 { color: var(--brand); }
.editors-card .ec-meta {
  margin-top: 10px;
  font-size: 12px; color: var(--ink-4);
}

/* 双栏：最新报道 + 热门阅读/热门标签
   align-items:start —— 右栏按内容高度收住，不再被拉伸到和左栏一样高。
   拉伸(stretch)时 .hot-panel 会变成一整列的高度，两个卡片下面留出一大片
   属于容器的空白，看起来就是"右边下面有个大洞"；收住之后余量就是正常的页面留白。 */
.latest-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  align-items: start;
}
.latest-list { display: flex; flex-direction: column; }
.latest-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line-light);
}
.latest-item:first-child { padding-top: 0; }
/* 同 .cover-side-item：只位移内容，分隔线原地不动，且不触发重排 */
.latest-item > * { transition: transform var(--dur) var(--ease-out); }
.latest-item:hover > * { transform: translateX(6px); }
.latest-item .li-thumb {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
}
.latest-item .li-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease-out);
}
.latest-item:hover .li-thumb img { transform: scale(1.05); }
.latest-item-body { display: flex; flex-direction: column; }
.latest-item-body .li-cat {
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
  color: var(--brand); text-transform: uppercase;
  margin-bottom: 8px;
}
.latest-item-body h3 {
  font-size: 19px; font-weight: 700; line-height: 1.4;
  font-family: var(--font-serif);
  color: var(--ink);
  margin-bottom: 8px;
  transition: color var(--dur-fast) var(--ease);
}
.latest-item:hover h3 { color: var(--brand); }
.latest-item-body .li-desc {
  font-size: 14px; color: var(--ink-3); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.latest-item-body .li-meta {
  margin-top: 10px;
  font-size: 12px; color: var(--ink-4);
  display: flex; align-items: center; gap: 10px;
}
.latest-item-body .li-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-5); }

/* 右栏：热门阅读 + 热门标签（两个小部件，和设计稿一致） */
.hot-panel {
  display: flex; flex-direction: column; gap: 24px;
}
/* 面板整体约 780px 高。视口不够高时 sticky 会把底部钉在屏幕外、永远看不到，
   所以只在够高的视口上启用吸附 */
@media (min-height: 900px) {
  .hot-panel { position: sticky; top: calc(var(--header-h) + 24px); }
}
.hot-card {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 28px;
}
.hot-card .hot-label {
  font-size: 11px; font-weight: 800; letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--brand-light);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.hot-list li {
  display: flex; gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.hot-list li:last-child { border-bottom: 0; }
.hot-list .hot-no {
  font-size: 24px; font-weight: 900;
  font-family: var(--font-serif);
  color: rgba(255,255,255,.2);
  line-height: 1; flex-shrink: 0;
  width: 32px;
}
.hot-list li:nth-child(1) .hot-no { color: var(--brand-light); }
.hot-list li:nth-child(2) .hot-no { color: rgba(255,255,255,.5); }
.hot-list li:nth-child(3) .hot-no { color: rgba(255,255,255,.35); }
.hot-list a {
  font-size: 14px; font-weight: 600; line-height: 1.5;
  color: rgba(255,255,255,.85);
  transition: color var(--dur-fast) var(--ease);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.hot-list a:hover { color: var(--brand-light); }

/* 标签云小部件 */
.tags-widget {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px;
}
.tags-widget .tw-label {
  font-size: 11px; font-weight: 800; letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.tags-widget .tag-cloud .tag { margin: 3px; }

/* 各频道精选区块 */
.channel-blocks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 48px;
}
.channel-block { display: flex; flex-direction: column; }
/* 奇数个频道块时最后一块横跨整行：不让 2 列网格留下空的右下角。
   .cb-body 只有两个子元素（feature + list），所以加宽后要同时把 list 内部改成 2 列，
   否则第 3 条轨道会空着 —— 那等于把空洞从外层搬到内层。
   内层重排只在 >640px 生效：窄屏下 .cb-body 已经塌成单列，再套 2 列会挤成一团。 */
.channel-block-wide { grid-column: 1 / -1; }
@media (min-width: 641px) {
  .channel-block-wide .cb-body { grid-template-columns: 1.05fr 1.95fr; }
  .channel-block-wide .cb-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 32px;
    align-content: start;
  }
  .channel-block-wide .cb-list-item:nth-child(-n+2) { padding-top: 0; }
  .channel-block-wide .cb-list-item:last-child { border-bottom: 1px solid var(--line-light); }
  .channel-block-wide .cb-list-item:nth-last-child(-n+2) { border-bottom: 0; }
}
.cb-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}
.cb-title {
  font-size: 18px; font-weight: 800;
  font-family: var(--font-serif);
  color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.cb-title .cb-badge {
  display: inline-block;
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px;
  color: #fff; background: var(--brand);
  padding: 3px 8px; border-radius: 3px;
  text-transform: uppercase;
}
.cb-more {
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  transition: color var(--dur-fast) var(--ease);
}
.cb-more:hover { color: var(--brand); }
.cb-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  flex: 1;
}
.cb-feature { display: block; }
.cb-feature .cbf-thumb {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  margin-bottom: 12px;
}
.cb-feature .cbf-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease-out);
}
.cb-feature:hover .cbf-thumb img { transform: scale(1.05); }
.cb-feature h3 {
  font-size: 16px; font-weight: 700; line-height: 1.4;
  font-family: var(--font-serif);
  color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--dur-fast) var(--ease);
}
.cb-feature:hover h3 { color: var(--brand); }
.cb-feature .cbf-meta {
  margin-top: 6px;
  font-size: 12px; color: var(--ink-4);
}
.cb-list { display: flex; flex-direction: column; }
.cb-list-item {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-light);
}
.cb-list-item:first-child { padding-top: 0; }
.cb-list-item:last-child { border-bottom: 0; }
/* 同 .cover-side-item：只位移内容，分隔线原地不动，且不触发重排 */
.cb-list-item > * { transition: transform var(--dur) var(--ease-out); }
.cb-list-item:hover > * { transform: translateX(6px); }
.cb-list-item h4 {
  font-size: 14px; font-weight: 600; line-height: 1.45;
  color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--dur-fast) var(--ease);
}
.cb-list-item:hover h4 { color: var(--brand); }
.cb-list-item .cbli-meta {
  margin-top: 4px;
  font-size: 11px; color: var(--ink-4);
}

/* 范儿频道 - 横向卡片 */
.style-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.style-card { display: block; }
.style-card .sc-thumb {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3/4;
  margin-bottom: 14px;
}
.style-card .sc-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease-out);
}
.style-card:hover .sc-thumb img { transform: scale(1.05); }
.style-card .sc-cat {
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
  color: var(--brand); text-transform: uppercase;
  margin-bottom: 6px;
}
.style-card h3 {
  font-size: 15px; font-weight: 700; line-height: 1.4;
  font-family: var(--font-serif);
  color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--dur-fast) var(--ease);
}
.style-card:hover h3 { color: var(--brand); }

/* 频道聚焦 */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.channel-card {
  position: relative;
  display: block;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 4/5;
}
.channel-card img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s var(--ease-out);
}
.channel-card:hover img { transform: scale(1.06); }
.channel-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.2) 50%, transparent 80%);
}
.channel-card-body {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 28px;
  color: #fff;
}
.channel-card-body .ch-cat {
  font-size: 11px; font-weight: 800; letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brand-light);
  margin-bottom: 10px;
}
.channel-card-body h3 {
  font-size: 22px; font-weight: 800; line-height: 1.3;
  font-family: var(--font-serif);
  color: #fff;
  margin-bottom: 8px;
}
.channel-card-body .ch-meta {
  font-size: 12px; color: rgba(255,255,255,.78);
}

/* ==========================================================================
   滚动渐入的错落节奏
   main.js 里已有的 IntersectionObserver 只负责加 .visible，
   这里用 nth-child 补每张卡的延迟，做出依次浮现的效果（纯 CSS，无新依赖）。
   prefers-reduced-motion 下 style.css 会把过渡时长压到 0.01ms，等同于不动。
   ========================================================================== */
.editors-grid > .reveal:nth-child(2),
.latest-list > .reveal:nth-child(2),
.style-row > .reveal:nth-child(2),
.channel-grid > .reveal:nth-child(2),
.channel-blocks > .reveal:nth-child(2) { transition-delay: 70ms; }

.editors-grid > .reveal:nth-child(3),
.latest-list > .reveal:nth-child(3),
.style-row > .reveal:nth-child(3),
.channel-grid > .reveal:nth-child(3),
.channel-blocks > .reveal:nth-child(3) { transition-delay: 140ms; }

.editors-grid > .reveal:nth-child(4),
.latest-list > .reveal:nth-child(4),
.style-row > .reveal:nth-child(4),
.channel-blocks > .reveal:nth-child(4) { transition-delay: 210ms; }

.latest-list > .reveal:nth-child(5) { transition-delay: 280ms; }

/* 响应式 */
@media (max-width: 1024px) {
  .cover-grid { grid-template-columns: 1fr; gap: 32px; }
  .cover-main { min-height: 420px; }
  .cover-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 24px; }
  .editors-grid { grid-template-columns: repeat(2, 1fr); }
  .latest-grid { grid-template-columns: 1fr; gap: 40px; }
  .hot-panel { position: static; }
  .channel-grid { grid-template-columns: 1fr; }
  .channel-card { aspect-ratio: 16/9; }
  .channel-blocks { grid-template-columns: 1fr; gap: 40px; }
  .style-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .cover-main-body { padding: 24px; }
  .cover-main-body .cover-title { font-size: 24px; }
  .cover-main { min-height: 360px; }
  .editors-grid { grid-template-columns: 1fr; }
  .latest-item { grid-template-columns: 1fr; gap: 14px; }
  .latest-item .li-thumb { aspect-ratio: 16/9; }
  .mag-section { padding: 40px 0; }
  .cb-body { grid-template-columns: 1fr; }
  .style-row { grid-template-columns: 1fr; }
}