* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f8f9fa;
  color: #1d1d1f;
  line-height: 1.6;
}

.header {
  background: linear-gradient(135deg, #0a1628 0%, #1a365d 100%);
  padding: 16px max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left));
  padding-top: max(16px, env(safe-area-inset-top));
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.logo {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}

.back-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 10px 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.2);
}

.back-link:active {
  background: rgba(255, 255, 255, 0.28);
}

.main {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px max(20px, env(safe-area-inset-right)) 60px max(20px, env(safe-area-inset-left));
  padding-bottom: max(60px, env(safe-area-inset-bottom));
}

.page-title {
  text-align: center;
  margin-bottom: 30px;
}

.page-title h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 6px;
}

.page-title p {
  color: #86868b;
  font-size: 0.95rem;
}

.pages {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page-item {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.page-item img {
  width: 100%;
  display: block;
}

.page-number {
  text-align: center;
  padding: 10px;
  color: #86868b;
  font-size: 0.8rem;
  background: #f8f9fa;
}

.footer {
  text-align: center;
  padding: 40px 20px;
  color: #86868b;
  font-size: 0.85rem;
}

.footer a {
  color: #3b82f6;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.page-item {
  cursor: pointer;
}

.page-item img {
  transition: opacity 0.2s;
}

.page-item:hover img {
  opacity: 0.9;
}

/* 图片预览模态框 */
.preview-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.preview-modal.active {
  display: flex;
}

.preview-modal .img-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.preview-modal .img-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
}

.preview-modal .close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  line-height: 1;
  z-index: 1001;
}

.preview-modal .close-btn:hover {
  background: rgba(255,255,255,0.25);
}

@media (max-width: 600px) {
  .header {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .logo {
    font-size: 0.82rem;
    line-height: 1.35;
    flex: 1;
    min-width: 0;
  }

  .main {
    padding: 20px max(12px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .page-title h1 {
    font-size: 1.4rem;
  }

  .pages {
    gap: 16px;
  }
}
