/* 配色令牌：浅色为默认，深色跟随系统设置 */
:root {
  --bg: #faf8f4;
  --bg-outer: #ece8df;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5d6670;
  --line: #e6e1d7;
  --life: #2f7d5b;
  --ent: #b0386f;
  --sports: #1f5fbf;
  --radius: 14px;
  /* 手机竖屏单列宽度；宽屏下也保持这个宽度居中 */
  --col: 480px;
  --head-h: 52px;
  --bar-h: 58px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --bg-outer: #0c0d10;
    --surface: #1c1f25;
    --text: #ebe8e1;
    --muted: #a3aab3;
    --line: #2c3038;
    --life: #5fc59a;
    --ent: #ee82b3;
    --sports: #74a7f6;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* 吸顶标题栏高度，避免锚点跳转后栏目标题被遮住 */
  scroll-padding-top: calc(var(--head-h) + 8px);
}

body {
  margin: 0;
  background: var(--bg-outer);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  /* 给底部标签栏和安全区让出位置 */
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
}

a { color: inherit; }

/* 标题折行时均衡分配，避免单字孤行 */
h1, h2, h3 { text-wrap: balance; }

/* 单列容器：整页内容都在这一列里 */
.page {
  max-width: var(--col);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
}

.wrap { padding: 0 16px; }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  padding: 8px 12px;
  background: var(--text);
  color: var(--bg);
  border-radius: 8px;
  z-index: 30;
}
.skip:focus { top: 12px; }

/* 顶部标题栏：品牌 + 今日日期 */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: var(--head-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .04em;
}
.brand__mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: conic-gradient(var(--life) 0 33%, var(--ent) 0 66%, var(--sports) 0);
}
.top__date { margin: 0; color: var(--muted); font-size: 13px; white-space: nowrap; }

/* 首屏 */
.hero { padding: 28px 0 8px; }
.hero__title {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.3;
  letter-spacing: .01em;
}
.hero__sub { margin: 0; color: var(--muted); font-size: 15px; }

/* 栏目 */
.section { padding: 28px 0 8px; --accent: var(--life); }
.s-life { --accent: var(--life); }
.s-ent { --accent: var(--ent); }
.s-sports { --accent: var(--sports); }

.section__head {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}
.section__head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.4;
  color: var(--accent);
  letter-spacing: .06em;
}
.section__head p { margin: 0; color: var(--muted); font-size: 14px; }

/* 手机端永远单列竖排 */
.grid { display: grid; gap: 12px; }

/* 文章卡片 */
.card {
  padding: 16px 16px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card h3 { margin: 6px 0 6px; font-size: 17px; line-height: 1.5; }
.card p { margin: 0 0 8px; color: var(--muted); font-size: 15px; }

.card--lead { padding: 0 0 12px; overflow: hidden; }
.card--lead > :not(.cover) { margin-left: 16px; margin-right: 16px; }
.card--lead h3 { font-size: 20px; }

.cover {
  display: grid;
  place-items: center;
  height: 120px;
  margin-bottom: 14px;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--accent);
}
.cover span { font-size: 46px; font-weight: 800; letter-spacing: .1em; opacity: .55; }

.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.tag {
  padding: 1px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}

details { margin-top: 2px; }
summary {
  display: flex;
  align-items: center;
  /* 触控目标不小于 44px */
  min-height: 44px;
  cursor: pointer;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: " ↓"; white-space: pre; }
details[open] summary::after { content: " ↑"; }
details p { margin-top: 2px; }

:focus-visible { outline: 2px solid var(--accent, var(--life)); outline-offset: 3px; border-radius: 6px; }

/* 页脚 */
.foot { margin-top: 28px; padding: 18px 0 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot__row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.foot p { margin: 0; }

/* 底部栏目标签栏：固定在屏幕底部，宽度与内容列一致 */
.nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  max-width: var(--col);
  transform: translateX(-50%);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--line);
}
.nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--bar-h);
  text-decoration: none;
  font-size: 12px;
  color: var(--muted);
}
.nav a[data-target="life"] { --accent: var(--life); }
.nav a[data-target="entertainment"] { --accent: var(--ent); }
.nav a[data-target="sports"] { --accent: var(--sports); }
.nav i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .45;
  transition: transform .15s, opacity .15s;
}
.nav a[aria-current="true"] { color: var(--accent); font-weight: 700; }
.nav a[aria-current="true"] i { opacity: 1; transform: scale(1.5); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav i { transition: none; }
}
