/* --- 全局重置与变量 (保持一致性) --- */
:root {
  --bg-color: #0f1012;
  --card-bg: #151618;
  /* 比背景稍亮一点 */
  --text-main: #ffffff;
  --text-grey: #8c8c8c;
  --accent-orange: #d99c68;
  --border-color: #333;
  --font-serif: "SimSun", "Songti SC", serif;
  --font-sans: "DengXian", "Microsoft YaHei", sans-serif;
  --font-mono: "Consolas", "Monaco", monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

a {
  text-decoration: none;
  color: inherit;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* 防止全屏滚动 */
}

/* --- 顶部导航 --- */
header {
  height: 60px;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.header-left .back-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 14px;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.header-left .back-btn:hover {
  color: #ffffff;
}

.logo-area {
  text-align: center;
}

.logo-title {
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: 2px;
  margin-left: 320px;
}

.logo-sub {
  font-size: 10px;
  color: #fff;
  letter-spacing: 3px;
  margin-left: 320px;
}

.nav-menu {
  display: flex;
  gap: 20px;
}

.nav-item {
  font-size: 15px;
  padding: 6px 16px;
  border-radius: 4px;
  color: var(--text-grey);
  transition: all 0.3s;
}

.nav-item.active {
  background-color: var(--accent-orange);
  color: #1e1f21;
  font-weight: bold;
}

.nav-item:hover:not(.active) {
  color: var(--text-main);
}

/* --- 页面主体容器 --- */
.page-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 60px 40px 60px;
}

/* 顶部标题区 */
.header-section {
  text-align: center;
  margin-bottom: 30px;
}

.page-title {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 800;
  color: var(--accent-orange);
  margin-bottom: 10px;
}

.page-desc {
  font-size: 16px;
  color: #fff;
}

/* --- 主要内容大卡片 --- */
.content-card {
  background-color: var(--card-bg);
  width: 100%;
  max-width: 1100px;
  border-radius: 12px;
  padding: 40px;
  /* 模拟微弱的光照 */
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  border: 1px solid #222;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 30px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 30px;
  text-align: center;
  margin-bottom: 40px;
  color: var(--text-main);
}

/* --- 左右分栏布局 --- */
.split-layout {
  display: flex;
  gap: 60px;
  height: 100%;
}

.left-column {
  flex: 1.2;
  display: flex;
  flex-direction: column;
}

.right-column {
  flex: 0.8;
}

/* 文字段落 */
.text-body {
  font-size: 17px;
  line-height: 1.8;
  color: #ffffff;
  margin-bottom: 20px;
  text-align: justify;
}

/* --- 化学反应盒子 --- */
.reaction-group {
  margin-top: 30px;
  /* 推到底部 */
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.reaction-box {
  border: 1px solid #ad7d54;
  border-radius: 8px;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.02);
  height: 90px;
  background-color: #27211b;
}

.reaction-label {
  display: block;
  font-size: 18px;
  color: #ffffff;
  margin-bottom: 8px;
}

.equation {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--accent-orange);
  letter-spacing: 0.5px;
}

.note {
  font-family: var(--font-sans);
  color: #b9b9ba;
  font-size: 18px;
}

/* 下标微调 */
sub {
  font-size: 0.8em;
}

/* --- 右侧表格 --- */
.table-title {
  font-size: 20px;
  color: var(--accent-orange);
  margin-bottom: 20px;
  font-weight: normal;
}

.chemistry-table {
  display: flex;
  flex-direction: column;
  width: 110%;
}

.table-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  /* 三列比例 */
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  align-items: center;
}

.table-row.header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 10px;
}

.table-row.header .col {
  color: var(--accent-orange);
  font-size: 17px;
  font-weight: bold;
}

.col {
  font-size: 16px;
  /* color: var(--text-main); */
  color: #bcbaba;
}

.col.mono {
  font-family: var(--font-mono);
  color: #bcbaba;
}

/* 最后一项去边框 */
.table-row:last-child {
  border-bottom: none;
}

@media (max-width: 768px) {

  body {
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }

  header {
    height: auto;
    flex-direction: column;
    /* 改为垂直排列 */
    padding: 15px 15px 10px 15px;
    gap: 15px;
    /* 两行间距 */
    position: relative;
  }

  .header-left {
    position: absolute;
    left: 15px;
    top: 20px;
  }

  .logo-title,
  .logo-sub {
    margin-left: 0;
    text-align: center;
  }

  .nav-menu {
    width: 100%;
    justify-content: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
    /* 给滑动条留一点空间 */
  }

  .nav-item {
    font-size: 12px;
    padding: 6px 10px;
    white-space: nowrap;
    /* 保证文字不换行 */
  }

  .hero-text {
    margin-top: 15px;
    margin-bottom: 20px;
    padding: 0 15px;
  }

  .main-title {
    font-size: 24px;
    margin-bottom: 8px;
  }
}

/* --- 响应式适配 (移动端: 屏幕宽度小于768px) --- */

@media (max-width: 768px) {

  body {
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }

  header {
    height: auto;
    flex-direction: column;
    padding: 15px 15px 10px 15px;
    gap: 15px;
    position: relative;
  }

  .header-left {
    position: absolute;
    left: 15px;
    top: 20px;
  }

  .logo-title,
  .logo-sub {
    margin-left: 0;
    text-align: center;
  }

  .nav-menu {
    width: 100%;
    justify-content: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
  }

  .nav-item {
    font-size: 12px;
    padding: 6px 10px;
    white-space: nowrap;
  }

  .page-container {
    padding: 15px 15px 40px 15px;
    /* 减小左右留白 */
  }

  .header-section {
    margin-bottom: 20px;
  }

  .page-title {
    font-size: 24px;
    margin-bottom: 8px;
  }

  .page-desc {
    font-size: 13px;
  }

  .content-card {
    padding: 20px;
    /* 缩小卡片内边距 */
    margin-top: 15px;
  }

  .section-title {
    font-size: 20px;
    margin-bottom: 25px;
  }

  .split-layout {
    flex-direction: column;
    /* 核心：左右分栏变成上下分栏 */
    gap: 30px;
    /* 上下两部分的间距 */
  }

  .text-body {
    font-size: 14px;
    /* 稍微缩小正文字体 */
    line-height: 1.6;
  }

  /* 6. 化学方程式盒子调整 */
  .reaction-group {
    gap: 15px;
    margin-top: 20px;
  }

  .reaction-box {
    height: auto;
    padding: 12px 15px;
  }

  .reaction-label {
    font-size: 14px;
  }

  .equation {
    font-size: 12px;
    word-break: break-all;
    /* 允许在极窄屏幕下换行 */
  }

  .note {
    font-size: 12px;
  }

  .right-column {
    margin-top: 10px;
  }

  .chemistry-table {
    width: 100%;
  }

  .table-row {
    grid-template-columns: 1.2fr 1.5fr 1fr;
    /* 微调列比例，给化学式留多点空间 */
    gap: 5px;
  }

  .table-row.header .col,
  .col {
    font-size: 12px;
    /* 缩小表格字体 */
  }
}