/* =========================================================
 * 手机端优先（mobile-first）响应式
 * 优先级：手机 > 桌面 > 平板（768–1023px 仅做基础适配）
 * ========================================================= */

:root {
  --ink: #14313d;
  --ink-2: #3d5a66;
  --muted: #718790;
  --accent: #1d8a7a;
  --accent-dark: #146b5f;
  --accent-soft: #e8f5f2;
  --gold: #b8762e;
  --bg: #f5f7f6;
  --card: #ffffff;
  --line: #e3eae8;
  --shadow: 0 2px 10px rgba(20, 49, 61, .06);
  --radius: 14px;
  --maxw: 1120px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

/* ---------------- 密码层 ---------------- */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(150deg, #0f2c37 0%, #1b4a52 55%, #24796c 100%);
}
.gate::before {
  content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: rgba(255,255,255,.05); top: -160px; right: -120px;
}
.gate::after {
  content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255,255,255,.04); bottom: -140px; left: -100px;
}
.gate-card {
  position: relative; z-index: 1; width: 100%; max-width: 400px;
  background: rgba(255,255,255,.97); border-radius: 20px;
  padding: 32px 26px 24px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.gate-mark {
  width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 14px;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 18px;
  letter-spacing: 1px; display: flex; align-items: center; justify-content: center;
}
.gate-card h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: .5px; }
.gate-sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.gate-hint {
  display: inline-block; font-size: 12px; color: var(--accent-dark);
  background: var(--accent-soft); border-radius: 20px; padding: 4px 12px; margin-bottom: 22px;
}
.gate-form, #gateForm { text-align: left; }
#gateForm label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 7px; font-weight: 600; }
#gateForm input {
  width: 100%; height: 46px; padding: 0 14px; font-size: 16px;
  border: 1px solid #cfdcd8; border-radius: 10px; outline: none;
  background: #fff; color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
#gateForm input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gate-error { min-height: 20px; color: #c0392b; font-size: 12px; padding-top: 5px; }
#gateForm button {
  width: 100%; height: 46px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--ink); color: #fff; font-size: 15px; font-weight: 600;
  letter-spacing: .5px; transition: background .2s, transform .1s;
}
#gateForm button:hover { background: var(--accent-dark); }
#gateForm button:active { transform: scale(.99); }
.gate-foot { font-size: 11px; color: #9aabb0; text-align: center; margin: 16px 0 0; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.94); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 14px; }
.brand-text small { font-size: 10px; color: var(--muted); }
.topnav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  white-space: nowrap; font-size: 12px; padding: 6px 11px; border-radius: 18px;
  background: #eef2f1; color: var(--ink-2); transition: all .2s;
}
.topnav a.active { background: var(--accent); color: #fff; }

/* ---------------- 主体 ---------------- */
.main { max-width: var(--maxw); margin: 0 auto; padding: 22px 16px 56px; }

.hero { padding: 14px 2px 22px; }
.hero-kicker {
  display: inline-block; font-size: 11px; letter-spacing: 1px; color: var(--accent-dark);
  background: var(--accent-soft); padding: 4px 10px; border-radius: 20px; margin-bottom: 12px;
}
.hero h1 { font-size: 25px; line-height: 1.35; margin: 0 0 10px; letter-spacing: -.3px; }
.hero p { color: var(--ink-2); margin: 0; font-size: 14px; }
.hero-meta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-meta span {
  font-size: 11px; padding: 4px 10px; border: 1px solid var(--line);
  border-radius: 20px; background: #fff; color: var(--ink-2);
}

.section-title {
  display: flex; align-items: baseline; gap: 10px; margin: 30px 0 14px;
}
.section-title h2 { font-size: 18px; margin: 0; }
.section-title small { color: var(--muted); font-size: 12px; }

/* ---------------- 项目 Tab ---------------- */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto; min-width: 120px; text-align: center; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 12px; padding: 11px 10px; font-size: 13px; font-weight: 600;
  transition: all .2s;
}
.tab:hover { border-color: var(--accent); color: var(--accent-dark); }
.tab small { display: block; font-size: 10px; font-weight: 400; color: var(--muted); margin-top: 2px; }

/* ---------------- 项目卡片 ---------------- */
.project-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 16px; margin-bottom: 14px;
}
.pc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pc-index {
  font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: 1px;
  background: var(--accent-soft); border-radius: 6px; padding: 3px 8px; flex-shrink: 0;
}
.pc-title { font-size: 19px; font-weight: 700; margin: 8px 0 2px; line-height: 1.35; }
.pc-sub { color: var(--accent-dark); font-size: 13px; margin: 0 0 8px; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pc-tags span { font-size: 11px; color: var(--muted); background: #f2f5f4; border-radius: 5px; padding: 3px 8px; }
.pc-intro { font-size: 13px; color: var(--ink-2); margin: 0 0 14px; }

/* 里程碑 */
.milestones { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.ms {
  flex: 1 1 90px; background: #f7faf9; border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 9px;
}
.ms b { display: block; font-size: 12px; color: var(--accent-dark); }
.ms span { font-size: 11px; color: var(--muted); }

/* 时间线（横向滚动，手机优先） */
.tl-label { font-size: 11px; color: var(--muted); margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.tl-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.timeline-scroll { overflow-x: auto; padding: 4px 0 10px; scrollbar-width: thin; scroll-snap-type: x proximity; }
.timeline-scroll::-webkit-scrollbar { height: 4px; }
.timeline-scroll::-webkit-scrollbar-thumb { background: #cfded9; border-radius: 4px; }
.timeline { display: flex; list-style: none; margin: 0; padding: 0; min-width: max-content; }
.tl-node {
  position: relative; width: 82px; flex: 0 0 82px; padding-top: 26px;
  text-align: center; scroll-snap-align: start;
}
.tl-node:not(:last-child)::after {
  content: ""; position: absolute; top: 10px; left: 50%; width: 100%; height: 2px;
  background: #d7e4e0; z-index: 0;
}
.tl-dot {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 22px; height: 22px; border-radius: 50%; z-index: 1;
  background: #fff; border: 2px solid #c9d9d4; color: var(--muted);
  font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.tl-node.key .tl-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.tl-name { display: block; font-size: 11px; color: var(--ink-2); line-height: 1.4; }
.tl-date { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0 14px; }
.kpi { background: #f7faf9; border-radius: 9px; padding: 9px 10px; }
.kpi b { display: block; font-size: 16px; color: var(--gold); line-height: 1.3; }
.kpi span { font-size: 10px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 10px; cursor: pointer; font-weight: 600;
  padding: 10px 16px; font-size: 13px; transition: all .2s;
}
.btn-primary { background: var(--ink); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-dark); }

/* 方法论卡片 */
.method-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.method-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.method-card img { width: 100%; height: auto; border-bottom: 1px solid var(--line); }
.method-card div { padding: 13px 14px; }
.method-card h3 { font-size: 14px; margin: 0 0 5px; }
.method-card p { font-size: 12px; color: var(--ink-2); margin: 0; }

/* ---------------- 项目子页面 ---------------- */
.sub-head {
  background: linear-gradient(145deg, #14313d, #1e5c60); color: #fff;
  border-radius: var(--radius); padding: 22px 18px; margin-bottom: 16px;
}
.back-link { display: inline-block; font-size: 12px; opacity: .8; margin-bottom: 12px; }
.back-link:hover { opacity: 1; }
.sub-head h1 { font-size: 23px; margin: 0 0 4px; line-height: 1.3; }
.sub-sub { color: #a8d8d0; font-size: 14px; margin: 0 0 12px; }
.sub-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sub-tags span { font-size: 11px; background: rgba(255,255,255,.13); padding: 4px 9px; border-radius: 16px; }
.sub-intro { font-size: 13px; color: #dcecea; margin: 0; line-height: 1.75; }
.sub-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 16px; }
.sub-kpi { background: rgba(255,255,255,.1); border-radius: 9px; padding: 9px 10px; }
.sub-kpi b { display: block; font-size: 17px; color: #ffd9a0; line-height: 1.3; }
.sub-kpi span { font-size: 10px; color: #c9ded9; }

.sub-nav {
  display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 12px;
  scrollbar-width: none; position: sticky; top: 56px; z-index: 20;
  background: var(--bg);
}
.sub-nav::-webkit-scrollbar { display: none; }
.sub-nav a {
  flex: 0 0 auto; font-size: 11px; padding: 5px 10px; border-radius: 16px;
  background: #fff; border: 1px solid var(--line); color: var(--ink-2);
}

/* 九环节链条 */
.chain { position: relative; padding-left: 30px; }
.chain::before {
  content: ""; position: absolute; left: 10px; top: 8px; bottom: 8px;
  width: 2px; background: linear-gradient(180deg, var(--accent), #cfe4df);
}
.stage {
  position: relative; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 14px 14px 13px;
  margin-bottom: 13px;
}
.stage::before {
  content: ""; position: absolute; left: -25px; top: 20px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.stage-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.stage-no {
  font-size: 11px; font-weight: 700; color: #fff; background: var(--accent);
  width: 22px; height: 22px; border-radius: 6px; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.stage-head h3 { font-size: 15px; margin: 0; }
.stage ul { margin: 0 0 10px; padding-left: 17px; }
.stage li { font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }
.stage li::marker { color: var(--accent); }
.stage-output {
  font-size: 12px; color: var(--accent-dark); background: var(--accent-soft);
  border-radius: 8px; padding: 7px 10px;
}
.stage-output b { font-weight: 700; }
.stage img {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  margin-top: 11px; background: #fff;
}
.stage-figcaption { font-size: 11px; color: var(--muted); margin-top: 5px; text-align: center; }

/* 复盘 */
.review-box {
  background: #fffaf3; border: 1px solid #f0dfc6; border-left: 4px solid var(--gold);
  border-radius: 10px; padding: 15px 16px; margin-top: 20px;
}
.review-box h2 { font-size: 16px; margin: 0 0 9px; color: #8a5a1e; }
.review-box ul { margin: 0; padding-left: 18px; }
.review-box li { font-size: 13px; color: #6b5433; margin-bottom: 6px; }

.sub-bottom { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.sub-bottom .btn { flex: 1 1 140px; }

/* ---------------- 页脚 ---------------- */
.footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 18px 16px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; color: var(--muted);
}
.footer-right { color: #9aabb0; }

/* =========================================================
 * 桌面端 ≥ 1024px（第二优先级）
 * ========================================================= */
@media (min-width: 1024px) {
  body { font-size: 16px; }
  .topbar-inner { padding: 12px 24px; }
  .topnav a { font-size: 13px; padding: 7px 14px; }
  .main { padding: 34px 24px 72px; }
  .hero { padding: 10px 0 28px; }
  .hero h1 { font-size: 34px; max-width: 720px; }
  .hero p { font-size: 15px; max-width: 700px; }
  .hero-meta span { font-size: 12px; }
  .section-title h2 { font-size: 21px; }
  .tabs { gap: 14px; }
  .tab { min-width: 200px; padding: 15px 14px; font-size: 15px; }
  .tab small { font-size: 11px; margin-top: 4px; }

  .project-card { padding: 24px 26px; margin-bottom: 18px; }
  .pc-head { align-items: center; }
  .pc-title { font-size: 24px; }
  .pc-sub { font-size: 14px; }
  .pc-intro { font-size: 14px; max-width: 820px; }
  .milestones { flex-wrap: nowrap; gap: 12px; max-width: 640px; }
  .ms { padding: 10px 14px; }
  .ms b { font-size: 13px; }
  .tl-node { width: 96px; flex-basis: 96px; padding-top: 30px; }
  .tl-dot { width: 25px; height: 25px; font-size: 11px; top: 0; }
  .tl-node:not(:last-child)::after { top: 11px; }
  .tl-name { font-size: 12px; }
  .tl-date { font-size: 11px; }
  .kpis { grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 760px; }
  .kpi { padding: 12px 14px; }
  .kpi b { font-size: 21px; }
  .kpi span { font-size: 11px; }
  .btn-primary { width: auto; min-width: 190px; padding: 12px 24px; font-size: 14px; }

  .method-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .method-card h3 { font-size: 15px; }
  .method-card p { font-size: 13px; }

  .sub-head { padding: 34px 36px; margin-bottom: 22px; }
  .sub-head h1 { font-size: 32px; }
  .sub-sub { font-size: 16px; }
  .sub-intro { font-size: 14px; max-width: 800px; }
  .sub-kpis { grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 800px; }
  .sub-kpi b { font-size: 22px; }
  .sub-nav { top: 62px; }
  .sub-nav a { font-size: 12px; padding: 7px 13px; }

  .chain { padding-left: 44px; max-width: 900px; }
  .chain::before { left: 16px; }
  .stage { padding: 20px 24px; margin-bottom: 18px; }
  .stage::before { left: -33px; top: 26px; width: 12px; height: 12px; }
  .stage-head h3 { font-size: 18px; }
  .stage-no { width: 26px; height: 26px; font-size: 12px; }
  .stage li { font-size: 14px; }
  .stage-output { font-size: 13px; }
  .review-box { padding: 20px 24px; }
  .review-box h2 { font-size: 18px; }
  .review-box li { font-size: 14px; }
  .ct-name, .ct-axis-name { flex-basis: 120px; font-size: 12px; }
  .ct-tick { font-size: 11px; }
  .ct-node em { font-size: 10px; top: 18px; }
  .ct-caption { font-size: 12px; margin-left: 20px; }
  .method-card .method-note { font-size: 13px; }
  .footer-inner { flex-direction: row; justify-content: space-between; padding: 22px 24px; }
}

/* =========================================================
 * 平板 768–1023px（最低优先级，仅保证可读可用）
 * ========================================================= */
@media (min-width: 768px) and (max-width: 1023px) {
  .main { padding: 24px 20px 48px; }
  .hero h1 { font-size: 28px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .method-grid { grid-template-columns: repeat(2, 1fr); }
  .sub-kpis { grid-template-columns: repeat(4, 1fr); }
  .chain { padding-left: 36px; }
  .chain::before { left: 12px; }
  .stage::before { left: -29px; }
  .footer-inner { flex-direction: row; justify-content: space-between; }
}

/* 大屏图片限宽，避免拉伸失真 */
.stage img, .method-card img { object-fit: contain; }
@media (min-width: 1024px) {
  .stage img { max-width: 720px; }
}

/* ---------------- 三项目交叉时间线（甘特图） ---------------- */
.cross-tl {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 0 12px; margin-bottom: 16px;
}
.ct-scroll { overflow-x: auto; padding: 0 14px 6px; scrollbar-width: thin; }
.ct-scroll::-webkit-scrollbar { height: 5px; }
.ct-scroll::-webkit-scrollbar-thumb { background: #cfded9; border-radius: 5px; }
.ct-inner { min-width: 680px; }
.ct-axis-row { display: flex; align-items: center; margin-bottom: 14px; }
.ct-axis-name {
  flex: 0 0 100px; font-size: 11px; color: var(--muted); font-weight: 600;
  position: sticky; left: 0; background: #fff; z-index: 3;
}
.ct-axis {
  position: relative; flex: 1; height: 20px;
  border-bottom: 1px solid #d7e4e0;
}
.ct-tick {
  position: absolute; top: 0; transform: translateX(-50%);
  font-size: 10px; color: var(--muted); white-space: nowrap;
}
.ct-tick:first-child { transform: none; }
.ct-tick:last-child { transform: translateX(-100%); }
.ct-tick::after {
  content: ""; position: absolute; bottom: -7px; left: 50%;
  width: 1px; height: 6px; background: #cbd9d5;
}
.ct-row { display: flex; align-items: center; margin-bottom: 18px; }
.ct-row:last-of-type { margin-bottom: 6px; }
.ct-name {
  flex: 0 0 100px; padding-right: 8px; font-size: 11px; font-weight: 600;
  color: var(--ink-2); line-height: 1.35; position: sticky; left: 0;
  background: #fff; z-index: 3;
}
.ct-name:hover { color: var(--accent-dark); }
.ct-track {
  position: relative; flex: 1; height: 46px; border-radius: 6px;
  background: repeating-linear-gradient(90deg,
    transparent, transparent calc(16.666% - 1px),
    #eef3f1 calc(16.666% - 1px), #eef3f1 16.666%);
}
.ct-bar {
  position: absolute; top: 15px; height: 18px; border-radius: 9px;
  min-width: 6px;
}
.ct-node { position: absolute; top: -5px; transform: translateX(-50%); }
.ct-node i {
  display: block; width: 12px; height: 12px; margin: 0 auto;
  border-radius: 50%; background: #fff; border: 2px solid var(--ink);
}
.ct-node em {
  position: absolute; top: 17px; left: 50%; transform: translateX(-50%);
  font-size: 9px; font-style: normal; white-space: nowrap;
  color: var(--ink-2); background: #fff; padding: 0 2px;
}
.ct-caption {
  font-size: 11px; color: var(--muted); margin: 6px 14px 0;
  line-height: 1.6;
}

/* 项目子页内的方法论卡片：与第一张卡之间加项目关联说明 */
.method-card .method-note {
  font-size: 12px; color: var(--accent-dark); background: var(--accent-soft);
  border-radius: 7px; padding: 6px 9px; margin: 0 0 7px; font-weight: 600;
  line-height: 1.55;
}
.sub-methods { margin-top: 4px; }

/* 打印/导出 PDF 时隐藏交互层 */
@media print {
  .topbar, .footer, .tabs, .sub-nav, .gate { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; max-width: none; }
  .stage, .project-card, .method-card { break-inside: avoid; box-shadow: none; }
}
