:root {
  color-scheme: light;
  --ink: #0b1f33;
  --ink-2: #16354b;
  --teal: #1fb6b2;
  --teal-dark: #06716f;
  --amber: #e8a93a;
  --paper: #f5f8f7;
  --white: #ffffff;
  --mist: #e3efed;
  --line: #c6d7d5;
  --muted: #516a78;
  --danger: #a33d32;
  --shadow: 0 16px 48px rgba(11, 31, 51, 0.11);
  --radius: 18px;
  --content: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }
a { color: var(--teal-dark); text-decoration-thickness: 0.09em; text-underline-offset: 0.2em; }
a:hover { color: #065f60; }
button, input, select, textarea { font: inherit; }
button, .button { min-height: 44px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.skip-link { position: fixed; left: 12px; top: 10px; z-index: 100; transform: translateY(-160%); padding: 9px 14px; background: var(--white); color: var(--ink); border-radius: 8px; }
.skip-link:focus { transform: none; }
.shell { width: min(calc(100% - 40px), var(--content)); margin-inline: auto; }
.site-header { background: var(--ink); color: var(--white); border-bottom: 3px solid var(--teal); position: relative; z-index: 20; }
.header-row { min-height: 76px; display: grid; grid-template-columns: auto 1fr auto; gap: 26px; align-items: center; }
.brand { display: inline-flex; gap: 11px; align-items: center; color: var(--white); text-decoration: none; min-width: 218px; }
.brand img { width: 44px; height: 44px; flex: 0 0 auto; }
.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font-size: 18px; letter-spacing: 0.03em; }
.brand-copy span { margin-top: 4px; color: #9bc4c3; font-size: 10px; letter-spacing: 0.18em; }
.top-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.top-nav a { color: #dbe8e6; text-decoration: none; font-size: 14px; font-weight: 650; padding: 9px 10px; border-radius: 8px; }
.top-nav a:hover, .top-nav a[aria-current="page"] { background: #183b4d; color: var(--white); }
.header-search { display: inline-grid; place-items: center; width: 44px; height: 44px; color: var(--white); border: 1px solid #416071; border-radius: 12px; text-decoration: none; }
.header-search::before { content: ""; width: 14px; height: 14px; border: 2px solid var(--teal); border-radius: 50%; }
.header-search::after { content: ""; width: 8px; border-top: 2px solid var(--teal); transform: rotate(45deg) translate(9px, -8px); }

.rebuild-bar { background: #fff4dc; color: #513b14; border-bottom: 1px solid #ecd7a9; }
.rebuild-bar .shell { min-height: 34px; display: flex; gap: 9px; align-items: center; font-size: 12px; }
.rebuild-bar strong { font-size: 10px; letter-spacing: 0.1em; background: var(--amber); color: var(--ink); padding: 2px 7px; border-radius: 999px; }

main { min-height: 62vh; }
.home-hero { background: var(--ink); color: var(--white); padding: 68px 0 84px; position: relative; overflow: hidden; }
.home-hero::after { content: ""; position: absolute; width: 480px; height: 480px; right: -190px; top: -210px; border: 1px solid rgba(31,182,178,.25); transform: rotate(24deg); border-radius: 80px; }
.diagnostic-stage { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(350px, .82fr); gap: 70px; align-items: end; position: relative; z-index: 1; }
.eyebrow { margin: 0 0 13px; color: var(--teal-dark); font-size: 12px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.home-hero .eyebrow { color: #70dad5; }
h1, h2, h3 { line-height: 1.25; text-wrap: balance; }
h1 { margin: 0; font-size: clamp(38px, 5.6vw, 72px); letter-spacing: -.045em; }
.hero-lead { margin: 24px 0 0; max-width: 720px; color: #bfd1d6; font-size: clamp(17px, 2vw, 21px); line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button { display: inline-flex; justify-content: center; align-items: center; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 760; text-decoration: none; cursor: pointer; }
.button-primary { background: var(--teal); color: var(--ink); }
.button-primary:hover { background: #48d2cd; color: var(--ink); }
.button-quiet { background: transparent; border-color: #527080; color: var(--white); }
.button-quiet:hover { background: #17384a; color: var(--white); }
.pulse-panel { border: 1px solid #335466; background: #0e293d; border-radius: 22px; padding: 25px; box-shadow: 0 24px 70px rgba(0,0,0,.2); }
.pulse-panel-title { display: flex; justify-content: space-between; gap: 20px; color: #a9c3c8; font-size: 12px; letter-spacing: .1em; }
.pulse-rail { margin: 28px 0 24px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; align-items: end; min-height: 150px; }
.pulse-step { min-width: 0; position: relative; border-top: 4px solid var(--teal); padding-top: 14px; }
.pulse-step:nth-child(2), .pulse-step:nth-child(4) { transform: translateY(-30px); }
.pulse-step:not(:last-child)::after { content: ""; position: absolute; right: -2px; top: -4px; height: 34px; border-right: 4px solid var(--teal); }
.pulse-step b { display: block; color: var(--white); font-size: 14px; }
.pulse-step small { color: #8fb1b8; font-size: 11px; }
.pulse-dot { width: 14px; height: 14px; border: 3px solid var(--teal); background: var(--ink); border-radius: 50%; position: absolute; top: -9px; left: 0; }
.pulse-step:nth-child(3) .pulse-dot { background: var(--amber); border-color: var(--amber); }
.panel-note { border-top: 1px solid #2d4d5f; margin: 0; padding-top: 18px; color: #9fb9c0; font-size: 13px; }

.layer-strip { margin-top: -30px; position: relative; z-index: 4; }
.layer-grid { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--white); box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; }
.layer-card { min-width: 0; padding: 22px; color: var(--ink); text-decoration: none; border-right: 1px solid var(--line); }
.layer-card:last-child { border-right: 0; }
.layer-card span { display: block; color: var(--teal-dark); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.layer-card strong { display: block; margin-top: 5px; font-size: 17px; }
.layer-card:hover { background: #edf8f6; color: var(--ink); }

.section { padding: 76px 0; }
.section-compact { padding: 50px 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 420px); gap: 40px; align-items: end; margin-bottom: 30px; }
.section-head h2 { margin: 0; font-size: clamp(28px, 3.7vw, 44px); letter-spacing: -.03em; }
.section-head p { margin: 0; color: var(--muted); }
.pathway { display: grid; grid-template-columns: 1.05fr .95fr; gap: 24px; }
.path-main { padding: 38px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.path-main h3 { font-size: 28px; margin: 0 0 14px; }
.path-main p { color: var(--muted); }
.path-list { margin: 28px 0 0; padding: 0; list-style: none; counter-reset: path; }
.path-list li { counter-increment: path; display: grid; grid-template-columns: 42px 1fr; gap: 14px; padding: 15px 0; border-top: 1px solid var(--line); }
.path-list li::before { content: counter(path, decimal-leading-zero); color: var(--teal-dark); font-weight: 800; }
.tool-stack { display: grid; gap: 14px; }
.tool-teaser { display: grid; grid-template-columns: 52px 1fr auto; gap: 18px; align-items: center; background: var(--ink); color: var(--white); border-radius: 15px; padding: 20px; text-decoration: none; }
.tool-teaser:hover { background: var(--ink-2); color: var(--white); }
.tool-teaser .ordinal { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid #4f7282; border-radius: 12px; color: var(--amber); font-weight: 800; }
.tool-teaser strong { display: block; }
.tool-teaser small { color: #a9c2c7; }
.tool-teaser .arrow { color: var(--teal); font-size: 24px; }

.page-hero { padding: 56px 0 44px; background: #eaf2f1; border-bottom: 1px solid var(--line); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); }
.page-hero h1 { max-width: 930px; font-size: clamp(34px, 5vw, 58px); }
.page-lead { max-width: 780px; margin: 20px 0 0; color: #355363; font-size: 19px; }
.content-shell { display: grid; grid-template-columns: minmax(0, 760px) minmax(240px, 1fr); gap: 56px; align-items: start; }
.article-body { min-width: 0; }
.article-section { padding: 34px 0; border-bottom: 1px solid var(--line); }
.article-section:first-child { padding-top: 0; }
.article-section h2 { margin: 0 0 14px; font-size: clamp(25px, 3vw, 34px); }
.article-section p { margin: 12px 0; color: #243f50; }
.steps { margin: 22px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 38px 1fr; gap: 12px; margin: 10px 0; padding: 12px 14px; background: #eaf4f2; border-radius: 10px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; color: var(--white); background: var(--teal-dark); border-radius: 50%; font-size: 13px; font-weight: 800; }
.caution { margin-top: 20px; padding: 15px 17px; background: #fff4dc; border-left: 4px solid var(--amber); color: #58451e; }
.article-aside { position: sticky; top: 22px; display: grid; gap: 14px; }
.aside-card { padding: 20px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.aside-card h2 { margin: 0 0 9px; font-size: 15px; }
.aside-card p, .aside-card li { color: var(--muted); font-size: 13px; }
.aside-card ul { margin: 0; padding-left: 18px; }
.aside-mark { display: flex; gap: 12px; align-items: center; }
.aside-mark img { width: 42px; height: 42px; }
.faq-list { display: grid; gap: 12px; }
.faq-list details { border: 1px solid var(--line); border-radius: 12px; background: var(--white); padding: 15px 17px; }
.faq-list summary { cursor: pointer; font-weight: 740; }
.faq-list p { margin: 10px 0 0; color: var(--muted); }
.related-grid, .hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.hub-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.content-card { min-width: 0; display: flex; flex-direction: column; padding: 22px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; }
.content-card:hover { transform: translateY(-2px); border-color: var(--teal); color: var(--ink); box-shadow: 0 12px 30px rgba(11,31,51,.08); }
.content-card small { color: var(--teal-dark); font-weight: 750; }
.content-card strong { margin: 9px 0 7px; font-size: 18px; line-height: 1.45; }
.content-card p { margin: 0; color: var(--muted); font-size: 14px; }

.decision-cta { margin: 34px 0; padding: 26px; background: var(--ink); color: var(--white); border-radius: var(--radius); }
.decision-cta .eyebrow { color: #75d7d3; }
.decision-cta h2 { margin: 0; font-size: 24px; }
.decision-cta p { color: #bdd0d5; }
.decision-cta .button { background: var(--amber); color: var(--ink); }
.decision-cta .button:hover { background: #f7c76f; }

.tool-workbench { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tool-status { display: flex; justify-content: space-between; gap: 20px; padding: 15px 22px; background: var(--ink); color: #c1d2d6; font-size: 12px; }
.tool-status strong { color: #74d7d2; letter-spacing: .08em; }
.tool-form { padding: 28px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 7px; }
.field label, fieldset legend { font-weight: 720; }
.field input, .field select, .search-form input { width: 100%; min-height: 48px; border: 1px solid #9bb2b7; border-radius: 9px; background: var(--white); padding: 10px 12px; color: var(--ink); }
fieldset { margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check-option { display: flex; gap: 10px; align-items: flex-start; padding: 11px; background: #eef5f4; border-radius: 8px; }
.check-option input { width: 20px; height: 20px; flex: 0 0 auto; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.tool-actions button { border: 0; padding: 10px 17px; border-radius: 9px; background: var(--teal-dark); color: var(--white); font-weight: 750; cursor: pointer; }
.tool-actions button[type="reset"] { background: #e4eeec; color: var(--ink); }
.tool-output { margin-top: 22px; min-height: 130px; padding: 20px; border-radius: 12px; background: #eaf4f2; border-left: 5px solid var(--teal); }
.tool-output[hidden] { display: none; }
.tool-output h2 { margin: 0 0 8px; font-size: 21px; }
.tool-output pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0 0; font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.privacy-note { margin-top: 18px; color: var(--muted); font-size: 13px; }

.search-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.search-form button { border: 0; border-radius: 9px; background: var(--teal-dark); color: var(--white); padding: 10px 22px; font-weight: 750; cursor: pointer; }
.search-summary { margin: 20px 0 10px; color: var(--muted); }
.search-results { display: grid; gap: 12px; }
.search-result { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.search-result a { font-size: 19px; font-weight: 760; color: var(--ink); }
.search-result p { margin: 5px 0 0; color: var(--muted); }
.empty-state { padding: 28px; border: 1px dashed #90aaa9; background: #edf6f5; border-radius: 12px; }

.error-stage { min-height: 62vh; display: grid; place-items: center; padding: 80px 0; background: var(--ink); color: var(--white); }
.error-grid { display: grid; grid-template-columns: .7fr 1.3fr; gap: 50px; align-items: center; }
.error-code { position: relative; font-size: clamp(92px, 18vw, 210px); font-weight: 850; letter-spacing: -.1em; line-height: .8; color: transparent; -webkit-text-stroke: 2px var(--teal); }
.error-code::after { content: ""; position: absolute; width: 42%; left: 31%; top: 47%; border-top: 8px solid var(--amber); transform: rotate(-12deg); }
.error-copy h1 { font-size: clamp(36px, 5vw, 60px); }
.error-copy p { color: #bad0d4; max-width: 620px; }

.site-footer { background: #071724; color: #b8cbd0; padding: 50px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 54px; }
.footer-brand { display: flex; gap: 15px; align-items: flex-start; }
.footer-brand img { width: 58px; height: 58px; }
.footer-brand strong { display: block; color: var(--white); font-size: 18px; }
.footer-brand p { max-width: 400px; margin: 7px 0 0; font-size: 13px; }
.footer-col h2 { margin: 0 0 12px; color: var(--white); font-size: 14px; }
.footer-col a { display: block; width: fit-content; margin: 7px 0; color: #b8cbd0; font-size: 13px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 38px; padding-top: 20px; border-top: 1px solid #254052; font-size: 12px; }
.footer-bottom code { color: #72d0cc; }

@media (max-width: 1050px) {
  .header-row { grid-template-columns: auto auto; justify-content: space-between; padding: 13px 0; }
  .top-nav { grid-column: 1 / -1; justify-content: flex-start; border-top: 1px solid #2a4657; padding-top: 9px; }
  .header-search { grid-column: 2; grid-row: 1; }
  .diagnostic-stage { grid-template-columns: 1fr; gap: 42px; }
  .pulse-panel { max-width: 720px; }
  .layer-grid { grid-template-columns: repeat(3, 1fr); }
  .layer-card { border-bottom: 1px solid var(--line); }
  .pathway, .content-shell { grid-template-columns: 1fr; }
  .article-aside { position: static; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hub-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 700px) {
  body { font-size: 15px; }
  .shell { width: min(calc(100% - 28px), var(--content)); }
  .brand { min-width: 0; }
  .brand-copy span { display: none; }
  .brand-copy strong { font-size: 16px; }
  .top-nav { flex-wrap: nowrap; overflow-x: auto; margin-inline: -14px; padding-inline: 14px; scrollbar-width: thin; }
  .top-nav a { flex: 0 0 auto; }
  .rebuild-bar .shell { padding: 7px 0; align-items: flex-start; }
  .home-hero { padding: 48px 0 66px; }
  h1 { font-size: clamp(36px, 12vw, 52px); }
  .hero-lead { font-size: 17px; }
  .hero-actions { display: grid; }
  .pulse-panel { padding: 20px 16px; }
  .pulse-rail { min-height: 178px; }
  .pulse-step b { font-size: 12px; writing-mode: horizontal-tb; }
  .pulse-step small { display: none; }
  .layer-grid { grid-template-columns: 1fr; }
  .layer-card { border-right: 0; display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; padding: 15px 18px; }
  .layer-card strong { margin: 0; }
  .section { padding: 56px 0; }
  .section-head { grid-template-columns: 1fr; gap: 12px; }
  .path-main { padding: 25px 20px; }
  .tool-teaser { grid-template-columns: 45px 1fr; }
  .tool-teaser .arrow { display: none; }
  .page-hero { padding: 42px 0 34px; }
  .page-hero h1 { font-size: clamp(32px, 10vw, 45px); }
  .page-lead { font-size: 17px; }
  .article-aside, .related-grid, .hub-grid, .field-grid, .check-grid { grid-template-columns: 1fr; }
  .article-section { padding: 28px 0; }
  .tool-form { padding: 20px 16px; }
  .tool-status { align-items: flex-start; flex-direction: column; gap: 4px; }
  .search-form { grid-template-columns: 1fr; }
  .error-grid { grid-template-columns: 1fr; gap: 30px; }
  .error-code { font-size: 100px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; }
}

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

.mobile-menu-toggle,
.mobile-nav-panel { display: none; }
.mobile-menu-toggle {
  min-width: 70px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #416071;
  border-radius: 10px;
  background: #17384a;
  color: var(--white);
  font: inherit;
  font-size: 14px;
  font-weight: 760;
  cursor: pointer;
}
.mobile-nav-panel[hidden] { display: none !important; }
@media (max-width: 700px) {
  .header-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 13px 0;
    align-items: center;
  }
  .top-nav.desktop-nav,
  .header-search { display: none; }
  .mobile-menu-toggle { display: inline-flex; grid-column: 2; grid-row: 1; }
  .mobile-nav-panel:not([hidden]) { display: block; grid-column: 1 / -1; width: 100%; }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
  }
  .mobile-nav a {
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 9px 11px;
    border: 1px solid #416071;
    border-radius: 8px;
    background: #102c3f;
    color: #dbe8e6;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
  }
  .mobile-nav a[href="/search/"] { border-color: var(--teal); color: var(--white); }
}
