    :root {
      --primary: #0f172a;
      --accent: #3b82f6;
      --accent-light: #60a5fa;
      --bg: #f8fafc;
      --card-bg: #ffffff;
      --text: #1e293b;
      --text-light: #64748b;
      --border: #e2e8f0;
      --success: #10b981;
      --warning: #f59e0b;
      --danger: #ef4444;
      --shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
      --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
      --radius: 16px;
      --radius-sm: 10px;
      --nav-height: 64px;
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
      background: var(--bg);
      color: var(--text);
      line-height: 1.6;
      -webkit-font-smoothing: antialiased;
    }

    /* Nav */
    .nav-bar {
      position: fixed;
      top: 0; left: 0; right: 0;
      height: var(--nav-height);
      background: rgba(255,255,255,0.95);
      backdrop-filter: blur(10px);
      border-bottom: 1px solid var(--border);
      z-index: 1000;
    }
    .nav-inner {
      max-width: 1200px;
      margin: 0 auto;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 1.5rem;
    }
    .nav-logo {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-weight: 500;
      font-size: 1.25rem;
      color: var(--primary);
      text-decoration: none;
    }
    .nav-logo svg { width: 24px; height: 24px; stroke: var(--accent); }
    .nav-logo-img { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; }
    .nav-links { display: flex; gap: 2rem;align-items: center; margin-left: auto; }
    .nav-links a {
      text-decoration: none;
      color: var(--text-light);
      font-weight: 500;
      font-size: 0.95rem;
      transition: color 0.2s;
    }
    .nav-links a:hover, .nav-links a.active { color: var(--accent); }

    /* Nav dropdown (更多工具) */
    .nav-dropdown { position: relative; }
    .nav-dropdown-toggle {
      background: none;
      border: none;
      cursor: pointer;
      font-family: inherit;
      font-size: 0.95rem;
      font-weight: 500;
      color: var(--text-light);
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 0;
      transition: color 0.2s;
    }
    .nav-dropdown-toggle:hover { color: var(--accent); }
    .nav-dropdown-arrow {
      width: 14px;
      height: 14px;
      transition: transform 0.2s;
    }
    .nav-dropdown.open .nav-dropdown-arrow { transform: rotate(180deg); }
    .nav-dropdown-menu {
      position: absolute;
      top: 100%;
      left: 50%;
      transform: translateX(-50%);
      margin-top: 14px;
      min-width: 160px;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      box-shadow: 0 8px 24px rgba(15,23,42,0.12);
      padding: 0.5rem;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.15s, visibility 0.15s;
      z-index: 100;
    }
    .nav-dropdown.open .nav-dropdown-menu {
      opacity: 1;
      visibility: visible;
    }
    /* 鼠标设备：悬停展开（触屏设备不触发，走 JS 点击） */
    @media (hover: hover) {
      .nav-dropdown:hover .nav-dropdown-menu {
        opacity: 1;
        visibility: visible;
      }
      .nav-dropdown:hover .nav-dropdown-arrow { transform: rotate(180deg); }
    }
    .nav-dropdown-menu a {
      display: block;
      padding: 0.6rem 0.75rem;
      border-radius: 6px;
      color: var(--text);
      font-size: 0.9rem;
      font-weight: 500;
      text-decoration: none;
      white-space: nowrap;
      transition: background 0.15s, color 0.15s;
    }
    .nav-dropdown-menu a:hover {
      background: #f1f5f9;
      color: var(--accent);
    }
    .nav-toggle { display: none; }

    /* Header */
    header {
      text-align: center;
      padding: calc(var(--nav-height) + 1rem) 1.5rem 2rem;
      max-width: 1200px;
      margin: 0 auto;
    }
    header h1 {
      font-size: 2rem;
      font-weight: 700;
      margin-bottom: 0.5rem;
      color: var(--primary);
      letter-spacing: -0.02em;
    }
    header p { color: var(--text-light); font-size: 1.05rem; }

    /* Main Layout */
    main { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem 3rem; }
    .calculator-layout {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 2rem;
      align-items: start;
      margin-bottom: 3rem;
    }
    .calc-panel {
      position: sticky;
      top: calc(var(--nav-height) + 1.5rem);
      align-self: start;
    }
    .calculator-card {
      background: var(--card-bg);
      border-radius: var(--radius);
      padding: 2rem;
      border: 1px solid var(--border);
    }
    .intro-text {
      font-size: 0.95rem;
      color: var(--text-light);
      margin-bottom: 1.5rem;
      line-height: 1.7;
    }
    .intro-text strong { color: var(--text); }

    /* Result Panel */
    .result-panel { min-height: 200px; }
    .result-placeholder {
      background: var(--card-bg);
      border-radius: var(--radius);
      padding: 3rem 2rem;
      box-shadow: var(--shadow);
      text-align: center;
      color: var(--text-light);
      border: 2px dashed var(--border);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      min-height: 300px;
    }

    .result-placeholder p { margin: 0.25rem 0; font-size: 0.95rem; }
    .result-placeholder p:last-child { font-size: 0.85rem; opacity: 0.7; }

    #results {
      background: var(--card-bg);
      border-radius: var(--radius);
      padding: 2rem;
      border: 1px solid var(--border);
      opacity: 1;
      transform: translateY(0);
      transition: opacity 0.5s ease, transform 0.5s ease;
    }

    /* Form */
    .form-section { margin-bottom: 1rem; }
    .form-section:last-of-type { margin-bottom: 1rem; }
    .form-section h2 {
      font-size: 1.05rem;
      font-weight: 700;
      margin-bottom: 1rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      color: var(--primary);
    }

    .shujvtitle {
      font-size: 1.05rem;
      font-weight: 500;
      margin-bottom: 1rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      color: var(--primary);
    }

    /* Cards */
    .formula-cards, .activity-cards {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
      gap: 0.75rem;
    }
    .formula-card, .activity-card {
      border: 2px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 1rem;
      cursor: pointer;
      transition: all 0.2s;
      position: relative;
      background: white;
      user-select: none;
    }
    .formula-card:hover, .activity-card:hover {
      border-color: var(--accent-light);
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(59,130,246,0.08);
    }
    .formula-card.selected, .activity-card.selected {
      border-color: var(--accent);
      background: #eff6ff;
      box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
    }

    .card-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
    .formula-card h3 { font-size: 0.9rem; margin-bottom: 0.25rem; color: var(--text); }
    .formula-card p { font-size: 0.78rem; color: var(--text-light); line-height: 1.4; }


    .activity-card .act-label { font-weight: 500; margin-bottom: 0.25rem; font-size: 0.9rem; }
    .activity-card .act-desc { font-size: 0.78rem; color: var(--text-light); line-height: 1.4; }

    .info-box {
      margin-top: 1rem;
      padding: 1rem;
      background: #f8fafc;
      border-radius: var(--radius-sm);
      font-size: 0.9rem;
      color: var(--text-light);
      line-height: 1.5;
    }

    /* Inputs */
    .form-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1rem;
    }
    .form-group.hidden { display: none !important; }
    .form-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.form-group label {
  flex-shrink: 0;        /* label 不压缩 */
  min-width: 4.5em;      /* 最小宽度，对齐用 */
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
}
.form-group input,
.form-group select {
  flex: 1;               /* input 占满剩余空间 */
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: white;
  width: 100%;
}
    .form-group input:focus, .form-group select:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
    }
    .form-group.error input { border-color: var(--danger); }

    .inline-help {
      color: var(--accent);
      text-decoration: none;
      font-size: 0.75rem;
      margin-left: 0.25rem;
      font-weight: 600;
    }
    .inline-help:hover { text-decoration: underline; }

    button[type="submit"] {
      width: 100%;
      padding: 1rem;
      background: var(--accent);
      color: white;
      border: none;
      border-radius: var(--radius-sm);
      font-size: 1.1rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      letter-spacing: 0.02em;
    }
    button[type="submit"]:hover {
      background: #2563eb;
      transform: translateY(-1px);
      box-shadow: 0 8px 20px rgba(59,130,246,0.25);
    }
    button[type="submit"]:active { transform: translateY(0); }

    .a {color: #3b82f6;text-decoration: none;font-weight: 500;}

    /* Results */
    .result-hero,.diet-grid,.more-tools {
      padding-bottom: 1.5rem;
      border-bottom: 1px solid var(--border);
      margin-bottom: 1.5rem;
    }
    .hero-number {
      font-size: 1.5rem;
      font-weight: 600;
      color: #0ea5e9;
      line-height: 1;
      letter-spacing: -0.03em;
    }
    .bd-value {
      font-size: 1.5rem;
      font-weight: 600;
      color: #0ea5e9;
      line-height: 1;
      letter-spacing: -0.03em;
    }

    .diet-card {
      background: var(--bg);
      border-radius: var(--radius-sm);
      padding: 1.5rem 1rem;
      text-align: center;
      transition: transform 0.2s, box-shadow 0.2s;
      border: 1px solid var(--border);
    }
    .diet-card:hover { transform: translateY(-4px); box-shadow: 0 8px 16px rgba(0,0,0,0.06); }
    .diet-card.cut { border-top: 3px solid var(--success); }
    .diet-card.maintain { border-top: 3px solid var(--accent); }
    .diet-card.bulk { border-top: 3px solid var(--warning); }
    .diet-card h4 { font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--text); }
    .cal { font-size: 18px; font-weight: 500; color: var(--primary); }
    .cal-unit { font-size: 0.75rem; color: var(--text-light); font-weight: 500; }

    /* FAQ Accordion */
    .faq-section { margin-top: 1rem; }

    details.faq-item {
      background: var(--card-bg);
      border-radius: var(--radius-sm);
      margin-bottom: 1rem;
      overflow: hidden;
      border: 1px solid var(--border);
    }
    details.faq-item summary {
      padding: 1.25rem 1.5rem;
      font-weight: 500;
      cursor: pointer;
      list-style: none;
      display: flex;
      align-items: center;
      justify-content: space-between;
      transition: background 0.2s;
      font-size: 1rem;
      color: var(--text);
      line-height: 1.3;
    }
    details.faq-item summary::-webkit-details-marker { display: none; }
    details.faq-item summary::after {
      content: '+';
      font-size: 1.5rem;
      color: var(--accent);
      font-weight: 400;
      transition: transform 0.3s;
      flex-shrink: 0;
      margin-left: 1rem;
    }
    details.faq-item[open] summary::after { content: '−'; }
    details.faq-item summary:hover { background: #f8fafc; }
    details.faq-item .faq-content {
      padding: 0 1.5rem 1.5rem;
      animation: fadeIn 0.35s ease;
    }
    @keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

    .faq-content h4 {
      font-size: 1rem;
      margin: 1.25rem 0 0.75rem;
      color: var(--primary);
      font-weight: 700;
    }
    .faq-content h4:first-child { margin-top: 0.5rem; }
    .faq-content p { margin-bottom: 0.75rem; font-size: 0.95rem; color: var(--text-light); line-height: 1.7; }
    .faq-content ul, .faq-content ol {
      margin: 0.75rem 0;
      padding-left: 1.25rem;
      color: var(--text-light);
    }
    .faq-content li { margin-bottom: 0.5rem; font-size: 0.95rem; line-height: 1.7; }
    .faq-content strong { color: var(--text); }
    .faq-content code {
      background: #f1f5f9;
      padding: 0.2rem 0.4rem;
      border-radius: 4px;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 0.85em;
      color: var(--accent);
    }

    .comparison-table {
      width: 100%;
      border-collapse: collapse;
      margin: 1rem 0;
      font-size: 0.9rem;
    }
    .comparison-table th, .comparison-table td {
      border: 1px solid var(--border);
      padding: 0.65rem 0.75rem;
      text-align: left;
      line-height: 1.5;
    }
    .comparison-table th {
      background: var(--bg);
      font-weight: 700;
      font-size: 0.82rem;
      color: var(--text);
    }
    .comparison-table td { color: var(--text-light); font-size: 0.88rem; }
    .comparison-table tr:nth-child(even) { background: #f8fafc; }

    .tip-icon { font-size: 1.25rem; flex-shrink: 0; line-height: 1; }

    .method-tag {
      display: inline-block;
      padding: 0.15rem 0.5rem;
      border-radius: 4px;
      font-size: 0.75rem;
      font-weight: 700;
      margin-left: 0.5rem;
      vertical-align: middle;
    }
    .method-tag.gold { background: #fef3c7; color: #92400e; }
    .method-tag.good { background: #d1fae5; color: #065f46; }
    .method-tag.okay { background: #dbeafe; color: #1e40af; }
    .method-tag.rough { background: #f3f4f6; color: #4b5563; }

    .faq-lead { font-size: 0.95rem; color: var(--text-light); margin-bottom: 1rem; line-height: 1.7; }
    .formula-note {
      font-size: 0.85rem;
      color: var(--text-light);
      margin: 0.5rem 0 1rem;
      line-height: 1.6;
      font-style: italic;
    }

    /* Footer */
    footer {
      text-align: center;
      color: var(--text-light);
      font-size: 0.85rem;
      border-top: 1px solid var(--border);
      background: white;
    }

    /* Back to top */
    #backToTop {
      position: fixed;
      bottom: 2rem;
      right: 2rem;
      width: 48px;
      height: 48px;
      border-radius: 50%;
      background: var(--accent);
      color: white;
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      visibility: hidden;
      transition: all 0.3s;
      box-shadow: 0 4px 12px rgba(59,130,246,0.3);
      z-index: 999;
    }
    #backToTop.visible { opacity: 1; visibility: visible; }
    #backToTop:hover { transform: translateY(-2px); background: #2563eb; }
    #backToTop svg { width: 24px; height: 24px; }

    /* Mobile Nav */
    .nav-mobile,
.nav-overlay {
  display: none;
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  
  /* 移动端：左汉堡 / 右语言切换（隐藏标题文字防拥挤） */
  .nav-logo {
    display: none;
  }
  .lang-switch a {
    padding: 0.25rem 0.2rem;
    font-size: 0.85rem;
  }
  
  .nav-mobile {
    display: block; /* 覆盖上面的 none */
    position: fixed;
    top: 0; right: 0;
    width: 280px;
    height: 100vh;
    background: white;
    padding: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1001;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  }
  .nav-mobile.open {
    transform: translateX(0);
  }
  
  .nav-overlay {
    display: block; /* 覆盖上面的 none */
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.4);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 1000;
  }
  .nav-overlay.open {
    opacity: 1;
    visibility: visible;
  }
    @media (max-width: 640px) {
      .nav-links { display: none; }
      .nav-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.5rem;
      }
      .nav-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background: var(--text);
        transition: 0.3s;
      }
      .nav-mobile {
        position: fixed;
        top: 0; right: 0;
        width: 280px;
        height: 100vh;
        background: white;
        padding: 1.5rem;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 1001;
        box-shadow: -4px 0 20px rgba(0,0,0,0.1);
      }
      .nav-mobile.open { transform: translateX(0); }
      .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15,23,42,0.4);
        opacity: 0;
        visibility: hidden;
        transition: 0.3s;
        z-index: 1000;
      }
      .nav-overlay.open { opacity: 1; visibility: visible; }
      .nav-mobile-label {
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: var(--text-light);
        margin-bottom: 1rem;
        font-weight: 700;
      }
      .nav-mobile a {
        display: block;
        padding: 0.875rem 0;
        color: var(--text);
        text-decoration: none;
        border-bottom: 1px solid var(--border);
        font-weight: 500;
        font-size: 1rem;
      }
      .nav-mobile a.active { color: var(--accent); }
      /* 移动端「更多工具」子菜单 */
      .nav-mobile .nav-mobile-group {
        border-bottom: 1px solid var(--border);
      }
      .nav-mobile .nav-mobile-group summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.875rem 0;
        color: var(--text);
        font-weight: 500;
        font-size: 1rem;
        cursor: pointer;
        list-style: none;
      }
      .nav-mobile .nav-mobile-group summary::-webkit-details-marker { display: none; }
      .nav-mobile .nav-mobile-group summary::after {
        content: "▾";
        font-size: 0.8rem;
        color: var(--text-light);
        transition: transform 0.2s;
      }
      .nav-mobile .nav-mobile-group[open] summary::after { transform: rotate(180deg); }
      .nav-mobile .nav-mobile-group a {
        padding: 0.6rem 0 0.6rem 1rem;
        font-size: 0.92rem;
        border-bottom: none;
        color: var(--text-light);
      }
      .nav-mobile .nav-mobile-group a:last-child { padding-bottom: 0.875rem; }
    }

    /* Responsive */
    @media (max-width: 900px) {
      .calculator-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
      }
      .calc-panel {
        position: relative;
        top: 0;
      }
      .diet-grid { grid-template-columns: 1fr; }
      .breakdown-grid { grid-template-columns: 1fr 1fr; }
      .formula-cards { grid-template-columns: 1fr; }
      .activity-cards { grid-template-columns: 1fr 1fr; }
      header h1 { font-size: 1.5rem; }
      .hero-number { font-size: 1.5rem; }
      .result-placeholder { min-height: 200px; }
    }

    @media (max-width: 480px) {
      .form-grid { grid-template-columns: 1fr; }
      .activity-cards { grid-template-columns: 1fr; }
      .breakdown-grid { grid-template-columns: 1fr; }
      .calculator-card, #results { padding: 1.25rem; }
      main { padding: 0 1rem 2rem; }
      .diet-grid { grid-template-columns: 1fr; }
      .comparison-table { font-size: 0.82rem; }
      .comparison-table th, .comparison-table td { padding: 0.5rem; }
      header { padding-top: calc(var(--nav-height) + 2rem); }
      header h1 { font-size: 1.35rem; }
    }

    /* Print */
    @media print {
      .nav-bar, .nav-toggle, #backToTop, .faq-section, .result-placeholder { display: none !important; }
      .calculator-layout { grid-template-columns: 1fr; }
      #results { display: block !important; opacity: 1 !important; page-break-inside: avoid; }
    }
}


/* 菜单内显式关闭按钮 */
.nav-mobile-close {
  display: none;
}
@media (max-width: 640px) {
  .nav-mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: calc(var(--nav-height) / 2 - 16px);
    right: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    z-index: 1003;
    transition: background 0.2s, color 0.2s;
  }
  .nav-mobile-close:hover {
    background: var(--accent);
    color: white;
  }
}


.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}
.friend-links-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-bottom: 12px;
  font-size: 0.85rem;
}
.friend-label {
  color: #64748b;
  font-weight: 500;
}
.footer-links a {
    color: #475569;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: #38bdf8;
}
.friend-links-row a {
  color: #475569;
  text-decoration: none;
  transition: color 0.2s;
}
.friend-links-row a:hover {
  color: #38bdf8;
}
footer p {
  color: #475569;
  font-size: 0.8rem;
  margin: 0;
}
footer .footer-disclaimer {
  margin-top: 10px;
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.6;
}

/* ===== 首页资讯板块样式 ===== */
.news-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 0;
}

/* 文章卡片网格 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.news-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  transition: all 0.25s ease;
  overflow: hidden;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-light);
}

.news-card-link {
  display: block;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.news-tag {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.news-tag.guide { background: #dbeafe; color: #1e40af; }
.news-tag.faq { background: #d1fae5; color: #065f46; }
.news-tag.tip { background: #fef3c7; color: #92400e; }
.news-tag.nutrition { background: #fce7f3; color: #be185d; }
.news-tag.fitness { background: #e0e7ff; color: #4338ca; }

.news-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.4;
  margin-bottom: 0.6rem;
  transition: color 0.2s;
}

.news-card:hover .news-card-title {
  color: var(--accent);
}

.news-card-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card:hover .read-more {
  color: #2563eb;
}

/* 响应式 */
@media (max-width: 900px) {
  .news-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .news-section {
    padding: 0 1rem 0;
  }
}

@media (max-width: 480px) {
  .news-card-link {
    padding: 1.25rem;
  }
  .news-card-title {
    font-size: 1rem;
  }
  .news-section-header h2 {
    font-size: 1.2rem;
  }
  .tags-cloud {
    gap: 0.5rem;
  }
  .cloud-tag {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
}


.gongshi {
  font-weight: 500;
  color: var(--primary);
}

.gender-select { display: flex; gap: 10px;width:100%; }
.gender-option {
  flex: 1; text-align: center; padding: 12px; border: 2px solid #e2e8f0;
  border-radius: 10px; cursor: pointer; font-size: 14px; transition: .2s;
}
.gender-option.active {     border-color: var(--accent);
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }
.gender-option:hover {
      border-color: var(--accent-light);
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(59,130,246,0.08);
}

.result-primary { margin-bottom: 16px; }  /* 替代 br 的间距 */
.result-label { font-size: 14px; color: #0f172a; margin-bottom: 4px;font-weight: 500; }
.hero-number, .bd-value { font-size: 25px; font-weight: 500; color: #3b82f6; }
.result-unit { font-size: 14px; color: #64748b; }

.result-size {font-size: 18px;color: #0f172a; margin-bottom: 4px;font-weight: 500;}

#cutReason,#maintainReason,#bulkReason {color: #64748b;font-size: 12px;}

.faq-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
  text-align: center;
}

#news-heading {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
}

.result-jianzhi {
  color: #059669;
}

.result-zengji {
  color: #d97706;
}


.faq-h3 {
  display: inline;
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

.news-card-time {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 8px;
}
.news-card-meta {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 8px;
}
.news-card-meta .meta-divider {
  margin: 0 6px;
  color: #cbd5e1;
}

.news-mini-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-mini-list li {
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 0;
}

.news-mini-list a {
  display: flex;
  align-items: baseline;
  text-decoration: none;
  color: #374151;
  transition: color 0.2s;
}

.news-mini-list a:hover {
  color: #e74c3c;
}

.news-mini-date {
  color: #9ca3af;
  font-size: 0.85rem;
  min-width: 60px;
  flex-shrink: 0;
}

.news-mini-title {
  font-size: 0.95rem;
  line-height: 1.5;
}

.news-mini-more {
  text-align: center;
  margin-top: 16px;
}

.news-mini-more a {
  color: #6b7280;
  font-size: 0.9rem;
  text-decoration: none;
}

.news-mini-more a:hover {
  color: #e74c3c;
}

@media (max-width: 768px) {
  .news-mini-list a {
    flex-direction: column;
    gap: 4px;
  }
  .news-mini-date {
    min-width: auto;
  }
}

/* ===== 历史记录样式 ===== */
.history-box {
  margin-top: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.history-box summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  padding: 12px 16px;
  user-select: none;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.history-box summary:hover {
  background: #f1f5f9;
}

.history-list {
  padding: 16px;
  max-height: 500px;
  overflow-y: auto;
}

.history-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #f8fafc;
  transition: opacity 0.2s, transform 0.2s;
}

.history-item:last-child {
  margin-bottom: 0;
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}

.history-item-time {
  color: #475569;
  font-size: 12px;
  font-weight: 500;
}

.history-item-time time {
  color: #334155;
}

.history-item-tags {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.history-item-formula {
  color: #0284c7;
  font-weight: 600;
  font-size: 13px;
}

.history-item-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-recalc {
  padding: 3px 10px;
  font-size: 12px;
  border: 1px solid #0ea5e9;
  background: #fff;
  color: #0ea5e9;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-recalc:hover {
  background: #0ea5e9;
  color: #fff;
}

.btn-delete-item {
  padding: 3px 8px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.4;
}
.btn-delete-item:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: #fef2f2;
}

.history-item-body {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
}

.history-item-body span {
  background: #e9edf2;
  padding: 0 6px;
  border-radius: 4px;
}

.history-item-result {
  margin-top: 6px;
  font-size: 14px;
  color: #0f172a;
  font-weight: 600;
}

.history-item-compare {
  font-size: 12px;
  font-weight: 400;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 12px;
  background: #f1f5f9;
}
/* BMR 专用：上升=绿色（好），下降=红色（坏） */
.history-item-compare.bmr-up {
  color: #16a34a;
  background: #dcfce7;
}
.history-item-compare.bmr-down {
  color: #dc2626;
  background: #fee2e2;
}

/* 体重专用：中性色（只用方向，不表达好坏） */
.history-item-compare.weight-up {
  color: #2563eb;
  background: #dbeafe;  /* 蓝色 */
}
.history-item-compare.weight-down {
  color: #6b7280;
  background: #f3f4f6;  /* 灰色 */
}
.history-item-compare.same {
  color: #6b7280;
  background: #f3f4f6;
}

.history-empty {
  color: #475569;
  font-size: 14px;
  margin: 0;
  text-align: center;
  padding: 20px 0;
}

.history-clear-btn {
  padding: 4px 14px;
  font-size: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.history-clear-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: #fef2f2;
}

.history-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

/* 输入框闪烁动画 - 回填数据时的视觉反馈 */
@keyframes inputFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4);
    background-color: #eff6ff;
  }
  30% {
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.25), 0 0 20px rgba(14, 165, 233, 0.1);
    background-color: #dbeafe;
  }
  70% {
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
    background-color: #eff6ff;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
    background-color: transparent;
  }
}

.input-flash {
  animation: inputFlash 0.8s ease 2;  /* 闪两遍，约1.6秒，配合 js 的 1.5秒移除 */
  border-color: #0ea5e9 !important;
  transition: border-color 0.2s;
}

/* ===== 自定义确认对话框 ===== */
.confirm-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  animation: confirmFadeIn 0.25s ease;
}

.confirm-overlay.open {
  display: flex;
}

@keyframes confirmFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.confirm-box {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px 36px 28px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  animation: confirmSlideUp 0.3s ease;
}

@keyframes confirmSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.confirm-icon {
  font-size: 44px;
  margin-bottom: 8px;
  line-height: 1.2;
}

.confirm-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.confirm-message {
  font-size: 15px;
  color: #475569;
  margin: 0 0 24px 0;
  line-height: 1.6;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-btn {
  padding: 10px 28px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 80px;
}

.confirm-btn-cancel {
  background: #f1f5f9;
  color: #475569;
}
.confirm-btn-cancel:hover {
  background: #e2e8f0;
}

.confirm-btn-danger {
  background: #dc2626;
  color: #fff;
}
.confirm-btn-danger:hover {
  background: #b91c1c;
  transform: scale(1.02);
}

.confirm-btn-primary {
  background: #0ea5e9;
  color: #fff;
}
.confirm-btn-primary:hover {
  background: #0284c7;
  transform: scale(1.02);
}

@media (max-width: 480px) {
  .confirm-box {
    padding: 24px 20px 20px;
    width: 92%;
  }
  .confirm-btn {
    padding: 12px 16px;
    font-size: 14px;
  }
  .confirm-icon {
    font-size: 36px;
  }
}



/* ===== 文章样式 ===== */
    /* Article Specific Styles */
    .article-container {
      max-width: 1200px;
      margin: 0 auto;
      padding: calc(var(--nav-height) + 2rem) 1.5rem 3rem;
    }

    .article-breadcrumb {
      max-width: 800px;
      margin: 0 auto;
      font-size: 0.85rem;
      color: var(--text-light);
    }
    .article-breadcrumb a {
      color: var(--accent);
      text-decoration: none;
      font-weight: 500;
    }
    .article-breadcrumb a:hover { text-decoration: underline; }
    .article-breadcrumb span { margin: 0 0.5rem; color: var(--border); }

    .article-header {
      max-width: 800px;
      margin: 0 auto 2.5rem;
      padding-bottom: 1.5rem;
      border-bottom: 2px solid var(--border);
    }
    .article-header h1 {
      font-size: 1.85rem;
      font-weight: 800;
      color: var(--primary);
      line-height: 1.3;
      letter-spacing: -0.02em;
      margin-bottom: 1rem;
    }
    .article-meta {
      font-size: 0.85rem;
      color: var(--text-light);
    }

    .article-lead {
      max-width: 800px;
      margin: 0 auto 2rem;
      font-size: 1.1rem;
      color: var(--text-light);
      line-height: 1.8;
      padding: 1.25rem;
      background: #eff6ff;
      border-radius: var(--radius-sm);
    }
    .article-lead strong { color: var(--text); }

    .article-content {
      max-width: 800px;
      margin: 0 auto;
    }
    .article-content img {
      max-width: 100%;
      height: auto;
      border-radius: var(--radius-sm);
    }
    .article-content blockquote {
      margin: 1.25rem 0;
      padding: 1rem 1.25rem;
      background: var(--card-bg);
      border-radius: var(--radius-sm);
      color: var(--text-light);
      line-height: 1.7;
    }
    .article-content blockquote p { margin-bottom: 0; }

    .article-content h2 {
      font-size: 1.4rem;
      font-weight: 800;
      color: var(--primary);
      margin: 2.5rem 0 1rem;
      padding-bottom: 0.5rem;
      border-bottom: 2px solid var(--border);
      letter-spacing: -0.01em;
    }
    .article-content h2:first-child { margin-top: 0; }

    .article-content h3 {
      font-size: 1.15rem;
      font-weight: 700;
      color: var(--primary);
      margin: 1.75rem 0 0.75rem;
    }

    .article-content p {
      font-size: 1rem;
      line-height: 1.8;
      color: var(--text);
      margin-bottom: 1rem;
    }
    .article-content p strong { color: var(--primary); }

    .article-content ul, .article-content ol {
      margin: 1rem 0 1.25rem;
      padding-left: 1.5rem;
    }
    .article-content li {
      margin-bottom: 0.6rem;
      line-height: 1.7;
      color: var(--text);
    }
    .article-content li::marker { color: var(--accent); }

    .article-content a {
      color: var(--accent);
      text-decoration: none;
      font-weight: 500;
      border-bottom: 1px solid transparent;
      transition: border-color 0.2s;
    }
    .article-content a:hover {
      border-bottom-color: var(--accent);
    }

    .article-content table {
      width: 100%;
      border-collapse: collapse;
      margin: 1.25rem 0;
      font-size: 0.95rem;
      box-shadow: var(--shadow);
      border-radius: var(--radius-sm);
      overflow: hidden;
    }
    .article-content th, .article-content td {
      border: 1px solid var(--border);
      padding: 0.75rem 1rem;
      text-align: left;
      line-height: 1.5;
    }
    .article-content th {
      background: #eff6ff;
      font-weight: 700;
      color: var(--primary);
      font-size: 0.9rem;
    }
    .article-content td { color: var(--text); }
    .article-content tr:nth-child(even) { background: #f8fafc; }

    .tip-box {
      background: #eff6ff;
      padding: 1rem 1.25rem;
      border-radius: var(--radius-sm);
      margin: 1.5rem 0;
      display: flex;
      gap: 0.75rem;
      align-items: flex-start;
    }
    .tip-box div { font-size: 0.95rem; color: var(--text-light); line-height: 1.7; }
    .tip-box p { font-size: 0.95rem; color: var(--text-light); line-height: 1.7; }
    .tip-box div strong { color: var(--text); }

    .warning-box {
      background: #fef3c7;
      padding: 1rem 1.25rem;
      border-radius: var(--radius-sm);
      margin: 1.5rem 0;
      display: flex;
      gap: 0.75rem;
      align-items: flex-start;
    }
    .warning-box div { font-size: 0.95rem; color: var(--text); line-height: 1.7; }
    .warning-box p { font-size: 0.95rem; color: var(--text-light); line-height: 1.7; }

    .formula-box {
      margin: 1rem 0;
    }
    .formula-box p { margin-bottom: 0.5rem; }
    .formula-box p:last-child { margin-bottom: 0; }
    .formula-box code {
      display: block;
      background: #e2e8f0;
      border: 1px solid #cbd5e1;
      color: #0f172a;
      padding: 0.7rem 1rem;
      border-radius: var(--radius-sm);
      font-size: 0.95rem;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
      line-height: 1.75;
      margin: 0.4rem 0;
      overflow-x: auto;
      white-space: pre-wrap;
      word-break: break-all;
    }

    /* 高亮框 */
    .highlight-box {
      background: #eef2ff;
      border-radius: var(--radius-sm);
      padding: 1.25rem 1.5rem;
      margin: 1.5rem 0;
    }
    .highlight-box p { margin-bottom: 0.5rem; }
    .highlight-box p:last-child { margin-bottom: 0; }
    .highlight-box ul { margin: 0.5rem 0 0; padding-left: 1.4rem; }

    /* 成功提示框 */
    .success-box {
      background: #ecfdf5;
      padding: 1rem 1.25rem;
      border-radius: var(--radius-sm);
      margin: 1.5rem 0;
    }
    .success-box div, .success-box p {
      font-size: 0.95rem;
      color: var(--text-light);
      line-height: 1.7;
    }
    .success-box div strong, .success-box p strong { color: var(--text); }

    /* 对比卡片（如干净增肌 vs 脏增肌、BMR 公式对比） */
    .compare-box {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1rem;
      margin: 1.5rem 0;
    }
    .compare-item {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-top: 3px solid var(--accent);
      border-radius: var(--radius-sm);
      padding: 1.25rem 1.5rem;
      box-shadow: var(--shadow);
    }
    .compare-item.harris { border-top-color: var(--warning); }
    .compare-item.mifflin, .compare-item.bmi { border-top-color: var(--accent); }
    .compare-item.katch, .compare-item.bmr { border-top-color: var(--success); }
    .compare-item h4 {
      font-size: 1.05rem;
      font-weight: 700;
      color: var(--primary);
      margin: 0 0 0.5rem;
    }
    .compare-item p {
      margin: 0;
      font-size: 0.95rem;
      color: var(--text-light);
      line-height: 1.7;
    }
    .compare-icon {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: #eff6ff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.25rem;
      margin-bottom: 0.75rem;
    }

    /* 方法卡片（测量方法、操作步骤） */
    .method-card {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 1.5rem;
      margin: 1.25rem 0;
      box-shadow: var(--shadow);
    }
    .method-card > .method-tag { margin-left: 0; margin-bottom: 0.5rem; }
    .method-card h4 {
      font-size: 1.05rem;
      font-weight: 700;
      color: var(--primary);
      margin: 0 0 0.75rem;
    }
    .method-card p {
      margin: 0 0 0.6rem;
      font-size: 0.95rem;
      line-height: 1.7;
      color: var(--text);
    }
    .method-card p:last-child { margin-bottom: 0; }
    .method-card p strong { color: var(--primary); }
    .method-num {
      width: 2rem;
      height: 2rem;
      border-radius: 50%;
      background: var(--accent);
      color: #fff;
      font-weight: 700;
      font-size: 1rem;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 0.75rem;
    }

    /* 步骤卡片 */
    .step-box {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 1.5rem;
      margin: 1.25rem 0;
      box-shadow: var(--shadow);
    }
    .step-box h4 {
      font-size: 1.05rem;
      font-weight: 700;
      color: var(--primary);
      margin: 0 0 0.6rem;
    }
    .step-box p {
      margin: 0 0 0.6rem;
      font-size: 0.95rem;
      line-height: 1.7;
      color: var(--text);
    }
    .step-box p:last-child { margin-bottom: 0; }
    .step-num {
      width: 2rem;
      height: 2rem;
      border-radius: 50%;
      background: var(--accent);
      color: #fff;
      font-weight: 700;
      font-size: 1rem;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 0.75rem;
    }

    /* 结论对比卡片（高 BMR vs 低 BMR） */
    .comparison-card-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1rem;
      margin: 1.5rem 0;
    }
    .comparison-card {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 1.5rem;
      box-shadow: var(--shadow);
    }
    .comparison-card h4 {
      font-size: 1.05rem;
      font-weight: 700;
      margin: 0 0 0.75rem;
    }
    .comparison-card.high h4 { color: var(--success); }
    .comparison-card.low h4 { color: var(--danger); }
    .comparison-card ul { margin: 0; padding-left: 1.25rem; }
    .comparison-card li {
      font-size: 0.9rem;
      line-height: 1.6;
      margin-bottom: 0.4rem;
    }

    /* 参考资料区 */
    .references-section {
      max-width: 800px;
      margin: 2rem auto 0;
      padding: 1.25rem 1.5rem;
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
    }
    .references-section h3 { margin-top: 0; }
    .references-section ol { margin: 0.5rem 0 0; padding-left: 1.5rem; }
    .references-section li {
      font-size: 0.85rem;
      color: var(--text-light);
      line-height: 1.7;
      margin-bottom: 0.5rem;
    }
    .references-section li:last-child { margin-bottom: 0; }

    /* 文章元信息分隔符 */
    .meta-divider {
      margin: 0 0.5rem;
      color: var(--border);
    }

    /* 引言段 */
    .article-content .lead {
      font-size: 1.05rem;
      color: var(--text);
      line-height: 1.8;
      margin-bottom: 1.5rem;
    }

    .toc {
      max-width: 800px;
      margin: 0 auto 2rem;
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 1.25rem;
      box-shadow: var(--shadow);
    }
    .toc h3 {
      font-size: 1rem;
      font-weight: 700;
      color: var(--primary);
      margin-bottom: 0.75rem;
      margin-top: 0;
    }
    .toc ul {
      list-style: none;
      padding: 0;
      margin: 0;
    }
    .toc li { margin-bottom: 0.4rem; }
    .toc a {
      color: var(--text-light);
      text-decoration: none;
      font-size: 0.9rem;
      font-weight: 500;
      display: block;
      padding: 0.3rem 0;
      transition: color 0.2s;
    }
    .toc a:hover { color: var(--accent); }
    .toc a::before { content: "→ "; color: var(--accent); opacity: 0.6; }

    /* Schema FAQ inline */
    .faq-inline details {
      background: var(--card-bg);
      border-radius: var(--radius-sm);
      margin-bottom: 1rem;
      box-shadow: var(--shadow);
      overflow: hidden;
      border: 1px solid var(--border);
    }
    .faq-inline summary {
      padding: 1.25rem 1.5rem;
      font-weight: 700;
      cursor: pointer;
      list-style: none;
      display: flex;
      align-items: center;
      justify-content: space-between;
      transition: background 0.2s;
      font-size: 1rem;
      color: var(--text);
      line-height: 1.4;
    }
    .faq-inline summary::-webkit-details-marker { display: none; }
    .faq-inline summary::after {
      content: '+';
      font-size: 1.5rem;
      color: var(--accent);
      font-weight: 400;
      transition: transform 0.3s;
      flex-shrink: 0;
      margin-left: 1rem;
    }
    .faq-inline details[open] summary::after { content: '−'; }
    .faq-inline summary:hover { background: #f8fafc; }
    .faq-inline .faq-answer {
      padding: 0 1.5rem 1.5rem;
      animation: fadeIn 0.35s ease;
    }
    .faq-inline .faq-answer p {
      margin-bottom: 0.75rem;
      font-size: 0.95rem;
      color: var(--text-light);
      line-height: 1.7;
    }
    .faq-inline .faq-answer p:last-child { margin-bottom: 0; }
    @keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

    @media (max-width: 640px) {
      .article-container { padding: calc(var(--nav-height) + 1.5rem) 1rem 2rem; }
      .article-header h1 { font-size: 1.5rem; }
      .article-content h2 { font-size: 1.2rem; }
      .article-content table { font-size: 0.85rem; }
      .article-content th, .article-content td { padding: 0.5rem 0.75rem; }
      .compare-box, .comparison-card-grid { grid-template-columns: 1fr; }
    }

/* ===== 语言切换（EN / 中文，点击直接切换，纯文字无边框无背景） ===== */
.lang-switch {
  display: inline-flex;
  align-items: center;
  margin-left: 2rem; /* 与左侧导航链接拉开间距 */
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.3rem;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text-light);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.lang-switch a + a::before {
  content: "/";
  margin-right: 0.3rem;
  color: var(--text-light);
  opacity: 0.45;
}

.lang-switch a:hover {
  color: var(--accent);
}

/* 当前语言高亮：仅文本变颜色（依据 html lang 属性自动匹配） */
html[lang="zh-CN"] .lang-switch a[hreflang="zh"],
html[lang="en"]    .lang-switch a[hreflang="en"] {
  color: var(--accent);
  font-weight: 600;
}

/* ===== 语言下拉（桌面端，ja 版仍在用） ===== */
.lang-dropdown {
  position: relative;
  cursor: pointer;
  user-select: none;
  outline: none; /* 保留 focus 轮廓用于键盘操作 */
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.lang-dropdown:hover .lang-current,
.lang-dropdown:focus-within .lang-current {
  background: var(--bg);
  color: var(--accent);
}

.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: 0.5rem 0;
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

/* 点击/悬停/聚焦时显示菜单 */
.lang-dropdown:hover .lang-menu,
.lang-dropdown:focus-within .lang-menu,
.lang-dropdown:active .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-menu li {
  list-style: none;
}

.lang-menu a {
  display: block;
  padding: 0.5rem 1.25rem;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.lang-menu a:hover {
  background: var(--bg);
  color: var(--accent);
}

/* 高亮当前语言（依据 html lang 属性自动匹配） */
html[lang="zh-CN"] .lang-menu a[hreflang="zh"],
html[lang="en"]    .lang-menu a[hreflang="en"] {
  font-weight: 700;
  color: var(--accent);
  background: #eff6ff;
}

/* 当前语言标签显示为选择的语言名（仅显示，不可点击） */
html[lang="zh-CN"] .lang-label { content: "中文"; }
html[lang="en"]    .lang-label { content: "English"; }
/* 移动端语言列表 */
.lang-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.lang-mobile-list a {
  display: block;
  padding: 0.75rem 0;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

/* 移动端高亮 */
html[lang="zh-CN"] .lang-mobile-list a[hreflang="zh"],
html[lang="en"]    .lang-mobile-list a[hreflang="en"] {
  color: var(--accent);
  font-weight: 700;
}

.sample-note {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  color: #ef4444;
  margin-top: 0.5rem;
}

#loadLastRecordBtn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;                /* 继承父元素的字体属性 */
  cursor: pointer;
  /* 下面的样式沿用 .inline-help 的定义，但提高优先级 */
  color: #3b82f6;               /* 或 --accent */
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;          /* 防止文字换行 */
  line-height: 1.5;
}

#loadLastRecordBtn:hover {
  text-decoration: underline;
  color: #2563eb;
}



/* 文章原创图表与作者署名 */
.article-chart {
  margin: 1.75rem auto;
  max-width: 720px;
  text-align: center;
}
.article-chart img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.article-chart figcaption {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.6rem;
  line-height: 1.7;
  text-align: left;
}
.article-author-line {
  max-width: 800px;
  margin: 0.25rem auto 1rem;
  font-size: 0.85rem;
  color: var(--text-light);
}
.article-author-line a {
  color: var(--accent);
  font-weight: 500;
}

/* 兜底：个别文章把"参考资料"等块放在正文容器外（1200px），
   统一约束为与正文同宽（800px） */
.article-container > h3,
.article-container > ol {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}