:root {
  --canvas: #f2f7f6;
  --canvas-deep: #e4efee;
  --ink: #0a2d35;
  --ink-soft: #173f47;
  --muted: #5f7478;
  --line: rgba(10, 45, 53, .17);
  --line-strong: rgba(10, 45, 53, .42);
  --blue: #2f63ff;
  --blue-dark: #1f46bf;
  --aqua: #bdebf0;
  --coral: #ff7050;
  --mint: #c8ead9;
  --white: #ffffff;
  --font-display: "Bahnschrift SemiCondensed", "Arial Narrow", "Microsoft YaHei UI", sans-serif;
  --font-body: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, monospace;
  --shadow: 9px 10px 0 var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body {
  margin: 0;
  background-color: var(--canvas);
  background-image:
    linear-gradient(rgba(10,45,53,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10,45,53,.045) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(47,99,255,.35); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header {
  width: min(1180px, calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(242,247,246,.93);
  position: relative;
  z-index: 20;
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 7px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 12px);
  opacity: .28;
  pointer-events: none;
}
.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; font-family: var(--font-display); font-size: 18px; font-weight: 800; letter-spacing: -.025em; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: var(--white); background: var(--blue); border: 2px solid var(--ink); border-radius: 4px 50% 50% 50%; box-shadow: 3px 3px 0 var(--ink); font-family: var(--font-mono); font-size: 15px; }
.site-header nav { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.site-header nav a { min-height: 42px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; }
.site-header nav a:hover { color: var(--blue-dark); background: var(--white); }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.country-picker select, .language-button { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--white); color: var(--ink); padding: 0 15px; outline: none; font-weight: 700; }
.country-picker select:focus, .language-button:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,99,255,.15); }
.language-button { min-width: 54px; }

.hero {
  width: min(1180px, calc(100% - 40px));
  min-height: 500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  align-items: center;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--line-strong);
}
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18px;
  background:
    linear-gradient(var(--ink),var(--ink)) left bottom / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 14px);
  opacity: .36;
}
.hero-copy { padding: 76px 0 70px; position: relative; z-index: 2; }
.eyebrow, .section-kicker { margin: 0 0 22px; color: var(--blue-dark); font-family: var(--font-mono); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow > span { width: 28px; height: 3px; background: var(--coral); }
.hero h1 { margin: 0; max-width: 760px; font-family: var(--font-display); font-size: clamp(54px, 6.8vw, 96px); line-height: 1.02; letter-spacing: 0; font-weight: 850; }
.hero .eyebrow { color: #ef4f2f; }
.hero h1 em { display: inline-block; margin-top: .05em; color: #f15432; font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, SimSun, serif; font-size: 1.14em; font-style: normal; font-weight: 400; letter-spacing: -.055em; }
.hero-intro { max-width: 650px; margin: 30px 0; font-size: 17px; line-height: 1.8; color: var(--muted); }
.country-status { max-width: 100%; width: fit-content; display: flex; align-items: center; gap: 11px; padding: 8px 9px 8px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--white); box-shadow: 4px 4px 0 rgba(10,45,53,.16); }
.status-flag { font-size: 24px; }
.country-status small, .country-status strong { display: block; }
.country-status small { color: var(--muted); font-size: 10px; }
.country-status strong { font-size: 14px; }
.system-pill { margin-left: 4px; padding: 8px 12px; border-radius: 999px; background: var(--aqua); color: var(--ink); font: 800 10px var(--font-mono); }

.atlas-orb { position: relative; justify-self: center; width: min(35vw, 390px); aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 50%; background: linear-gradient(90deg,transparent 49.7%,rgba(10,45,53,.2) 50%,transparent 50.3%), linear-gradient(transparent 49.7%,rgba(10,45,53,.2) 50%,transparent 50.3%), radial-gradient(circle at 66% 28%,var(--aqua) 0 10%,transparent 10.5%), radial-gradient(circle at 33% 58%,rgba(47,99,255,.17) 0 22%,transparent 22.5%), var(--white); box-shadow: inset 0 0 0 34px rgba(200,234,217,.36), 12px 14px 0 rgba(10,45,53,.1); }
.atlas-orb::before, .atlas-orb::after { content: ""; position: absolute; inset: 11% 33%; border: 1px solid rgba(10,45,53,.25); border-radius: 50%; }
.atlas-orb::after { inset: 33% 11%; }
.orbit-line { position: absolute; inset: -8%; border: 1px dashed rgba(10,45,53,.32); border-radius: 50%; transform: rotate(-18deg); }
.orb-label { position: absolute; z-index: 2; display: grid; place-items: center; width: 56px; height: 56px; border: 2px solid var(--ink); border-radius: 50%; background: var(--blue); color: var(--white); font: 800 13px var(--font-mono); box-shadow: 4px 5px 0 var(--ink); }
.orb-label.one { left: -3%; top: 24%; }
.orb-label.two { right: -1%; top: 10%; background: var(--coral); color: var(--ink); }
.orb-label.three { right: -6%; bottom: 20%; background: var(--ink); }
.orb-label.four { left: 13%; bottom: -5%; background: var(--mint); color: var(--ink); }

.converter-shell { width: min(1180px, calc(100% - 40px)); min-height: 600px; margin: 62px auto 120px; display: grid; grid-template-columns: 270px 1fr; overflow: hidden; border: 2px solid var(--ink); border-radius: 22px; background: var(--white); box-shadow: var(--shadow); }
.category-panel { min-width: 0; padding: 28px 18px; border-right: 2px solid var(--ink); background: var(--ink); color: var(--white); }
.panel-title-row { display: flex; justify-content: space-between; align-items: center; padding: 0 7px; font-family: var(--font-display); font-size: 19px; font-weight: 800; }
.category-count { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; background: var(--blue); color: white; font: 800 11px var(--font-mono); }
.search-box { min-height: 44px; margin: 22px 0 15px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid rgba(255,255,255,.24); border-radius: 10px; background: rgba(255,255,255,.1); }
.search-box span { color: var(--aqua); }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--white); font-size: 13px; }
.search-box input::placeholder { color: rgba(255,255,255,.58); }
.category-list { display: grid; gap: 5px; }
.category-list button { min-height: 50px; width: 100%; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 8px 9px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: rgba(255,255,255,.66); text-align: left; }
.category-list button:hover { border-color: rgba(255,255,255,.2); color: var(--white); background: rgba(255,255,255,.08); }
.category-list button.active { border-color: var(--aqua); background: var(--aqua); color: var(--ink); }
.category-icon { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid currentColor; border-radius: 8px; font-family: var(--font-mono); }
.category-list button.active .category-icon { color: var(--white); background: var(--blue); border-color: var(--ink); }
.category-arrow { font-size: 19px; }

.converter-panel { min-width: 0; padding: 42px 46px; display: flex; flex-direction: column; }
.converter-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.converter-heading h2 { margin: 7px 0 0; font-family: var(--font-display); font-size: clamp(34px,4vw,54px); letter-spacing: -.045em; }
.section-kicker { display: block; margin-bottom: 8px; }
.country-mini { flex: 0 0 auto; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--canvas); color: var(--muted); font: 700 11px var(--font-mono); }
.conversion-workspace { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 54px minmax(0,1fr); align-items: center; gap: 12px; margin: 50px 0 34px; }
.unit-card { min-width: 0; padding: 23px; border: 1px solid var(--line-strong); border-radius: 15px; background: var(--canvas); }
.unit-card label { display: block; margin-bottom: 14px; color: var(--muted); font-size: 12px; font-weight: 750; }
.unit-card input, .unit-card output { width: 100%; min-width: 0; display: block; overflow: hidden; border: 0; background: transparent; color: var(--ink); font-family: var(--font-display); font-size: clamp(38px,5vw,68px); font-weight: 850; line-height: 1.1; letter-spacing: -.045em; outline: none; text-overflow: ellipsis; white-space: nowrap; }
.unit-card output { color: var(--aqua); }
.unit-card select { width: 100%; min-height: 48px; margin-top: 18px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--white); color: var(--ink); outline: none; }
.result-card { background: var(--ink); color: var(--white); }
.result-card label { color: rgba(255,255,255,.66); }
.result-card select { background: var(--ink-soft); border-color: rgba(255,255,255,.32); color: white; }
.result-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.copy-button { min-height: 38px; padding: 0 10px; border: 1px solid rgba(255,255,255,.22); border-radius: 7px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.82); font-size: 11px; }
.swap-button { width: 50px; height: 50px; border: 2px solid var(--ink); border-radius: 50%; background: var(--coral); color: var(--ink); font-size: 22px; box-shadow: 3px 3px 0 var(--ink); transition: transform .2s ease; }
.swap-button:hover { transform: rotate(180deg); }
.equation-strip { display: flex; align-items: center; gap: 16px; min-width: 0; padding-top: 23px; border-top: 1px solid var(--line); color: var(--muted); font: 12px var(--font-mono); }
.equation-strip strong { color: var(--blue-dark); }
.equation-line { flex: 1; min-width: 24px; height: 1px; background: var(--line); }

.tools-directory { width: min(1180px, calc(100% - 40px)); margin: 0 auto 120px; }
.directory-heading { max-width: 740px; margin-bottom: 38px; }
.directory-heading h2, .guide-copy h2, .value-heading h2, .faq-section h2 { margin: 12px 0 19px; font-family: var(--font-display); font-size: clamp(40px,5vw,70px); line-height: .98; letter-spacing: -.05em; }
.directory-heading p, .guide-copy p, .value-heading p { color: var(--muted); line-height: 1.8; }
.tool-link-grid { display: grid; grid-template-columns: repeat(3,1fr); border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); background: var(--white); }
.tool-link-grid a { min-height: 160px; padding: 21px; display: flex; flex-direction: column; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transition: background .18s ease, color .18s ease, transform .18s ease; }
.tool-link-grid a:hover { background: var(--blue); color: var(--white); transform: translate(-3px,-3px); box-shadow: 3px 3px 0 var(--ink); }
.tool-link-grid span { color: var(--blue-dark); font: 800 11px var(--font-mono); }
.tool-link-grid a:hover span { color: var(--aqua); }
.tool-link-grid b { margin-top: auto; font-family: var(--font-display); font-size: 23px; letter-spacing: -.025em; }
.tool-link-grid small { margin-top: 7px; color: var(--muted); line-height: 1.5; }
.tool-link-grid a:hover small { color: rgba(255,255,255,.74); }

.country-guide { width: min(1180px, calc(100% - 40px)); margin: 0 auto 120px; display: grid; grid-template-columns: .78fr 1.22fr; gap: 68px; align-items: end; }
.country-picker.large select { width: 100%; min-height: 54px; margin-top: 20px; border-radius: 10px; background: var(--white); }
.local-unit-grid { display: grid; grid-template-columns: repeat(2,1fr); border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); background: var(--white); }
.local-unit-grid article { min-height: 166px; padding: 21px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); display: flex; flex-direction: column; }
.local-unit-grid article > span { font: 800 9px var(--font-mono); color: var(--blue-dark); letter-spacing: .09em; }
.local-unit-grid article p { margin: auto 0 8px; color: var(--muted); }
.local-unit-grid article strong { font-family: var(--font-display); font-size: 38px; letter-spacing: -.04em; }
.country-guide-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 9px; margin-top: -38px; }
.country-guide-links a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--white); color: var(--muted); font-size: 13px; font-weight: 750; }
.country-guide-links a:hover { border-color: var(--blue); color: var(--blue-dark); }

.value-section { padding: 108px max(20px,calc((100vw - 1180px)/2)); background: var(--ink); color: var(--white); position: relative; overflow: hidden; }
.value-section::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(189,235,240,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(189,235,240,.07) 1px,transparent 1px); background-size: 48px 48px; pointer-events: none; }
.value-heading, .value-grid { position: relative; z-index: 1; }
.value-heading { max-width: 760px; }
.value-heading p { color: rgba(255,255,255,.67); }
.value-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 50px; }
.value-grid article { min-height: 220px; padding: 26px; border: 1px solid rgba(255,255,255,.25); border-radius: 14px; background: rgba(255,255,255,.04); }
.value-grid article > span { display: inline-flex; min-height: 29px; align-items: center; padding: 0 8px; border-radius: 6px; background: var(--aqua); color: var(--ink); font: 800 10px var(--font-mono); }
.value-grid h3 { margin: 62px 0 11px; font-family: var(--font-display); font-size: 26px; }
.value-grid p { margin: 0; color: rgba(255,255,255,.64); line-height: 1.7; }

.faq-section { width: min(900px, calc(100% - 40px)); margin: 118px auto; }
.faq-list { border-top: 2px solid var(--ink); }
.faq-list details { border-bottom: 1px solid var(--line-strong); }
.faq-list summary { list-style: none; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 0; font-size: 17px; font-weight: 800; cursor: pointer; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary b { flex: 0 0 auto; font-size: 26px; font-weight: 400; color: var(--blue); transition: transform .2s ease; }
.faq-list details[open] summary b { transform: rotate(45deg); }
.faq-list details p { margin: -4px 0 24px; max-width: 740px; color: var(--muted); line-height: 1.8; }

footer { width: min(1180px, calc(100% - 40px)); min-height: 130px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; border-top: 2px solid var(--ink); }
footer p { margin: 0; color: var(--muted); font-size: 13px; }
footer > span { justify-self: end; color: var(--muted); font: 11px var(--font-mono); }
.footer-center { text-align: center; }
.footer-center nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 13px; margin-top: 9px; color: var(--muted); font-size: 11px; }
.footer-center nav a { min-height: 30px; display: inline-flex; align-items: center; }
.footer-center nav a:hover { color: var(--blue-dark); }
noscript { display: block; padding: 12px; text-align: center; background: #ffe4dc; color: #73301e; }

@media (max-width: 900px) {
  html { scroll-padding-top: 132px; }
  .site-header { width: 100%; min-height: auto; padding: 11px 20px 9px; grid-template-columns: 1fr auto; gap: 8px 14px; position: sticky; top: 0; border-bottom: 1px solid var(--line); box-shadow: 0 8px 22px rgba(10,45,53,.08); }
  .site-header::after { bottom: -5px; height: 5px; }
  .site-header nav { grid-column: 1 / -1; width: 100%; justify-content: flex-start; gap: 4px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; scroll-snap-type: x proximity; }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav a { flex: 0 0 auto; min-height: 40px; padding: 0 11px; border: 1px solid var(--line); background: var(--white); scroll-snap-align: start; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-copy { padding-bottom: 38px; }
  .atlas-orb { position: absolute; right: -85px; bottom: 55px; width: 300px; opacity: .42; }
  .converter-shell { grid-template-columns: 1fr; min-height: auto; }
  .category-panel { padding: 22px 18px 18px; border-right: 0; border-bottom: 2px solid var(--ink); }
  .search-box { max-width: 520px; margin: 16px 0 12px; }
  .category-list { display: flex; gap: 7px; overflow-x: auto; padding: 0 0 5px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .category-list::-webkit-scrollbar { display: none; }
  .category-list button { flex: 0 0 auto; width: auto; min-width: max-content; min-height: 48px; grid-template-columns: 30px auto; padding-right: 14px; scroll-snap-align: start; }
  .category-arrow { display: none; }
  .conversion-workspace { grid-template-columns: 1fr; margin-top: 34px; }
  .swap-button { justify-self: center; transform: rotate(90deg); }
  .swap-button:hover { transform: rotate(270deg); }
  .country-guide { grid-template-columns: 1fr; gap: 36px; }
  .country-guide-links { margin-top: -16px; }
  .tool-link-grid { grid-template-columns: repeat(2,1fr); }
  .value-grid { grid-template-columns: 1fr; }
  .value-grid article { min-height: 180px; }
  .value-grid h3 { margin-top: 42px; }
}

@media (max-width: 620px) {
  body { background-size: 32px 32px; }
  .site-header { padding-inline: 12px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 35px; height: 35px; box-shadow: 2px 2px 0 var(--ink); }
  .compact { display: none; }
  .language-button { min-width: 52px; padding-inline: 12px; }
  .site-header nav { margin-top: 2px; }
  .site-header nav a { font-size: 12px; }
  .hero, .tools-directory, .country-guide, footer { width: min(100% - 24px,1180px); }
  .hero-copy { padding: 52px 0 44px; }
  .hero h1 { max-width: 350px; font-size: clamp(44px,13.2vw,62px); line-height: 1.04; letter-spacing: 0; }
  .hero-intro { max-width: 94%; margin: 24px 0; font-size: 15px; line-height: 1.75; }
  .eyebrow { margin-bottom: 17px; }
  .system-pill { display: none; }
  .country-status { padding-right: 13px; }
  .atlas-orb { right: -105px; bottom: 32px; width: 245px; }
  .orb-label { width: 48px; height: 48px; font-size: 11px; box-shadow: 3px 3px 0 var(--ink); }
  .converter-shell { width: min(100% - 16px,1180px); margin: 34px auto 86px; border-radius: 18px; box-shadow: 5px 6px 0 var(--ink); }
  .category-panel { padding: 18px 13px 14px; }
  .panel-title-row { font-size: 17px; }
  .search-box { margin-top: 13px; }
  .converter-panel { padding: 27px 14px 24px; }
  .converter-heading { display: block; }
  .converter-heading h2 { font-size: 35px; }
  .country-mini { display: inline-flex; margin-top: 14px; }
  .conversion-workspace { margin: 28px 0 28px; gap: 10px; }
  .unit-card { padding: 18px 15px; border-radius: 13px; }
  .unit-card input, .unit-card output { font-size: clamp(38px,14vw,54px); }
  .unit-card select { min-height: 50px; }
  .copy-button { min-height: 42px; }
  .swap-button { width: 48px; height: 48px; }
  .equation-strip { flex-wrap: wrap; gap: 8px 10px; font-size: 11px; }
  .equation-line { display: none; }
  .equation-strip strong { width: 100%; }
  .tools-directory { margin-bottom: 86px; }
  .directory-heading { margin-bottom: 28px; }
  .directory-heading h2, .guide-copy h2, .value-heading h2, .faq-section h2 { font-size: clamp(38px,12vw,54px); }
  .tool-link-grid { grid-template-columns: 1fr; }
  .tool-link-grid a { min-height: 132px; padding: 18px; }
  .tool-link-grid b { font-size: 21px; }
  .country-guide { margin-bottom: 86px; }
  .country-picker.large select { min-height: 52px; }
  .local-unit-grid article { min-height: 140px; padding: 17px; }
  .local-unit-grid article strong { font-size: 31px; }
  .country-guide-links { gap: 7px; }
  .country-guide-links a { flex: 1 1 calc(50% - 7px); justify-content: center; }
  .value-section { padding-top: 82px; padding-bottom: 82px; }
  .value-section::before { background-size: 32px 32px; }
  .value-grid { margin-top: 38px; }
  .faq-section { width: min(100% - 24px,900px); margin: 86px auto; }
  .faq-list summary { min-height: 68px; font-size: 15px; }
  footer { min-height: 180px; grid-template-columns: 1fr; justify-items: center; gap: 14px; padding: 28px 0; text-align: center; }
  footer > span { justify-self: center; }
  .footer-center { display: block; }
}

@media (max-width: 430px) {
  .local-unit-grid { grid-template-columns: 1fr; }
  .country-guide-links a { flex-basis: 100%; }
  .result-label-row { align-items: flex-start; }
}

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