/* ========================================
   全局样式 — Mobile-First 响应式框架
   配色: 深蓝(#1a365d) + 金色(#d69e2e) + 白(#fff)
   字体: Inter(正文) + Poppins(标题)
   ======================================== */

/* --- CSS 变量 --- */
:root {
  --color-primary: #1a365d;
  --color-primary-light: #2b4c7e;
  --color-primary-dark: #0f2440;
  --color-accent: #d69e2e;
  --color-accent-light: #ecc94b;
  --color-accent-dark: #b7791f;
  --color-success: #38a169;
  --color-danger: #e53e3e;
  --color-warning: #dd6b20;
  --color-info: #3182ce;
  --color-bg: #f7fafc;
  --color-bg-alt: #edf2f7;
  --color-card: #ffffff;
  --color-text: #1a202c;
  --color-text-secondary: #4a5568;
  --color-text-muted: #718096;
  --color-border: #e2e8f0;
  --color-border-light: #edf2f7;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Poppins', 'Inter', sans-serif;
  --font-mono: 'Fira Code', 'Consolas', monospace;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --max-width: 1200px;
  --header-height: 64px;
}

/* --- 全局重置 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-info);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

ul, ol {
  padding-left: 1.5em;
}

table {
  width: 100%;
  border-collapse: collapse;
}

/* --- 排版 --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-primary);
}

h1 { font-size: 1.75rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; }
h4 { font-size: 1.05rem; margin: 1.25rem 0 0.5rem; }

p { margin-bottom: 1rem; }

/* --- 布局容器 --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.main-content {
  flex: 1;
  padding: 1.5rem 0;
}

/* --- 顶部导航 --- */
.site-header {
  background: var(--color-primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.site-logo:hover {
  color: var(--color-accent-light);
  text-decoration: none;
}

.site-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-primary-dark);
}

/* 移动端汉堡菜单按钮 */
.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* 导航面板 — 移动端全屏滑入 */
.main-nav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-primary-dark);
  padding: 1rem;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  z-index: 999;
}

.main-nav.open {
  transform: translateX(0);
}

/* 一级导航列表 */
.nav-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* 一级导航项 */
.nav-list > li {
  position: relative;
}

/* 通用导航链接样式 */
.nav-list a {
  display: block;
  padding: 0.7rem 1rem;
  color: #cbd5e0;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
}

.nav-list a:hover,
.nav-list a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
}

.nav-list a.active {
  border-left: 3px solid var(--color-accent);
  color: var(--color-accent-light);
}

/* 二级下拉触发按钮 */
.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.7rem 1rem;
  background: none;
  border: none;
  color: #cbd5e0;
  font-size: 0.95rem;
  font-family: var(--font-body);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.nav-dropdown-toggle:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.nav-dropdown-toggle::after {
  content: '▾';
  font-size: 0.7rem;
  margin-left: 0.4rem;
  transition: transform 0.3s;
}

.nav-dropdown-toggle.open::after {
  transform: rotate(180deg);
}

/* 二级下拉面板 — 移动端手风琴式 */
.nav-dropdown {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  padding-left: 0.75rem;
}

.nav-dropdown.open {
  max-height: 1200px;
}

/* 二级导航链接 */
.nav-dropdown a {
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
  color: #a0aec0;
}

.nav-dropdown a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.nav-dropdown a.active {
  color: var(--color-accent-light);
  border-left: 2px solid var(--color-accent);
  background: rgba(214,158,46,0.08);
}

/* --- 面包屑 --- */
.breadcrumb {
  padding: 0.75rem 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.breadcrumb ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.breadcrumb li::after {
  content: '›';
  margin-left: 0.4rem;
  color: var(--color-text-muted);
}

.breadcrumb li:last-child::after {
  display: none;
}

.breadcrumb a {
  color: var(--color-info);
}

.breadcrumb span {
  color: var(--color-text-secondary);
}

/* --- 卡片 --- */
.card {
  background: var(--color-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-header {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-border-light);
}

/* --- 表单控件 --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.4rem;
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-text);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(214,158,46,0.2);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

/* 输入框带前缀/后缀 */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-prefix,
.input-suffix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: var(--color-bg-alt);
  border: 2px solid var(--color-border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.input-prefix {
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-suffix {
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.input-group .form-input {
  border-radius: 0;
}

.input-group .form-input:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group .form-input:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.input-prefix + .form-input {
  border-left: none;
}

/* 滑块控件 */
.slider-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.slider-group input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  outline: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
}

.slider-group input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-group input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: var(--shadow-sm);
}

.slider-value {
  min-width: 80px;
  text-align: right;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-primary);
}

/* 单选/复选按钮组 */
.radio-group,
.toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.radio-group label,
.toggle-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.radio-group input:checked + label,
.toggle-group input:checked + label,
.radio-group label.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.radio-group input,
.toggle-group input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 48px;
  min-width: 48px;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-primary-dark);
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.btn-secondary {
  background: var(--color-primary);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  min-height: 56px;
}

.btn-block {
  width: 100%;
}

.btn-reset {
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
}

.btn-reset:hover {
  background: var(--color-border);
  text-decoration: none;
}

/* --- 结果展示 --- */
.result-box {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
}

.result-label {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: 0.25rem;
}

.result-value {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
}

.result-sub {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-top: 0.5rem;
}

.result-breakdown {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.result-item {
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
}

.result-item-label {
  font-size: 0.8rem;
  opacity: 0.8;
}

.result-item-value {
  font-size: 1.15rem;
  font-weight: 700;
}

/* --- 数据表格 --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table thead {
  background: var(--color-primary);
  color: #fff;
}

.data-table th {
  padding: 0.75rem 0.5rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
}

.data-table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--color-border-light);
}

.data-table tbody tr:hover {
  background: var(--color-bg);
}

.data-table .text-right {
  text-align: right;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

/* --- 可折叠区域 --- */
.collapsible-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-primary);
  transition: background 0.2s;
}

.collapsible-toggle:hover {
  background: var(--color-border-light);
}

.collapsible-toggle::after {
  content: '▼';
  font-size: 0.7rem;
  transition: transform 0.3s;
}

.collapsible-toggle.active::after {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.collapsible-content.open {
  max-height: 5000px;
}

/* --- 图表容器 --- */
.chart-container {
  position: relative;
  width: 100%;
  margin: 1.5rem 0;
}

.chart-container canvas {
  max-width: 100%;
}

/* --- 对比表 --- */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.comparison-table th {
  background: var(--color-bg-alt);
  padding: 0.65rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-border);
}

.comparison-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--color-border-light);
}

.comparison-table tr.highlight {
  background: rgba(214,158,46,0.08);
  font-weight: 600;
}

/* --- FAQ --- */
.faq-list {
  list-style: none;
  padding: 0;
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  line-height: 1.4;
  transition: background 0.2s;
}

.faq-question:hover {
  background: var(--color-bg);
}

.faq-question::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--color-accent);
  flex-shrink: 0;
  margin-left: 1rem;
  transition: transform 0.3s;
}

.faq-item.open .faq-question::after {
  content: '−';
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s;
}

.faq-item.open .faq-answer {
  max-height: 800px;
  padding: 0 1.25rem 1rem;
}

.faq-answer p {
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* --- 内链网格 — 相关计算器 --- */
.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.related-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.2s;
}

.related-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.related-card .rc-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.related-card .rc-text h4 {
  font-size: 0.95rem;
  color: var(--color-primary);
  margin: 0 0 0.2rem;
}

.related-card .rc-text p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
}

/* --- 广告容器 --- */
.ad-container {
  margin: 1.5rem 0;
  min-height: 0;
  overflow: hidden;
  text-align: center;
}

.ad-container:empty,
.ad-container.ad-hidden {
  display: none;
  margin: 0;
  padding: 0;
}

/* --- 页脚 --- */
.site-footer {
  background: var(--color-primary-dark);
  color: #a0aec0;
  padding: 2rem 0 1rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col li {
  margin-bottom: 0.4rem;
}

.footer-col a {
  color: #a0aec0;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--color-accent-light);
  text-decoration: none;
}

.footer-disclaimer {
  font-size: 0.78rem;
  color: #718096;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  line-height: 1.6;
}

.footer-bottom {
  text-align: center;
  font-size: 0.8rem;
  padding-top: 1rem;
  color: #718096;
}

/* --- 公式展示 --- */
.formula-block {
  background: var(--color-bg-alt);
  border-left: 4px solid var(--color-accent);
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 1.05rem;
  font-family: var(--font-mono);
  overflow-x: auto;
}

/* --- 步骤说明 --- */
.steps-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.steps-list li {
  counter-increment: step;
  position: relative;
  padding: 1rem 1rem 1rem 3.5rem;
  margin-bottom: 0.75rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 28px;
  height: 28px;
  background: var(--color-accent);
  color: var(--color-primary-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* --- 内容区段标题装饰 --- */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title .icon {
  font-size: 1.5rem;
}

/* --- 提示框 --- */
.tip-box {
  background: #ebf8ff;
  border-left: 4px solid var(--color-info);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

.tip-box strong {
  color: var(--color-info);
}

.warning-box {
  background: #fffaf0;
  border-left: 4px solid var(--color-warning);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

/* --- 工具提示 --- */
.tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
}

.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary-dark);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  white-space: nowrap;
  max-width: 260px;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
  line-height: 1.4;
}

.tooltip:hover::after {
  opacity: 1;
}

/* --- 选项卡 --- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--color-primary);
}

.tab-btn.active {
  color: var(--color-accent-dark);
  border-bottom-color: var(--color-accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* --- 打印样式 --- */
@media print {
  .site-header, .site-footer, .menu-toggle, .main-nav,
  .ad-container, .btn, .breadcrumb {
    display: none !important;
  }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ========================================
   响应式断点 — 从移动端向上适配
   ======================================== */

/* 平板 (≥640px) */
@media (min-width: 640px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.65rem; }

  .result-breakdown {
    grid-template-columns: repeat(3, 1fr);
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 桌面 (≥1024px) */
@media (min-width: 1024px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.8rem; }

  .container {
    padding: 0 2rem;
  }

  .main-content {
    padding: 2rem 0;
  }

  /* 桌面端导航：水平排列 + 二级下拉 */
  .menu-toggle {
    display: none;
  }

  .main-nav {
    position: static;
    transform: none;
    background: none;
    padding: 0;
    overflow: visible;
  }

  .nav-list {
    flex-direction: row;
    gap: 0;
    align-items: center;
  }

  .nav-list > li {
    position: relative;
  }

  .nav-list > li > a {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
  }

  .nav-list > li > a.active {
    border-left: none;
    background: rgba(255,255,255,0.15);
  }

  /* 桌面端下拉触发按钮 */
  .nav-dropdown-toggle {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    white-space: nowrap;
    color: #cbd5e0;
  }

  .nav-dropdown-toggle:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
  }

  /* 桌面端下拉面板 — 单列绝对定位浮层 */
  .nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    max-height: 0;
    overflow: hidden;
    padding-left: 0;
    background: var(--color-primary-dark);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 240px;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s;
    z-index: 1002;
    display: flex;
    flex-direction: column;
  }

  .nav-dropdown.open {
    max-height: 600px;
    opacity: 1;
    padding: 0.5rem 0;
  }

  .nav-dropdown a {
    padding: 0.4rem 1.1rem;
    font-size: 0.82rem;
    white-space: nowrap;
    border-radius: 0;
  }

  /* 桌面端工具页布局 */
  .calc-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 2rem;
    align-items: start;
  }

  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .result-value {
    font-size: 2.75rem;
  }
}

/* 大桌面 (≥1280px) */
@media (min-width: 1280px) {
  .related-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
