/* ============================================================
   首頁（依設計稿）
   由上而下依序為：主視覺、學習概況、今天的學習任務與學習流程、
   最新文章、平台特色、加入會員。
   色彩一律沿用 style.css 的 --site-* 變數，不寫死色碼。
   ============================================================ */
.home-page {
  /* main 為 flex 容器，撐滿剩餘高度讓底色延伸至頁尾 */
  flex: 1;
  --hm-ink: #111827;
  --hm-muted: #6b7280;
  --hm-line: #e3e9f3;
  --hm-surface: #ffffff;
  --hm-bg: #f6f8fb;
  /* 閱讀狀態圓標的完成色（與探索文章的 --article-warm 同色） */
  --hm-done: #f59e0b;
  background: var(--hm-bg);
  padding-bottom: 60px;
}

.hm-shell {
  /* 與頁首選單（.header-inner）同寬 */
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------------------------------------
   共用：按鈕、區塊標題
   --------------------------------------------- */
.hm-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.hm-btn i {
  font-size: 17px;
}

.hm-btn-sm {
  height: 44px;
  padding: 0 22px;
  font-size: 19px;
}

.hm-btn-main {
  background: var(--site-primary);
  border-color: var(--site-primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(var(--site-primary-rgb), 0.22);
}

.hm-btn-main:hover {
  background: var(--site-primary-dark);
  border-color: var(--site-primary-dark);
  color: #fff;
}

.hm-btn-line {
  background: var(--hm-surface);
  border-color: var(--hm-line);
  color: var(--hm-ink);
}

.hm-btn-line:hover {
  border-color: var(--site-primary);
  color: var(--site-primary);
}

.hm-btn-ghost {
  background: transparent;
  border-color: var(--site-primary-line);
  color: var(--site-primary);
}

.hm-btn-ghost:hover {
  background: var(--site-primary-soft);
  color: var(--site-primary-dark);
}

.hm-sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.hm-sec-title {
  margin: 0;
  color: var(--hm-ink);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hm-sec-sub {
  margin-top: 6px;
  color: var(--hm-muted);
  font-size: 17px;
}

.hm-sec-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--site-primary);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.hm-sec-more i {
  font-size: 16px;
  transition: transform 0.2s;
}

.hm-sec-more:hover {
  color: var(--site-primary-dark);
}

.hm-sec-more:hover i {
  transform: translateX(3px);
}

/* ---------------------------------------------
   主視覺
   --------------------------------------------- */
.hm-hero {
  background: linear-gradient(180deg, #ffffff 0%, var(--site-primary-soft-2) 100%);
  padding: 46px 0 70px;
}

.hm-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
}

.hm-hero-badge {
  display: inline-block;
  margin-bottom: 20px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--site-primary-soft);
  color: var(--site-primary);
  font-size: 17px;
  font-weight: 700;
}

.hm-hero-title {
  margin: 0;
  color: var(--hm-ink);
  font-size: clamp(34px, 3.2vw, 50px);
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -0.02em;
}

.hm-hero-desc {
  margin: 20px 0 0;
  color: var(--hm-muted);
  font-size: 20px;
  line-height: 1.9;
}

.hm-hero-act {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.hm-hero-media {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
}

.hm-hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 380px;
  max-height: 440px;
  object-fit: cover;
}

/* 主視覺上的引言卡 */
.hm-hero-quote {
  position: absolute;
  right: 24px;
  bottom: 34px;
  width: 210px;
  padding: 18px 20px 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.14);
}

.hm-hero-quote i {
  color: var(--site-primary);
  font-size: 20px;
}

.hm-hero-quote p {
  margin: 10px 0 14px;
  color: var(--hm-ink);
  font-size: 19px;
  line-height: 1.6;
}

.hm-hero-quote-bar {
  display: block;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: var(--site-primary-soft);
  overflow: hidden;
}

.hm-hero-quote-bar::after {
  content: "";
  display: block;
  width: 62%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--site-primary), var(--site-primary-accent));
}

/* ---------------------------------------------
   學習概況：四格數字卡，往上覆蓋主視覺
   --------------------------------------------- */
.hm-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: -40px;
  margin-bottom: 34px;
  border: 1px solid var(--hm-line);
  border-radius: 10px;
  background: var(--hm-surface);
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
  overflow: hidden;
}

.hm-stat {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 24px 24px 26px;
  border-left: 1px solid var(--hm-line);
}

.hm-stat:first-child {
  border-left: 0;
}

.hm-stat-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 23px;
}

.hm-stat-icon-1 {
  background: var(--site-primary-soft);
  color: var(--site-primary);
}

.hm-stat-icon-2 {
  background: var(--site-primary-soft);
  color: var(--site-primary);
}

.hm-stat-icon-3 {
  background: var(--site-primary-soft);
  color: var(--site-primary);
}

.hm-stat-icon-4 {
  background: var(--site-primary-soft);
  color: var(--site-primary);
}

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

.hm-stat-label {
  color: var(--hm-muted);
  font-size: 17px;
}

.hm-stat-value {
  margin-top: 4px;
  color: var(--hm-ink);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.3;
}

.hm-stat-value small {
  margin-left: 6px;
  color: var(--hm-muted);
  font-size: 17px;
  font-weight: 500;
}

.hm-stat-value-sm {
  font-size: 20px;
  font-weight: 700;
}

.hm-stat-bar {
  width: 100%;
  height: 6px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--site-primary-soft);
  overflow: hidden;
}

.hm-stat-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--site-primary), var(--site-primary-accent));
}

.hm-stat-note {
  margin-top: 8px;
  color: var(--hm-muted);
  font-size: 17px;
}

.hm-stat-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--site-primary);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.hm-stat-link i {
  font-size: 15px;
  transition: transform 0.2s;
}

.hm-stat-link:hover {
  color: var(--site-primary-dark);
}

.hm-stat-link:hover i {
  transform: translateX(3px);
}

/* ---------------------------------------------
   今天的學習任務 ＋ 學習流程
   --------------------------------------------- */
.hm-task-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(0, 1fr);
  align-items: start;
  gap: 30px;
  margin-bottom: 40px;
}

.hm-task-card {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid var(--hm-line);
  border-radius: 10px;
  background: var(--hm-surface);
  overflow: hidden;
}

.hm-task-cover {
  position: relative;
  display: block;
  overflow: hidden;
}

.hm-task-cover img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 200px;
  object-fit: cover;
  transition: transform 0.35s;
}

.hm-task-cover:hover img {
  transform: scale(1.04);
}

.hm-task-type {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--site-primary);
  font-size: 16px;
  font-weight: 700;
}

.hm-task-body {
  display: flex;
  flex-direction: column;
  padding: 24px 24px 22px;
}

.hm-task-title {
  margin: 0;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.5;
}

.hm-task-title a {
  color: var(--hm-ink);
  text-decoration: none;
}

.hm-task-title a:hover {
  color: var(--site-primary);
}

.hm-task-text {
  margin: 12px 0 0;
  color: var(--hm-muted);
  font-size: 18px;
  line-height: 1.85;
}

.hm-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 16px 0 20px;
  color: var(--hm-muted);
  font-size: 17px;
}

.hm-task-meta i {
  margin-right: 6px;
  color: var(--site-primary);
}

.hm-task-body .hm-btn {
  align-self: flex-start;
  margin-top: auto;
}

.hm-empty {
  padding: 46px 20px;
  border: 1px dashed var(--hm-line);
  border-radius: 10px;
  background: var(--hm-surface);
  color: var(--hm-muted);
  text-align: center;
}

.hm-empty i {
  color: var(--site-primary-line);
  font-size: 36px;
}

.hm-empty p {
  margin: 12px 0 0;
  font-size: 18px;
}

/* 學習流程 */
.hm-flow-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 26px 18px 24px;
  border: 1px solid var(--hm-line);
  border-radius: 10px;
  background: var(--hm-surface);
  list-style: none;
}

.hm-flow-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* 步驟之間的虛線 */
.hm-flow-item::before {
  content: "";
  position: absolute;
  left: calc(-50% + 34px);
  top: 27px;
  width: calc(100% - 68px);
  border-top: 2px dashed var(--hm-line);
}

.hm-flow-item:first-child::before {
  display: none;
}

.hm-flow-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--site-primary-soft);
  color: var(--site-primary);
  font-size: 24px;
}

/* 五個步驟原本各有色相，現統一為主色；規則保留，日後要分色只需改這裡。 */
.hm-flow-item-2 .hm-flow-icon,
.hm-flow-item-3 .hm-flow-icon,
.hm-flow-item-4 .hm-flow-icon,
.hm-flow-item-5 .hm-flow-icon {
  background: var(--site-primary-soft);
  color: var(--site-primary);
}

.hm-flow-no {
  margin-top: 12px;
  color: var(--hm-ink);
  font-size: 17px;
  font-weight: 700;
}

.hm-flow-name {
  margin-top: 4px;
  color: var(--hm-ink);
  font-size: 18px;
  font-weight: 700;
}

.hm-flow-en {
  margin-top: 2px;
  color: var(--site-primary);
  font-size: 16px;
  font-weight: 600;
}

.hm-flow-note {
  margin-top: 6px;
  color: var(--hm-muted);
  font-size: 16px;
  line-height: 1.6;
}

/* ---------------------------------------------
   最新文章
   --------------------------------------------- */
.hm-latest {
  margin-bottom: 40px;
}

/* 最新文章列表之後的 Google 廣告（共用樣式在 style.css 的「Google 廣告」區塊，此處只調整間距） */
.hm-ad.is-filled,
.hm-ad.site-ad-preview {
  margin-top: 24px;
}

.hm-cat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.hm-cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--hm-line);
  border-radius: 999px;
  background: var(--hm-surface);
  color: var(--hm-ink);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.hm-cat i {
  color: var(--site-primary);
  font-size: 17px;
}

.hm-cat span {
  color: var(--hm-muted);
  font-size: 16px;
  font-weight: 500;
}

.hm-cat:hover {
  border-color: var(--site-primary);
  background: var(--site-primary-soft);
  color: var(--site-primary-dark);
}

.hm-card-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.hm-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hm-line);
  border-radius: 10px;
  background: var(--hm-surface);
  overflow: hidden;
  transition: box-shadow 0.25s, transform 0.25s;
}

.hm-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.09);
}

.hm-card-cover {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.hm-card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 閱讀狀態：封面右上角的小圓標（僅「已閱讀完成」「已完成測驗」時才輸出，故一律為完成色）
   今天的學習任務（.hm-task-cover）與最新文章卡片（.hm-card-cover）共用 */
.hm-card-state {
  position: absolute;
  right: 12px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hm-card-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--hm-done);
  color: #fff;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.14);
}

/* 底部資訊列：難度徽章與主題分類（原位於封面，已移至原閱讀時間的位置） */
.hm-card-level {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--hm-line);
  background: #fff;
  color: var(--hm-ink);
  font-size: 15px;
  font-weight: 700;
}

.hm-card-foot .hm-card-level i {
  margin-right: 0;
  color: var(--site-primary);
}

.hm-card-type {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--site-primary-soft);
  color: var(--site-primary);
  font-size: 15px;
  font-weight: 600;
}

.hm-card-body {
  flex: 1;
  padding: 18px 18px 12px;
}

.hm-card-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.6;
}

.hm-card-title a {
  color: var(--hm-ink);
  text-decoration: none;
}

.hm-card-title a:hover {
  color: var(--site-primary);
}

.hm-card-text {
  margin: 10px 0 0;
  color: var(--hm-muted);
  font-size: 17px;
  line-height: 1.8;
}

.hm-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--hm-line);
  color: var(--hm-muted);
  font-size: 16px;
}

.hm-card-foot i {
  margin-right: 6px;
  color: var(--site-primary);
}

/* ---------------------------------------------
   平台特色
   --------------------------------------------- */
.hm-feature {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 8px 0;
  border: 1px solid var(--hm-line);
  border-radius: 10px;
  background: var(--hm-surface);
}

.hm-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px;
  border-left: 1px solid var(--hm-line);
}

.hm-feature-item:first-child {
  border-left: 0;
}

.hm-feature-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--site-primary-soft);
  color: var(--site-primary);
  font-size: 21px;
}

.hm-feature-name {
  color: var(--hm-ink);
  font-size: 19px;
  font-weight: 700;
}

.hm-feature-note {
  margin: 6px 0 0;
  color: var(--hm-muted);
  font-size: 17px;
  line-height: 1.7;
}

/* ---------------------------------------------
   加入會員
   --------------------------------------------- */
.hm-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin-top: 34px;
  padding: 34px 36px;
  border-radius: 10px;
  background: linear-gradient(120deg, var(--site-primary) 0%, var(--site-primary-light) 100%);
  color: #fff;
}

.hm-cta-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
}

.hm-cta-desc {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  line-height: 1.8;
}

.hm-cta-act {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hm-cta .hm-btn-main {
  background: #fff;
  border-color: #fff;
  color: var(--site-primary);
  box-shadow: none;
}

.hm-cta .hm-btn-main:hover {
  background: var(--site-primary-soft);
  border-color: var(--site-primary-soft);
  color: var(--site-primary-dark);
}

.hm-cta .hm-btn-ghost {
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
}

.hm-cta .hm-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* ---------------------------------------------
   響應式
   --------------------------------------------- */
@media (max-width: 1280px) {
  .hm-task-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .hm-feature {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hm-feature-item:nth-child(3n + 1) {
    border-left: 0;
  }
}

@media (max-width: 992px) {
  .hm-hero {
    padding: 32px 0 60px;
  }

  .hm-hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .hm-hero-media img {
    min-height: 260px;
    max-height: 320px;
  }

  .hm-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hm-stat:nth-child(odd) {
    border-left: 0;
  }

  .hm-stat:nth-child(n + 3) {
    border-top: 1px solid var(--hm-line);
  }

  .hm-task-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .hm-flow-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px 6px;
  }

  .hm-flow-item::before {
    display: none;
  }

  .hm-card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hm-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 576px) {
  .hm-hero-quote {
    right: 14px;
    bottom: 14px;
    width: 168px;
    padding: 14px 16px 16px;
  }

  .hm-hero-quote p {
    font-size: 17px;
  }

  .hm-btn {
    width: 100%;
    justify-content: center;
  }

  .hm-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .hm-stat {
    border-left: 0;
  }

  .hm-stat:nth-child(n + 2) {
    border-top: 1px solid var(--hm-line);
  }

  .hm-flow-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hm-card-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .hm-feature {
    grid-template-columns: minmax(0, 1fr);
  }

  .hm-feature-item {
    border-left: 0;
  }

  .hm-feature-item:nth-child(n + 2) {
    border-top: 1px solid var(--hm-line);
  }

  .hm-cta {
    padding: 26px 22px;
  }

  .hm-cta-act {
    width: 100%;
  }
}
