/*
Theme Name: 与上科技 (Yushang Industrial Design)
Description: 与上科技工业设计获客站定制主题。基于需求文档 V1.0 第9节技术选型：轻量自研主题，不依赖页面构建器。
Author: 与上科技
Version: 1.0.0
Text Domain: yushang
*/

/* ============================================
   设计令牌 —— 与 M2 设计稿 style.css 保持一致
   ============================================ */
:root {
  --paper: #f6f7f7;
  --panel: #ebeef0;
  --ink: #181b1d;
  --ink-2: #5a6266;
  --line: #dde2e2;
  --accent: #1f4e5f;
  --accent-soft: #e7eef0;
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "IBM Plex Mono", Menlo, Consolas, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.8;
  font-size: 16px;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 250, 248, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between; height: 72px;
}
.logo { font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: .06em; }
.logo em { font-style: normal; color: var(--accent); }
.nav-links { display: flex; gap: 40px; font-size: 15px; }
.nav-links a { color: var(--ink-2); transition: color .2s; }
.nav-links a:hover, .nav-links a.on { color: var(--ink); }
.nav-cta { font-size: 14px; padding: 9px 22px; border: 1px solid var(--ink); }
.nav-cta:hover { background: var(--ink); color: var(--paper); }

/* ---------- 通用区块 ---------- */
.section { padding: 104px 0; }
.section.alt { background: var(--panel); }
.kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: .18em; color: var(--accent);
  font-weight: 500; margin-bottom: 20px; display: inline-flex; align-items: center; gap: 10px;
  text-transform: uppercase;
}
/* 签名元素：借用工程图纸基准标记（datum mark）的视觉语言，贯穿全站的分隔符号 */
.kicker::before, .kicker::after {
  content: ""; width: 7px; height: 7px; flex-shrink: 0;
  border: 1.4px solid var(--accent); border-right-color: transparent; border-bottom-color: transparent;
}
.kicker::after { transform: rotate(180deg); }
.h2 { font-family: var(--serif); font-size: 36px; font-weight: 700; line-height: 1.4; margin-bottom: 16px; }
.h3 { font-family: var(--serif); font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.lead { color: var(--ink-2); max-width: 640px; margin-bottom: 56px; }

.btn { display: inline-block; padding: 14px 36px; font-size: 15px; background: var(--ink); color: var(--paper); transition: background .2s; border: none; cursor: pointer; font-family: var(--sans); }
.btn:hover { background: var(--accent); }
.btn.ghost { background: none; color: var(--ink); border: 1px solid var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

.ph { background: linear-gradient(135deg, #d8dbd6 0%, #c2c8c6 55%, #aeb6b5 100%); display: flex; align-items: center; justify-content: center; color: #6b7276; font-size: 13px; letter-spacing: .15em; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 80px; }
.hero-flex { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-family: var(--serif); font-size: 46px; font-weight: 700; line-height: 1.35; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { margin: 24px 0 36px; font-size: 18px; color: var(--ink-2); max-width: 480px; }
.hero-visual .hero-img, .hero-visual .ph { aspect-ratio: 4/3; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-banner-img { margin-top: 56px; aspect-ratio: 21/9; width: 100%; object-fit: cover; object-position: center; }

/* ---------- 观点列表：纯文字为主，有真实配图才显示，不留占位空位 ---------- */
.insights-list { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.insights-item {
  display: flex; gap: 32px; padding: 40px 0; border-bottom: 1px solid var(--line);
  align-items: flex-start; transition: opacity .15s;
}
.insights-item:hover { opacity: .72; }
.insights-item-img { width: 180px; aspect-ratio: 4/3; object-fit: cover; flex-shrink: 0; }
.insights-item-body { flex: 1; min-width: 0; }
.insights-item h3 { font-family: var(--serif); font-size: 25px; font-weight: 700; margin-bottom: 10px; text-wrap: balance; }
.insights-item p { font-size: 14.5px; color: var(--ink-2); margin-bottom: 14px; }
.insights-item .tag { font-family: var(--mono); font-size: 11px; color: var(--ink-2); letter-spacing: .06em; }

/* ---------- 案例卡 ---------- */
.works-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px 40px; }
.work-card .ph, .work-card img { aspect-ratio: 4/3; margin-bottom: 20px; transition: opacity .2s; object-fit: cover; width: 100%; }
.work-card:hover .ph, .work-card:hover img { opacity: .88; }
.work-card .tag { font-size: 12px; letter-spacing: .2em; color: var(--accent); }
.work-card h3 { font-family: var(--serif); font-size: 21px; margin: 6px 0 4px; }
.work-card p { font-size: 14px; color: var(--ink-2); }

/* ---------- 服务矩阵 ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.svc-cell { background: var(--paper); padding: 40px 32px; transition: background .2s; position: relative; }
.svc-cell::before {
  content: ""; position: absolute; top: 14px; left: 14px; width: 10px; height: 10px;
  border-top: 1.4px solid var(--accent); border-left: 1.4px solid var(--accent);
  opacity: .3; transition: opacity .2s;
}
.svc-cell:hover { background: var(--accent-soft); }
.svc-cell:hover::before { opacity: 1; }
.svc-cell .no { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: .1em; text-transform: uppercase; }
.svc-cell h3 { font-family: var(--serif); font-size: 19px; margin: 10px 0 8px; }
.svc-cell p { font-size: 13.5px; color: var(--ink-2); }

/* ---------- 数据条 ---------- */
.stats { display: flex; gap: 80px; flex-wrap: wrap; }
.stat b { font-family: var(--mono); font-size: 40px; font-weight: 600; display: block; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat span { font-size: 14px; color: var(--ink-2); }

/* ---------- 面包屑 ---------- */
.crumb { padding: 24px 0 0; font-size: 13px; color: var(--ink-2); }
.crumb a:hover { color: var(--accent); }

/* ---------- 正文 ---------- */
.article { max-width: 760px; }
.article h1 { font-family: var(--serif); font-size: 40px; line-height: 1.4; margin: 16px 0 20px; text-wrap: balance; }
.article .meta { font-size: 13px; line-height: 1.7; color: var(--ink-2); margin-bottom: 48px; letter-spacing: .01em; }
/* 案例规格块：客户/周期/交付，像仪器铭牌一样标签在上、数值在下 */
.case-spec { display: flex; flex-wrap: wrap; gap: 32px 48px; margin-bottom: 48px; padding-top: 20px; border-top: 1px solid var(--line); }
.case-spec span {
  display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px;
}
.case-spec b { font-size: 14.5px; font-weight: 600; }
.article h2 { font-family: var(--serif); font-size: 26px; margin: 56px 0 18px; display: flex; align-items: baseline; gap: 14px; }
.article h2 .stage-no { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--accent); letter-spacing: .02em; }
.article p { margin-bottom: 18px; color: #2c3034; }
.article ul { margin: 0 0 18px 1.4em; color: #2c3034; }
.article li { margin-bottom: 8px; }
.article li::marker { color: var(--accent); }
.article table { border-collapse: collapse; width: 100%; font-size: 14.5px; margin: 24px 0; }
.article-figure { width: 100%; height: auto; margin: 32px 0; } /* 按素材原生比例显示，不强制统一比例导致裁切 */
.article th {
  font-family: var(--mono); text-transform: uppercase; font-size: 11.5px; letter-spacing: .07em;
  font-weight: 600; color: var(--ink-2); text-align: left; padding: 10px 16px 10px 0;
  border-bottom: 1.4px solid var(--ink);
}
.article td {
  font-variant-numeric: tabular-nums; padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--line); vertical-align: top;
}

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); padding: 24px 0; }
.faq-item h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.faq-item p { font-size: 14.5px; color: var(--ink-2); }

/* ---------- 询盘区块 ---------- */
.inquiry { background: var(--ink); color: var(--paper); }
.inquiry .h2 { color: var(--paper); }
.inquiry p { color: #b8bcc0; }
.inquiry-flex { display: flex; justify-content: space-between; align-items: center; gap: 48px; flex-wrap: wrap; }
.inquiry .btn { background: var(--paper); color: var(--ink); white-space: nowrap; }

/* ---------- 表单 ---------- */
.form { display: grid; gap: 22px; max-width: 520px; }
.form label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2); display: block; margin-bottom: 10px;
}
.form input, .form select, .form textarea {
  width: 100%; padding: 10px 0 12px; font-size: 15px; font-family: var(--sans);
  border: none; border-bottom: 1.4px solid var(--line); border-radius: 0;
  background: transparent; color: var(--ink); transition: border-color .15s;
}
.form select { padding-top: 10px; } /* 保持下拉箭头与文字基线对齐 */
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-bottom-color: var(--accent);
}
/* 签名元素呼应：聚焦时字段两端浮现基准标记，像被对齐仪测量中 */
.form > div { position: relative; }
.form > div::before, .form > div::after {
  content: ""; position: absolute; bottom: 0; width: 1.4px; height: 8px;
  background: var(--accent); opacity: 0; transition: opacity .15s;
}
.form > div::before { left: 0; }
.form > div::after { right: 0; }
.form > div:focus-within::before, .form > div:focus-within::after { opacity: 1; }
.form-msg { font-size: 14px; padding: 12px 0; }
.form-msg.ok { color: var(--accent); }
.form-msg.err { color: #b3261e; }

/* ---------- 联系页 ---------- */
.contact-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 80px; }
.contact-card { border: 1px solid var(--line); padding: 36px; margin-bottom: 24px; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--line); padding: 64px 0 40px; font-size: 13.5px; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer h4 { font-size: 14px; color: var(--ink); margin-bottom: 14px; }
.footer a { display: block; margin-bottom: 8px; }
.footer a:hover { color: var(--accent); }
.footer .icp { border-top: 1px solid var(--line); padding-top: 24px; }

/* ---------- 悬浮转化组件 ---------- */
.float-pc { position: fixed; right: 24px; bottom: 120px; z-index: 90; display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); box-shadow: 0 4px 24px rgba(0,0,0,.08); }
.float-pc a { background: #fff; padding: 14px 16px; font-size: 12px; text-align: center; color: var(--ink-2); width: 72px; }
.float-pc a:hover { background: var(--accent); color: #fff; }
.float-mobile { display: none; }

/* ---------- 分页 ---------- */
.pagination { display: flex; gap: 12px; margin-top: 56px; font-size: 14px; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid var(--line); }
.pagination .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-flex { grid-template-columns: 1fr; gap: 32px; }
  .hero h1 { font-size: 34px; }
  .h2 { font-size: 28px; }
  .works-grid, .svc-grid { grid-template-columns: 1fr; }
  .insights-item { flex-direction: column; gap: 16px; }
  .insights-item-img { width: 100%; aspect-ratio: 16/9; }
  .stats { gap: 32px 48px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-cta { display: none; } /* 移动端由底部悬浮栏承担CTA，避免顶部按钮文字换行 */
  .float-pc { display: none; }
  .float-mobile { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; border-top: 1px solid var(--line); background: #fff; }
  .float-mobile a { flex: 1; text-align: center; padding: 14px 0; font-size: 14px; color: var(--ink); }
  .float-mobile a.primary { background: var(--accent); color: #fff; }
  body { padding-bottom: 52px; }
}

/* ---------- 资源下载（内容诱饵） ---------- */
.res-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.res-card { border: 1px solid var(--line); padding: 36px 32px; background: var(--paper); position: relative; }
.res-card::before {
  content: ""; position: absolute; top: 14px; right: 14px; width: 10px; height: 10px;
  border-top: 1.4px solid var(--accent); border-right: 1.4px solid var(--accent); opacity: .4;
}
.res-meta { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--ink-2); text-transform: uppercase; }
.res-title { font-family: var(--serif); font-size: 23px; font-weight: 700; margin: 10px 0 12px; }
.res-desc { font-size: 14.5px; color: var(--ink-2); margin-bottom: 24px; }
.res-form-row { display: flex; gap: 12px; margin-bottom: 14px; }
.res-form-row input { flex: 1; min-width: 0; }
@media (max-width: 760px) {
  .res-grid { grid-template-columns: 1fr; }
  .res-form-row { flex-direction: column; }
}

/* ---------- 项目估算器 ---------- */
.est-layout { display: grid; grid-template-columns: 1fr 380px; gap: 56px; align-items: start; }
.est-step { margin-bottom: 40px; }
.est-q { font-size: 17px; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.est-no { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: .08em; border: 1px solid var(--line); padding: 3px 7px; }
.est-opts { display: flex; flex-wrap: wrap; gap: 10px; }
.est-opt { position: relative; cursor: pointer; }
.est-opt input { position: absolute; opacity: 0; pointer-events: none; }
.est-opt span {
  display: inline-block; padding: 12px 20px; border: 1px solid var(--line);
  background: var(--paper); font-size: 14.5px; color: var(--ink-2); transition: all .15s;
}
.est-opt:hover span { border-color: var(--ink-2); color: var(--ink); }
.est-opt.is-on span { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 600; }

.est-result { border: 1px solid var(--ink); padding: 32px; position: sticky; top: 88px; background: var(--paper); }
.est-tier-label, .est-metric-label { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--ink-2); text-transform: uppercase; }
.est-tier { font-family: var(--serif); font-size: 34px; font-weight: 700; line-height: 1.1; margin: 6px 0 28px; }
.est-metric { padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--line); }
.est-metric-val { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.est-metric-val b { font-family: var(--mono); font-size: 30px; font-weight: 600; letter-spacing: -.01em; }
.est-metric-val span { font-size: 14px; color: var(--ink-2); }
.est-phases { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.est-chip { font-size: 12.5px; padding: 4px 10px; background: var(--panel); color: var(--ink); }
.est-note { font-size: 12px; color: var(--ink-2); line-height: 1.7; margin: 24px 0; }
.est-result .btn { width: 100%; text-align: center; padding: 14px; }
.est-summary-preview { font-size: 13px; color: var(--ink-2); background: var(--panel); padding: 12px 14px; line-height: 1.6; }
.est-summary-preview:empty { display: none; }

@media (max-width: 860px) {
  .est-layout { grid-template-columns: 1fr; gap: 32px; }
  .est-result { position: static; }
}

/* ---------- 滚动进场 ---------- */
/* .reveal 由 JS 动态添加，不写死在标记里——没有 JS 时内容照常直接显示，不会被卡住看不见 */
.reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity .5s cubic-bezier(.2,.6,.2,1), transform .5s cubic-bezier(.2,.6,.2,1);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* 网格子项依次进场：仅在 JS 已加 .reveal 时生效（无 JS 时选择器不命中，内容照常直接显示）。
   每项晚 60ms，形成轻微顺序感，替代整块平移的生硬。 */
.reveal .works-grid > *,
.reveal .svc-grid > *,
.reveal .insights-list > * {
  opacity: 0; transform: translateY(12px);
  transition: opacity .45s cubic-bezier(.2,.6,.2,1), transform .45s cubic-bezier(.2,.6,.2,1);
}
.reveal.is-visible .works-grid > *,
.reveal.is-visible .svc-grid > *,
.reveal.is-visible .insights-list > * { opacity: 1; transform: none; }
.reveal.is-visible .works-grid > *:nth-child(2),
.reveal.is-visible .svc-grid > *:nth-child(2),
.reveal.is-visible .insights-list > *:nth-child(2) { transition-delay: .06s; }
.reveal.is-visible .works-grid > *:nth-child(3),
.reveal.is-visible .svc-grid > *:nth-child(3),
.reveal.is-visible .insights-list > *:nth-child(3) { transition-delay: .12s; }
.reveal.is-visible .works-grid > *:nth-child(4),
.reveal.is-visible .svc-grid > *:nth-child(4),
.reveal.is-visible .insights-list > *:nth-child(4) { transition-delay: .18s; }
.reveal.is-visible .works-grid > *:nth-child(5),
.reveal.is-visible .svc-grid > *:nth-child(5),
.reveal.is-visible .insights-list > *:nth-child(5) { transition-delay: .24s; }
.reveal.is-visible .works-grid > *:nth-child(n+6),
.reveal.is-visible .svc-grid > *:nth-child(n+6),
.reveal.is-visible .insights-list > *:nth-child(n+6) { transition-delay: .30s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
