:root {
  color-scheme: dark;
  --bg: #07100f;
  --panel: #0d1917;
  --panel-2: #11211e;
  --line: rgba(177, 217, 200, .15);
  --text: #f2f6ee;
  --muted: #9eb0aa;
  --acid: #d7ff57;
  --mint: #7af0c2;
  --cyan: #62d9f7;
  --orange: #ffad62;
  --red: #ff6f6f;
  --radius: 18px;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { color: inherit; }
.shell { width: min(1460px, calc(100% - 40px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; padding: 10px 14px; color: #07100f; background: var(--acid); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.hero { position: relative; min-height: 560px; overflow: hidden; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 75% 25%, rgba(122, 240, 194, .16), transparent 26%), radial-gradient(circle at 92% 70%, rgba(215, 255, 87, .08), transparent 28%), #07100f; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent 49.9%, rgba(215,255,87,.08) 50%, transparent 50.1%), linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px); background-size: 240px 100%, 100% 64px; mask-image: linear-gradient(to right, transparent 20%, black); }
.hero__mesh { position: absolute; right: -5vw; top: 42px; width: 52vw; aspect-ratio: 1; opacity: .48; background: repeating-radial-gradient(ellipse at center, transparent 0 25px, rgba(122,240,194,.24) 26px 27px, transparent 28px 52px); transform: perspective(700px) rotateX(65deg) rotateZ(-12deg); }
.hero__inner { position: relative; z-index: 1; padding: 82px 0 62px; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--mint); font: 700 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .18em; }
.eyebrow__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 18px var(--acid); }
h1 { margin: 25px 0 20px; max-width: 800px; font-size: clamp(58px, 8vw, 120px); line-height: .87; letter-spacing: -.075em; }
h1 span { color: transparent; -webkit-text-stroke: 1px var(--acid); text-shadow: 0 0 42px rgba(215,255,87,.08); }
.hero__lead { width: min(680px, 100%); margin: 0; color: #c3d1cc; font-size: 18px; line-height: 1.8; }
.hero__stats { display: flex; gap: 8px; margin-top: 34px; }
.hero__stats div { min-width: 128px; padding: 14px 18px; border-left: 1px solid var(--acid); background: rgba(255,255,255,.025); }
.hero__stats strong { display: block; color: var(--acid); font: 500 26px/1 ui-monospace, monospace; }
.hero__stats span { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.hero__notice { max-width: 720px; margin: 28px 0 0; padding-left: 14px; border-left: 2px solid var(--orange); color: #b8c3be; font-size: 13px; line-height: 1.65; }

.toolbar { position: sticky; z-index: 10; top: 0; margin: 34px 0 28px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(8, 18, 16, .9); box-shadow: 0 18px 45px rgba(0,0,0,.3); backdrop-filter: blur(16px); }
.search { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid rgba(215,255,87,.22); border-radius: 12px; background: #091411; }
.search > span { color: var(--acid); font-size: 25px; }
.search input { height: 48px; border: 0; outline: 0; color: var(--text); background: transparent; }
.search input::placeholder { color: #70827c; }
kbd { padding: 3px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--panel); }
.toolbar__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.filter, .motion-toggle { min-height: 36px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; transition: .18s ease; }
.filter:hover, .motion-toggle:hover { border-color: var(--mint); }
.filter[aria-pressed="true"] { color: #07100f; border-color: var(--acid); background: var(--acid); }
.motion-toggle { flex: none; border-radius: 10px; color: var(--muted); }
.motion-toggle span { color: var(--acid); font-family: monospace; }
.result-line { margin: 12px 2px 0; color: var(--muted); font-size: 12px; }
.result-line > span:first-child { color: var(--acid); font-family: monospace; }
.result-line__hint { float: right; }

.atlas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.fault-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(255,255,255,.022), transparent 38%), var(--panel); transition: transform .2s ease, border-color .2s ease; }
.fault-card:hover { transform: translateY(-2px); border-color: rgba(122,240,194,.38); }
.fault-card::before { content: ""; position: absolute; top: 0; left: 0; width: 110px; height: 2px; background: var(--acid); }
.fault-card__head { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 22px 22px 18px; border-bottom: 1px solid var(--line); }
.fault-card__code { display: inline-flex; margin-right: 8px; color: var(--acid); font: 700 12px ui-monospace, monospace; }
.fault-card__type { color: var(--muted); font-size: 12px; }
.fault-card h2 { margin: 10px 0 3px; font-size: 24px; letter-spacing: -.03em; }
.fault-card__en { overflow-wrap: anywhere; color: #758882; font: 11px ui-monospace, monospace; text-transform: uppercase; }
.source-links { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 7px; }
.source-link { display: inline-flex; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--mint); background: transparent; font-size: 11px; text-decoration: none; cursor: pointer; }
.source-link:hover { border-color: var(--mint); }
.source-link--case { border-color: #4b726f; color: var(--acid); }
.fault-card__signals { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.signal { min-height: 126px; padding: 18px 22px; }
.signal + .signal { border-left: 1px solid var(--line); }
.label { display: block; margin-bottom: 8px; color: var(--mint); font: 700 10px ui-monospace, monospace; letter-spacing: .12em; }
.signal p, .fault-card__analysis p { margin: 0; color: #cbd5d1; font-size: 14px; line-height: 1.68; }
.fault-card__visuals { display: grid; grid-template-columns: 1fr 1fr; min-height: 230px; border-bottom: 1px solid var(--line); }
.visual { position: relative; min-width: 0; margin: 0; padding: 16px; }
.visual + .visual { border-left: 1px solid var(--line); }
.visual__title { display: flex; justify-content: space-between; margin-bottom: 8px; color: #a9b9b4; font: 10px ui-monospace, monospace; letter-spacing: .1em; }
.visual__title i { color: var(--acid); font-style: normal; }
.chart, .mechanism { display: block; width: 100%; border-radius: 10px; background: #081310; }
.chart { height: 89px; }
.mechanism { height: 194px; }
.visual .motion-diagram { aspect-ratio: 620 / 360; min-height: 194px; }
.motion-detail { color: var(--acid); font-style: normal; text-decoration: none; }
.motion-detail:hover { text-decoration: underline; }
.chart .grid { stroke: rgba(180,220,205,.12); stroke-width: .7; }
.chart .axis { stroke: rgba(205,226,217,.36); }
.chart .spectrum { stroke: var(--acid); stroke-width: 2; fill: none; filter: drop-shadow(0 0 4px rgba(215,255,87,.35)); }
.chart .wave { stroke: var(--cyan); stroke-width: 1.7; fill: none; }
.chart text { fill: #7e918b; font: 8px ui-monospace, monospace; }
.chart .peak-label { fill: var(--acid); font-size: 7px; }
.mechanism { color: var(--mint); }
.mechanism .frame { stroke: rgba(122,240,194,.35); fill: none; }
.mechanism .metal { fill: #263c36; stroke: #6d8c82; }
.mechanism .active { fill: var(--acid); stroke: #07100f; }
.mechanism .accent { fill: var(--orange); stroke: #07100f; }
.mechanism .shaft { stroke: #a7bbb4; stroke-width: 8; stroke-linecap: round; }
.mechanism .rotor { transform-origin: 110px 88px; animation: spin 2.2s linear infinite; }
.mechanism .counter { transform-origin: 225px 88px; animation: spin-reverse 2.8s linear infinite; }
.mechanism .shake { animation: shake .34s ease-in-out infinite alternate; }
.mechanism .pulse { animation: pulse 1.1s ease-in-out infinite; }
.mechanism .bubble { animation: bubble 1.7s ease-in infinite; }
.mechanism .flow { stroke-dasharray: 10 8; animation: flow 1s linear infinite; }
.mechanism .belt { stroke-dasharray: 12 7; animation: flow .8s linear infinite; }
.fault-card__analysis { position: relative; padding: 18px 22px 21px 54px; }
.fault-card__analysis::before { content: "↳"; position: absolute; left: 22px; top: 15px; color: var(--acid); font-size: 22px; }
.fault-card__analysis .label { color: var(--orange); }
.empty { padding: 90px 20px; text-align: center; color: var(--muted); }
.empty strong, .empty span { display: block; }
.empty strong { margin-bottom: 10px; color: var(--text); font-size: 22px; }

.method-note { display: grid; grid-template-columns: .75fr 1.25fr; gap: 40px; margin: 70px 0 40px; padding: 36px; border: 1px solid rgba(215,255,87,.25); border-radius: var(--radius); background: linear-gradient(130deg, rgba(215,255,87,.06), transparent 45%), var(--panel); }
.method-note span { color: var(--acid); font: 11px ui-monospace, monospace; letter-spacing: .16em; }
.method-note h2 { margin: 10px 0 0; font-size: 32px; }
.method-note ol { margin: 0; padding-left: 20px; color: #b9c6c1; line-height: 1.72; }
.method-note li + li { margin-top: 12px; }
.method-note strong { color: var(--text); }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 0 45px; border-top: 1px solid var(--line); color: #71837d; font-size: 11px; }

.source-dialog { width: min(920px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 16px; color: var(--text); background: #0a1513; box-shadow: 0 30px 90px #000; }
.source-dialog::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(5px); }
.source-dialog__close { position: absolute; z-index: 1; top: 10px; right: 10px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: #0b1714; cursor: pointer; }
.source-dialog__body { padding: 48px 20px 20px; text-align: center; }
.source-dialog img { max-width: 100%; max-height: 75vh; border-radius: 10px; }
.source-dialog p { color: var(--muted); }

body.motion-paused * { animation-play-state: paused !important; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-reverse { to { transform: rotate(-360deg); } }
@keyframes shake { from { transform: translate(-2px, -1px) rotate(-.5deg); } to { transform: translate(2px, 1px) rotate(.5deg); } }
@keyframes pulse { 0%,100% { opacity: .25; transform: scale(.78); transform-origin: center; } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes bubble { 0% { transform: translateY(24px) scale(.5); opacity: 0; } 35% { opacity: .8; } 100% { transform: translateY(-54px) scale(1.25); opacity: 0; } }
@keyframes flow { to { stroke-dashoffset: -36; } }

@media (max-width: 980px) {
  .atlas { grid-template-columns: 1fr; }
  .method-note { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 1460px); }
  .hero { min-height: auto; }
  .hero__inner { padding-top: 58px; }
  h1 { font-size: clamp(52px, 18vw, 78px); }
  .hero__stats { flex-wrap: wrap; }
  .toolbar { position: relative; }
  .toolbar__row { display: block; }
  .motion-toggle { margin-top: 10px; }
  .result-line__hint { display: none; }
  .fault-card__head, .fault-card__signals, .fault-card__visuals { grid-template-columns: 1fr; }
  .source-links { grid-column: 1; }
  .signal + .signal, .visual + .visual { border-left: 0; border-top: 1px solid var(--line); }
  .footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  :root { color-scheme: light; --bg: white; --panel: white; --text: #111; --muted: #555; --line: #bbb; }
  .hero { min-height: 0; color: #111; background: white; }
  .hero__mesh, .toolbar, .source-links, .footer { display: none; }
  .hero__inner { padding: 30px 0; }
  .hero { break-after: page; }
  h1 { font-size: 54px; }
  h1 span { color: #111; -webkit-text-stroke: 0; }
  .atlas { display: block; }
  .fault-card { margin: 0; break-before: page; break-inside: avoid-page; box-shadow: none; }
  .fault-card__head { padding: 14px 16px 12px; }
  .fault-card__signals, .fault-card__visuals { grid-template-columns: 1fr 1fr; }
  .signal { min-height: 0; padding: 12px 16px; }
  .fault-card__visuals { min-height: 0; }
  .visual { padding: 10px 14px; }
  .chart { height: 70px; }
  .mechanism { height: 150px; }
  .fault-card__analysis { padding: 12px 16px 14px 44px; }
  .fault-card__analysis::before { left: 16px; top: 9px; }
  .method-note { break-before: page; margin: 0; }
}
