/**
 * 沸点日报 · 移动栏目页高保真（Mobile / m/ only · 样例「模型」）
 * 独立树；禁止靠把 desktop 挤小验收
 * @import 令牌：栏目/mobile → 上四级到 设计系统
 */
@import url("./tokens.css");

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

body.has-tabbar {
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
}

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

a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* —— 栏目态顶栏：← 分类 + 栏目名 —— */
.m-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top, 0px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.m-back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: var(--space-1) 0;
  font-size: var(--fs-nav);
  font-weight: var(--fw-medium);
  color: var(--ink-muted);
}

.m-back:hover,
.m-back:active {
  color: var(--boil);
}

.m-cat-title {
  margin: 0;
  justify-self: center;
  font-size: 17px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  color: var(--brand-mark);
  line-height: 1.2;
  white-space: nowrap;
}

.m-header-spacer {
  justify-self: end;
  width: 1px;
  height: 1px;
}

/* —— Feed 单列 —— */
.m-feed {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-3) var(--gutter) var(--space-5);
}

.m-cat-dek {
  margin: 0 0 var(--space-5);
  font-size: var(--fs-caption);
  color: var(--ink-faint);
  line-height: var(--lh-body);
  /* 签名动效：说明淡入上移（克制） */
  animation: dek-rise 0.45s ease-out both;
}

@keyframes dek-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .m-cat-dek {
    animation: none;
  }
}

.m-card {
  position: relative;
  background: var(--paper-elevated);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.m-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  background: var(--daily-mark);
  border-radius: 1px;
}

.m-card .meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-label);
  color: var(--ink-faint);
  padding-left: var(--space-2);
}

.tag {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  color: var(--ink-muted);
  font-weight: var(--fw-medium);
}

.m-card h2 {
  margin: 0;
  font-size: var(--fs-h2);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: -0.01em;
  padding-left: var(--space-2);
}

.m-card h2 a {
  display: block;
  min-height: var(--touch-min);
  padding: var(--space-1) 0;
}

.m-card .dek {
  margin: 0;
  font-size: var(--fs-body);
  color: var(--ink-muted);
  line-height: var(--lh-body);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-left: var(--space-2);
}

/* —— 分页：文字链，非大胶囊 —— */
.m-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--rule);
  font-size: var(--fs-nav);
}

.m-pagination a,
.m-pagination span.is-disabled {
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  font-weight: var(--fw-medium);
  color: var(--ink-muted);
  padding: 0 var(--space-1);
}

.m-pagination a:not(.is-disabled):active {
  color: var(--boil);
}

.m-pagination a.is-disabled,
.m-pagination span.is-disabled {
  color: var(--ink-faint);
  opacity: 0.5;
  pointer-events: none;
}

.m-page-status {
  font-size: var(--fs-caption);
  color: var(--ink-faint);
}

/* —— 底栏 5 项；分类 active —— */
.m-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--paper-elevated);
  border-top: 1px solid var(--rule);
}

.m-tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--touch-min);
  font-size: var(--fs-nav);
  font-weight: var(--fw-medium);
  color: var(--ink-faint);
  position: relative;
}

.m-tabbar a.is-active {
  color: var(--ink);
  font-weight: var(--fw-semibold);
}

.m-tabbar a.is-active::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 28px;
  height: 2px;
  margin-left: -14px;
  background: var(--boil);
  border-radius: 1px;
  animation: tab-indicator 0.35s ease-out both;
}

@keyframes tab-indicator {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .m-tabbar a.is-active::after {
    animation: none;
  }
}

/* 宽屏预览仍保持移动编排，不切换成桌面双列 */
@media (min-width: 600px) {
  .m-feed {
    max-width: 420px;
  }
}
