/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #fdfbf7;
  min-height: 100vh;
  color: #1a1a1a;
  user-select: none;
  -webkit-user-select: none;
}

/* ===== 水印 ===== */
.watermark {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 120px,
    rgba(180, 160, 220, 0.045) 120px,
    rgba(180, 160, 220, 0.045) 121px
  );
  background-size: 260px 260px;
  /* 文字水印通过 pseudo element 实现 */
}

.watermark::after {
  content: "仅限本人学习使用";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 3.5rem;
  font-weight: 700;
  color: rgba(160, 140, 200, 0.055);
  white-space: nowrap;
  letter-spacing: 6px;
  pointer-events: none;
}

/* ===== 工具类 ===== */
.hidden { display: none !important; }
.page { min-height: 100vh; }

/* ===== 顶部操作栏 ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  background: rgba(253, 251, 247, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #e8e2d9;
}

.topbar-brand {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: 0.5px;
}

.topbar button,
#logout-btn {
  font-size: 0.78rem;
  color: #8a8a8a;
  background: none;
  border: 1px solid #e8e2d9;
  border-radius: 20px;
  padding: 4px 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.topbar button:hover,
#logout-btn:hover {
  color: #c0392b;
  border-color: #c0392b;
  background: #fdf0ef;
}

/* ===== 主容器 ===== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 56px 20px 40px;
}

.hero-icon {
  font-size: 3.2rem;
  margin-bottom: 16px;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(192, 57, 43, 0.15));
}

.hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: #1a1a1a;
  letter-spacing: 1px;
  line-height: 1.3;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: #5a5a5a;
  font-weight: 500;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.copyright-banner {
  display: inline-block;
  background: linear-gradient(90deg, #fff7e6, #fff3e0);
  border: 1px solid #f5c842;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 0.8rem;
  color: #b8860b;
  font-weight: 500;
  max-width: 600px;
  line-height: 1.6;
}

/* ===== 目录区 ===== */
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e8e2d9;
  letter-spacing: 0.5px;
}

.catalog {
  margin-bottom: 40px;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== 目录卡片 ===== */
.catalog-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  border: 1px solid #e8e2d9;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  position: relative;
  overflow: hidden;
}

.catalog-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #c0392b;
  border-radius: 4px 0 0 4px;
  opacity: 0;
  transition: opacity 0.22s;
}

.catalog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.10);
  background: #fdfbf7;
}

.catalog-card:hover::before {
  opacity: 1;
}

.catalog-card:active {
  transform: translateY(-1px);
}

/* 工具类卡片（思维导图/闪卡/PDF） */
.card-tool {
  background: #f8f5f0;
}

.card-icon {
  font-size: 1.8rem;
  min-width: 44px;
  text-align: center;
  line-height: 1;
}

.card-body {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: 0.97rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-desc {
  font-size: 0.82rem;
  color: #8a8a8a;
  line-height: 1.5;
}

.card-arrow {
  font-size: 1.5rem;
  color: #ccc;
  font-weight: 300;
  transition: transform 0.2s, color 0.2s;
}

.catalog-card:hover .card-arrow {
  transform: translateX(4px);
  color: #c0392b;
}

/* ===== 好评送书区 ===== */
.review-section {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  border: 1px solid #e8e2d9;
  margin-bottom: 40px;
}

.review-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1a1a1a;
  background: linear-gradient(90deg, #fff7e6, #fff3e0);
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 20px;
  border-left: 4px solid #f5a623;
}

/* 主体区：文案 + 图片并排 */
.review-body {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.review-text p {
  font-size: 0.92rem;
  color: #3a3a3a;
  line-height: 1.95;
  margin-bottom: 0.65em;
}

.review-text p:last-child { margin-bottom: 0; }

.review-highlight {
  display: inline;
  background: #fdf0ef;
  color: #c0392b;
  font-weight: 700;
  border-radius: 3px;
  padding: 1px 5px;
}

/* 图片区域 */
.review-img-placeholder {
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.review-img-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.review-img-placeholder img:hover {
  transform: scale(1.04);
  opacity: 0.92;
}

/* 海报大图弹窗 */
.poster-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.poster-modal.show {
  opacity: 1;
}
.poster-modal.hidden {
  display: none;
}
.poster-modal-inner {
  position: relative;
  max-width: 420px;
  width: 100%;
}
.poster-modal-inner img {
  width: 100%;
  border-radius: 14px;
  display: block;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
.poster-modal-close {
  position: absolute;
  top: -13px;
  right: -13px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  transition: background 0.15s, transform 0.15s;
  z-index: 1;
}
.poster-modal-close:hover {
  background: #f5f5f5;
  transform: scale(1.12);
}

/* 步骤说明条 */
.review-steps {
  background: #f8f5f0;
  border: 1px solid #e8e2d9;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.review-step {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.83rem;
  color: #5a5a5a;
  line-height: 1.5;
}

.review-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c0392b;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* 客服联系行 */
.review-cs-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  background: #faf8ff;
  border: 1px solid rgba(107, 79, 160, 0.18);
  border-radius: 12px;
  padding: 12px 16px;
}

.review-cs-label {
  font-size: 0.8rem;
  color: #888;
  flex-shrink: 0;
}

.review-cs-id {
  font-size: 1rem;
  font-weight: 800;
  color: #3d2b6e;
  letter-spacing: 1px;
  flex: 1;
}

.review-cs-copy-btn {
  background: linear-gradient(135deg, #7c5cbf, #a78bfa);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.review-cs-copy-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}
.review-cs-copy-btn.is-copied {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.review-plan-link {
  font-size: 0.8rem;
  color: #7c5cbf;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 12px;
  border: 1px solid rgba(107, 79, 160, 0.25);
  border-radius: 20px;
  transition: background 0.2s, color 0.2s;
}
.review-plan-link:hover {
  background: rgba(107, 79, 160, 0.08);
  color: #5b3fa0;
}


.footer {
  text-align: center;
  font-size: 0.78rem;
  color: #aaa;
  padding: 24px 0 0;
  border-top: 1px solid #e8e2d9;
  line-height: 1.8;
}

/* ===== Toast 弹窗 ===== */
.toast {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(30, 20, 60, 0.88);
  color: #fff;
  padding: 12px 28px;
  border-radius: 40px;
  font-size: 0.9rem;
  z-index: 9998;
  transition: opacity 0.3s, transform 0.3s;
  opacity: 0;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== 激活码页 ===== */
#activate-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: #fdfbf7;
}

.activate-card {
  background: #fff;
  border-radius: 20px;
  padding: 48px 40px 40px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 6px 32px rgba(0,0,0,0.10);
  border: 1px solid #e8e2d9;
  text-align: center;
}

.activate-logo {
  font-size: 3.6rem;
  margin-bottom: 18px;
  filter: drop-shadow(0 4px 12px rgba(192, 57, 43, 0.18));
}

.activate-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.activate-sub {
  font-size: 0.85rem;
  color: #c0392b;
  margin-bottom: 20px;
  font-weight: 500;
}

.activate-desc {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 28px;
  line-height: 1.6;
}

.activate-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

#code-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e8e2d9;
  border-radius: 12px;
  font-size: 1rem;
  color: #1a1a1a;
  background: #fdfbf7;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: center;
  letter-spacing: 3px;
  font-family: inherit;
}

#code-input:focus {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
  background: #fff;
}

#unlock-btn {
  width: 100%;
  padding: 14px;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 4px;
  transition: opacity 0.2s, transform 0.18s, box-shadow 0.2s;
  box-shadow: 0 4px 18px rgba(192, 57, 43, 0.28);
  font-family: inherit;
}

#unlock-btn:hover {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(192, 57, 43, 0.36);
}

#unlock-btn:active {
  transform: translateY(0);
}

.error-msg {
  color: #e05a5a;
  font-size: 0.85rem;
  margin-top: 4px;
  margin-bottom: 8px;
}

.activate-hint {
  font-size: 0.78rem;
  color: #bbb;
  margin-top: 12px;
  line-height: 1.6;
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
  .topbar {
    padding: 0 16px;
  }

  .container {
    padding: 0 14px 48px;
  }

  .hero {
    padding: 36px 12px 28px;
  }

  .hero-icon {
    font-size: 2.6rem;
  }

  .catalog-card {
    padding: 14px 16px;
    gap: 12px;
  }

  .card-icon {
    font-size: 1.5rem;
    min-width: 36px;
  }

  .card-title {
    font-size: 0.9rem;
  }

  .review-section {
    padding: 20px 18px;
  }

  .review-body {
    grid-template-columns: 1fr;
  }

  .review-img-placeholder {
    max-width: 180px;
    margin: 0 auto;
  }

  .activate-card {
    padding: 36px 24px 30px;
  }

  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

@media (max-width: 380px) {
  .hero-title {
    font-size: 1.4rem;
  }
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
