/* =========================================================
   CalcDelta — 多语言计算器站样式
   纯 CSS，无依赖。浅色为主，跟随系统深色。
   ========================================================= */

:root {
  --bg: #f4f7fc;
  --bg-soft: #eef2f9;
  --card: #ffffff;
  --ink: #131c2b;
  --ink-2: #3d4a5e;
  --muted: #66748b;
  --line: #e2e8f1;
  --line-2: #edf1f7;

  --brand: #2f5cf0;
  --brand-ink: #2448c8;
  --brand-soft: #eaf0ff;
  --brand-glow: rgba(47, 92, 240, 0.18);

  --accent: #0e9f7a;
  --accent-soft: #e6f7f1;

  --radius-lg: 20px;
  --radius: 13px;
  --radius-sm: 9px;

  /* 玻璃面板：半透明底 + 环境光透过 + 细白描边。
     --glass 用于大面积面板，--glass-strong 给需要更高对比度的结果区 */
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.74);
  --glass-line: rgba(255, 255, 255, 0.62);
  --blur: saturate(180%) blur(20px);

  /* 浮层（分类下拉 / 移动面板）：压在密集内容之上，近乎不透明以保证文字可读 */
  --pop-bg: rgba(255, 255, 255, 0.97);

  --shadow-sm: 0 1px 2px rgba(19, 28, 43, 0.05);
  --shadow: 0 1px 2px rgba(19, 28, 43, 0.05), 0 10px 26px -12px rgba(19, 28, 43, 0.16);
  --shadow-lg: 0 2px 4px rgba(19, 28, 43, 0.05), 0 20px 44px -18px rgba(19, 28, 43, 0.22);

  --header-h: 64px;
  --maxw: 1020px;

  /* 图表色板：环形/条形/折线共用，浅色主题 */
  --c1: #2f5cf0;
  --c2: #0e9f7a;
  --c3: #f2994a;
  --c4: #9b51e0;
  --c5: #eb5757;
  --c6: #2d9cdb;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/*
 * 环境光斑：毛玻璃要"透"出东西才有玻璃感。三个大而柔的径向渐变固定在视口上，
 * 面板的半透明底透出它们，滚动时背景不动（fixed 不产生重绘成本）。
 * 透明度都压得很低 —— 玻璃下面是环境，不是霓虹灯。
 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(46rem 30rem at 6% -8%, rgba(110, 160, 255, 0.28), transparent 62%),
    radial-gradient(40rem 28rem at 98% 2%, rgba(37, 232, 206, 0.16), transparent 58%),
    radial-gradient(54rem 38rem at 50% 120%, rgba(59, 39, 200, 0.16), transparent 64%);
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}
.narrow {
  max-width: 700px;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--brand-ink);
}

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.015em;
}
h1 {
  font-size: clamp(26px, 4.4vw, 36px);
  margin: 0 0 10px;
}
h2 {
  font-size: 19px;
  margin: 0 0 14px;
}
p {
  margin: 0 0 12px;
}

/* ================= 顶栏 ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand:hover {
  color: var(--ink);
}
.brand-mark {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 6px;
  box-shadow: 0 2px 8px -1px rgba(47, 92, 240, 0.45);
}
/* 主导航（桌面端行内） */
.nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  margin-inline-start: 10px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  color: var(--ink-2);
  font-size: 14.5px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link:hover {
  background: var(--bg-soft);
  color: var(--ink);
  text-decoration: none;
}
.nav-link[aria-current='page'] {
  color: var(--brand-ink);
  background: var(--brand-soft);
  font-weight: 600;
}

/* 「分类」下拉（桌面端；移动端改由汉堡面板承载）。
   定位参照 .nav 而非触发器本身：触发器靠近视口右缘，
   380px 宽的菜单若左对齐触发器会溢出屏幕，改为与导航条右缘对齐 */
.cat-switch {
  position: static;
}
.cat-switch > summary {
  list-style: none;
  cursor: pointer;
}
.cat-switch > summary::-webkit-details-marker {
  display: none;
}
.cat-switch .chev {
  transition: transform 0.16s ease;
}
.cat-switch[open] .chev {
  transform: rotate(180deg);
}
.cat-trigger.is-active {
  color: var(--brand-ink);
  font-weight: 600;
}
.cat-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 10px);
  display: grid;
  grid-template-columns: repeat(2, minmax(168px, 1fr));
  gap: 2px;
  min-width: 380px;
  max-width: min(92vw, 640px);
  max-height: 70vh;
  overflow: auto;
  padding: 8px;
  background: var(--pop-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.cat-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 13.5px;
  white-space: nowrap;
}
.cat-menu-item:hover {
  background: var(--bg-soft);
  color: var(--ink);
  text-decoration: none;
}
.cat-menu-item[aria-current='true'] {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 600;
}
.cat-menu-item .cm-ico {
  flex: none;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-soft);
  font-size: 14px;
}
.cat-menu-item .cm-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-menu-item .cm-count {
  flex: none;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 页头右侧操作区：语言切换 + 移动汉堡 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}

/* 语言切换下拉 */
.lang-switch {
  position: relative;
}
.lang-switch > summary {
  list-style: none;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  user-select: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lang-switch > summary::-webkit-details-marker {
  display: none;
}
.lang-switch > summary:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.lang-switch[open] > summary {
  border-color: var(--brand);
}
.lang-switch ul {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  min-width: 172px;
  margin: 0;
  padding: 6px;
  list-style: none;
  text-align: start;
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 62vh;
  overflow: auto;
}
.lang-switch li a {
  display: block;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 14px;
}
.lang-switch li a:hover {
  background: var(--bg-soft);
  color: var(--ink);
  text-decoration: none;
}
.lang-switch li a.active {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 600;
}

/* 移动汉堡（≤860px 才显示，桌面隐藏） */
.mobile-menu {
  display: none;
  position: relative;
}
.menu-trigger {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  color: var(--ink-2);
}
.menu-trigger::-webkit-details-marker {
  display: none;
}
.mobile-menu[open] .menu-trigger {
  border-color: var(--brand);
  color: var(--brand-ink);
}
.mobile-panel {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 10px);
  width: min(86vw, 340px);
  max-height: 72vh;
  overflow: auto;
  padding: 10px;
  background: var(--pop-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.mobile-panel .m-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 14.5px;
  white-space: nowrap;
}
.mobile-panel .m-link:hover {
  background: var(--bg-soft);
  text-decoration: none;
}
.mobile-panel .m-top {
  font-weight: 600;
}
.mobile-panel .m-link[aria-current='page'],
.mobile-panel .m-link[aria-current='true'] {
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.mobile-panel .m-title {
  margin: 8px 12px 4px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.mobile-panel .cm-ico {
  flex: none;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--bg-soft);
  font-size: 13px;
}
.mobile-panel .cm-count {
  margin-inline-start: auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 桌面/移动导航切换点与主体布局断点（861px）保持一致 */
@media (max-width: 860px) {
  .nav {
    display: none;
  }
  .mobile-menu {
    display: block;
  }
}

/* ================= 主体 ================= */
main {
  padding: 26px 0 72px;
}
main > * + * {
  margin-top: 22px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.breadcrumb a {
  color: var(--muted);
}
.breadcrumb a:hover {
  color: var(--brand);
}
.breadcrumb span[aria-hidden] {
  opacity: 0.45;
}
.breadcrumb .current {
  color: var(--ink-2);
  font-weight: 500;
}

.page-head {
  margin-bottom: 20px;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-ink);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 12px;
}
.page-head h1 {
  margin-bottom: 8px;
}
.lead {
  color: var(--muted);
  font-size: 16px;
  max-width: 66ch;
}

/* ================= 首页 hero ================= */
.hero {
  background: linear-gradient(135deg, #6ea0ff 0%, #2f5cf0 52%, #3b27c8 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 40px 34px 34px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}
/* 右上白色光圈 + 左下青色渗透，与新图标同一套"玻璃透彩"语言 */
.hero::after {
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  pointer-events: none;
}
.hero::before {
  content: '';
  position: absolute;
  left: -120px;
  bottom: -160px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(37, 232, 206, 0.35), transparent);
  pointer-events: none;
}
.hero h1 {
  color: #fff;
  margin-bottom: 10px;
}
.hero .lead {
  color: rgba(255, 255, 255, 0.92);
  font-size: 16.5px;
  max-width: 56ch;
}
/* 搜索框是工具站最该占的黄金位，直接放第一屏，不用先跳一次列表页 */
.hero-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 2px;
  max-width: 560px;
  padding: 6px 6px 6px 18px;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 999px;
  box-shadow: 0 12px 30px -14px rgba(9, 24, 66, 0.55);
  transition: box-shadow 0.15s ease;
}
.hero-search:focus-within {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3), 0 12px 30px -14px rgba(9, 24, 66, 0.55);
}
.hero-search-ico {
  flex: none;
  font-size: 15px;
  opacity: 0.5;
}
.hero-search input[type='search'] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 15.5px;
  color: var(--ink);
}
.hero-search input[type='search']::placeholder {
  color: var(--muted);
}
.hero-search button {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.hero-search button:hover {
  background: var(--brand-ink);
  transform: translateX(1px);
}
.trust {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 0;
  margin: 18px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.95);
}
.hero-count {
  margin: 16px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}
.hero-count strong {
  font-size: 20px;
  font-weight: 700;
}

/* ================= 面板 ================= */
.panel {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

/* ================= 计算器布局 ================= */
.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: 22px;
  align-items: start;
}
@media (max-width: 860px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }
}

.field {
  margin-bottom: 15px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field .unit {
  font-weight: 400;
  color: var(--muted);
}
.field input,
.field select {
  width: 100%;
  padding: 11px 13px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:hover,
.field select:hover {
  border-color: #cdd8e8;
}
.field input:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.btn {
  font: inherit;
  font-size: 14px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
  background: var(--brand-soft);
}
.btn.ok {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
/* /contact/ 页的邮件入口：链接套 .btn，需要 inline-block 才撑得起内边距 */
.contact-cta {
  margin: 22px 0 8px;
}
.contact-cta .btn {
  display: inline-block;
  font-size: 15px;
  padding: 11px 22px;
  text-decoration: none;
}

/* ================= 结果面板 ================= */
.results {
  background: var(--glass-strong);
  border-color: var(--glass-line);
}
@media (min-width: 861px) {
  .results {
    position: sticky;
    top: calc(var(--header-h) + 20px);
    /* 输出项很多的页面结果面板可能比视口还高，sticky 时底部会永远看不到；
       限定高度让面板内部滚动（bottom 留 20px 与 top 对称） */
    max-height: calc(100vh - var(--header-h) - 40px);
    overflow-y: auto;
  }
}
.result-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.result-item:last-of-type {
  border-bottom: none;
}
.result-label {
  font-size: 14px;
  color: var(--muted);
  flex: none;
}
.result-value {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand-ink);
  text-align: right;
  letter-spacing: -0.01em;
}
.result-item:first-of-type .result-value {
  font-size: 32px;
}
.result-value .unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 5px;
}
.result-value.bump {
  animation: bump 0.28s ease;
}
@keyframes bump {
  0% {
    transform: scale(0.94);
    opacity: 0.6;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.band {
  display: inline-block;
  margin: 14px 0 0;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 13.5px;
  font-weight: 600;
}
/* display:inline-block 会覆盖 [hidden] 的默认 none：无分档的计算器（占大多数）
   必须把这个空胶囊真正藏掉，否则结果区底部挂一个 28×10 的空色块 */
.band[hidden] {
  display: none;
}

/* 文本型结果（判断词、整句说明）不套数字的大字加粗样式，改为标签在上、正文在下 */
.result-item-text {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.result-item-text .result-right {
  width: 100%;
}
.result-item-text .result-value {
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
  color: var(--ink);
  letter-spacing: normal;
}
.result-item-text .copy-btn {
  align-self: flex-start;
}

/* ================= How it works 流程 ================= */
.howto-flow {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
}
.flow-side {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.flow-chip {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 13.5px;
}
.flow-chip.accent {
  background: var(--accent-soft);
  border-color: #bfe8db;
  color: #0a7a5d;
  font-weight: 600;
}
.flow-arrow {
  color: var(--muted);
  font-size: 18px;
}

/* ================= FAQ ================= */
.faq details {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 9px;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.faq details[open] {
  background: rgba(255, 255, 255, 0.8);
  border-color: #cfdcf7;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 18px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '+';
  color: var(--brand);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  flex: none;
}
.faq details[open] summary::after {
  content: '−';
}
.faq details p {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--muted);
  font-size: 15px;
}

/* ================= 卡片列表 ================= */
.filter {
  margin-bottom: 16px;
}
.filter input[type='search'] {
  width: 100%;
  padding: 12px 15px;
  font-size: 15.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.filter input[type='search']:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.grid-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.grid-cards.compact {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.card-calc > a {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  height: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.card-calc > a:hover {
  border-color: var(--brand);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px -10px var(--brand-glow);
  transform: translateY(-1px);
  text-decoration: none;
}
.card-ico {
  font-size: 20px;
  line-height: 1;
  flex: none;
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.card-body strong {
  font-size: 15px;
  font-weight: 600;
}
.card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-arrow {
  margin-left: auto;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  flex: none;
}
.card-calc > a:hover .card-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.no-results {
  text-align: center;
  color: var(--muted);
  padding: 26px 0;
  font-size: 15px;
}
/* 全部计算器页在手机上能有 20000px 高，滚到底要有个往回走的出口 */
.back-top {
  margin: 34px 0 0;
  text-align: center;
}
.back-top a {
  display: inline-block;
  font-size: 13.5px;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
}
.back-top a:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
  text-decoration: none;
}

/* ================= 分类卡（首页） ================= */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 12px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.cat-card:hover {
  border-color: var(--brand);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px -12px var(--brand-glow);
}
.cat-card-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 15px 11px;
  color: var(--ink);
}
.cat-card-head:hover {
  text-decoration: none;
}
.cat-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--brand-soft);
  font-size: 19px;
  line-height: 1;
  flex: none;
}
/* 33 张分类卡一路全是蓝底会显得很闷，用 6 色轮转给图标垫底分出层次 */
.cat-grid .cat-card:nth-child(6n + 2) .cat-ico {
  background: var(--accent-soft);
}
.cat-grid .cat-card:nth-child(6n + 3) .cat-ico {
  background: #fff3e4;
}
.cat-grid .cat-card:nth-child(6n + 4) .cat-ico {
  background: #f3ecfd;
}
.cat-grid .cat-card:nth-child(6n + 5) .cat-ico {
  background: #fdeaea;
}
.cat-grid .cat-card:nth-child(6n + 6) .cat-ico {
  background: #e6f4fb;
}
.cat-card-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cat-name {
  font-weight: 600;
  font-size: 15px;
}
.cat-count {
  font-size: 12.5px;
  color: var(--muted);
}
/* 每张分类卡里挂几个代表作，首页才有足够的深链把权重送到计算器页，
   同时不必把 700 多个链接全铺在首页 */
.cat-links {
  list-style: none;
  margin: auto 0 0;
  padding: 9px 15px 13px;
  border-top: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
}
.cat-links a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.45;
  padding: 2px 0;
  color: var(--ink-2);
}
.cat-links a:hover {
  color: var(--brand);
}

.browse-all {
  margin: 20px 0 2px;
  text-align: center;
}
.btn-all {
  display: inline-block;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  box-shadow: 0 10px 24px -14px var(--brand);
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn-all:hover {
  background: var(--brand-ink);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}
.panel-more {
  font-size: 13.5px;
  font-weight: 600;
}

/* ================= 全部计算器页 ================= */
.anchor-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 22px;
}
.anchor-nav a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}
.anchor-nav a:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
  background: var(--brand-soft);
  text-decoration: none;
}
.anchor-nav a span {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/*
 * 每个分类一个分区。content-visibility 让浏览器跳过屏外分区的排版与绘制 ——
 * 700+ 个链接必须留在 DOM 里给搜索引擎抓，但不必让首屏为它们付出渲染代价。
 *
 * 高度估算是算出来的，不是拍脑袋：每项都是单行（行高固定 32px），列数由下面的
 * 媒体查询钉死，所以「44px 标题 + 行数 × 32px」与真实高度基本相等。
 * 这一点很重要 —— 估准了，滚动条不会边滚边跳，锚点跳转也不会落偏。
 * auto 关键字还会让浏览器记住实测高度，第二次之后就是精确值。
 */
.cat-section {
  content-visibility: auto;
  contain-intrinsic-size: auto calc(44px + var(--n, 20) / 3 * 32px);
  scroll-margin-top: calc(var(--header-h) + 12px);
}
.cat-section + .cat-section {
  margin-top: 28px;
}
.cat-section h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 13px;
}
.cat-section h2 .cat-count {
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 1px 9px;
}

.lnk-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 20px;
}
.lnk-grid li {
  min-width: 0;
}
/* 单行 + 省略号：行高恒为 32px，上面那条高度公式才成立。
   可能被截断的长标题由构建期补 title 属性兜底（见 template.js 的 linkItem）。 */
.lnk-grid a {
  display: block;
  font-size: 14px;
  line-height: 1.5;
  padding: 5px 0;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.13s ease;
}
.lnk-grid a:hover {
  color: var(--brand);
  text-decoration: none;
}
@media (max-width: 860px) {
  .cat-section {
    contain-intrinsic-size: auto calc(44px + var(--n, 20) / 2 * 32px);
  }
  .lnk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .cat-section {
    contain-intrinsic-size: auto calc(44px + var(--n, 20) * 32px);
  }
  .lnk-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* ================= 页脚 ================= */
.site-footer {
  border-top: 1px solid var(--glass-line);
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  padding: 30px 0 36px;
  font-size: 13.5px;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.footer-brand strong {
  display: inline-block;
  margin-left: 7px;
  color: var(--ink);
  font-size: 15px;
}
.muted-sm {
  margin: 6px 0 0;
  font-size: 13px;
}
.footer-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.disclaimer {
  max-width: 74ch;
  font-size: 12.5px;
  line-height: 1.6;
  opacity: 0.9;
}
.copy {
  margin: 8px 0 0;
  font-size: 12.5px;
  opacity: 0.65;
}

/* ================= 深色（跟随系统） ================= */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1420;
    --bg-soft: #18202f;
    --card: #151d2b;
    --ink: #eaf0fa;
    --ink-2: #b8c4d6;
    --muted: #8797ad;
    --line: #253044;
    --line-2: #1e2839;
    --brand: #6c9bff;
    --brand-ink: #93b6ff;
    --brand-soft: #1a2740;
    --brand-glow: rgba(108, 155, 255, 0.22);
    --accent: #35c9a0;
    --accent-soft: #123027;
    /* 深色玻璃：底更沉、描边换成细白高光，光斑透出来才有层次 */
    --glass: rgba(24, 33, 50, 0.58);
    --glass-strong: rgba(26, 36, 55, 0.72);
    --glass-line: rgba(255, 255, 255, 0.09);
    --pop-bg: rgba(26, 36, 55, 0.97);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 10px 26px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 20px 44px -18px rgba(0, 0, 0, 0.7);
    --c1: #6c9bff;
    --c2: #35c9a0;
    --c3: #f6ad5c;
    --c4: #b47ce8;
    --c5: #f0736f;
    --c6: #4fb3e8;
  }
  /* 深色环境光：靛蓝为主，压低亮度避免脏 */
  body::before {
    background:
      radial-gradient(46rem 30rem at 6% -8%, rgba(64, 100, 220, 0.22), transparent 62%),
      radial-gradient(40rem 28rem at 98% 2%, rgba(24, 160, 150, 0.12), transparent 58%),
      radial-gradient(54rem 38rem at 50% 120%, rgba(90, 60, 220, 0.18), transparent 64%);
  }
  .site-header {
    background: rgba(16, 23, 37, 0.68);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, var(--shadow-sm);
  }
  /* 不透明白底件换成深色卡底；玻璃件保持 var(--glass) 让 blur 生效 */
  .lang-switch > summary,
  .field input,
  .field select,
  .btn,
  .card-calc > a,
  .cat-card {
    background: var(--card);
  }
  .faq details {
    background: rgba(21, 29, 43, 0.55);
  }
  .faq details[open] {
    background: rgba(26, 36, 55, 0.85);
  }
  .flow-chip.accent {
    color: var(--accent);
  }
  .hero::after {
    background: rgba(255, 255, 255, 0.08);
  }
}

/* 不支持 backdrop-filter 的浏览器：玻璃件回退到不透明底，保证对比度 */
@supports not (backdrop-filter: blur(1px)) {
  .site-header,
  .lang-switch ul,
  .panel,
  .site-footer {
    background: var(--card);
  }
  .site-header {
    border-bottom-color: var(--line);
  }
  .results {
    background: var(--card);
    border-color: var(--line);
  }
}

/* =========================================================
   交互增强组件
   ========================================================= */

/* ---- 滑块 + 数字框：两者是同一输入的两个视图，数字框始终是真值源 ---- */
.range-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}
.range-wrap input[type='number'] {
  width: 116px;
  flex: none;
  text-align: right;
}
.range {
  flex: 1;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 22px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand) var(--fill, 50%), var(--line) var(--fill, 50%));
}
.range::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
}
.range::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--brand);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease;
}
.range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand);
}
.range:hover::-webkit-slider-thumb,
.range:focus-visible::-webkit-slider-thumb {
  transform: scale(1.12);
}
.range:focus-visible {
  outline: none;
}
.range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--brand-glow);
}

/* ---- 快捷示例 ---- */
.presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}
.presets-label {
  font-size: 12.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 2px;
}
.preset-chip {
  font: inherit;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.14s ease;
}
.preset-chip:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
}
.preset-chip.on {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
}

/* ---- 结果右侧：数值 + 复制按钮 ---- */
.result-right {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.copy-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.14s ease, color 0.14s ease, background 0.14s ease;
}
.result-item:hover .copy-btn,
.copy-btn:focus-visible {
  opacity: 1;
}
.copy-btn:hover {
  color: var(--brand-ink);
  background: var(--brand-soft);
}
.copy-btn.ok {
  opacity: 1;
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}
@media (hover: none) {
  .copy-btn {
    opacity: 0.55;
  }
}

/* ---- 图表 ---- */
.chart-panel,
.table-panel {
  margin-top: 20px;
}
.chart-box {
  width: 100%;
}
.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart-svg text {
  font-family: inherit;
  fill: var(--ink-2);
}
.chart-center-value {
  font-size: 22px;
  font-weight: 700;
  fill: var(--ink);
  font-variant-numeric: tabular-nums;
}
.chart-center-label {
  font-size: 11px;
  fill: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.chart-legend-label {
  font-size: 13px;
  fill: var(--ink-2);
}
.chart-legend-value {
  font-size: 13.5px;
  font-weight: 700;
  fill: var(--ink);
  font-variant-numeric: tabular-nums;
}
.chart-legend-pct {
  font-size: 11.5px;
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}
.chart-bar-label {
  font-size: 13px;
  fill: var(--ink-2);
}
.chart-bar-value {
  font-size: 13px;
  font-weight: 700;
  fill: var(--ink);
  font-variant-numeric: tabular-nums;
}
.chart-grid {
  stroke: var(--line-2);
  stroke-width: 1;
}
.chart-axis-line {
  stroke: var(--line);
  stroke-width: 1;
}
.chart-axis {
  font-size: 11px;
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}
.chart-marker-value {
  font-size: 13px;
  font-weight: 700;
  fill: var(--ink);
}

/* ---- 刻度条（BMI 这类「落点比数值重要」的指标） ---- */
.scale-box {
  margin-top: 16px;
}

/* ---- 明细表 ---- */
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.panel-head h2 {
  margin: 0;
}
.seg-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-soft);
}
.seg {
  font: inherit;
  font-size: 13px;
  padding: 5px 15px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.14s ease;
}
.seg.on {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.data-table th,
.data-table td {
  padding: 9px 14px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-2);
}
.data-table th {
  position: sticky;
  top: 0;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 1;
}
.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
}
.data-table tbody tr:last-child td {
  border-bottom: 0;
}
.data-table tbody tr:hover td {
  background: var(--brand-soft);
}
.data-table td .unit {
  margin-left: 4px;
  font-size: 11.5px;
  color: var(--muted);
}
.data-table td.col-text {
  text-align: left;
}

@media (max-width: 480px) {
  /* 窄屏仍保持「数字框 + 滑块」同一行：上下堆叠会让每个滑块字段占两行，
     一个 7 输入的页面表单高度直接翻倍。这里只收窄数字框、压缩间距。 */
  .range-wrap {
    gap: 8px;
  }
  .range-wrap input[type='number'] {
    width: 84px;
    flex: none;
    text-align: right;
  }
}

/* ================= 列表搜索结果计数 ================= */
.result-count {
  margin: -2px 0 14px;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ================= 交互细节 ================= */
/* 移动端点击卡片/按钮时的系统灰闪去掉 */
a,
button,
.cat-card-head {
  -webkit-tap-highlight-color: transparent;
}

/* 数字框原生上下三角与整体控件风格不统一，滑块才是主输入方式；
   隐藏 spinner，键盘上下键照常步进 */
.field input[type='number']::-webkit-outer-spin-button,
.field input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.field input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* RTL：纯箭头元素水平镜像。带文字的按钮箭头单独包在 .arr 里，避免文字被一起镜像 */
[dir='rtl'] .card-arrow,
[dir='rtl'] .flow-arrow,
[dir='rtl'] .hero-search button,
[dir='rtl'] .arr {
  transform: scaleX(-1);
}

/* 键盘导航：统一 :focus-visible 焦点环（鼠标点击不出现） */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
.seg:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* 小屏顶栏收紧：导航已收进汉堡面板，这里只压缩品牌与操作区间距 */
@media (max-width: 560px) {
  .header-inner {
    gap: 8px;
  }
  .lang-switch > summary {
    padding: 5px 10px;
  }
}
@media (max-width: 380px) {
  /* 极窄屏只留 logo，把站名宽度让给导航链接 */
  .brand span:last-child {
    display: none;
  }
}

/* 窄屏流程条竖排，箭头转 90° 居中；RTL 反向旋转，视觉上同样朝下 */
@media (max-width: 600px) {
  .howto-flow {
    flex-direction: column;
    align-items: stretch;
  }
  .howto-flow .flow-side {
    width: 100%;
  }
  .howto-flow .flow-arrow {
    align-self: center;
    transform: rotate(90deg);
  }
  [dir='rtl'] .howto-flow .flow-arrow {
    transform: rotate(-90deg);
  }
}

/* 尊重系统「减弱动态效果」：关闭平滑滚动、入场/强调动画和非必要过渡 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
