/* ══════════════════════════════════════════════════════════════
   home.css —— 首页作品展示
   产品页式的大标题、整块展示卡片（tile）、滚动时画出来的图表。
   ══════════════════════════════════════════════════════════════ */

.home { padding: 0 22px 40px; }

/* ---------- 首屏 ---------- */

.h-hero {
  position: relative;
  min-height: calc(100vh - 48px);
  min-height: calc(100svh - 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  margin: 0 -22px;
  padding: 0 22px;
}
.h-hero-inner {
  position: relative;
  max-width: 980px;
  transform: translateY(calc(var(--p, 0) * 70px)) scale(calc(1 - var(--p, 0) * 0.07));
  opacity: calc(1 - var(--p, 0) * 1.15);
  will-change: transform, opacity;
}
.h-hero { isolation: isolate; }
.h-glow { inset: -20% -10% auto; height: 90%; }
.h-title {
  font-size: 88px;
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 6px 0 22px;
}
.h-sub {
  font-size: 24px;
  line-height: 1.42;
  color: var(--text-secondary);
  margin: 0 auto 30px;
  letter-spacing: 0.005em;
}
.h-live {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border-radius: 980px;
  background: var(--fill);
  font-size: 13px;
  color: var(--text-secondary);
}
.h-live .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.5);
  animation: livePulse 2s infinite var(--ease-io);
}
@keyframes livePulse {
  70% { box-shadow: 0 0 0 8px rgba(48, 209, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); }
}
.h-cue {
  position: absolute;
  bottom: 22px; left: 50%;
  width: 44px; height: 44px;
  margin-left: -22px;
  border: 0; background: none; cursor: pointer;
  color: var(--text-secondary);
  opacity: calc(1 - var(--p, 0) * 3);
  animation: cue 2.4s var(--ease) infinite;
}
.h-cue svg { width: 26px; height: 26px; }
@keyframes cue { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }

/* ---------- 数字带 ---------- */

.h-band {
  max-width: 1180px;
  margin: 0 auto 72px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.h-cell { padding: 34px 24px 30px; }
.h-cell + .h-cell { border-left: 1px solid var(--hairline); }
.h-num {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.h-num small { font-size: 19px; font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.h-lbl { font-size: 14px; color: var(--text-secondary); margin-top: 10px; line-height: 1.5; }

.h-num .count, .h-num small, .kpis b, .big-stat .count {
  background-image: linear-gradient(92deg, var(--g1) 0%, var(--g2) 55%, var(--g3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.h-cell { text-align: left; }

/* ---------- 展示卡片 ---------- */

.tile {
  max-width: 1180px;
  margin: 0 auto 24px;
  padding: 72px 72px 60px;
  border-radius: 30px;
  background: var(--fill);
  overflow: hidden;
  position: relative;
}
.tile.reveal { transform: translateY(48px) scale(0.975); transition-duration: 1s; }
.tile.reveal.in { transform: none; }
.tile-note {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-secondary);
  margin: 26px 0 0;
  max-width: 860px;
}
/* 每个项目的封面：居中大标题、第二行渐变、背后光晕 */
.cover {
  position: relative;
  isolation: isolate;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 36px 0 8px;
}
.cover .eyebrow { font-size: 17px; font-weight: 600; margin-bottom: 14px; }
.cover-title {
  font-size: 76px;
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 0 0 22px;
  text-wrap: balance;
}
.cover-sub {
  font-size: 21px;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto;
  text-wrap: pretty;
}
.cover-sm { padding-top: 12px; }
.cover-sm .eyebrow { font-size: 14px; margin-bottom: 10px; }
.cover-sm .cover-title { font-size: 48px; margin-bottom: 16px; }
.cover-sm .cover-sub { font-size: 17px; }
.cover-sm .glow { inset: -50% -40%; }

/* 渐变药丸按钮（次要按钮用 .ghost） */
.tile-cta {
  display: flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  margin: 36px auto 0;
  padding: 12px 20px 12px 26px;
  border: 0; border-radius: 980px; cursor: pointer;
  font: inherit; font-size: 16px; font-weight: 600;
  color: #fff;
  background-image: linear-gradient(92deg, var(--g1), var(--g2) 50%, var(--g3), var(--g1));
  background-size: 300% 100%;
  background-position: 0 0;
  box-shadow: 0 10px 28px -12px color-mix(in srgb, var(--g2) 75%, transparent);
  transition: background-position 0.8s var(--ease), transform 0.2s var(--ease), box-shadow 0.35s var(--ease);
}
.tile-cta svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.3s var(--ease-out);
}
.tile-cta:hover {
  background-position: 66% 0;
  box-shadow: 0 16px 34px -12px color-mix(in srgb, var(--g2) 85%, transparent);
}
.tile-cta:hover svg { transform: translateX(3px); }
.tile-cta:active { transform: scale(0.96); }
.tile-skel { height: 300px; border-radius: 14px; background: linear-gradient(90deg, var(--fill), var(--hairline), var(--fill)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; opacity: .35; }
.tile-empty { padding: 60px 0; text-align: center; color: var(--text-secondary); }

/* ---------- 指标行 ---------- */

.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 34px;
  border-top: 1px solid var(--hairline);
}
.kpis-3 { grid-template-columns: repeat(3, 1fr); }
.kpis > div { padding: 24px 20px 0 0; display: flex; flex-direction: column; gap: 6px; }
.kpis .k { font-size: 13px; color: var(--text-secondary); }
.kpis b {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpis span:last-child { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.pills span {
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 980px;
  border: 1px solid var(--hairline);
  color: var(--text-secondary);
}

/* ---------- 图表 ---------- */

.chart-host { width: 100%; margin-top: 18px; }
.chart-host svg { display: block; overflow: visible; }
.lc-grid { stroke: var(--hairline); stroke-width: 1; opacity: 0.6; }
.lc-t { fill: var(--text-secondary); font-size: 11.5px; font-family: var(--mono); }
.lc-s { fill: none; stroke: url(#tqs); stroke-width: 2.6; stroke-linejoin: round; }
.lc-b { fill: none; stroke: #8e8e93; stroke-width: 1.6; stroke-linejoin: round; opacity: 0.8; }
.tq-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  margin-top: 40px; font-size: 13px; color: var(--text-secondary);
}
.tq-legend .lg { display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-right: 7px; vertical-align: middle; }
.lg-s { background: linear-gradient(90deg, var(--g1), var(--g3)); }
.lg-b { background: #8e8e93; }
.tq-range { margin-left: auto; font-family: var(--mono); font-size: 12px; }

.tf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 44px; }
.tf-fig { margin: 0; background: var(--bg); border-radius: 20px; padding: 24px 24px 20px; }
.tf-fig figcaption { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.tf-cap { font-size: 12px; color: var(--text-secondary); line-height: 1.6; margin-top: 12px; }
.tf-curve { fill: none; stroke: url(#tfg); stroke-width: 3; stroke-linecap: round; }
.tf-dot { fill: var(--bg); stroke: var(--g3); stroke-width: 3; }
.tf-lbl { fill: var(--text); font-size: 12px; font-weight: 600; font-family: var(--mono); }

#tf-routes { margin-top: 12px; --ref: 50%; }
.rt-row {
  display: grid;
  grid-template-columns: 78px 1fr 44px;
  align-items: center;
  gap: 10px;
  height: 17px;
  font-size: 11.5px;
}
.rt-name { color: var(--text-secondary); white-space: nowrap; }
.rt-v { text-align: right; font-family: var(--mono); color: var(--text-secondary); }
.rt-track { position: relative; height: 9px; }
.rt-track::after {
  content: "";
  position: absolute;
  left: var(--ref);
  top: -4px; bottom: -4px;
  border-left: 1.5px dashed var(--text-secondary);
  opacity: 0.55;
}
.rt-bar {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: var(--accent);
  transform-origin: left center;
}
.rt-bar { background: linear-gradient(90deg, var(--g1), var(--g2)); }
.rt-bar.hot { background: linear-gradient(90deg, #ff9500, #ff4d2e); }

/* ---------- 双列卡片 ---------- */

.tile-pair {
  max-width: 1180px;
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.tile-pair .tile { margin: 0; padding: 56px 48px 48px; display: flex; flex-direction: column; }
.tile-pair .tile-cta, .tile-pair .cta-row { margin-top: auto; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.cta-row .tile-cta { margin: 0; }
.tile-pair .tw-latest, .tile-pair .tn-list { margin-bottom: 34px; }

.big-stat { margin-top: 38px; display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap; }
.big-stat .count { font-size: 64px; font-weight: 700; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.big-stat small { font-size: 15px; color: var(--text-secondary); }

.tw-bars { display: flex; align-items: flex-end; gap: 2px; height: 88px; margin-top: 26px; }
.tw-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 22px; }
.tw-mini div { background: var(--bg); border-radius: 14px; padding: 14px 14px 12px; }
.tw-mini b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tw-mini span { font-size: 12px; color: var(--text-secondary); }
.tw-bars i { flex: 1; border-radius: 3px 3px 1px 1px; background: var(--hairline); transform-origin: bottom; }
.tw-bars i.on { background: linear-gradient(to top, var(--g1), var(--g3)); }
.tw-latest {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--hairline);
}
.tw-latest .k { font-size: 12px; color: var(--text-secondary); }
.tw-latest b { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.tw-latest .t { font-size: 14px; color: var(--text-secondary); }

.tn-list { list-style: none; padding: 0; margin: 26px 0 0; }
.tn-list li { padding: 13px 0; border-top: 1px solid var(--hairline); }
.tn-list a {
  display: block; color: var(--text); text-decoration: none;
  font-size: 15px; font-weight: 600; line-height: 1.4;
}
.tn-list a:hover { color: var(--accent); }
.tn-list span { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 4px; font-family: var(--mono); }

/* ---------- 首页日记卡 ---------- */

.td-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 30px; }
.td-cell {
  position: relative; aspect-ratio: 1; padding: 0; border: 0; cursor: pointer;
  border-radius: 14px; overflow: hidden; background: var(--bg);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.td-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.td-cell .dy-textcell { font-size: 12.5px; padding: 10px; }
@media (hover: hover) { .td-cell:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); } }
.td-empty { grid-column: 1 / -1; text-align: center; padding: 30px 0 10px; color: var(--text-secondary); font-size: 15px; }
#t-diary .cta-row { margin-top: 34px; }

/* ---------- 页脚 ---------- */

.h-foot { position: relative; isolation: isolate; max-width: 1180px; margin: 96px auto 30px; padding: 40px 0 10px; text-align: center; }
.h-foot .cover-title { margin-bottom: 14px; }
.h-foot .glow { inset: -30% 0; }
.h-mail {
  display: inline-block;
  font-size: 28px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--accent); text-decoration: none;
}
.h-mail:hover { text-decoration: underline; }
.h-foot p { font-size: 12px; color: var(--text-secondary); margin-top: 36px; }

/* ---------- 进场动画：卡片进入视口才播放 ---------- */

.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawLine 2.2s var(--ease-out) 0.25s forwards; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
.fade { opacity: 0; animation: fadeIn 1.2s var(--ease) 1.1s forwards; }
@keyframes fadeIn { to { opacity: 1; } }
.pop { opacity: 0; animation: popIn 0.6s var(--ease-out) forwards; animation-delay: calc(1s + var(--i, 0) * 0.35s); transform-box: fill-box; transform-origin: center; }
@keyframes popIn { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }
.grow { animation: growX 1s var(--ease-out) both; animation-delay: calc(0.2s + var(--i, 0) * 0.035s); }
@keyframes growX { from { transform: scaleX(0); } }
.grow-y { animation: growY 0.9s var(--ease-out) both; animation-delay: calc(0.15s + var(--i, 0) * 0.02s); }
@keyframes growY { from { transform: scaleY(0); } }
.reveal:not(.in) :is(.draw, .fade, .pop, .grow, .grow-y) { animation-play-state: paused; }

/* ══════════════ 平板 ══════════════ */
@media (max-width: 1068px) {
  .h-title { font-size: 68px; }
  .h-sub { font-size: 21px; }
  .h-band { grid-template-columns: repeat(2, 1fr); }
  .h-cell:nth-child(3) { border-left: 0; }
  .h-cell:nth-child(n+3) { border-top: 1px solid var(--hairline); }
  .tile { padding: 56px 44px 48px; }
  .cover-title { font-size: 58px; }
  .cover-sub { font-size: 19px; }
  .cover-sm .cover-title { font-size: 44px; }
  .tf-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpis-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .tile-pair { grid-template-columns: 1fr; }
}

/* ══════════════ 手机 ══════════════ */
@media (max-width: 734px) {
  .home { padding: 0 12px 24px; }
  .h-hero {
    margin: 0 -12px; padding: 0 20px;
    min-height: calc(100vh - 44px - var(--bar-h));
    min-height: calc(100svh - 44px - var(--bar-h) - env(safe-area-inset-bottom));
  }
  .h-title { font-size: min(46px, 10.4vw); letter-spacing: -0.03em; }
  .h-sub { font-size: 17px; }
  .br-wide { display: none; }
  .h-live { font-size: 12px; padding: 7px 13px; }
  .h-band { margin-bottom: 36px; }
  .h-cell { padding: 22px 14px 20px; }
  .h-num { font-size: 36px; }
  .h-num small { font-size: 15px; }
  .h-lbl { font-size: 12.5px; }
  .tile { padding: 40px 22px 34px; border-radius: 24px; margin-bottom: 12px; }
  .tile .eyebrow { font-size: 13px; }
  .cover { padding-top: 12px; }
  .cover .eyebrow { font-size: 14px; }
  .cover-title { font-size: min(38px, 8.6vw); letter-spacing: -0.03em; }
  .cover-sub { font-size: 16px; }
  .cover-sm .cover-title { font-size: min(34px, 8.6vw); }
  .cover-sm .cover-sub { font-size: 15.5px; }
  .tile-cta { margin-top: 28px; padding: 11px 18px 11px 22px; font-size: 15px; }
  .tile-pair { gap: 12px; margin-bottom: 12px; }
  .tile-pair .tile { padding: 40px 22px 34px; }
  .tq-legend { margin-top: 28px; }
  .tq-range { margin-left: 0; flex-basis: 100%; }
  .kpis, .kpis-3 { grid-template-columns: repeat(2, 1fr); }
  .kpis > div { padding: 18px 12px 0 0; }
  .kpis b { font-size: 30px; }
  .tf-grid { gap: 12px; margin-top: 28px; }
  .tf-fig { padding: 18px 14px 16px; border-radius: 16px; }
  .rt-row { grid-template-columns: 70px 1fr 40px; gap: 8px; }
  .big-stat .count { font-size: 52px; }
  .tw-mini { grid-template-columns: repeat(2, 1fr); }
  .td-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .td-cell { border-radius: 10px; }
  .h-foot { margin-top: 64px; }
  .h-mail { font-size: 21px; }
}


@media (prefers-reduced-motion: reduce) {
  .h-cue, .h-live .dot { animation: none; }
  .tile-cta { transition: none; }
  .h-hero-inner { transform: none; opacity: 1; }
  .draw, .fade, .pop, .grow, .grow-y { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; opacity: 1; transform: none; }
}

a.tile-cta { text-decoration: none !important; }
.tile-cta.ghost {
  color: var(--text);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.tile-cta.ghost:hover { box-shadow: inset 0 0 0 1px var(--g2), 0 10px 26px -14px color-mix(in srgb, var(--g2) 60%, transparent); }

/* ---------- 插件下载 ---------- */
.ext-cta { margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ext-cta .tile-cta { margin: 0; }
.ext-meta { font-size: 12.5px; color: var(--text-secondary); font-family: var(--mono); min-height: 1em; }
.ext-steps { font-size: 14px; color: var(--text-secondary); text-align: left; max-width: 420px; }
.ext-steps summary { cursor: pointer; text-align: center; color: var(--text); list-style: none; }
.ext-steps summary::-webkit-details-marker { display: none; }
.ext-steps summary::after { content: " ›"; display: inline-block; transition: transform 0.25s var(--ease); }
.ext-steps[open] summary::after { transform: rotate(90deg); }
.ext-steps ol { margin: 12px 0 0; padding-left: 22px; line-height: 1.9; }
.ext-steps code { font-family: var(--mono); font-size: 12.5px; background: var(--fill); padding: 1px 6px; border-radius: 5px; color: var(--text); }
