/* 首页 · 小工具橱窗：柔彩网格渐变背景（mesh gradient）+ 编号描边卡片。
   版式与配色逐行对应 /static/home-demo/mesh.html（用户选定的候选效果）。
   背景由 /static/home/home.js 的 WebGL 着色器绘制（参数在后台调），
   无 WebGL 时走 body.no-gl 的静态浅色渐变。 */
:root {
  --ink: #1b2430; --ink2: #4a5766; --muted: #7c8899;
  --hair: rgba(15, 23, 42, .26); --hair2: rgba(15, 23, 42, .13);
  --sans: "Inter", "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --maxw: 70rem;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: #f5f7fa; color: var(--ink); font-family: var(--sans);
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
body.no-gl #bg { display: none; }
body.no-gl { background: linear-gradient(160deg, #f8fafd, #e8eef6 60%, #f8fafd); }

/* 浅色遮罩：白色柔化层，透明度由 home.js 按后台「遮罩强度」参数统一缩放 */
.veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.70;
  background:
    radial-gradient(1300px 520px at 50% 0%, rgba(255, 255, 255, .62), transparent 72%),
    linear-gradient(180deg, rgba(248, 250, 253, .66) 0%, rgba(248, 250, 253, .24) 38%, rgba(248, 250, 253, .60) 100%);
}
.page { position: relative; z-index: 2; display: flex; flex-direction: column; min-height: 100vh; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); text-transform: uppercase; letter-spacing: .13em; font-size: .66rem; }
:focus { outline: none; }
:focus-visible { outline: 2px solid rgba(15, 23, 42, .55); outline-offset: 2px; }

/* 顶栏 */
.nav { padding: 1.5rem 0; display: flex; align-items: center; gap: 1.6rem; }
.brand { font-weight: 700; font-size: 1.04rem; display: flex; align-items: center; gap: .55rem; letter-spacing: -.01em; }
.brand .logo { width: 22px; height: 22px; flex: none; border-radius: 5px; }
.nav .sp { margin-left: auto; }
.nav a.lk { font-size: .83rem; color: var(--ink2); transition: color .18s; }
.nav a.lk:hover { color: #0b1220; }

/* 引导行 */
.lab {
  padding: 1.05rem 0 .8rem; border-bottom: 1px solid var(--hair2);
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.lab-lead { display: flex; flex-direction: column; gap: .35rem; }
.eyebrow {
  font-family: var(--mono); font-size: .62rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}
.lab h1 { color: var(--ink2); font-size: .97rem; font-weight: 400; line-height: 1.6; }
.lab .cur {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
}

/* 卡片橱窗 */
.shelf {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(17.5rem, 100%), 1fr));
  gap: clamp(.9rem, 2vw, 1.4rem); padding: clamp(1.5rem, 3.5vw, 2.5rem) 0 clamp(1.25rem, 3vw, 1.9rem);
}
.card {
  position: relative; display: flex; flex-direction: column; color: inherit; overflow: hidden;
  min-height: clamp(13.5rem, 24vh, 17rem);
  transition: transform .24s cubic-bezier(.16, 1, .3, 1), border-color .24s, background .24s, box-shadow .24s;
  border: 1px solid var(--hair2); border-radius: 2px; background: rgba(255, 255, 255, .55);
  animation: card-in .52s cubic-bezier(.16, 1, .3, 1) backwards;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.card .meta {
  display: flex; align-items: center; gap: .7rem;
  padding: .9rem 1.1rem .7rem; border-bottom: 1px solid var(--hair2);
}
.card .meta .no { font-family: var(--mono); font-size: .72rem; font-weight: 700; letter-spacing: .08em; color: #334155; }
.card .meta .kind { font-family: var(--mono); font-size: .63rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.card .meta .ver { margin-left: auto; font-family: var(--mono); font-size: .67rem; color: var(--muted); }
.card .main { display: flex; flex-direction: column; flex: 1; padding: .95rem 1.1rem .9rem; }
.card h3 { display: flex; align-items: center; gap: .55rem; font-size: 1.2rem; font-weight: 700; letter-spacing: -.018em; line-height: 1.35; }
.card h3 .pic { width: 22px; height: 22px; flex: none; object-fit: contain; }
.card h3 .pic-px { image-rendering: pixelated; }
.card .main p { margin-top: .55rem; font-size: .91rem; color: var(--ink2); }
.card .tail {
  display: flex; align-items: center; gap: .7rem; padding: .8rem 1.1rem;
  border-top: 1px solid var(--hair2); font-size: .74rem; color: var(--muted);
}
.card .tail .dt { font-family: var(--mono); font-size: .67rem; }
.card .tail .go { margin-left: auto; transition: transform .24s, color .24s; }
.card:hover { transform: translateY(-2px); border-color: var(--hair); background: rgba(255, 255, 255, .78); box-shadow: 0 6px 22px rgba(15, 23, 42, .07); }
.card:hover .tail .go { transform: translateX(4px); color: #0b1220; }

/* 减弱动效偏好：关掉入场动画与上浮 */
@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  .card:hover { transform: none; }
}

/* 收尾 */
footer { margin-top: auto; border-top: 1px solid var(--hair2); padding: 1.3rem 0 2rem; }
footer .row2 { display: flex; gap: 1rem 1.6rem; flex-wrap: wrap; align-items: baseline; font-size: .78rem; color: var(--muted); }
footer .row2 a { transition: color .18s; }
footer .row2 a:hover { color: #0b1220; }
footer .row2 .cp { margin-left: auto; font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; }
