/* ===== 基础重置 ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #ffffff;
  --text-dark: #191919;
  --text-gray: #979797;
  --text-section: #565656;
  --tip-bg: #fff2df;
  --tip-text: #7d4d29;
  --radius: 16px;
  --transition: 0.25s ease;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== 加载动画 ===== */
.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}
.loader-spinner {
  width: 40px; height: 40px;
  border: 3px solid #eee;
  border-top-color: #999;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 主容器 ===== */
.content {
  max-width: 480px;
  margin: 0 auto;
  padding: 60px 20px 40px;
  min-height: 100vh;
}
.hidden { display: none !important; }

/* ===== 顶部图标 ===== */
.top-icon {
  text-align: center;
  font-size: 56px;
  margin-bottom: 24px;
  line-height: 1;
}

/* ===== 主标题 ===== */
.main-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 1px;
  margin-bottom: 12px;
}

/* ===== 副标题 ===== */
.subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-gray);
  line-height: 1.8;
  white-space: pre-line;
  margin-bottom: 28px;
}

/* ===== 温馨提示框 ===== */
.tip-box {
  background: var(--tip-bg);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 32px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.tip-box.hidden { display: none; }
.tip-icon { font-size: 16px; flex-shrink: 0; line-height: 1.6; }
.tip-text {
  font-size: 13px;
  color: var(--tip-text);
  line-height: 1.6;
  flex: 1;
}

/* ===== 板块标题 ===== */
.section-title {
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-section);
  margin-bottom: 20px;
}

/* ===== 按钮列表 ===== */
.buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 40px;
}

.btn-item {
  display: flex;
  align-items: center;
  padding: 20px 22px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  animation: btnIn 0.4s ease both;
  border: none;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
@keyframes btnIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.btn-item:active {
  transform: scale(0.97);
  opacity: 0.9;
}

/* 按钮内容区 */
.btn-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.btn-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
}
.btn-description {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  line-height: 1.4;
}
.btn-label {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  line-height: 1.4;
  margin-top: 2px;
}

/* 按钮箭头 */
.btn-arrow {
  color: #fff;
  font-size: 24px;
  font-weight: 300;
  flex-shrink: 0;
  margin-left: 12px;
  opacity: 0.8;
}

/* ===== 底部 ===== */
.footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-gray);
  padding: 20px 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== 弹窗通用 ===== */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal.active { display: flex; }
.modal-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 20px;
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.88) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border: none;
  background: #f0f0f0;
  color: #666;
  font-size: 22px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 10;
}
.modal-close:hover { background: #e0e0e0; }
.modal-title {
  font-size: 20px;
  margin-bottom: 20px;
  padding-right: 40px;
  color: var(--text-dark);
}

/* 画廊网格 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.gallery-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.gallery-grid img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.gallery-empty {
  text-align: center;
  color: var(--text-gray);
  padding: 40px 0;
  grid-column: 1 / -1;
}

/* 单图弹窗 */
.popup-modal {
  max-width: 600px;
  padding: 20px;
}
.popup-modal img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

/* 视频弹窗 */
.video-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.video-item video {
  width: 100%;
  border-radius: 12px;
  display: block;
}
.video-empty {
  text-align: center;
  color: var(--text-gray);
  padding: 40px 0;
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 20px;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 95%;
  max-height: 95vh;
  border-radius: 8px;
  animation: fadeIn 0.3s ease;
}

/* ===== 响应式：平板 ===== */
@media (max-width: 768px) {
  .content { padding: 48px 18px 32px; }
  .top-icon { font-size: 48px; margin-bottom: 20px; }
  .main-title { font-size: 22px; }
  .modal-content { width: 94%; padding: 22px; max-height: 88vh; }
  .modal-title { font-size: 18px; margin-bottom: 16px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .lightbox { padding: 16px; }
}

/* ===== 响应式：手机 ===== */
@media (max-width: 480px) {
  .content {
    padding: 40px 16px 24px;
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .top-icon { font-size: 44px; margin-bottom: 18px; }
  .main-title { font-size: 20px; letter-spacing: 0.5px; }
  .subtitle { font-size: 13px; margin-bottom: 24px; }

  .tip-box { padding: 12px 14px; margin-bottom: 28px; border-radius: 10px; }
  .tip-icon { font-size: 14px; }
  .tip-text { font-size: 12px; }

  .section-title { font-size: 15px; margin-bottom: 16px; }

  .buttons { gap: 12px; margin-bottom: 32px; }
  .btn-item { padding: 16px 18px; border-radius: 14px; }
  .btn-title { font-size: 15px; }
  .btn-description { font-size: 12px; }
  .btn-label { font-size: 11px; }
  .btn-arrow { font-size: 20px; margin-left: 10px; }

  .footer { font-size: 11px; }

  /* 弹窗全屏化 */
  .modal { padding: 0; }
  .modal-content {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    padding: 16px;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
  }
  .popup-modal { padding: 16px; }
  .modal-title { font-size: 17px; margin-bottom: 14px; }
  .modal-close {
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 12px;
    width: 34px; height: 34px;
    font-size: 20px;
  }

  /* 画廊：手机两列 */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .gallery-grid img { border-radius: 10px; }
  .video-item video { border-radius: 10px; }
  .lightbox { padding: 12px; }
  .lightbox img { max-width: 100%; border-radius: 6px; }
}

/* ===== 响应式：小屏手机 ===== */
@media (max-width: 375px) {
  .content { padding: 32px 14px 20px; }
  .top-icon { font-size: 40px; margin-bottom: 16px; }
  .main-title { font-size: 18px; }
  .subtitle { font-size: 12px; }
  .btn-item { padding: 14px 16px; border-radius: 12px; }
  .btn-title { font-size: 14px; }
  .btn-description { font-size: 11px; }
  .btn-label { font-size: 10px; }
  .gallery-grid { gap: 7px; }
}

/* ===== 横屏适配 ===== */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .content { padding: 20px 16px; }
  .top-icon { font-size: 36px; margin-bottom: 10px; }
  .main-title { font-size: 18px; }
  .subtitle { font-size: 12px; margin-bottom: 16px; }
  .tip-box { margin-bottom: 18px; padding: 10px 14px; }
  .section-title { font-size: 14px; margin-bottom: 12px; }
  .buttons { gap: 10px; margin-bottom: 20px; }
  .btn-item { padding: 12px 16px; }
  .modal-content { max-height: 95vh; padding: 16px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* 滚动条 */
.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }
