* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0a0f1e; --card: rgba(255,255,255,.045); --line: rgba(255,255,255,.09);
  --cyan: #38e1ff; --blue: #4f8cff; --gold: #ffd166; --txt: #e8eef7; --sub: #93a3bd;
}
body {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: var(--bg); color: var(--txt); min-height: 100vh; overflow-x: hidden;
}
/* 背景光效 */
body::before, body::after {
  content: ""; position: fixed; border-radius: 50%; filter: blur(120px); z-index: 0; pointer-events: none;
}
body::before { width: 520px; height: 520px; left: -140px; top: -140px; background: rgba(56,129,255,.16); }
body::after { width: 460px; height: 460px; right: -120px; bottom: -120px; background: rgba(56,225,255,.10); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 22px 60px; position: relative; z-index: 1; }

/* ===== 头部 ===== */
header { text-align: center; padding: 26px 0 8px; }
.badge-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.badge {
  font-size: 12px; letter-spacing: 2px; color: var(--cyan);
  border: 1px solid rgba(56,225,255,.35); border-radius: 999px; padding: 4px 14px;
  background: rgba(56,225,255,.06);
}
h1 {
  font-size: 40px; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(92deg, #7fdcff 0%, #4f8cff 55%, #b48cff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub { color: var(--sub); margin-top: 10px; font-size: 14px; }
.sub b { color: var(--gold); font-weight: 600; }

/* ===== 左侧目录树 ===== */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 300px;
  background: #0b1424; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 30;
  transition: transform .25s ease;
}
body.side-hidden .sidebar { transform: translateX(-100%); }
body.side-hidden .wrap { margin-left: 0; }
.side-toggle {
  position: fixed; left: 12px; top: 12px; z-index: 31;
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: #101a2e; color: var(--cyan); font-size: 18px; cursor: pointer; display: none;
}
body.side-hidden .side-toggle { display: block; }
#searchBox {
  margin: 14px 14px 10px; padding: 9px 14px; border-radius: 10px;
  border: 1px solid rgba(56,225,255,.3); background: rgba(56,225,255,.05);
  color: var(--txt); font-size: 13px; outline: none; flex: none;
}
#searchBox:focus { border-color: var(--cyan); }
#searchBox::placeholder { color: #5a6b85; }
.tree { flex: 1; overflow-y: auto; padding: 4px 10px 20px; }
.tree::-webkit-scrollbar { width: 6px; }
.tree::-webkit-scrollbar-thumb { background: #243a58; border-radius: 3px; }
.tree-foot { flex: none; padding: 10px 14px; font-size: 12px; color: var(--sub); border-top: 1px solid var(--line); }
.tree-foot b { color: var(--cyan); }
.t-empty { padding: 14px; color: var(--sub); font-size: 13px; text-align: center; }
.t-book { margin-bottom: 4px; }
.t-book-h {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; font-size: 14px; font-weight: 700; color: var(--cyan);
  cursor: pointer; border-radius: 8px; user-select: none;
}
.t-book-h:hover { background: rgba(56,225,255,.07); }
.t-book-h .cnt { font-size: 11px; color: var(--sub); font-weight: 400; }
.t-book.collapsed .t-ch, .t-book.collapsed > .t-ch-h { display: none; }
.t-ch { margin: 2px 0 2px 10px; border-left: 1px solid var(--line); padding-left: 6px; }
.t-ch.closed .t-items { display: none; }
.t-ch-h {
  padding: 5px 8px; font-size: 12.5px; color: var(--sub); cursor: pointer;
  border-radius: 6px; user-select: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.t-ch-h:hover { color: var(--txt); background: rgba(255,255,255,.04); }
.t-ch-h .cnt { font-size: 11px; opacity: .7; margin-left: 4px; }
.t-ch.closed .t-ch-h::before { content: "▸ "; }
.t-ch:not(.closed) .t-ch-h::before { content: "▾ "; }
.t-items { padding-left: 4px; }
.t-item {
  padding: 6px 8px 6px 12px; font-size: 12.5px; color: #b9c6da; cursor: pointer;
  border-radius: 6px; line-height: 1.5; transition: background .15s, color .15s;
  white-space: normal; word-break: break-all;
}
.t-item:hover { background: rgba(56,225,255,.08); color: var(--txt); }
.t-item.on {
  background: linear-gradient(90deg, rgba(56,225,255,.18), rgba(56,225,255,.05));
  color: #fff; border-left: 2px solid var(--cyan); padding-left: 10px;
}
/* 主内容区让位 */
.wrap { margin-left: 300px; transition: margin-left .25s ease; }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  body:not(.side-hidden) .sidebar { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.6); }
  body:not(.side-hidden) .side-toggle { display: block; }
  .wrap { margin-left: 0; }
}

/* ===== 工艺切换（保留样式防残留引用） ===== */
.tabs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 26px 0 22px; }
.tab {
  cursor: pointer; border: 1px solid var(--line); border-radius: 12px; padding: 10px 18px;
  background: var(--card); transition: all .25s; user-select: none;
}
.tab .tm { font-size: 12px; color: var(--sub); letter-spacing: 2px; }
.tab .tt { font-size: 15px; font-weight: 600; margin-top: 2px; }
.tab:hover { transform: translateY(-2px); border-color: rgba(56,225,255,.4); }
.tab.on {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(56,129,255,.28), rgba(56,225,255,.18));
  box-shadow: 0 6px 24px rgba(79,140,255,.25);
}
.tab.on .tm { color: var(--cyan); }

/* ===== 卡片 ===== */
.card {
  border: 1px solid var(--line); border-radius: 18px; background: var(--card);
  backdrop-filter: blur(8px); padding: 22px 24px; animation: rise .4s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; } }
.card-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.card-head h2 { font-size: 22px; }
.card-head .path { color: var(--sub); font-size: 13px; }
.card-head .src { margin-left: auto; font-size: 12px; color: var(--sub); border: 1px dashed var(--line); padding: 3px 10px; border-radius: 8px; }

.main { display: grid; grid-template-columns: 330px 1fr; gap: 22px; margin-top: 18px; }
@media (max-width: 980px) { .main { grid-template-columns: 1fr; } }

/* ===== 工序面板 ===== */
.panel h3, .right h3 { font-size: 14px; color: var(--cyan); letter-spacing: 3px; margin-bottom: 12px; }
.progress { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; margin-bottom: 14px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .5s ease; box-shadow: 0 0 12px rgba(56,225,255,.8); }
.steps { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.step {
  display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px;
  border: 1px solid transparent; color: var(--sub); font-size: 14px; transition: all .3s;
  cursor: pointer; user-select: none;
}
.step:hover { border-color: rgba(56,225,255,.3); background: rgba(56,225,255,.05); color: #dfeaf8; }
.step .no {
  width: 22px; height: 22px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  font-size: 12px; border: 1px solid var(--line); color: var(--sub);
}
.step.done { color: #cfd9e8; }
.step.done .no { background: rgba(79,140,255,.25); border-color: rgba(79,140,255,.5); color: #bfd6ff; }
.step.cur {
  color: #fff; border-color: rgba(56,225,255,.45); background: rgba(56,225,255,.08);
  box-shadow: 0 0 18px rgba(56,225,255,.12) inset;
}
.step.cur .no { background: var(--cyan); border-color: var(--cyan); color: #04212b; font-weight: 700; }
.ctl { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.btn {
  cursor: pointer; border: none; border-radius: 10px; padding: 9px 16px; font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, var(--blue), var(--cyan)); color: #04212b; transition: all .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(56,225,255,.3); }
.btn.ghost { background: none; border: 1px solid var(--line); color: var(--txt); }
.btn.ghost.active { background: rgba(255,209,102,.12); border-color: rgba(255,209,102,.45); color: var(--gold); }
input[type=range] { flex: 1; accent-color: var(--cyan); cursor: pointer; }

/* ===== 图区（SVG 示意图） ===== */
.stage { position: relative; border-radius: 14px; overflow: hidden; background: #0b1c30; border: 1px solid var(--line); }
.stage svg { width: 100%; display: block; }
.stage [data-step] {
  opacity: 0; transform: translateY(-14px); pointer-events: none;
  transition: opacity .5s ease, transform .5s cubic-bezier(.2,1.5,.4,1);
}
.stage [data-step].on { opacity: 1; transform: none; }
.stage [data-step].cur { filter: drop-shadow(0 0 7px rgba(56,225,255,.75)); }
.stage.all [data-step] { opacity: 1; transform: none; filter: none; }
.stage.all [data-step].on { transform: none; }
.stage.for3d { aspect-ratio: 1000 / 560; background: radial-gradient(ellipse at 50% 30%, #14294a, #0a1626); }
.stage.for3d canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.stage.for3d canvas:active { cursor: grabbing; }
.hint3d { font-size: 12px; color: var(--sub); letter-spacing: 1px; margin-left: 10px; font-weight: 400; }
.figcaps { display: flex; gap: 18px; margin-top: 8px; color: var(--sub); font-size: 12px; flex-wrap: wrap; }
.figcaps span::before { content: "▣ "; color: var(--cyan); }

/* ===== 右侧下部 ===== */
.below { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
@media (max-width: 980px) { .below { grid-template-columns: 1fr; } }
ul.points { list-style: none; display: flex; flex-direction: column; gap: 9px; }
ul.points li { font-size: 14px; color: #cfd9e8; padding-left: 24px; position: relative; line-height: 1.6; }
ul.points li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--gold); font-weight: 700; }
.params { display: flex; flex-wrap: wrap; gap: 10px; }
.param {
  border: 1px solid rgba(255,209,102,.4); background: rgba(255,209,102,.07);
  border-radius: 10px; padding: 8px 14px; font-size: 13px;
}
.param b { color: var(--gold); margin-left: 8px; }
.brief-btn { margin-top: 16px; }
.ctl .brief-btn { margin-top: 0; }

/* ===== 交底弹窗 ===== */
.mask { position: fixed; inset: 0; background: rgba(4,8,18,.72); display: none; align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(4px); }
.mask.show { display: flex; }
.doc {
  width: min(760px, 92vw); max-height: 86vh; overflow: auto; border-radius: 6px; background: #fcfbf7;
  color: #1f2430; padding: 40px 48px 30px; font-size: 14px; line-height: 1.9;
  font-family: "SimSun", "Songti SC", "Microsoft YaHei", serif;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
}
.doc-head { text-align: center; border-bottom: 3px double #3a4152; padding-bottom: 14px; margin-bottom: 16px; }
.doc-brand { font-size: 12px; letter-spacing: 4px; color: #8a8f9c; font-family: "Microsoft YaHei", sans-serif; }
.doc h1 {
  font-size: 28px; letter-spacing: 10px; text-indent: 10px; color: #14181f; margin: 8px 0 4px;
  background: none; -webkit-text-fill-color: initial; font-family: "SimHei", "Microsoft YaHei", sans-serif; font-weight: 700;
}
.doc-sub { font-size: 12px; color: #6d7382; font-family: "Microsoft YaHei", sans-serif; }
.doc h2 {
  font-size: 16px; margin: 22px 0 10px; color: #14181f; font-family: "SimHei", "Microsoft YaHei", sans-serif;
  border-left: none; padding: 0 0 7px; border-bottom: 1.5px solid #3a4152; letter-spacing: 1px;
}
.doc table { border-collapse: collapse; margin: 6px 0 4px; width: 100%; background: #fff; }
.doc td, .doc th { border: 1px solid #565e70; padding: 7px 12px; font-size: 14px; text-align: left; vertical-align: top; }
.doc th { background: #efece2; font-family: "SimHei", "Microsoft YaHei", sans-serif; font-weight: 600; white-space: nowrap; width: 130px; }
.doc td b { color: #b3261e; }
.doc ol, .doc ul { padding-left: 26px; }
.doc ol li { margin: 3px 0; }
.doc .chk { list-style: none; padding-left: 4px; }
.doc .chk li { margin: 4px 0; }
.doc table.sign th { text-align: center; }
.doc table.sign td { height: 44px; }
.doc-note { margin-top: 18px; padding: 10px 14px; background: #f1efe6; border: 1px dashed #a9a992; font-size: 12.5px; color: #5d6270; }
@media print {
  body { background: #fff; }
  .wrap, .doc-bar { display: none !important; }
  .mask { position: static; display: block; background: none; backdrop-filter: none; padding: 0; }
  .doc-wrap { width: 100%; margin: 0; }
  .doc { width: 100%; max-height: none; box-shadow: none; border-radius: 0; padding: 8mm 6mm; }
}
.doc-bar { width: min(860px, 92vw); display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 10px; }
.doc-bar .btn.ghost { color: #e3ecf8; border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.08); }
.doc-bar .btn.ghost:hover { background: rgba(255,255,255,.16); }
.doc-wrap { display: flex; flex-direction: column; }

footer { text-align: center; color: var(--sub); font-size: 12px; margin-top: 40px; line-height: 1.8; }
