/* =============================================================================
 * 天天互助站 · UI Pro 增强层（v20261202a）
 * -----------------------------------------------------------------------------
 * 纯叠加层：不改动既有 base / components / home / pages 的任何规则。
 * 灵感来源：MotionSites 的滚动叙事、React Bits 的 Spotlight / Tilt / Blur Text
 * 组件模式，全部以原生 CSS + JS 实现，零依赖、零构建。
 * 所有效果均尊重 prefers-reduced-motion。
 * ========================================================================== */

/* ---------------------------------------------------------------------------
 * 0. 入场：页面级淡入（配合 ui-pro.js 的 View Transitions）
 * ------------------------------------------------------------------------ */
html.u-pro { view-transition-name: none; }
html.u-pro body { animation: uProPageIn var(--dur-4, 820ms) var(--ease-out-quint) both; }
@keyframes uProPageIn {
  from { opacity: 0; transform: translateY(6px); filter: saturate(.6); }
  to   { opacity: 1; transform: none; filter: none; }
}
::view-transition-old(root) { animation: uProOut .16s ease-in both; }
::view-transition-new(root) { animation: uProIn .32s var(--ease-out-quint) both; }
@keyframes uProOut { to { opacity: 0; transform: scale(.992); } }
@keyframes uProIn  { from { opacity: 0; transform: scale(1.008); } }

/* ---------------------------------------------------------------------------
 * 1. 分区标题：眉题带动画渐变线，标题下划渐显
 * ------------------------------------------------------------------------ */
.section-head { position: relative; }
.section-head__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: var(--ls-wider, .16em);
}
.section-head__eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--grad-brand-h);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform .8s var(--ease-out-expo) .15s;
}
.is-in .section-head__eyebrow::before,
.section-head.is-in .section-head__eyebrow::before { transform: scaleX(1); }
.section-head__title em {
  background: linear-gradient(90deg, var(--c-brand) 0%, #FF8A5B 40%, var(--c-brand) 80%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: uProTextFlow 6s linear infinite;
}
@keyframes uProTextFlow { to { background-position: -220% 0; } }
.section-head__more { position: relative; overflow: hidden; }

/* ---------------------------------------------------------------------------
 * 2. 交错揭示：网格子项按序入场（ui-pro.js 写入 --i）
 * ------------------------------------------------------------------------ */
html.has-reveal [data-reveal] { transition-duration: .9s; }
html.has-reveal [data-reveal].is-in { transition-delay: calc(var(--i, 0) * 70ms); }
.u-pro-stagger > * {
  --i: 0;
  animation: uProRise .8s var(--ease-out-quint) both;
  animation-delay: calc(var(--i) * 70ms);
}
@keyframes uProRise {
  from { opacity: 0; transform: translate3d(0, 22px, 0); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* ---------------------------------------------------------------------------
 * 3. 聚光灯卡片（Spotlight）：跟随指针的内发光
 *    应用于：互助卡 / 通用卡 / 场景卡 / 口碑卡 / 论坛帖 / 后台面板外的 panel
 * ------------------------------------------------------------------------ */
.u-pro-spot {
  position: relative;
  isolation: isolate;
  --mx: 50%; --my: 50%; --mr: 260px;
}
.u-pro-spot::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  background:
    radial-gradient(var(--mr) circle at var(--mx) var(--my),
      rgba(255, 110, 70, .16), transparent 60%);
  transition: opacity .45s var(--ease-out-quint);
}
.u-pro-spot.is-spot::before { opacity: 1; }
.u-pro-spot::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: radial-gradient(220px circle at var(--mx) var(--my),
      rgba(255, 255, 255, .9), rgba(255, 90, 54, .45) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .45s var(--ease-out-quint);
}
.u-pro-spot.is-spot::after { opacity: .9; }

/* 深色 / 品牌色卡片的聚光灯改为白色光 */
.scene--brand.u-pro-spot::before,
.is-dark .u-pro-spot::before {
  background: radial-gradient(var(--mr) circle at var(--mx) var(--my),
    rgba(255, 255, 255, .22), transparent 60%);
}

/* ---------------------------------------------------------------------------
 * 4. 3D 轻倾斜（Tilt）：仅场景卡与 bento 大卡，幅度克制
 * ------------------------------------------------------------------------ */
.u-pro-tilt { transform: perspective(1000px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)); transition: transform .5s var(--ease-out-quint); will-change: transform; }
.u-pro-tilt.is-tilting { transition-duration: .08s; }

/* ---------------------------------------------------------------------------
 * 5. 磁吸按钮（Magnetic）：仅精确指针设备
 * ------------------------------------------------------------------------ */
@media (hover: hover) and (pointer: fine) {
  .u-pro-magnet { transition: transform .35s var(--ease-out-spring), box-shadow .35s; will-change: transform; }
  .u-pro-magnet.is-magnet { transition-duration: .08s; }
}

/* ---------------------------------------------------------------------------
 * 6. 骨架屏微光
 * ------------------------------------------------------------------------ */
.help-task--skeleton, .fm-skeleton, .skeleton, [class*="skeleton"] {
  position: relative;
  overflow: hidden;
  background: linear-gradient(100deg, var(--c-ink-04) 20%, var(--c-ink-07) 40%, var(--c-ink-04) 60%);
  background-size: 200% 100%;
  animation: uProShimmer 1.6s linear infinite;
}
@keyframes uProShimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------------------
 * 7. 公告跑马灯（Ticker）
 * ------------------------------------------------------------------------ */
.u-pro-ticker {
  position: relative;
  display: flex;
  overflow: hidden;
  padding: 14px 0;
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
  background: rgba(255, 253, 250, .55);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.u-pro-ticker__track {
  display: flex;
  flex: none;
  width: max-content;
  gap: 0;
  animation: uProTicker 38s linear infinite;
}
.u-pro-ticker:hover .u-pro-ticker__track { animation-play-state: paused; }
.u-pro-ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 28px;
  white-space: nowrap;
  font-size: var(--fs-sm);
  color: var(--c-ink-80);
  letter-spacing: .02em;
}
.u-pro-ticker__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-brand);
  box-shadow: 0 0 0 4px rgba(255, 90, 54, .14);
}
.u-pro-ticker__item b { font-weight: var(--fw-semi); color: var(--c-ink); }
@keyframes uProTicker { to { transform: translate3d(-100%, 0, 0); } }

/* ---------------------------------------------------------------------------
 * 8. Bento 网格：为什么选择我们
 * ------------------------------------------------------------------------ */
.u-bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(200px, auto);
  gap: 18px;
}
.u-bento__cell {
  position: relative;
  grid-column: span 3;
  padding: 28px;
  border-radius: var(--r-lg, 26px);
  background: var(--glass-bg, rgba(255, 253, 250, .66));
  border: 1px solid var(--glass-border-soft, rgba(255, 255, 255, .72));
  box-shadow: var(--sh-card), var(--sh-hair);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform .6s var(--ease-out-quint), box-shadow .6s;
}
.u-bento__cell:hover { transform: translateY(-4px); box-shadow: var(--sh-3), var(--sh-hair); }
.u-bento__cell--wide { grid-column: span 4; }
.u-bento__cell--half { grid-column: span 3; }
.u-bento__cell--wide .u-bento__title { font-size: clamp(24px, 2.4vw, 36px); letter-spacing: var(--ls-tighter, var(--ls-tight)); }
.u-bento__cell--wide .u-bento__desc { max-width: 560px; font-size: var(--fs-md, var(--fs-sm)); }
.u-bento__cell--row { grid-row: span 2; }
.u-bento__cell--ink {
  background: var(--grad-ink);
  color: #fff;
  border-color: rgba(255, 255, 255, .08);
}
.u-bento__cell--brand {
  grid-column: span 2;
  background: var(--grad-brand);
  color: #fff;
  border-color: transparent;
}
.u-pro .cta__title { color: #fff; }
/* base.css 给 h1-h6 写死 color: var(--text-1)，这里显式覆盖回白色 */
.u-pro .u-bento__cell--ink h3, .u-pro .u-bento__cell--brand h3,
.u-pro .u-bento__cell--ink p, .u-pro .u-bento__cell--brand p { color: #fff; }
.u-bento__ico {
  position: relative;
  flex: none;
  margin-bottom: auto;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(255, 255, 255, .8);
  color: var(--c-brand);
  box-shadow: var(--sh-1);
}
.u-bento__ico svg { width: 22px; height: 22px; }
.u-bento__cell--ink .u-bento__ico,
.u-bento__cell--brand .u-bento__ico { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .18); color: #fff; }
.u-bento__eyebrow { font-size: var(--fs-2xs); letter-spacing: var(--ls-wider); opacity: .6; margin: 18px 0 6px; }
.u-bento__title { font-size: var(--fs-h3); line-height: 1.25; letter-spacing: var(--ls-tight); margin: 0 0 6px; }
.u-bento__desc { font-size: var(--fs-sm); line-height: 1.6; opacity: .72; margin: 0; }
.u-bento__deco {
  position: absolute; right: -60px; bottom: -80px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .28), transparent 60%);
  pointer-events: none;
}
.u-bento__num {
  position: absolute; top: 22px; right: 26px;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  opacity: .45;
}
.u-bento__ring {
  position: absolute; right: -40px; top: -40px;
  width: 220px; height: 220px; border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, .28);
  animation: uProSpin 26s linear infinite;
}
.u-bento__ring::after {
  content: ""; position: absolute; top: 14px; left: 50%;
  width: 8px; height: 8px; border-radius: 50%; background: #FFD98A;
  box-shadow: 0 0 18px #FFD98A;
}
@keyframes uProSpin { to { transform: rotate(360deg); } }
@media (max-width: 1024px) {
  .u-bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: minmax(190px, auto); }
  .u-bento__cell, .u-bento__cell--wide { grid-column: span 2; }
  .u-bento__cell--half { grid-column: span 2; }
  .u-bento__cell--row { grid-row: span 1; }
}
@media (max-width: 640px) {
  .u-bento { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 14px; }
  .u-bento__cell, .u-bento__cell--wide, .u-bento__cell--half { grid-column: span 1; min-height: 170px; padding: 24px; }
}

/* ---------------------------------------------------------------------------
 * 9. FAQ 手风琴
 * ------------------------------------------------------------------------ */
.u-faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.u-faq__list { display: flex; flex-direction: column; gap: 12px; }
.u-faq__item {
  border-radius: var(--r-md, 18px);
  background: var(--glass-bg, rgba(255, 253, 250, .66));
  border: 1px solid var(--c-line);
  box-shadow: var(--sh-1);
  overflow: hidden;
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.u-faq__item[open] { border-color: rgba(255, 90, 54, .28); box-shadow: var(--sh-card), var(--sh-hair); background: #fff; }
.u-faq__q {
  list-style: none;
  cursor: pointer;
  padding: 20px 52px 20px 22px;
  position: relative;
  font-weight: var(--fw-semi);
  font-size: var(--fs-body);
  color: var(--c-ink);
  user-select: none;
}
.u-faq__q::-webkit-details-marker { display: none; }
.u-faq__q::before, .u-faq__q::after {
  content: ""; position: absolute; right: 24px; top: 50%;
  width: 14px; height: 2px; border-radius: 2px;
  background: var(--c-ink-55);
  transition: transform .4s var(--ease-out-expo), background .3s;
}
.u-faq__q::after { transform: rotate(90deg); }
.u-faq__item[open] .u-faq__q::after { transform: rotate(0); }
.u-faq__item[open] .u-faq__q::before,
.u-faq__item[open] .u-faq__q::after { background: var(--c-brand); }
.u-faq__a { padding: 0 22px 22px; color: var(--c-ink-68); line-height: var(--lh-normal); font-size: var(--fs-sm); animation: uProFaqIn .4s var(--ease-out-quint); }
@keyframes uProFaqIn { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 900px) { .u-faq { grid-template-columns: 1fr; gap: 28px; } }

/* ---------------------------------------------------------------------------
 * 10. 安全与规则条
 * ------------------------------------------------------------------------ */
.u-safety {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-radius: var(--r-xl, 36px);
  overflow: hidden;
  background: var(--grad-ink);
  color: #fff;
  box-shadow: var(--sh-3);
}
.u-safety__item { padding: 34px 28px; border-right: 1px solid rgba(255, 255, 255, .08); transition: background .4s; }
.u-safety__item:last-child { border-right: 0; }
.u-safety__item:hover { background: rgba(255, 255, 255, .05); }
.u-safety__ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); color: #FFD98A; margin-bottom: 16px; }
.u-safety__ico svg { width: 20px; height: 20px; }
.u-safety__title { font-weight: var(--fw-semi); margin-bottom: 6px; }
.u-safety__desc { font-size: var(--fs-sm); color: var(--c-white-64); line-height: 1.6; }
@media (max-width: 900px) {
  .u-safety { grid-template-columns: 1fr 1fr; }
  .u-safety__item:nth-child(2n) { border-right: 0; }
  .u-safety__item:nth-child(-n+2) { border-bottom: 1px solid rgba(255, 255, 255, .08); }
}
@media (max-width: 520px) {
  .u-safety { grid-template-columns: 1fr; }
  .u-safety__item { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .08); padding: 26px 22px; }
  .u-safety__item:last-child { border-bottom: 0; }
}

/* ---------------------------------------------------------------------------
 * 11. 全局微调：滚动条、焦点环、导航毛玻璃、输入聚焦
 * ------------------------------------------------------------------------ */
html { scrollbar-width: thin; scrollbar-color: rgba(38, 50, 56, .3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(255, 90, 54, .55), rgba(38, 50, 56, .35)); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 3px; border-radius: 6px; }
.nav.is-solid { backdrop-filter: blur(22px) saturate(180%); -webkit-backdrop-filter: blur(22px) saturate(180%); }
.input:focus, .fm-input:focus, .fm-textarea:focus, input:focus, textarea:focus, select:focus {
  border-color: rgba(255, 90, 54, .6) !important;
  box-shadow: 0 0 0 4px rgba(255, 90, 54, .14) !important;
  transition: box-shadow .25s, border-color .25s;
}
.btn { position: relative; overflow: hidden; }
.btn--primary { background-size: 150% 100%; background-position: 0% 0; transition: background-position .6s var(--ease-out-quint), transform var(--dur-2), box-shadow var(--dur-2); }
.btn--primary:hover { background-position: 100% 0; }
.img-hover, .dish__img, .shop-hero__img { transition: transform .8s var(--ease-out-quint); }
.img-hover:hover, .dish:hover .dish__img { transform: scale(1.04); }

/* 数字统计：用等宽数字，避免跳动 */
.hero__stat-num, .stat-card b, .t-num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------------
 * 12. 减少动态效果：全部关闭
 * ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html.u-pro body, .u-pro-stagger > *, .section-head__title em, .u-bento__ring,
  .help-task--skeleton, .fm-skeleton, .skeleton, [class*="skeleton"],
  .u-pro-ticker__track, .u-faq__a { animation: none !important; }
  .u-pro-tilt, .u-pro-magnet { transform: none !important; transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .u-pro-ticker { display: block; mask-image: none; -webkit-mask-image: none; }
  .u-pro-ticker__track { flex-wrap: wrap; width: auto; justify-content: center; animation: none; }
  .u-pro-ticker__track[aria-hidden] { display: none; }
}
