/* ==========================================================================
   慢日子 · home.css — 首页
   日签 / 名言 / 图文轮播 / 闲读 / 阅读浮层
   ========================================================================== */

/* ---------- 1. 日签 ---------- */
.hero {
  position: relative;
  padding-top: clamp(54px, 9vw, 96px);
  padding-bottom: clamp(40px, 7vw, 76px);
  text-align: center;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: -25% -10% auto -10%;
  height: 130%;
  pointer-events: none;
  background:
    radial-gradient(40% 40% at 50% 26%, rgba(217, 164, 65, .20), transparent 72%),
    radial-gradient(56% 48% at 16% 8%, rgba(196, 120, 90, .13), transparent 72%),
    radial-gradient(52% 44% at 86% 16%, rgba(126, 155, 130, .15), transparent 72%);
  animation: breathe 16s var(--ease-soft) infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: .85; }
  50%      { transform: scale(1.07); opacity: 1; }
}

.hero-inner { position: relative; z-index: 1; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;          /* 窄屏宁可换行，也别把「星期二」从中间挤断 */
  gap: 8px 10px;
  font-size: 13.5px;
  letter-spacing: .18em;
  color: var(--ink-3);
}
.hero-eyebrow::before,
.hero-eyebrow::after {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--line);
}

.hero-title {
  margin-top: 22px;
  font-family: var(--serif);
  font-size: clamp(30px, 5.6vw, 52px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: .08em;
  color: var(--ink);
}
/* 日环 */
.daydial {
  position: relative;
  width: clamp(184px, 25vw, 226px);
  margin: clamp(30px, 5vw, 44px) auto 0;
  aspect-ratio: 1;
}
.dial { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial .track,
.dial .fill { fill: none; stroke-width: 5.5; stroke-linecap: round; }
.dial .track { stroke: var(--line); }
.dial .fill {
  stroke: url(#dialGrad);
  stroke-dasharray: 552.9;
  stroke-dashoffset: 552.9;
  transition: stroke-dashoffset 1.8s var(--ease);
}

.dial-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.dial-num {
  font-family: var(--serif);
  font-size: clamp(44px, 7.4vw, 60px);
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.dial-unit {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: .24em;
  color: var(--clay-ink);
  margin-left: 4px;
}
.dial-label {
  margin-top: 7px;
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--ink-3);
}

.hero-countdown {
  margin-top: 24px;
  font-size: 14px;
  letter-spacing: .08em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.hero-countdown b {
  font-family: var(--latin-serif);
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .04em;
}

.hero-year {
  margin: 18px auto 0;
  max-width: 340px;
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--ink-3);
}
.year-track {
  margin-top: 9px;
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.year-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--sage), var(--gold));
  transition: width 1.6s var(--ease) .3s;
}

.hero-chips {
  margin-top: clamp(26px, 4vw, 38px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.chip--yi { background: var(--sage-soft); color: var(--sage-ink); }
.chip--ji { background: var(--paper-3); color: var(--ink-3); }
.chip b { font-weight: 600; letter-spacing: .12em; opacity: .75; margin-right: 2px; }

/* ---------- 2. 名言 ---------- */
.quote-section {
  position: relative;
  padding-block: clamp(52px, 8vw, 96px);
}
.quote-section::before {
  content: "";
  position: absolute;
  inset: 6% 0;
  background: linear-gradient(180deg, transparent, rgba(var(--paper-rgb), 0) 0%);
  pointer-events: none;
}

.quote {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* 名言长短差得多，给个下限，轮播时卡片不会一高一低 */
  min-height: 336px;
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
  padding: clamp(30px, 5vw, 48px) clamp(18px, 4vw, 44px);
  border-radius: var(--r-lg);
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
@media (max-width: 700px) { .quote { min-height: 300px; } }
.quote::before {
  content: "“";
  position: absolute;
  top: -18px;
  left: 22px;
  font-family: var(--latin-serif);
  font-size: 130px;
  line-height: 1;
  color: var(--clay-ink);
  opacity: .12;
  pointer-events: none;
}

.quote-body,
.quote-by,
.quote-why { transition: opacity .5s var(--ease), transform .5s var(--ease); }

.quote.is-out .quote-body,
.quote.is-out .quote-by,
.quote.is-out .quote-why { opacity: 0; transform: translateY(10px); }

.quote-tag {
  margin-bottom: 16px;
  font-size: 11.5px;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--clay-ink);
}

.quote-zh {
  font-family: var(--serif);
  font-size: clamp(20px, 3.1vw, 27px);
  font-weight: 500;
  line-height: 1.85;
  letter-spacing: .05em;
  color: var(--ink);
}
.quote-en {
  margin-top: 18px;
  font-family: var(--latin-serif);
  font-style: italic;
  font-size: clamp(14px, 1.6vw, 16px);
  line-height: 1.9;
  color: var(--ink-3);
}
.quote-by {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13.5px;
  letter-spacing: .12em;
  color: var(--ink-2);
}
.quote-by::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--line);
}
.quote-src {
  font-family: var(--latin-serif);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--ink-3);
}
.quote-why {
  margin-top: 16px;
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--ink-3);
}

.quote-bar {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.quote-bar .icon-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.quote-bar .icon-btn:hover { border-color: var(--clay-soft); }
.quote-bar .icon-btn svg { width: 15px; height: 15px; }

.quote-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  max-width: min(58vw, 460px);
}
.quote-dots button {
  position: relative;
  padding: 0;                 /* 少了这句，UA 给 button 的内边距会把圆点压成椭圆 */
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--line);
  transition: all .4s var(--ease);
}
.quote-dots button:hover { background: var(--ink-3); }
.quote-dots button.is-active {
  width: 20px;
  border-radius: 3px;
  background: var(--clay);
}

.quote-progress {
  margin-top: 16px;
  height: 2px;
  width: 180px;
  margin-inline: auto;
  border-radius: 2px;
  background: var(--line-2);
  overflow: hidden;
}
.quote-progress i {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--clay);
  opacity: .55;
}

/* ---------- 3. 图文轮播 ---------- */
.gallery { position: relative; }

.gallery-viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--paper-3);
  box-shadow: var(--shadow-2);
}
@media (max-width: 700px) {
  .gallery-viewport { aspect-ratio: 4 / 3; }
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.1s var(--ease);
  pointer-events: none;
}
.slide.is-active { opacity: 1; pointer-events: auto; }

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 9s linear;
}
.slide.is-active img { transform: scale(1.09); }

.slide-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: clamp(22px, 4vw, 40px);
  color: #FFF9F0;
  /* 底下压的是会轮换的插画，最亮的那张上白字会糊掉。
     所以压暗不能一路淡到透明，文字所在的区域得一直有底色；
     再加一层投影兜底，换任何图都读得清。 */
  background: linear-gradient(0deg,
    rgba(26, 20, 15, .76) 0%,
    rgba(26, 20, 15, .64) 58%,
    rgba(26, 20, 15, .38) 84%,
    rgba(26, 20, 15, 0) 100%);
  text-shadow: 0 1px 2px rgba(18, 12, 6, .55), 0 2px 14px rgba(18, 12, 6, .45);
}
.slide-kicker {
  font-family: var(--latin-serif);
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
  opacity: .92;
}
.slide-title {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: clamp(19px, 2.9vw, 27px);
  font-weight: 600;
  letter-spacing: .1em;
}
.slide-desc {
  margin-top: 6px;
  font-size: 13.5px;
  letter-spacing: .04em;
  opacity: .92;
  max-width: 46ch;
}
.slide.is-active .slide-kicker,
.slide.is-active .slide-title,
.slide.is-active .slide-desc {
  animation: capUp .9s var(--ease) both;
}
.slide.is-active .slide-title { animation-delay: .06s; }
.slide.is-active .slide-desc { animation-delay: .12s; }

@keyframes capUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.gal-arrow {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #FFF9F0;
  background: rgba(38, 30, 22, .3);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .4s var(--ease), background .3s var(--ease), transform .4s var(--ease);
}
.gal-arrow svg { width: 17px; height: 17px; }
.gal-arrow--prev { left: 16px; }
.gal-arrow--next { right: 16px; }
.gallery:hover .gal-arrow,
.gal-arrow:focus-visible { opacity: 1; }
.gal-arrow:hover { background: rgba(38, 30, 22, .55); transform: scale(1.06); }

.gal-bar {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.gal-dots { display: flex; align-items: center; gap: 8px; }
.gal-dots button {
  position: relative;
  padding: 0;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--line);
  transition: all .4s var(--ease);
}
.gal-dots button:hover { background: var(--ink-3); }
/* 圆点本身只有 6-7px，靠伪元素把可点范围撑开 */
.quote-dots button::after,
.gal-dots button::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
}

.gal-dots button.is-active {
  width: 24px;
  border-radius: 4px;
  background: var(--clay);
}
.gal-count {
  font-family: var(--latin-serif);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--ink-3);
}
.gal-count b { color: var(--ink-2); font-weight: 600; }

/* ---------- 4. 闲读 ---------- */
.reads-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.2vw, 26px);
}
@media (max-width: 940px) { .reads-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .reads-grid { grid-template-columns: 1fr; } }

.read-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-1);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .5s var(--ease);
}
.read-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-2);
  border-color: var(--line);
}

.read-cover {
  position: relative;
  height: 116px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.read-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 120%, rgba(255, 255, 255, .55), transparent 60%);
  opacity: .7;
}
.read-glyph {
  position: relative;
  z-index: 1;
  font-size: 34px;
  line-height: 1;
  filter: saturate(.92);
  transition: transform .6s var(--ease);
}
.read-card:hover .read-glyph { transform: translateY(-3px) scale(1.08); }

/* 封面用的是浅色渐变，暗色下压一压 */
:root[data-theme="dark"] .read-cover { filter: brightness(.6) saturate(.85); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .read-cover { filter: brightness(.6) saturate(.85); }
}
:root[data-theme="dark"] .read-glyph { filter: saturate(.9) brightness(1.25); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .read-glyph { filter: saturate(.9) brightness(1.25); }
}

.read-flag {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  font-size: 11px;
  letter-spacing: .14em;
  padding: 3px 10px;
  border-radius: var(--r-full);
  color: rgba(48, 36, 24, .72);
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.read-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.read-title {
  font-family: var(--serif);
  font-size: 18.5px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: .04em;
  color: var(--ink);
}
.read-dek {
  margin-top: 9px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.read-meta {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: .06em;
}
.read-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line); }

/* ---------- 4.5 去挑一挑 ---------- */
.promo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(20px, 4vw, 48px);
  padding: clamp(26px, 4vw, 42px) clamp(22px, 4vw, 46px);
  border-radius: var(--r-lg);
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .5s var(--ease);
}
.promo:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
  border-color: var(--clay-soft);
}

.promo-glow {
  position: absolute;
  inset: -60% -10% auto -30%;
  height: 220%;
  pointer-events: none;
  background:
    radial-gradient(34% 44% at 22% 50%, rgba(217, 164, 65, .18), transparent 70%),
    radial-gradient(38% 48% at 70% 60%, rgba(126, 155, 130, .16), transparent 70%);
}

.promo-text { position: relative; display: flex; flex-direction: column; gap: 8px; }
.promo-kicker {
  font-family: var(--latin-serif);
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.promo-title {
  font-family: var(--serif);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink);
}
.promo-desc {
  font-size: 13.5px;
  line-height: 1.8;
  letter-spacing: .03em;
  color: var(--ink-3);
  max-width: 46ch;
}

.promo-go {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--r-full);
  font-size: 14px;
  letter-spacing: .1em;
  white-space: nowrap;
  color: var(--paper);
  background: var(--ink);
  transition: background .4s var(--ease);
}
.promo-go svg { width: 17px; height: 17px; transition: transform .45s var(--ease); }
.promo:hover .promo-go { background: var(--clay); }
.promo:hover .promo-go svg { transform: translateX(5px); }

@media (max-width: 680px) {
  .promo { flex-direction: column; align-items: flex-start; }
  .promo-go { align-self: stretch; justify-content: center; }
}

/* ---------- 5. 阅读浮层 ---------- */
.reader {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--paper);
  opacity: 0;
  transition: opacity .45s var(--ease);
  overscroll-behavior: contain;
}
.reader.is-open { opacity: 1; }
.reader:focus { outline: none; }
.reader[hidden] { display: none; }

.reader-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 3;
  background: transparent;
}
.reader-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--sage), var(--clay));
  transition: width .12s linear;
}

.reader-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.reader-close {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 4;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-2);
  background: rgba(var(--paper-rgb), .82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  transition: transform .4s var(--ease), color .3s, background .3s;
}
.reader-close:hover { transform: rotate(90deg); color: var(--clay-ink); }
.reader-close svg { width: 17px; height: 17px; }

.reader-article {
  max-width: 700px;
  margin-inline: auto;
  padding: clamp(76px, 11vw, 116px) clamp(20px, 5vw, 32px) 60px;
}

.reader-head { text-align: center; padding-bottom: clamp(26px, 4vw, 40px); }
.reader-kicker {
  font-family: var(--latin-serif);
  font-size: 11px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.reader-title {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: clamp(25px, 4.6vw, 36px);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .05em;
  color: var(--ink);
}
.reader-dek {
  margin-top: 14px;
  font-size: 14.5px;
  letter-spacing: .04em;
  color: var(--ink-3);
}
.reader-meta {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: .08em;
}
.reader-head::after {
  content: "";
  display: block;
  width: 40px;
  height: 1px;
  margin: 30px auto 0;
  background: var(--clay);
  opacity: .5;
}

.reader-body {
  font-size: 17px;
  line-height: 2.1;
  letter-spacing: .02em;
  color: var(--ink-2);
}
.reader-body p { margin-bottom: 1.35em; }
.reader-body p:last-child { margin-bottom: 0; }

/* 开篇那句本来就是小标题时，当导语来排 */
.reader-body .reader-lead {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.95;
  letter-spacing: .08em;
  color: var(--ink);
  margin-bottom: 1.5em;
}

.reader-body h2 {
  margin: 2.2em 0 1em;
  font-family: var(--serif);
  font-size: 19.5px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
}
.reader-body h2::before {
  content: "";
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--clay);
  flex: none;
}

.reader-body blockquote {
  margin: 2em 0;
  padding: 22px 26px;
  border-radius: var(--r);
  background: var(--paper-3);
  border-left: 3px solid var(--clay);
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 1.95;
  letter-spacing: .06em;
  color: var(--ink);
}

.reader-body ul { margin: 1.5em 0; display: grid; gap: 13px; }
.reader-body li {
  position: relative;
  padding-left: 26px;
  font-size: 16.5px;
  line-height: 1.9;
}
.reader-body li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .82em;
  width: 9px;
  height: 1px;
  background: var(--sage);
}

.reader-foot {
  margin-top: clamp(40px, 6vw, 64px);
  padding-top: 28px;
  border-top: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.reader-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 44%;
  text-align: left;
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: .12em;
  transition: color .3s var(--ease);
}
.reader-nav:hover { color: var(--clay-ink); }
.reader-nav span {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .04em;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.reader-nav--next { text-align: right; align-items: flex-end; }

.reader-back {
  align-self: center;
  font-size: 13px;
  letter-spacing: .16em;
  color: var(--ink-3);
  padding: 8px 18px;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  transition: all .3s var(--ease);
  white-space: nowrap;
}
.reader-back:hover { color: var(--clay-ink); border-color: var(--clay-soft); background: var(--clay-soft); }

body.is-locked { overflow: hidden; }

@media (max-width: 640px) {
  .quote-dots { gap: 6px; max-width: 60vw; }
  .quote-bar { gap: 10px; }
}

@media (max-width: 560px) {
  .reader-foot { flex-direction: column; align-items: stretch; gap: 18px; }
  .reader-nav { max-width: none; }
  .reader-nav--next { text-align: left; align-items: flex-start; }
  .reader-back { order: 3; text-align: center; }
}
