/* 通用样式 - 响应式、简洁、专业 - 2025优化版 */

/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  /* 提升移动端体验：防止字体被系统强制放大 */
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.8;
  color: #333;
  background: #f8fbff;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

header {
  text-align: center;
  margin-bottom: 3rem;
  padding-top: 1.5rem;
}

.doc-title {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  color: #004080;
  margin-bottom: 0.6rem;
  border-bottom: 3px solid #004080;
  padding-bottom: 0.8rem;
  font-weight: 700;
}

.doc-version {
  font-size: 1.05rem;
  color: #666;
}

main {
  margin-bottom: 4rem;
}

.section {
  position: relative;
  margin: 2.5rem 0;
  padding: 1.8rem 2rem;
  background: white;
  border: 1px solid #e0e8f5;
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.section h2 {
  font-size: 1.65rem;
  color: #004080;
  margin-bottom: 1.2rem;
  border-left: 5px solid #004080;
  padding-left: 14px;
  font-weight: 600;
}

.section h3 {
  font-size: 1.38rem;
  color: #0059b3;
  margin: 1.8rem 0 0.9rem;
}

.section p,
.section li {
  margin-bottom: 1.1rem;
  color: #444;
  line-height: 1.85;
}

.section ul,
.section ol {
  margin: 1.2rem 0 1.2rem 2.2rem;
}

.section li {
  margin-bottom: 0.9rem;
}

/* ── 重点优化：图片自适应 ── */
img {
  max-width: 100%;
  height: auto;
  display: block;           /* 去除图片底部间隙 */
  margin: 1.5rem auto;      /* 居中 + 上下间距 */
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* 鼠标悬停放大效果（PC端） */
@media (hover: hover) and (pointer: fine) {
  img:hover {
    transform: scale(1.015);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  }
}

/* 高分辨率屏幕优化（Retina / 2x, 3x） */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  img {
    image-rendering: -webkit-optimize-contrast; /* 更清晰 */
  }
}

/* 限制超大图片的最大显示宽度（可选） */
img[src$=".jpg"],
img[src$=".jpeg"],
img[src$=".png"],
img[src$=".gif"],
img[src$=".webp"] {
  max-width: 100%;
  width: 100%;
  height: auto;
}

/* 如果图片有特定class，可以更精细控制 */
.figure,
img.align-center,
.center-img {
  margin: 2rem auto;
  text-align: center;
}

.figure img {
  margin: 0 auto 0.8rem;
}

/* 弹窗内的图片也要自适应 */
.modal-content img {
  max-width: 100%;
  height: auto;
  margin: 1.2rem 0;
}

/* 编辑按钮 */
.edit-btn {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  padding: 0.5rem 1.1rem;
  font-size: 0.94rem;
  color: #0066cc;
  background: rgba(0, 102, 204, 0.07);
  border: 1px solid #a3d0ff;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.22s ease;
  z-index: 10;
}

.edit-btn:hover {
  background: rgba(0, 102, 204, 0.16);
  border-color: #0066cc;
  transform: translateY(-1px);
}

/* 弹窗样式 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px); /* 现代浏览器毛玻璃效果 */
}

.modal-content {
  background: white;
  width: 92%;
  max-width: 960px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 2.2rem;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  position: relative;
}

.close-modal {
  position: absolute;
  top: 16px;
  right: 24px;
  font-size: 2.6rem;
  cursor: pointer;
  color: #bbb;
  line-height: 1;
}

.close-modal:hover {
  color: #444;
}

/* 响应式断点 */
@media (max-width: 1024px) {
  .container {
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  .doc-title {
    font-size: clamp(1.6rem, 6vw, 2rem);
  }

  .section {
    padding: 1.4rem 1.6rem;
    margin: 2rem 0;
  }

  .edit-btn {
    position: static;
    display: block;
    margin: 1.2rem auto 0;
    width: fit-content;
  }

  .modal-content {
    padding: 1.6rem;
    width: 96%;
  }

  .close-modal {
    top: 12px;
    right: 16px;
    font-size: 2.2rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  .section h2 {
    font-size: 1.45rem;
  }

  .section h3 {
    font-size: 1.28rem;
  }

  .modal-content {
    padding: 1.4rem;
  }
}

footer {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
  color: #777;
  font-size: 0.94rem;
  border-top: 1px solid #e0e0e0;
}