/* ============================================================
   开心快乐每一天 · wche.cn
   界面重构版：奶油底 + 铃铛金 + 豆绿（禁蓝色系）
   铁律：任何情况下不引入蓝色系作为主色
   支持系统深色模式（prefers-color-scheme）
   ============================================================ */

:root {
  --bg: #FDF6EC;
  --bg-soft: #F7EDE0;
  --card: #FFFFFF;
  --ink: #4A3F35;
  --ink-light: #9A8C7E;
  --line: #EFE4D4;
  --bell: #E8A33D;
  --bell-deep: #C77F1E;
  --bell-soft: #F7E3C3;
  --ai: #7BA88C;
  --clay: #C0703F;
  --plum: #8E6B9E;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(74, 63, 53, .07);
  --shadow-lg: 0 12px 34px rgba(74, 63, 53, .11);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1E1A16;
    --bg-soft: #26211C;
    --card: #2A2420;
    --ink: #F0E7DA;
    --ink-light: #A2937F;
    --line: #3A322A;
    --bell: #F0B458;
    --bell-deep: #F0B458;
    --bell-soft: #40332A;
    --ai: #8FC0A0;
    --clay: #D98A5B;
    --plum: #A98BB8;
    --shadow: 0 4px 18px rgba(0, 0, 0, .34);
    --shadow-lg: 0 12px 34px rgba(0, 0, 0, .46);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Serif SC", serif;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 32px 20px 80px; }

/* ---------- 头部 ---------- */
header.site { text-align: center; padding: 44px 0 30px; }

header.site .bell {
  font-size: 38px;
  display: block;
  animation: swing 3.8s ease-in-out infinite;
  transform-origin: top center;
}
@keyframes swing {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(13deg); }
  30% { transform: rotate(-9deg); }
  45% { transform: rotate(6deg); }
  60% { transform: rotate(0deg); }
}

header.site h1 {
  font-size: 34px;
  letter-spacing: 7px;
  margin-top: 12px;
  color: var(--bell-deep);
}

header.site .sub {
  margin-top: 8px;
  color: var(--ink-light);
  font-size: 13.5px;
  letter-spacing: 2.5px;
  min-height: 1.4em;
}

/* ---------- 导航 ---------- */
nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: 22px 0 36px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
nav a {
  color: var(--ink-light);
  text-decoration: none;
  padding: 6px 14px;
  font-size: 14.5px;
  border-radius: 20px;
  transition: color .2s ease, background .2s ease;
}
nav a:hover { color: var(--bell-deep); background: var(--bell-soft); }
nav a.active { color: var(--bell-deep); background: var(--bell-soft); }

/* ---------- 分类筛选（替代旧 tagbar） ---------- */
.catbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 0 34px;
}
.catbar button {
  font: inherit;
  font-size: 13px;
  color: var(--ink-light);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 16px;
  cursor: pointer;
  transition: .2s ease;
}
.catbar button:hover { color: var(--bell-deep); border-color: var(--bell); }
.catbar button.active {
  color: var(--bg);
  background: var(--bell);
  border-color: var(--bell);
  font-weight: 500;
}
.catbar button .cnt {
  opacity: .6;
  font-size: 11px;
  margin-left: 5px;
}

/* ---------- 杂志式主区：头条 + 次条 ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 42px;
}

.hero-main {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 32px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.hero-main:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--bell);
}

.hero-side { display: flex; flex-direction: column; gap: 14px; }

.hero-mini {
  flex: 1;
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  text-decoration: none;
  color: inherit;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.hero-mini:hover {
  transform: translateX(3px);
  border-color: var(--bell);
  box-shadow: var(--shadow);
}

.hero-flag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--bell-deep);
  background: var(--bell-soft);
  border-radius: 4px;
  padding: 2px 9px;
  margin-bottom: 10px;
}
.hero-date {
  font-size: 12.5px;
  color: var(--ink-light);
  letter-spacing: 1px;
}
.hero-main h2 {
  font-size: 23px;
  line-height: 1.5;
  margin: 8px 0 12px;
  color: var(--ink);
}
.hero-mini h3 { font-size: 16px; line-height: 1.6; margin: 6px 0 6px; color: var(--ink); }
.hero-desc { font-size: 14.5px; color: var(--ink-light); line-height: 1.8; }

/* ---------- 侧栏 ---------- */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 40px; align-items: start; }

.side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }

.side-box {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.side-box h4 {
  font-size: 12.5px;
  letter-spacing: 2px;
  color: var(--bell-deep);
  margin-bottom: 14px;
  font-weight: 500;
}
.side-stat { display: flex; justify-content: space-between; font-size: 13.5px; padding: 5px 0; }
.side-stat span:last-child { color: var(--ink-light); }

.side-list { list-style: none; }
.side-list li { padding: 6px 0; font-size: 13.5px; display: flex; justify-content: space-between; gap: 8px; }
.side-list a { color: var(--ink); text-decoration: none; }
.side-list a:hover { color: var(--bell-deep); }
.side-list em { font-style: normal; color: var(--ink-light); font-size: 12px; }

.side-feed {
  display: inline-block;
  font-size: 13px;
  color: var(--bell-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--bell);
  padding-bottom: 1px;
}
.side-feed:hover { opacity: .75; }

/* ---------- 时间线列表 ---------- */
.section-label {
  font-size: 12.5px;
  letter-spacing: 2.5px;
  color: var(--ink-light);
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--line);
}

.entry { position: relative; margin-bottom: 18px; }
.entry::before {
  content: "";
  position: absolute;
  left: -26px; top: 22px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bell);
  border: 2px solid var(--bg);
}

.entry .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.entry .card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--bell);
}

.entry .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-light);
  letter-spacing: .5px;
  flex-wrap: wrap;
}
.entry .date .weather { margin-left: 6px; }
.entry h2 { font-size: 18.5px; margin: 7px 0 7px; line-height: 1.6; }
.entry h2 a { color: var(--ink); text-decoration: none; }
.entry h2 a:hover { color: var(--bell-deep); }
.entry .summary { font-size: 14.5px; color: var(--ink-light); }

.chip {
  display: inline-block;
  font-size: 11px;
  padding: 1px 9px;
  border-radius: 12px;
  border: 1px solid;
  white-space: nowrap;
}
.chip-log { color: var(--bell-deep); border-color: var(--bell); background: var(--bell-soft); }
.chip-essay { color: var(--plum); border-color: var(--plum); background: transparent; }
.chip-note { color: var(--clay); border-color: var(--clay); background: transparent; }
.chip-weekly { color: var(--ai); border-color: var(--ai); background: transparent; }

.empty { padding: 40px 0; text-align: center; color: var(--ink-light); font-size: 14px; }

/* ---------- 文章页 ---------- */
article.post .meta { font-size: 13px; color: var(--ink-light); margin-bottom: 24px; letter-spacing: 1px; }
article.post h1 { font-size: 27px; margin-bottom: 8px; line-height: 1.5; }
article.post .body p { margin: 17px 0; font-size: 16px; }
article.post .body h3 { margin: 30px 0 10px; font-size: 17.5px; color: var(--bell-deep); }
article.post .body a { color: var(--bell-deep); }
article.post .body blockquote {
  border-left: 3px solid var(--bell);
  background: var(--bg-soft);
  padding: 12px 18px;
  margin: 18px 0;
  color: var(--ink-light);
  border-radius: 0 8px 8px 0;
}

.backlink { display: inline-block; margin-bottom: 22px; color: var(--ink-light); text-decoration: none; font-size: 13.5px; }
.backlink:hover { color: var(--bell-deep); }

/* ---------- AI 标识 ---------- */
.ai-badge {
  display: inline-block;
  font-size: 12px;
  color: var(--ai);
  border: 1px solid var(--ai);
  border-radius: 20px;
  padding: 2px 13px;
  margin-top: 12px;
  background: transparent;
}

/* ---------- 页脚 ---------- */
footer.site {
  margin-top: 70px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  color: var(--ink-light);
}
footer.site a { color: var(--ink-light); text-decoration: none; }
footer.site a:hover { color: var(--bell-deep); }
footer.site .icp { margin-top: 6px; }

/* ---------- 关于页人物卡 ---------- */
.profile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  margin-top: 12px;
  box-shadow: var(--shadow);
}
.profile .face { font-size: 44px; text-align: center; display: block; margin-bottom: 8px; }
.profile p { margin: 14px 0; font-size: 15.5px; }
.profile .secret { text-align: center; color: var(--ink-light); font-style: italic; margin-top: 22px; }

/* ---------- 留言页 ---------- */
.mailbtn {
  display: inline-block;
  background: var(--bell);
  color: #fff;
  text-decoration: none;
  font-size: 15.5px;
  padding: 12px 30px;
  border-radius: 30px;
  margin: 10px 0;
  transition: background .2s ease, transform .2s ease;
}
.mailbtn:hover { background: var(--bell-deep); transform: translateY(-2px); }
.note { font-size: 13px; color: var(--ink-light); margin: 8px 0; }

/* ---------- 归档页 ---------- */
.arch-year { font-size: 21px; color: var(--bell-deep); margin: 34px 0 10px; letter-spacing: 2px; }
.arch-list { list-style: none; }
.arch-list li {
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
}
.arch-list a { color: var(--ink); text-decoration: none; font-size: 16px; }
.arch-list a:hover { color: var(--bell-deep); }
.arch-list .d { color: var(--ink-light); font-size: 13px; white-space: nowrap; }
.arch-list .t { color: var(--ai); font-size: 12px; white-space: nowrap; }

/* ============================================================
   特效层（配合 assets/effects.js，主色随变量走）
   ============================================================ */

#fx-canvas {
  position: fixed;
  top: 0; left: 0;
  z-index: 9998;
  pointer-events: none;
}

#fx-glow {
  position: fixed;
  top: 0; left: 0;
  width: 260px; height: 260px;
  margin: -130px 0 0 -130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,163,61,.26) 0%, rgba(123,168,140,.12) 40%, transparent 70%);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 9997;
  will-change: transform;
}

#fx-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 9px; height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--bell);
  box-shadow: 0 0 8px rgba(232,163,61,.85);
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
}
html.fx-custom-cursor, html.fx-custom-cursor * { cursor: none !important; }

.fx-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
}
.fx-in { opacity: 1; transform: none; }

/* 减少动效：彻底关特效层 */
@media (prefers-reduced-motion: reduce) {
  #fx-canvas, #fx-glow, #fx-cursor { display: none !important; }
  .fx-reveal { opacity: 1 !important; transform: none !important; }
  header.site .bell { animation: none; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  .side { position: static; }
  .side-box { padding: 18px; }
}

@media (max-width: 560px) {
  .wrap { padding: 24px 16px 60px; }
  header.site h1 { font-size: 27px; letter-spacing: 4px; }
  .hero-main { padding: 24px 22px; }
  .hero-main h2 { font-size: 20px; }
  .entry .card { padding: 17px 19px; }
  article.post h1 { font-size: 23px; }
  .profile { padding: 26px 22px; }
  nav a { font-size: 13.5px; padding: 5px 11px; }
}
