:root {
  --bg: #f5f1e8;
  --bg-deep: #efe6d8;
  --surface: rgba(255, 252, 246, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --ink: #1d2b2f;
  --muted: #607173;
  --line: rgba(17, 53, 57, 0.1);
  --accent: #0d5b55;
  --accent-strong: #083f3b;
  --accent-soft: #d5ebe7;
  --accent-wash: rgba(13, 91, 85, 0.14);
  --shadow-lg: 0 26px 60px rgba(32, 43, 45, 0.14);
  --shadow-md: 0 14px 36px rgba(32, 43, 45, 0.1);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max-width: 1180px;
  --sans: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "STZhongsong", "Songti SC", "Noto Serif SC", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 28%),
    radial-gradient(circle at top right, rgba(13, 91, 85, 0.08), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, #f7f4ee 45%, #f1eadf 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(13, 91, 85, 0.08) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 82%);
  opacity: 0.4;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.section-shell {
  width: min(var(--max-width), calc(100vw - 32px));
  margin: 0 auto;
}

main > section[id] {
  scroll-margin-top: 110px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 16px 0 0;
}

.header-shell {
  width: min(var(--max-width), calc(100vw - 32px));
  margin: 0 auto;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(252, 248, 241, 0.7);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(28, 40, 41, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fdfaf5;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-text {
  font-weight: 700;
  letter-spacing: 0.08em;
}

.top-nav {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.top-nav a {
  position: relative;
}

.top-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms ease;
}

.top-nav a:hover::after,
.top-nav a:focus-visible::after {
  transform: scaleX(1);
}

.converter-card,
.result-panel,
.popular-card,
.faq-list details {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0.01em;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.shortcut-chip,
.preset-chip,
.category-tab,
.swap-btn {
  border: 0;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fdfaf5;
  box-shadow: 0 16px 28px rgba(13, 91, 85, 0.22);
}

.secondary-btn,
.ghost-btn {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(15, 64, 59, 0.1);
}

.shortcut-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 28px 0 12px;
}

.shortcut-chip,
.preset-chip,
.category-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(13, 91, 85, 0.12);
  color: var(--ink);
}

.shortcut-chip:hover,
.preset-chip:hover,
.category-tab:hover,
.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.popular-action:hover,
.swap-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(32, 43, 45, 0.08);
}

.section-heading {
  max-width: 66ch;
  margin-bottom: 22px;
}

.section-heading h2 {
  max-width: 18ch;
  font-size: clamp(1.55rem, 2.1vw, 2.25rem);
  line-height: 1.26;
  letter-spacing: 0.02em;
}

.section-heading p:not(.eyebrow) {
  max-width: 56ch;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.85;
}

.section-heading p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.converter-section {
  padding: 8px 0 0;
}

.popular-section,
.faq-section {
  padding: 34px 0 0;
}

.converter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 20px;
  align-items: start;
}

.converter-card,
.result-panel {
  border-radius: 30px;
  padding: 28px;
}

.converter-topline h1,
.converter-topline h3,
.result-card h3,
.common-headline h3,
.popular-card strong {
  margin: 0;
}

.converter-topline p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.category-tab {
  color: var(--muted);
}

.category-tab[aria-selected="true"] {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fdfaf5;
  box-shadow: 0 16px 26px rgba(13, 91, 85, 0.18);
}

.preset-area {
  margin-top: 22px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(13, 91, 85, 0.08);
}

.lookup-area {
  margin-top: 20px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(13, 91, 85, 0.08);
}

.preset-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.preset-title span {
  font-weight: 700;
}

.preset-title small {
  color: var(--muted);
}

.preset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.preset-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.lookup-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 14px;
}

.field-group-compact input {
  min-height: 52px;
  font-size: 1rem;
  font-weight: 500;
}

.lookup-target {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(13, 91, 85, 0.08);
  border: 1px solid rgba(13, 91, 85, 0.08);
}

.lookup-toggle,
.lookup-chip {
  background: #fffdf8;
  border: 1px solid rgba(13, 91, 85, 0.1);
  color: var(--ink);
}

.lookup-toggle {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.lookup-toggle.is-active,
.lookup-chip.is-active {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #fdfaf5;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(13, 91, 85, 0.16);
}

.lookup-meta {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.lookup-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.lookup-empty {
  margin: 0;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px dashed rgba(13, 91, 85, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  line-height: 1.8;
}

.lookup-section {
  display: grid;
  gap: 10px;
}

.lookup-section-title {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.lookup-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lookup-chip {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(32, 43, 45, 0.04);
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.lookup-chip-name {
  font-weight: 700;
  white-space: nowrap;
}

.lookup-chip-symbol {
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.lookup-chip.is-active .lookup-chip-symbol {
  color: rgba(253, 250, 245, 0.78);
}

.lookup-toggle:hover,
.lookup-chip:hover {
  border-color: rgba(13, 91, 85, 0.22);
  box-shadow: 0 10px 18px rgba(32, 43, 45, 0.08);
}

.lookup-toggle:focus-visible,
.lookup-chip:focus-visible {
  outline: 3px solid rgba(13, 91, 85, 0.16);
  outline-offset: 2px;
}

.converter-form {
  margin-top: 18px;
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(13, 91, 85, 0.08), rgba(252, 247, 239, 0.96));
  border: 1px solid rgba(13, 91, 85, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.field-group {
  display: grid;
  gap: 10px;
}

.field-group label {
  font-weight: 700;
}

.field-group small {
  color: var(--muted);
}

input,
select {
  width: 100%;
  border: 1px solid rgba(13, 91, 85, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  min-height: 58px;
  padding: 0 18px;
  outline: 0;
}

.converter-form input,
.converter-form select {
  background: rgba(255, 251, 244, 0.98);
  border-color: rgba(13, 91, 85, 0.16);
}

input {
  font-size: 1.3rem;
  font-weight: 700;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 25px,
    calc(100% - 16px) 25px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: end;
  margin-top: 18px;
}

.swap-btn {
  align-self: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(13, 91, 85, 0.12), rgba(255, 255, 255, 0.88));
  border: 1px solid rgba(13, 91, 85, 0.12);
  color: var(--accent-strong);
  font-size: 1.25rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.result-panel {
  display: grid;
  gap: 16px;
}

.result-highlight {
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(145deg, var(--accent-strong), var(--accent));
  color: #fdfaf5;
  box-shadow: var(--shadow-lg);
}

.result-highlight h3 {
  margin: 0;
  font-size: 1.3rem;
}

.result-value {
  margin: 18px 0 0;
  font-size: clamp(1.7rem, 2.8vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
}

.result-note {
  margin: 10px 0 0;
  color: rgba(253, 250, 245, 0.76);
  line-height: 1.7;
}

.result-card {
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(13, 91, 85, 0.08);
}

.result-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.common-headline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.common-headline span {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
}

.common-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.common-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(13, 91, 85, 0.08);
}

.common-item strong {
  font-size: 1rem;
}

.common-item span {
  color: var(--muted);
}

.common-item-empty {
  justify-content: flex-start;
}

.common-item-empty span {
  color: var(--muted);
}

.popular-grid {
  display: grid;
  gap: 18px;
}

.popular-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.popular-filter {
  display: grid;
  gap: 10px;
}

.popular-filter label {
  font-weight: 700;
}

.popular-filter input,
.popular-filter select {
  min-height: 54px;
}

.popular-meta,
.popular-empty {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.popular-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: 26px;
}

.popular-card::before {
  content: "";
  position: absolute;
  inset: auto -28px -28px auto;
  width: 120px;
  height: 120px;
  border-radius: 36px;
  background: linear-gradient(135deg, rgba(13, 91, 85, 0.12), transparent);
}

.popular-card p {
  position: relative;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.popular-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.popular-card span {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 700;
}

.popular-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.popular-card em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.92rem;
}

.popular-card strong {
  display: block;
  margin-top: 18px;
  font-size: 1.3rem;
  line-height: 1.4;
}

.popular-action {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(13, 91, 85, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.popular-card[hidden] {
  display: none !important;
}

.faq-list {
  display: grid;
  gap: 14px;
}

.faq-list details {
  padding: 20px 22px;
  border-radius: 22px;
}

.faq-list summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.85;
}

.site-footer {
  padding: 34px 0 46px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.noscript-note {
  width: min(var(--max-width), calc(100vw - 32px));
  margin: 0 auto 24px;
  padding: 14px 18px;
  border-radius: 16px;
  background: #fff3cd;
  color: #6a4c00;
}

[data-reveal="1"] {
  animation: rise 700ms ease both;
}

[data-reveal="2"] {
  animation: rise 800ms ease 100ms both;
}

[data-reveal="3"] {
  animation: rise 700ms ease 40ms both;
}

[data-reveal="4"] {
  animation: rise 700ms ease 120ms both;
}

[data-reveal="5"] {
  animation: rise 700ms ease 200ms both;
}

[data-reveal="6"] {
  animation: rise 700ms ease 280ms both;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(13, 91, 85, 0.2);
  outline-offset: 2px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1080px) {
  .converter-layout,
  .popular-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    padding-top: 10px;
  }

  .header-shell {
    border-radius: 24px;
    padding: 14px;
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    justify-content: flex-start;
    gap: 14px;
  }

  .converter-card,
  .result-panel,
  .popular-card,
  .faq-list details {
    border-radius: 24px;
  }

  .converter-card,
  .result-panel {
    padding: 22px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .lookup-toolbar {
    grid-template-columns: 1fr;
  }

  .lookup-target {
    width: 100%;
  }

  .lookup-toggle {
    width: 100%;
    justify-content: center;
  }

  .popular-toolbar {
    grid-template-columns: 1fr;
  }

  .swap-btn {
    width: 100%;
  }

  .common-item,
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .common-item strong {
    text-align: left;
  }
}
