/* Theme after rddefle.com: white and #f5f5f5 bands, #444 body text, #232332
   headings, the logo's #651416 burgundy as the accent (the #27cbc0 in that
   site's stylesheet is template residue it never shows), centred section
   titles with a short rule, and a white hero card with an inset outline. System fonts only: the site must work
   offline on a factory network and Google Fonts is unreachable in mainland China. */
:root {
  --accent: #651416;
  --accent-dark: #4a0e10;
  --accent-soft: #f6eced;
  --ink: #232332;
  --text: #444;
  --muted: #777;
  --line: #e5e5e5;
  --band: #f5f5f5;
  --card: #fff;
  --warn: #c0392b;
  --warn-soft: #fdf2f1;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 24px rgba(35, 35, 50, .06);
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, "Liberation Mono", monospace;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 15px/1.8 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--ink); font-weight: 500; line-height: 1.35; margin: 0 0 .6em; }
p { margin: 0 0 1em; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--accent); }
code, pre, .mono { font-family: var(--mono); }
code {
  background: var(--band);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: .88em;
  overflow-wrap: anywhere;
  padding: .05em .4em;
}
strong { color: var(--ink); font-weight: 600; }

.container { margin: 0 auto; max-width: 1170px; padding: 0 16px; }
.container.narrow { max-width: 820px; }

/* ---------- header ---------- */
.site-header {
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid transparent;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  transition: border-color .2s, box-shadow .2s;
  z-index: 50;
}
.site-header.scrolled { border-color: var(--line); box-shadow: 0 2px 12px rgba(0, 0, 0, .05); }
.header-inner { align-items: center; display: flex; height: var(--header-h); justify-content: space-between; }

.brand { align-items: center; color: var(--ink); display: inline-flex; gap: 12px; }
.brand:hover { color: var(--ink); }
.brand-logo { display: block; height: 34px; width: auto; }
.brand-text { display: flex; flex-direction: column; font-size: 15px; font-weight: 600; letter-spacing: 3px; line-height: 1.2; }
.brand-text small { color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 2px; }

.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 1px;
  padding: 8px 14px;
  position: relative;
}
.site-nav a::after {
  background: var(--accent);
  bottom: 2px;
  content: "";
  height: 2px;
  left: 14px;
  position: absolute;
  right: 14px;
  transform: scaleX(0);
  transition: transform .2s;
}
.site-nav a:hover::after, .site-nav a.active::after { transform: scaleX(1); }

.nav-toggle {
  background: none;
  border: 0;
  cursor: pointer;
  display: none;
  height: 40px;
  padding: 8px;
  width: 44px;
}
.nav-toggle span { background: var(--ink); display: block; height: 2px; margin: 5px 0; transition: .2s; }

/* ---------- hero ---------- */
.hero {
  align-items: center;
  background:
    radial-gradient(circle at 78% 30%, rgba(101, 20, 22, .10), transparent 45%),
    radial-gradient(circle at 15% 85%, rgba(35, 35, 50, .08), transparent 40%),
    linear-gradient(135deg, #f4efef 0%, #f7f7f7 55%, #efe9e9 100%);
  display: flex;
  min-height: 640px;
  overflow: hidden;
  padding: calc(var(--header-h) + 48px) 0 64px;
  position: relative;
}
.hero-bg {
  background-image:
    linear-gradient(rgba(35, 35, 50, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 35, 50, .05) 1px, transparent 1px);
  background-size: 40px 40px;
  inset: 0;
  position: absolute;
}
.hero-chip {
  color: rgba(101, 20, 22, .14);
  height: 560px;
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%) rotate(-8deg);
  width: 560px;
}
.hero-inner { position: relative; text-align: center; width: 100%; }
.hero-card {
  background: rgba(255, 255, 255, .9);
  display: inline-block;
  max-width: 640px;
  outline: 1px solid rgba(0, 0, 0, .2);
  outline-offset: -15px;
  padding: 64px 56px;
}
.hero-card h4 { color: #000; font-size: 13px; font-weight: 400; letter-spacing: 5px; margin-bottom: 18px; }
.hero-card h1 { font-size: 40px; font-weight: 500; letter-spacing: 4px; margin-bottom: 16px; }
.hero-card p { color: var(--text); margin: 0 auto 28px; max-width: 440px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero-meta { color: var(--muted) !important; font-size: 13px; letter-spacing: 1px; margin: 24px 0 0 !important; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-block;
  font-size: 14px;
  letter-spacing: 2px;
  padding: 12px 30px;
  text-align: center;
  transition: background .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-block { display: block; margin: 8px 0 12px; width: 100%; }
.btn[aria-disabled="true"] {
  background: #cfc9c9;
  border-color: #cfc9c9;
  color: #fff;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- sections ---------- */
.section { padding: 90px 0; }
.section.gray { background: var(--band); }

.area-title { margin: 0 auto 56px; max-width: 640px; text-align: center; }
.area-title h2 { display: inline-block; font-size: 28px; letter-spacing: 2px; margin-bottom: 20px; padding-bottom: 16px; position: relative; }
.area-title h2::after {
  background: #444;
  bottom: 0;
  content: "";
  height: 2px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  width: 40px;
}
.area-title p { color: var(--muted); margin: 0; }

.grid { display: grid; gap: 30px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 32px;
}
.card-label { color: var(--accent-dark); font-size: 12px; letter-spacing: 4px; margin-bottom: 10px; }
.card h3 { font-size: 20px; }
.file-name { font-family: var(--mono); font-size: 16px !important; word-break: break-all; }
.sub { font-size: 15px; margin-top: 24px; }

.facts { border-top: 1px solid var(--line); list-style: none; margin: 16px 0 20px; padding: 0; }
.facts li { border-bottom: 1px solid var(--line); display: flex; gap: 16px; justify-content: space-between; padding: 10px 0; }
.facts span { color: var(--muted); flex: none; }
.facts b { color: var(--ink); font-weight: 500; text-align: right; word-break: break-all; }
.facts b.mono { font-size: 13px; }

.hint { color: var(--muted); font-size: 13px; text-align: center; }
.note { color: var(--muted); font-size: 13px; margin-top: 16px; }

.checksum { background: var(--band); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 14px; padding: 12px 14px; }
.checksum-head { align-items: center; color: var(--muted); display: flex; font-size: 12px; gap: 12px; justify-content: space-between; letter-spacing: 1px; margin-bottom: 6px; }
.checksum-head .copy { flex: none; white-space: nowrap; }
.checksum code { background: none; border: 0; color: var(--ink); display: block; font-size: 12.5px; line-height: 1.6; padding: 0; }
.copy {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  padding: 2px 10px;
}
.copy:hover { border-color: var(--accent); color: var(--accent-dark); }
.copy.done { background: var(--accent); border-color: var(--accent); color: #fff; }

.pkg-table { border-collapse: collapse; font-size: 13px; width: 100%; }
.pkg-table td { border-bottom: 1px solid var(--line); padding: 7px 0; vertical-align: top; }
.pkg-table td:first-child { color: var(--ink); padding-right: 12px; }
.pkg-table td:last-child { color: var(--muted); font-family: var(--mono); font-size: 12px; text-align: right; word-break: break-all; }

/* ---------- prepare ---------- */
.feature {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 26px 26px;
  text-align: center;
  transition: transform .2s, box-shadow .2s;
}
.feature:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.feature .icon { color: var(--accent); height: 48px; margin-bottom: 18px; width: 48px; }
.feature h3 { font-size: 17px; letter-spacing: 1px; }
.feature p { color: var(--muted); font-size: 14px; margin: 0; }
.feature .tool-link { display: inline-block; margin-top: 6px; }

/* ---------- steps ---------- */
.steps { counter-reset: none; list-style: none; margin: 0 auto; max-width: 900px; padding: 0; }
.step { display: grid; gap: 28px; grid-template-columns: 72px 1fr; padding-bottom: 44px; position: relative; }
.step::before {
  background: var(--line);
  bottom: 0;
  content: "";
  left: 35px;
  position: absolute;
  top: 64px;
  width: 2px;
}
.step:last-child::before { display: none; }
.step-num {
  align-items: center;
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--accent-dark);
  display: flex;
  font-size: 18px;
  font-weight: 600;
  height: 64px;
  justify-content: center;
  letter-spacing: 1px;
  width: 64px;
}
.step-body { min-width: 0; padding-top: 14px; }
.step-body h3 { font-size: 20px; }
.substeps { margin: 0 0 1em; padding-left: 1.3em; }
.substeps li { margin-bottom: 4px; }
.ui-label {
  background: var(--accent-soft);
  border-radius: 3px;
  color: var(--accent);
  font-size: .92em;
  padding: .05em .45em;
  white-space: nowrap;
}

/* RKDevTool schematic */
.tool-mock { border: 1px solid #c8c8c8; border-radius: 6px; box-shadow: var(--shadow); font-size: 13px; margin: 18px 0 0; overflow: hidden; }
.tool-titlebar { background: #f0f0f0; border-bottom: 1px solid #d6d6d6; color: #333; padding: 6px 12px; }
.tool-body { background: #f7f7f7; display: grid; gap: 10px; grid-template-columns: 1.6fr 1fr; padding: 12px; }
.tool-left { background: #f0f0f0; border: 1px solid #d6d6d6; min-width: 0; padding: 10px; }
.tool-tabs { display: flex; gap: 2px; margin-bottom: 10px; }
.tool-tabs span { background: #e6e6e6; border: 1px solid #d0d0d0; padding: 2px 10px; }
.tool-tabs span.active { background: #fff; border-bottom-color: #fff; color: #000; }
.tool-buttons { display: flex; gap: 8px; margin-bottom: 12px; }
.tool-btn { background: #fafafa; border: 1px solid #c8c8c8; border-radius: 3px; padding: 5px 18px; position: relative; }
.tool-btn.hl { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(101, 20, 22, .2); }
.tool-btn i {
  background: var(--accent);
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  height: 18px;
  line-height: 18px;
  position: absolute;
  right: -9px;
  text-align: center;
  top: -9px;
  width: 18px;
}
.tool-row { align-items: center; display: flex; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 8px; }
.tool-row span { color: #555; }
.tool-row b { background: #fff; border: 1px solid #d0d0d0; font-weight: 400; padding: 0 8px; }
.tool-path { flex: 1 1 0; font-family: var(--mono); font-size: 11.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-status { background: #fff; border: 1px solid #d0d0d0; font-weight: 600; margin-top: 10px; padding: 6px; text-align: center; }
.tool-log { background: #fff; border: 1px solid #d0d0d0; font-family: var(--mono); font-size: 12px; min-width: 0; padding: 8px 10px; }
.tool-log .muted { color: #aaa; }

.callout { border-left: 3px solid var(--accent); border-radius: var(--radius); margin: 16px auto 0; max-width: 900px; padding: 22px 26px; }
.callout.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.callout h3 { color: var(--warn); font-size: 17px; }
.callout ul { margin: 0; padding-left: 1.2em; }
.callout li { margin-bottom: 6px; }

/* ---------- verify ---------- */
.check-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; position: relative; }
.check {
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: block;
  height: 36px;
  margin-bottom: 16px;
  position: relative;
  width: 36px;
}
.check::after {
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  content: "";
  height: 14px;
  left: 12px;
  position: absolute;
  top: 6px;
  transform: rotate(45deg);
  width: 7px;
}
.check-card h3 { font-size: 17px; }
.check-card p { color: var(--muted); font-size: 14px; margin: 0; }

details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

.engineer { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 30px; padding: 0 26px; }
.engineer summary { color: var(--ink); font-weight: 500; padding: 18px 0; }
.engineer summary::before { color: var(--accent-dark); content: "+ "; }
.engineer[open] summary::before { content: "− "; }
.engineer pre {
  background: var(--ink);
  border-radius: var(--radius);
  color: #e8ecec;
  font-size: 12.5px;
  line-height: 1.7;
  margin: 0 0 24px;
  overflow-x: auto;
  padding: 18px 20px;
}
.engineer pre code { background: none; border: 0; color: inherit; padding: 0; word-break: normal; }

/* ---------- faq ---------- */
.faq { border-bottom: 1px solid var(--line); }
.faq summary { color: var(--ink); font-size: 16px; padding: 20px 36px 20px 0; position: relative; }
.faq summary::after {
  color: var(--accent-dark);
  content: "+";
  font-size: 22px;
  line-height: 1;
  position: absolute;
  right: 4px;
  top: 22px;
}
.faq[open] summary::after { content: "−"; }
.faq p { color: var(--text); padding: 0 0 20px; margin: 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #aab; padding: 44px 0; }
.footer-inner { align-items: flex-end; display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.footer-brand { color: #fff; margin-bottom: 10px; }
.footer-brand .brand-logo { filter: brightness(0) invert(1); }
.footer-brand .brand-text small { color: #99a; }
.site-footer p { font-size: 13px; margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 991px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  :root { --header-h: 64px; }
  body { font-size: 14.5px; }
  .nav-toggle { display: block; flex: none; }
  .brand { gap: 8px; min-width: 0; }
  .brand-logo { height: 26px; }
  .brand-text { font-size: 12px; letter-spacing: 1px; white-space: nowrap; }
  .brand-text small { font-size: 11px; letter-spacing: 1px; }
  .site-nav {
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .06);
    flex-direction: column;
    left: 0;
    padding: 8px 16px 16px;
    position: absolute;
    right: 0;
    top: var(--header-h);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 4px; }
  .site-nav a::after { left: 4px; right: auto; width: 32px; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .hero { min-height: 0; padding: calc(var(--header-h) + 28px) 0 40px; }
  .hero-chip { height: 360px; opacity: .6; right: -140px; width: 360px; }
  .hero-card { padding: 44px 26px; }
  .hero-card h1 { font-size: 28px; letter-spacing: 2px; }
  .hero-card h4 { letter-spacing: 3px; }

  .section { padding: 64px 0; }
  .area-title { margin-bottom: 40px; }
  .area-title h2 { font-size: 24px; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .card { padding: 26px 20px; }

  .step { gap: 16px; grid-template-columns: 48px 1fr; }
  .step::before { left: 23px; top: 48px; }
  .step-num { font-size: 14px; height: 48px; width: 48px; }
  .step-body { padding-top: 8px; }

  .tool-body { grid-template-columns: 1fr; }
  .facts li { flex-direction: column; gap: 2px; }
  .facts b { text-align: left; }
}
