/* ============================================================
 * layout.css —— 各页面版式
 * index 全屏翻页 / tech 内核页 / eval 评价页 / sharing 共享页
 * ============================================================ */

/* ================= 首页：全屏滚动翻页 ================= */
/* 滚动容器必须是根元素：body 做滚动容器会让 window.scrollY 恒为 0，
   连锁废掉头部状态机、进度条与所有依赖滚动位置的逻辑。 */
html:has(body.snap-page) { height: 100dvh; overflow-y: auto; scroll-snap-type: y proximity; }
html:has(body.snap-page)::-webkit-scrollbar { width: 0; }
.snap-sec { scroll-snap-align: start; min-height: 100dvh; display: flex; align-items: center; }
.snap-sec > .wrap { width: min(var(--wrap), calc(100% - 48px)); padding-block: 84px; }
.snap-sec--loose > .wrap { padding-block: 108px; }
/* 页脚不参与强吸附，自然衔接 */
html:has(body.snap-page) .footer { scroll-snap-align: end; }

/* ---- 首屏 Hero ---- */
.hero {
  position: relative; min-height: 100dvh; height: 100dvh;
  display: flex; align-items: center;
  overflow: clip;
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media video, .hero-media img {
  width: 100%; height: 100%; object-fit: cover;
}
.hero-veil {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(100deg, rgba(255,255,255,0.94) 22%, rgba(255,255,255,0.72) 48%, rgba(238,250,245,0.30) 78%),
    linear-gradient(180deg, rgba(255,255,255,0.55), rgba(244,250,247,0.12) 30%, rgba(255,255,255,0.66) 96%);
}
.hero-copy { max-width: 640px; }
.hero-copy .lead { margin-top: 20px; max-width: 560px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-stats {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.72);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.hero-stats .wrap {
  display: flex; justify-content: space-between; align-items: stretch;
  gap: 12px; padding-block: 16px; flex-wrap: wrap;
}
.hero-stat { display: flex; flex-direction: column; gap: 2px; padding-right: 20px; border-right: 1px solid var(--line); flex: 1 1 130px; }
.hero-stat:last-child { border-right: none; }
.hero-stat b { font-size: clamp(1.15rem, 1.8vw, 1.5rem); }
.hero-stat span { font-size: 0.76rem; color: var(--ink-lo); font-weight: 600; }
.scroll-hint {
  position: absolute; right: max(24px, calc((100vw - var(--wrap)) / 2)); bottom: 96px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 0.72rem; letter-spacing: 0.2em; color: var(--ink-lo); font-weight: 700;
  writing-mode: vertical-rl;
}
.scroll-hint i {
  width: 1.5px; height: 46px; background: var(--line-strong); position: relative; overflow: hidden;
  writing-mode: horizontal-tb;
}
.scroll-hint i::after {
  content: ""; position: absolute; left: 0; top: -40%;
  width: 100%; height: 40%; background: var(--primary);
  animation: hintDrop 1.8s var(--ease) infinite;
}
@keyframes hintDrop { to { top: 110%; } }

/* ---- 首页：痛点 ---- */
.pain-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.pain-card { text-align: left; }
.pain-card .pain-num { font-size: clamp(2rem, 3.4vw, 2.8rem); line-height: 1.1; }
.pain-card p { margin-top: 10px; }

/* ---- 首页：共享理念 ---- */
.idea { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(28px, 4vw, 56px); align-items: center; }
.idea-points { display: grid; gap: 14px; margin-top: 26px; }
.idea-point {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow-sm);
}
.idea-point .ico {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-deep);
}
.idea-point .ico svg { width: 20px; height: 20px; }
.idea-point b { display: block; font-size: 0.98rem; }
.idea-point span { font-size: 0.86rem; color: var(--ink-mid); }

/* ---- 首页：三大内核模型 ---- */
.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.model-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; }
.model-card .model-no {
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700;
  color: var(--primary-deep); background: var(--primary-soft);
  align-self: flex-start; padding: 4px 12px; border-radius: 999px;
}
.model-card p { flex: 1; }
.model-card .formula-mini {
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink-mid);
  background: var(--surface-2); border-radius: 10px; padding: 10px 14px;
}
.model-card .go {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.88rem; font-weight: 700; color: var(--primary-deep);
}
.model-card .go svg { transition: transform 0.3s var(--ease); }
.model-card:hover .go svg { transform: translateX(4px); }

/* ---- 首页：导流区 ---- */
.nav-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.nav-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  color: var(--ink); transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.nav-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); color: var(--ink); }
.nav-card .nav-card-img { height: 150px; overflow: hidden; }
.nav-card .nav-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.nav-card:hover .nav-card-img img { transform: scale(1.06); }
.nav-card .nav-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.nav-card p { font-size: 0.86rem; color: var(--ink-mid); flex: 1; }
.nav-card .go { color: var(--primary-deep); font-weight: 700; font-size: 0.88rem; display: inline-flex; gap: 6px; align-items: center; }
.nav-card--solid .nav-card-img { display: grid; place-items: center; background: linear-gradient(135deg, #00d4aa, #007a5c); }
.nav-card--solid .nav-card-img svg { width: 54px; height: 54px; color: #fff; }

/* ================= 子页面通用分节 ================= */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 3.4vw, 48px); align-items: start; }
.split--wide-left { grid-template-columns: 1.15fr 0.85fr; }
.split--wide-right { grid-template-columns: 0.85fr 1.15fr; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { position: relative; padding-top: 8px; }
.step .step-no {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; margin-bottom: 14px;
  background: var(--primary-soft); color: var(--primary-deep);
  font-family: var(--font-mono); font-weight: 800; font-size: 0.9rem;
  border: 1.5px solid var(--primary-line);
}

/* ================= eval 页 ================= */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.kpi-card { position: relative; overflow: hidden; }
.kpi-card .kpi-val { font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.15; }
.kpi-card .kpi-label { font-size: 0.88rem; color: var(--ink-mid); margin-top: 6px; }
.kpi-card .kpi-delta {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  font-size: 0.8rem; font-weight: 700; color: var(--primary-deep);
  background: var(--primary-soft); border-radius: 999px; padding: 4px 12px;
}
.kpi-card .kpi-delta.down { color: var(--primary-deep); }
.kpi-card .kpi-target { position: absolute; top: 18px; right: 20px; font-size: 0.74rem; color: var(--ink-lo); font-weight: 600; }
.chart-card { padding: 22px 24px 12px; }
.chart-card .chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.chart-box { width: 100%; height: 300px; }
.chart-box--tall { height: 360px; }
.chart-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* 压测面板 */
.stress-panel { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.stress-metrics { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.stress-metrics .chip b { font-family: var(--font-mono); }

/* ================= sharing 页 ================= */
.share-hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; }
.match-weights { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.weight-chip {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow-sm);
  min-width: 128px; flex: 1;
}
.weight-chip .w-bar { width: 100%; height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.weight-chip .w-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--primary-deep), var(--primary)); }
.weight-chip b { font-size: 0.85rem; }
.weight-chip span { font-size: 0.72rem; color: var(--ink-lo); }

.share-list { display: grid; gap: 12px; }
.share-item {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s var(--ease);
}
.share-item:hover { border-color: var(--primary-line); box-shadow: var(--shadow-sm); transform: translateX(2px); }
.share-item.is-best { border-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), var(--surface) 55%); }
.share-score { font-size: 1.05rem; }
.share-item .share-main b { font-size: 0.95rem; }
.share-item .share-main span { display: block; font-size: 0.8rem; color: var(--ink-lo); margin-top: 2px; }
.best-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 22px; }
.best-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 0.88rem;
}
.best-row span:first-child { color: var(--ink-lo); }
.split-bar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; gap: 2px; }
.split-bar i { height: 100%; border-radius: 4px; min-width: 4px; }
.split-legend { display: flex; justify-content: space-between; font-size: 0.76rem; color: var(--ink-lo); margin-top: 8px; }

/* ================= 控制台（精简明亮版） ================= */
.console-shell {
  min-height: 100dvh; display: flex; flex-direction: column;
  padding-top: var(--header-h);
}
.console-main { flex: 1; width: min(1360px, calc(100% - 48px)); margin-inline: auto; padding-block: 22px 40px; display: grid; gap: 20px; min-width: 0; }
/* grid 单列 auto 轨道会被子项 min-content 撑破容器，全部收紧 */
.console-main > * { min-width: 0; max-width: 100%; }

.ctl-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 14px 20px;
}
.ctl-clock { display: flex; align-items: baseline; gap: 10px; }
.ctl-clock .num { font-size: 1.7rem; letter-spacing: 0.02em; }
.ctl-clock small { font-size: 0.78rem; color: var(--ink-lo); font-weight: 600; }
.ctl-group { display: flex; gap: 8px; align-items: center; }
.ctl-group .lbl { font-size: 0.78rem; color: var(--ink-lo); font-weight: 700; margin-right: 2px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button {
  border: none; background: transparent; border-radius: 999px;
  padding: 6px 14px; font-size: 0.8rem; font-weight: 700; color: var(--ink-mid);
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}
.seg button.is-on { background: var(--surface); color: var(--primary-deep); box-shadow: var(--shadow-sm); }

.kpi-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.kpi-tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 14px 18px;
}
.kpi-tile .k-val { font-size: clamp(1.4rem, 2vw, 1.9rem); line-height: 1.2; }
.kpi-tile .k-val small { font-size: 0.7em; color: var(--ink-lo); font-weight: 600; }
.kpi-tile .k-lbl { font-size: 0.78rem; color: var(--ink-lo); font-weight: 600; margin-top: 2px; }
.kpi-tile .k-sub { font-size: 0.72rem; color: var(--ink-lo); margin-top: 4px; }

.console-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 20px; align-items: stretch; }
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 20px 22px; display: flex; flex-direction: column; min-width: 0;
}
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h3 { font-size: 1rem; font-weight: 800; }
.panel-head .sub { font-size: 0.76rem; color: var(--ink-lo); font-weight: 600; }

.stream { display: grid; gap: 8px; max-height: 300px; overflow: auto; padding-right: 4px; }
.stream-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 12px;
  background: var(--surface-2); font-size: 0.88rem;
  animation: streamIn 0.4s var(--ease);
}
@keyframes streamIn { from { opacity: 0; transform: translateY(8px); } }
.stream-item .tag {
  flex: none; padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em;
}
.stream-item .tag.k-swap { background: var(--accent-soft); color: #9a6206; }
.stream-item .tag.k-charge { background: var(--primary-soft); color: var(--primary-deep); }
.stream-item .tag.k-none { background: var(--danger-soft); color: var(--danger); }
.stream-item .tag.k-arrive { background: rgba(14,155,181,0.12); color: var(--cyan); }
.stream-item .tag.k-fault { background: var(--danger-soft); color: var(--danger); }
.stream-item .tag.k-system { background: var(--surface-3); color: var(--ink-mid); }
.stream-item .t { margin-left: auto; flex: none; font-size: 0.78rem; color: var(--ink-lo); }

/* ================= 响应式 ================= */
@media (max-width: 1080px) {
  .pain-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-cards { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .console-grid { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .idea, .split, .split--wide-left, .split--wide-right, .share-hero-grid { grid-template-columns: 1fr; }
  .model-grid, .steps { grid-template-columns: 1fr; }
  .chart-grid-2 { grid-template-columns: 1fr; }
  .stress-panel { grid-template-columns: 1fr; }
  .scroll-hint { display: none; }
  .hero { height: auto; min-height: 100dvh; padding-top: var(--header-h); }
  .hero-veil { background: linear-gradient(180deg, rgba(255,255,255,0.9) 30%, rgba(255,255,255,0.82) 100%); }
  /* 荣耀/华为等国产浏览器会把 autoplay 失败的视频接管成悬浮原生播放层（压住正文）。
     窄屏一律禁用视频，改用海报图背景，顺带省下 4.8MB 流量。 */
  .hero-media video { display: none; }
  .hero-media {
    background: url("/static/assets/photos/hero-station.webp") center / cover no-repeat;
  }
}

/* ---- 移动端：关闭全屏吸附，改为自然流式 ---- */
@media (max-width: 880px) {
  html:has(body.snap-page) { height: auto; overflow: visible; scroll-snap-type: none; }
  .snap-sec { min-height: 0; display: block; }
  .snap-sec > .wrap { padding-block: 56px; }
  .hero { min-height: calc(100dvh - var(--header-h)); }
  .hero-stats { position: static; margin-top: 28px; }
  .hero-stats .wrap { padding-block: 12px; }
  .hero-stat { flex: 1 1 40%; border-right: none; }
}
