/* 小編互動電子書 - 區塊式排版與 UI/UX */

* {
  box-sizing: border-box;
}

body {
  font-family: "Microsoft JhengHei", "PingFang TC", sans-serif;
  line-height: 1.7;
  color: #2c2c2c;
  max-width: 780px;
  margin: 0 auto;
  padding: 0;
  background: #e8eae9;
}

/* ========== 通用區塊 ========== */
.block {
  margin: 0 auto;
  padding: 2rem 1.5rem;
  background: #fff;
  margin-bottom: 0.75rem;
  border-radius: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* 頂部 Hero 區塊 */
.block-hero {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: linear-gradient(160deg, #2d3a4a 0%, #1a2332 100%);
  color: #fff;
  margin-bottom: 0.75rem;
}

.icon-hero {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: rgba(255,255,255,0.9);
}

.icon-hero svg {
  display: block;
}

.block-hero h1 {
  margin: 0 0 0.35rem 0;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.block-hero .subtitle {
  margin: 0;
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
}

/* 章節頁：回到主頁導航 */
.block-nav {
  padding: 1rem 1.5rem !important;
}

.link-back {
  color: #4a90d9;
  text-decoration: none;
  font-size: 0.95rem;
}

.link-back:hover {
  text-decoration: underline;
}

/* ========== 首頁摘要區塊（第一篇～第三篇）========== */
.block-teaser {
  padding: 1.75rem 1.5rem;
  border-left: 4px solid #4a90d9;
}

.teaser-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.teaser-body {
  margin-bottom: 1rem;
}

.teaser-body p {
  margin: 0;
  color: #444;
  font-size: 0.98rem;
}

.link-read-more {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #4a90d9;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
}

.link-read-more:hover {
  background: #3a7bc8;
}

/* ========== 章節區塊（第四、五章）========== */
.block-chapter {
  padding: 1.75rem 1.5rem;
  border-left: 4px solid #4a90d9;
}

/* 章節標題列（含圖示） */
.chapter-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.chapter-icon {
  flex-shrink: 0;
  color: #4a90d9;
}

.chapter-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: #1a1a1a;
}

.chapter-body p {
  margin: 0 0 1rem 0;
}

.chapter-body p:last-child {
  margin-bottom: 0;
}

/* 圖片輔助區：預留空間，可換成 <img src="Images/xxx.jpg"> */
.chapter-figure {
  margin: 1.5rem 0;
}

.figure-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 280px;
  background: linear-gradient(135deg, #f0f2f4 0%, #e2e6ea 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #c8ccd0;
}

.figure-hint {
  font-size: 0.9rem;
  color: #8a8f94;
}

/* 若改用真實圖片，放在 .chapter-figure 內用 img，建議加上 */
.chapter-figure img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}

.chapter-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #6b7280;
}

/* ========== 第四、五章：毛玻璃霧化（未解鎖時）========= */
.blurred-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

/* 未解鎖時：內文區加上毛玻璃效果 */
.block-chapter.locked .blurred-content {
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
  opacity: 0.85;
}

.block-chapter.locked .blurred-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 10px;
}

/* 解鎖後：取消霧化 */
.block-chapter.locked.revealed .blurred-content {
  filter: none;
  user-select: auto;
  pointer-events: auto;
  opacity: 1;
}

.block-chapter.locked.revealed .blurred-wrap::after {
  display: none;
}

/* ========== 解鎖區塊 ========== */
.block-unlock {
  padding: 2rem 1.5rem;
  background: #f8fafc;
  border: 2px dashed #4a90d9;
  border-radius: 12px;
}

.unlock-card {
  max-width: 420px;
  margin: 0 auto;
}

.unlock-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.unlock-icon {
  flex-shrink: 0;
  color: #4a90d9;
}

.unlock-card h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
}

.unlock-hint {
  margin: 0 0 1.5rem 0;
  color: #5a6570;
  font-size: 0.9rem;
}

.unlock-step label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #333;
}

.label-icon {
  font-size: 1rem;
}

.unlock-step input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid #c8ccd0;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 0.85rem;
  background: #fff;
}

.unlock-step input:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 3px rgba(74,144,217,0.2);
}

.btn-primary {
  padding: 0.65rem 1.35rem;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 0.25rem;
}

.btn-primary:hover {
  background: #3a7bc8;
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.message {
  margin: 0.75rem 0;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.message.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.message.new-user {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.message.success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.hidden {
  display: none !important;
}
