/* minsurf-site · polish layer (layout fixes + motion) · 暖纸杂志配套 */
:root{
  --ease-out:cubic-bezier(.22,1,.36,1);
  --ease-soft:cubic-bezier(.4,0,.2,1);
  --amber-glow:rgba(200,151,58,.18);
}
html{scroll-behavior:smooth}
body.ms-theme-editorial{
  overflow-x:hidden;
}
body{
  overflow-x:hidden;
}
/* Back to hub (when opened from 五库) */
.ms-hub-bar{
  display:none;align-items:center;justify-content:space-between;gap:12px;
  padding:8px 20px;background:#111;color:rgba(255,255,255,.78);font-size:12px;
  position:sticky;top:0;z-index:120;border-bottom:1px solid rgba(255,255,255,.08);
}
.ms-hub-bar.is-on{display:flex}
.ms-hub-bar a{color:#fff;font-weight:600;text-decoration:none}
.ms-hub-bar a:hover{color:var(--amber)}
.ms-hub-bar .ms-hub-hint{opacity:.55}
body.has-hub-bar nav{top:36px}

/* Nav polish */
nav{
  transition:background .25s var(--ease-soft), box-shadow .25s var(--ease-soft), border-color .25s;
}
nav.is-scrolled{
  background:rgba(247,244,237,.96)!important;
  box-shadow:0 10px 32px rgba(26,24,20,.07);
  border-bottom-color:transparent;
}
.nav-links a{
  position:relative;
  transition:color .2s var(--ease-soft), background .2s var(--ease-soft), transform .2s var(--ease-soft);
}
.nav-links a:hover{transform:translateY(-1px)}
.nav-links a.active::after{
  content:'';position:absolute;left:10px;right:10px;bottom:2px;height:2px;
  background:var(--amber);border-radius:2px;opacity:.85;
}
.btn-nav,.btn{
  transition:opacity .2s, transform .25s var(--ease-out), box-shadow .25s var(--ease-out), background .2s, border-color .2s, color .2s;
}
.btn-nav:hover,.btn-dark:hover,.btn-light:hover{transform:translateY(-1px)}
.btn-nav:active,.btn:active{transform:translateY(0) scale(.98)}

/* Cards / placeholders */
.card{
  transition:border-color .25s var(--ease-soft), box-shadow .35s var(--ease-out), transform .35s var(--ease-out);
}
.card-hover:hover,.card.is-lift:hover{
  border-color:var(--border-active);
  box-shadow:0 14px 40px rgba(28,28,28,.08);
}
.img-ph,.img-ph-dk{
  transition:transform .45s var(--ease-out), border-color .3s;
}
.card:hover .img-ph,.card:hover .img-ph-dk{transform:scale(1.02)}
.img-ph--flush{
  border-radius:0!important;border:none!important;border-bottom:1px solid var(--border)!important;
}
.img-ph--flush-plain{border-radius:0!important;border:none!important}

/* Reveal on scroll */
.ms-reveal{
  opacity:0;transform:translateY(22px);
  transition:opacity .7s var(--ease-out), transform .7s var(--ease-out);
  will-change:opacity,transform;
}
.ms-reveal.is-in{opacity:1;transform:none}
.ms-reveal-delay-1{transition-delay:.08s}
.ms-reveal-delay-2{transition-delay:.16s}
.ms-reveal-delay-3{transition-delay:.24s}
.ms-stagger > .ms-reveal:nth-child(1){transition-delay:.04s}
.ms-stagger > .ms-reveal:nth-child(2){transition-delay:.1s}
.ms-stagger > .ms-reveal:nth-child(3){transition-delay:.16s}
.ms-stagger > .ms-reveal:nth-child(4){transition-delay:.22s}

/* Hero soft entrance */
.ms-hero-in{animation:msHeroIn .85s var(--ease-out) both}
.ms-hero-in-delay{animation:msHeroIn .9s var(--ease-out) .12s both}
@keyframes msHeroIn{
  from{opacity:0;transform:translateY(18px)}
  to{opacity:1;transform:none}
}

/* Trust bar shimmer dots */
.ms-trust-dot{
  width:4px;height:4px;border-radius:50%;background:var(--amber);display:inline-block;flex-shrink:0;
  box-shadow:0 0 0 0 var(--amber-glow);
  animation:msPulse 2.4s var(--ease-soft) infinite;
}
@keyframes msPulse{
  0%,100%{box-shadow:0 0 0 0 var(--amber-glow)}
  50%{box-shadow:0 0 0 6px transparent}
}

/* Mobile menu */
.ms-nav-toggle{
  display:none;align-items:center;justify-content:center;
  width:40px;height:40px;border-radius:999px;border:1px solid var(--border);
  background:transparent;cursor:pointer;flex-shrink:0;margin-left:auto;
}
.ms-nav-toggle span{
  display:block;width:16px;height:1.5px;background:var(--text);position:relative;
}
.ms-nav-toggle span::before,.ms-nav-toggle span::after{
  content:'';position:absolute;left:0;right:0;height:1.5px;background:var(--text);
}
.ms-nav-toggle span::before{top:-5px}
.ms-nav-toggle span::after{top:5px}
.ms-mobile-panel{
  display:none;position:fixed;inset:60px 0 auto 0;z-index:99;
  background:rgba(247,244,237,.98);backdrop-filter:blur(14px);
  border-bottom:1px solid var(--border);padding:16px 20px 20px;
  flex-direction:column;gap:4px;
  box-shadow:0 16px 40px rgba(28,28,28,.08);
}
body.has-hub-bar .ms-mobile-panel{top:96px}
.ms-mobile-panel.is-open{display:flex}
.ms-mobile-panel a{
  font-size:15px;font-weight:560;padding:12px 14px;border-radius:12px;color:var(--text);
}
.ms-mobile-panel a:hover,.ms-mobile-panel a.active{background:rgba(28,28,28,.06)}
.ms-mobile-panel .btn-nav{margin-top:10px;align-self:flex-start}
.img-ph:not(:has(img)):not(.ms-cms-has-img) .img-ph-id,
.img-ph:not(:has(img)):not(.ms-cms-has-img) .img-ph-title,
.img-ph:not(:has(img)):not(.ms-cms-has-img) .img-ph-spec,
.img-ph-dk:not(:has(img)):not(.ms-cms-has-img) .img-ph-id,
.img-ph-dk:not(:has(img)):not(.ms-cms-has-img) .img-ph-title,
.img-ph-dk:not(:has(img)):not(.ms-cms-has-img) .img-ph-spec{
  display:none !important;
}
.img-ph:not(:has(img)):not(.ms-cms-has-img),
.img-ph-dk:not(:has(img)):not(.ms-cms-has-img){
  border-style:solid;
  border-color:var(--border);
  background:var(--bg-alt);
}
.img-ph:not(:has(img)):not(.ms-cms-has-img)::before,
.img-ph-dk:not(:has(img)):not(.ms-cms-has-img)::before{
  display:none;
}

/* Layout helpers for inline grids that break on small screens */
.ms-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.ms-grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}
.ms-hero-grid{
  max-width:1200px;margin:0 auto;padding:80px 40px 60px;
  display:grid;grid-template-columns:55% 1fr;gap:60px;align-items:center;min-height:520px;
}
.ms-path-tabs{
  background:var(--bg-alt);border-top:1px solid var(--border);border-bottom:1px solid var(--border);
  padding:20px 40px;
}
.ms-path-tabs-inner{
  max-width:1200px;margin:0 auto;display:flex;align-items:center;gap:8px;flex-wrap:wrap;
}

@media (max-width:900px){
  .ms-hero-grid{grid-template-columns:1fr;gap:36px;min-height:0;padding:56px 24px 40px}
  .ms-grid-2,.ms-grid-3{grid-template-columns:1fr}
  /* Catch remaining inline marketing grids */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns:repeat(3, 1fr)"]{
    grid-template-columns:1fr !important;
  }
  [style*="grid-template-columns:55% 1fr"]{
    grid-template-columns:1fr !important;
  }
}
@media (max-width:768px){
  .ms-nav-toggle{display:inline-flex}
  .nav-links{display:none !important}
  .nav-right .lang-switch{display:none}
  .nav-right .ms-lang{display:block}
  .btn-nav{padding:7px 14px;font-size:12px}
  .foot-grid{grid-template-columns:1fr 1fr !important;gap:28px !important}
  .foot-bottom{flex-direction:column;gap:8px;align-items:flex-start}
  .ms-path-tabs{padding:16px 20px}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .ms-reveal,.ms-hero-in,.ms-hero-in-delay,.card,.btn,.btn-nav,.img-ph,.img-ph-dk,.nav-links a{
    animation:none !important;transition:none !important;opacity:1 !important;transform:none !important;
  }
  .ms-trust-dot{animation:none}
}
