/* ==========================================================================
   产品外壳 —— 图片设计 / 图像处理 / 视频剪辑 三个产品共用
   左侧 76px 竖向导航：首页 · 模板 · 编辑 · 建议 · 我的
   类名统一 sh- 前缀，避免和各页面自己的类撞车（历史上 .batch 撞过名）

   图标：直接用网站素材中台「APP 导航」组的 SVG（library/icons/ic-app-*.svg），
   以 CSS mask 上色 → 颜色跟 currentColor 走，悬停/选中换色不用换图。
   选中动效 = 左侧蓝线 + 图标转蓝 + 图标「落印」 + 点击涟漪（纯 CSS，无 JS）。
   2026-11-25 用户定：选中态不要米色底、不要取景框四角，只把图标换成蓝色 #1d5c96。
   ========================================================================== */

:root{
  --sh-rail: 76px;
  --sh-ink:#0c0b0a;  --sh-ink-2:#3d382f; --sh-ink-3:#6b6151; --sh-ink-4:#9a9082;
  --sh-paper:#fbf8f1; --sh-paper-2:#f4eee2; --sh-paper-3:#efe7d6;
  --sh-line:#e6dac1;  --sh-line-2:#d8cdb8;
  --sh-gold:#c9a557;  --sh-gold-d:#a8853a; --sh-ochre:#8c4a2f;
  /* 2026-11-25：左栏选中色改蓝（与智能工具页主蓝 #1d5c96 一致） */
  --sh-blue:#1d5c96;  --sh-blue-rgb:29,92,150;
  --sh-serif:"Songti SC","SimSun","Source Han Serif SC",serif;
}

/* 有侧栏的页面 → 主体让出 76px */
body.sh-has-rail{ margin-left: var(--sh-rail); }

.sh-rail{
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sh-rail); z-index: 200;
  display: flex; flex-direction: column; padding: 0; margin: 0;
  background:
    linear-gradient(180deg, rgba(251,248,241,.82), rgba(244,238,226,.55) 30%, rgba(244,238,226,.2)),
    var(--sh-paper-2);
  border-right: 1px solid var(--sh-line);
  box-shadow: 1px 0 0 rgba(255,255,255,.6) inset;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 顶部字标：点回首页 */
.sh-rail__logo{
  height: 64px; flex: 0 0 64px; display: flex; align-items: center; justify-content: center;
  text-decoration: none; position: relative;
}
.sh-rail__logo::after{
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--sh-line-2), transparent);
}
.sh-rail__logo b{
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--sh-ink); color: var(--sh-ink);
  font: 400 17px/1 var(--sh-serif); letter-spacing: .02em;
  transition: background .16s, color .16s, border-color .16s;
}
.sh-rail__logo:hover b{ background: var(--sh-gold); border-color: var(--sh-gold); color: #fff; }
.sh-rail__logo img{
  width: 36px; height: 36px; display: block; object-fit: contain;
  transition: opacity .16s;
}
.sh-rail__logo:hover img{ opacity: .78; }

.sh-rail__nav{ display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; }

/* ---------- 导航项 ---------- */
.sh-rail__item{
  position: relative; height: 62px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  color: var(--sh-ink-3); text-decoration: none;
  transition: background .2s ease, color .2s ease;
}
.sh-rail__item span{
  font-size: 11px; letter-spacing: .06em; line-height: 1;
  transition: letter-spacing .38s cubic-bezier(.2,.8,.2,1), color .2s;
}

/* 图标：素材中台 SVG 做遮罩，颜色 = currentColor */
.sh-rail__ico-w{
  position: relative; width: 21px; height: 21px; display: grid; place-items: center;
  transition: transform .5s cubic-bezier(.22,.9,.24,1);
}
.sh-rail__ico{
  width: 21px; height: 21px; display: block; background: currentColor;
  -webkit-mask-image: var(--ic); -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat; -webkit-mask-size: contain;
  mask-image: var(--ic); mask-position: center;
  mask-repeat: no-repeat; mask-size: contain;
  filter: drop-shadow(.35px 0 0 currentColor) drop-shadow(-.35px 0 0 currentColor);
}
/* 选中时的柔光（落印扩散） */
.sh-rail__ico-w::before{
  content: ""; position: absolute; left: -11px; top: -11px; width: 43px; height: 43px;
  border-radius: 50%; opacity: 0; transform: scale(.4); pointer-events: none;
  background: radial-gradient(circle, rgba(var(--sh-blue-rgb),.32), rgba(var(--sh-blue-rgb),0) 68%);
}
/* 点击涟漪 */
.sh-rail__ico-w::after{
  content: ""; position: absolute; left: -4px; top: -4px; width: 29px; height: 29px;
  border: 1px solid var(--sh-blue); border-radius: 50%; opacity: 0; pointer-events: none;
}

/* ---------- 悬停：纸面微亮 + 图标轻浮 ---------- */
.sh-rail__item:hover{
  background: linear-gradient(90deg, rgba(var(--sh-blue-rgb),.07), rgba(var(--sh-blue-rgb),.01));
  color: var(--sh-ink-2);
}
.sh-rail__item:hover .sh-rail__ico-w{ transform: translateY(-1.5px); }

/* ---------- 左侧指示线：两端渐隐，从中间长出来（选中时转蓝） ---------- */
.sh-rail__item::before{
  content: ""; position: absolute; left: 0; top: 13px; bottom: 13px; width: 2px;
  background: linear-gradient(180deg, rgba(201,165,87,0), var(--sh-gold) 22%, var(--sh-gold) 78%, rgba(201,165,87,0));
  transform: scaleY(0); transform-origin: center; opacity: 0;
}

/* ---------- 选中：只换蓝色，不加底色、不加框 ---------- */
.sh-rail__item.is-on{
  color: var(--sh-ink);
}
.sh-rail__item.is-on span{ letter-spacing: .13em; }
.sh-rail__item.is-on::before{
  opacity: 1; animation: shBar .52s cubic-bezier(.2,.9,.2,1) both;
  background: linear-gradient(180deg, rgba(var(--sh-blue-rgb),0), var(--sh-blue) 22%, var(--sh-blue) 78%, rgba(var(--sh-blue-rgb),0));
}
.sh-rail__item.is-on .sh-rail__ico-w{ color: var(--sh-blue); animation: shStamp .62s cubic-bezier(.2,.9,.2,1) both; }
.sh-rail__item.is-on .sh-rail__ico-w::before{ animation: shGlow .9s ease-out both; }

/* ---------- 按下：回弹 + 涟漪 ---------- */
.sh-rail__item:active .sh-rail__ico-w{ transform: scale(.9); transition-duration: .12s; }
.sh-rail__item:active .sh-rail__ico-w::after{ animation: shRing .62s cubic-bezier(.2,.8,.3,1) both; }

.sh-rail__item:focus-visible{ outline: 2px solid var(--sh-blue); outline-offset: -2px; }

@keyframes shStamp{ 0%{ transform: scale(.84); } 52%{ transform: scale(1.09); } 100%{ transform: scale(1); } }
@keyframes shBar{ 0%{ transform: scaleY(.18); opacity: 0; } 100%{ transform: scaleY(1); opacity: 1; } }
@keyframes shGlow{ 0%{ opacity: 0; transform: scale(.45); } 42%{ opacity: 1; } 100%{ opacity: 0; transform: scale(1.28); } }
@keyframes shRing{ 0%{ opacity: .85; transform: scale(.35); } 100%{ opacity: 0; transform: scale(2.1); } }

.sh-rail__foot{ margin-top: auto; padding: 10px 8px 16px; display: flex; justify-content: center; }
.sh-rail__badge{
  font-size: 10px; letter-spacing: .1em; color: var(--sh-ink-4);
  writing-mode: vertical-rl; line-height: 1;
}

/* ---------- 窄屏：底部横条 ---------- */
/* 🔴 2026-11-23：补全面屏安全区。两条规则必须一起改，且 sh-rail 必加 box-sizing:border-box
   （本文件没有全局 *{box-sizing:border-box}，.sh-rail 默认 content-box，
   否则 height 58+safe 再叠 padding-bottom:safe 会高出一整截）。
   小程序内嵌（?embed=1）也靠这段出底部导航，删了或改窄会直接影响内嵌形态。 */
@media (max-width: 820px){
  body.sh-has-rail{
    margin-left: 0;
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
  .sh-rail{
    top: auto; left: 0; right: 0; bottom: 0; width: auto;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
    flex-direction: row; border-right: 0; border-top: 1px solid var(--sh-line);
    background: rgba(244,238,226,.97);
  }
  .sh-rail__logo, .sh-rail__foot{ display: none; }
  .sh-rail__nav{ flex: 1; flex-direction: row; padding: 0; gap: 0; height: 58px; }
  /* 固定视口高度的页面（design/index.html、feedback.html 的 .main 是 height:100vh + overflow:hidden）：
     只给 body 加 padding-bottom 会让整页多出 58px、长出外层滚动条。
     权重 0,2,1 高于页面内联的 .main（0,1,0），不用 !important 也能盖住。 */
  body.sh-has-rail .main{ height: calc(100vh - 58px - env(safe-area-inset-bottom, 0px)); }
  .sh-rail__item{ flex: 1; height: 58px; gap: 3px; }
  .sh-rail__item span{ font-size: 10.5px; }
  .sh-rail__item.is-on{ background: transparent; }
  .sh-rail__item.is-on::before{
    left: 50%; top: 0; bottom: auto; width: 20px; height: 2px; transform: translateX(-50%);
    background: linear-gradient(90deg, rgba(var(--sh-blue-rgb),0), var(--sh-blue) 22%, var(--sh-blue) 78%, rgba(var(--sh-blue-rgb),0));
    animation: shBarX .48s cubic-bezier(.2,.9,.2,1) both;
  }
  @keyframes shBarX{ 0%{ transform: translateX(-50%) scaleX(.2); opacity: 0; } 100%{ transform: translateX(-50%) scaleX(1); opacity: 1; } }
}

/* ---------- 减弱动效偏好 ---------- */
@media (prefers-reduced-motion: reduce){
  .sh-rail__item, .sh-rail__item::before, .sh-rail__item::after,
  .sh-rail__ico-w, .sh-rail__ico-w::before, .sh-rail__ico-w::after,
  .sh-rail__item span{ animation: none !important; transition: none !important; }
}

/* ---------- 顶栏品牌铭牌 ---------- */
/* 品牌字：马善政楷书（毛笔楷），与智能工具同一款。
   🔴 只含固定字符（2026-12-01 扩到 27 字 / 14.3KB）：
      绘画设计 绘帧修图 绘影剪辑 绘学课堂（现行四模块品牌字）
      图片设计 图像处理 视频剪辑 运营知识（2026-12-01 前的旧名，留着回滚用）
      智能工具（工具站旧名）
   🔴 改品牌字之外的新字必须重新子集化，否则新字掉回系统宋体。
   源文件 library/fonts/MaShanZheng-full.woff。 */
@font-face{
  font-family:"ZC-Brand-Modules";
  src:url("../library/fonts/brand/zc-brand-modules-hy.woff?v=20261203") format("woff");
  font-weight:400; font-style:normal; font-display:swap;
}
.sh-brand{
  display:inline-flex; align-items:center; gap:11px; white-space:nowrap;
  text-decoration:none; color:var(--sh-ink);
}
.sh-brand__mark{ width:31px; height:31px; flex:0 0 31px; display:block; }
.sh-brand__mark .r1{ fill:none; stroke:var(--sh-gold); stroke-width:1.15; stroke-opacity:.95; }
.sh-brand__mark .r2{ fill:none; stroke:var(--sh-gold); stroke-width:.7; stroke-opacity:.42; }
.sh-brand__mark .sq{ fill:var(--sh-ochre); }
.sh-brand__txt{ display:inline-flex; flex-direction:column; gap:6px; }
.sh-brand__cn{
  font-family:"ZC-Brand-Modules",var(--sh-serif);
  font-size:27px; line-height:1; letter-spacing:.14em; font-weight:400;
}
.sh-brand__foot{
  display:block; height:1px; width:100%; margin-left:3px;
  background:linear-gradient(90deg, rgba(201,165,87,0), rgba(201,165,87,.85) 12%, rgba(201,165,87,.85) 88%, rgba(201,165,87,0));
  opacity:.85; transition:opacity .3s ease;
}
.sh-brand:hover .sh-brand__foot{ opacity:1; }
.sh-brand:hover .sh-brand__mark .sq{ fill:var(--sh-gold-d); }
.sh-brand__rule{ width:1px; height:17px; flex:0 0 1px; background:var(--sh-line-2); margin:0 1px 0 3px; }
.sh-brand__en{ font-style:normal; font-size:9.5px; letter-spacing:.32em; color:var(--sh-ink-4); }
.sh-brand__mark .sq{ transition:fill .3s ease; }

@media (max-width:900px){
  .sh-brand{ gap:8px; }
  .sh-brand__mark{ width:26px; height:26px; flex:0 0 26px; }
  .sh-brand__cn{ font-size:21px; letter-spacing:.1em; }
  .sh-brand__foot{ width:46px; }
  .sh-brand__en{ font-size:8.5px; letter-spacing:.24em; }
  .sh-brand__rule{ height:13px; }
}
