
:root {
  --hm-navy: #182b49;
  --hm-purple: #6846e8;
  --hm-purple-soft: #f1edff;
  --hm-green: #2eaa59;
  --hm-green-dark: #238947;
  --hm-blue: #4b86f7;
  --hm-orange: #f28b30;
  --hm-pink: #ef5d83;
  --hm-text: #34445d;
  --hm-muted: #69758a;
  --hm-border: #e4e8f0;
  --hm-bg: #fffdfa;
  --hm-card: #ffffff;
  --hm-shadow: 0 10px 30px rgba(34, 48, 78, 0.08);
  --hm-nav-font: "Sassoon Primary", "Sassoon Primary Std", "FS Me", "FS Me Web", "Century Gothic", CenturyGothic, ui-rounded, "Avenir Next Rounded", "Nunito", "Avenir Next", "Segoe UI Rounded", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--hm-bg);
  color: var(--hm-text);
  font-family: var(--hm-nav-font);
  line-height: 1.65;
}

a { color: inherit; }

.hm-header {
  background: #fff;
  border-bottom: 1px solid #edf0f5;
  position: sticky;
  top: 0;
  z-index: 20;
  font-family: var(--hm-nav-font);
}

.hm-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  min-height: 76px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.hm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: max-content;
}

.hm-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--hm-purple-soft);
  font-size: 24px;
}

/* 页头品牌统一改用 logo 图片，替换原先的 ✨ 星标 + "Homework Magic" 文字 */
.hm-brand {
  font-size: 0;
  line-height: 0;
  white-space: nowrap;
  min-width: 0;
  background: url('/static/images/homework-magic-logo-header.webp') center / contain no-repeat;
  width: 105px;
  height: 44px;
}

.hm-brand > * { display: none !important; }

.hm-brand-copy strong {
  display: block;
  color: var(--hm-purple);
  font-size: 18px;
  line-height: 1.1;
}

.hm-brand-copy span {
  display: block;
  color: #7b8494;
  font-size: 11px;
  margin-top: 3px;
}

.hm-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
  font-family: var(--hm-nav-font);
  font-weight: 600;
}

.hm-nav::-webkit-scrollbar { display: none; }

.hm-nav a {
  text-decoration: none;
  color: #1f2633;
  font-family: inherit;
  font-size: .95rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.35;
  text-transform: none;
}

.hm-nav a:hover,
.hm-nav a:focus-visible {
  color: var(--hm-purple);
}

.hm-dashboard {
  background: var(--hm-purple);
  color: #fff !important;
  padding: 10px 17px;
  border-radius: 12px;
}

.hm-page {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.hm-breadcrumb {
  text-align: center;
  color: var(--hm-muted);
  font-size: 14px;
  margin: 6px 0 28px;
}

.hm-breadcrumb a {
  color: var(--hm-purple);
  text-decoration: none;
  font-weight: 650;
}

.hm-hero {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hm-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--hm-purple-soft);
  color: var(--hm-purple);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
}

.hm-hero h1 {
  margin: 18px 0 12px;
  color: var(--hm-navy);
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1.08;
  letter-spacing: -1.4px;
}

.hm-star-line {
  width: 255px;
  max-width: 70%;
  margin: 18px auto 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--hm-purple);
}

.hm-star-line::before,
.hm-star-line::after {
  content: "";
  height: 2px;
  background: #cfc3ff;
  flex: 1;
}

.hm-star-line span { font-size: 18px; }

.hm-hero p {
  margin: 0 auto;
  max-width: 800px;
  font-size: 18px;
  color: #526076;
}

.hm-hero p + p { margin-top: 4px; }

.hm-actions {
  margin: 34px auto 42px;
  display: grid;
  gap: 14px;
  max-width: 1080px;
}

.hm-actions-primary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.hm-actions-secondary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.hm-action {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-weight: 850;
  box-shadow: 0 5px 14px rgba(30, 45, 70, 0.08);
  transition: transform .18s ease, box-shadow .18s ease;
}

.hm-action:hover,
.hm-action:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 9px 20px rgba(30, 45, 70, 0.13);
}

.hm-action.green { background: var(--hm-green); }
.hm-action.green:hover { background: var(--hm-green-dark); }
.hm-action.blue { background: #4776e8; }
.hm-action.purple { background: #7651df; }
.hm-action.orange { background: var(--hm-orange); }
.hm-action.pink { background: var(--hm-pink); }

.hm-action .arrow { margin-left: auto; opacity: .9; }

.hm-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin: 0 auto 54px;
}

.hm-feature-card {
  min-height: 360px;
  padding: 42px 34px 34px;
  border: 1px solid var(--hm-border);
  border-radius: 22px;
  text-align: center;
  box-shadow: var(--hm-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.hm-feature-card.lilac { background: linear-gradient(180deg, #fbf9ff, #f8f5ff); }
.hm-feature-card.sky { background: linear-gradient(180deg, #fbfdff, #f2f8ff); }

.hm-feature-icon {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 39px;
  margin-bottom: 20px;
  background: #eee8ff;
}

.sky .hm-feature-icon { background: #e7f0ff; }

.hm-feature-card h2 {
  margin: 0 0 14px;
  color: var(--hm-navy);
  font-size: 25px;
  line-height: 1.2;
}

.hm-feature-card p {
  max-width: 480px;
  margin: 0 auto 24px;
  color: #5b6575;
  font-size: 16px;
}

.hm-guide {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 2px solid var(--hm-purple);
  color: var(--hm-purple);
  text-decoration: none;
  font-weight: 850;
  margin-top: auto;
}

.sky .hm-guide {
  border-color: var(--hm-blue);
  color: var(--hm-blue);
}

.hm-section-title {
  text-align: center;
  margin: 0 0 24px;
}

.hm-section-title h2 {
  color: var(--hm-navy);
  margin: 0;
  font-size: 30px;
}

.hm-section-title .small-line {
  width: 150px;
  height: 3px;
  margin: 12px auto 0;
  background: linear-gradient(90deg, transparent 0 20%, #bfb1ff 20% 80%, transparent 80%);
  position: relative;
}

.hm-section-title .small-line::after {
  content: "★";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -58%);
  background: var(--hm-bg);
  color: var(--hm-purple);
  padding: 0 8px;
  font-size: 14px;
}

.hm-category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.hm-category {
  background: #fff;
  border: 1px solid #e8ebf1;
  border-radius: 18px;
  padding: 22px 14px;
  text-align: center;
  box-shadow: 0 5px 18px rgba(30, 45, 70, 0.05);
}

.hm-category-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f1edff;
  font-size: 24px;
}

.hm-category h3 {
  margin: 0 0 5px;
  color: var(--hm-navy);
  font-size: 15px;
}

.hm-category p {
  margin: 0 0 12px;
  color: #6b7585;
  font-size: 12px;
  line-height: 1.45;
}

.hm-count {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1edff;
  color: var(--hm-purple);
  font-size: 11px;
  font-weight: 800;
}

.hm-article-list {
  margin-top: 36px;
}

.hm-article-list h2 {
  text-align: center;
  color: var(--hm-navy);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.article-card {
  background: #fff;
  border: 1px solid var(--hm-border);
  border-radius: 18px;
  padding: 26px 22px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 5px 18px rgba(30, 45, 70, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 250px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.article-card:hover,
.article-card:focus-visible {
  transform: translateY(-3px);
  border-color: #cfc3ff;
  box-shadow: var(--hm-shadow);
}

.article-card .icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--hm-purple-soft);
  font-size: 28px;
  margin-bottom: 14px;
}

.article-card h3 {
  margin: 0 0 10px;
  color: var(--hm-navy);
  font-size: 19px;
  line-height: 1.25;
}

.article-card p {
  margin: 0;
  color: #626e80;
  font-size: 14px;
  line-height: 1.55;
  flex: 1;
}

.article-card .tag {
  display: inline-block;
  margin-top: 18px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #edf3ff;
  color: #3d78dc;
  font-size: 11px;
  font-weight: 800;
}

.hm-note {
  margin: 38px auto 0;
  max-width: 820px;
  padding: 16px 22px;
  border: 1px solid #e0d8ff;
  background: #f8f5ff;
  border-radius: 16px;
  text-align: center;
  color: #665c86;
  font-size: 13px;
}

.hm-footer {
  text-align: center;
  margin-top: 46px;
  padding-top: 24px;
  border-top: 1px solid #e8ebf1;
  color: #788294;
  font-size: 13px;
}

.hm-footer-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.hm-footer-links a {
  color: var(--hm-purple);
  text-decoration: none;
  font-weight: 650;
}

@media (max-width: 900px) {
  .hm-header-inner { gap: 14px; }
  .hm-nav { gap: 14px; }
  .hm-actions-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .hm-header-inner {
    min-height: 68px;
    padding: 8px 14px;
  }

  .hm-brand-copy span { display: none; }

  .hm-page {
    width: min(100% - 28px, 1180px);
    padding-top: 16px;
  }

  .hm-hero h1 { font-size: 39px; }
  .hm-hero p { font-size: 16px; }

  .hm-actions-primary,
  .hm-actions-secondary,
  .hm-feature-grid,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .hm-action { min-height: 54px; }

  .hm-feature-card {
    min-height: 330px;
    padding: 32px 22px;
  }

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

  .hm-section-title h2 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}


.hm-article-funnel {
  max-width: 1120px;
  margin: 52px auto 10px;
  padding: 30px 0 6px;
}
.hm-funnel-heading {
  max-width: 760px;
  margin: 0 auto 24px;
  text-align: center;
}
.hm-funnel-kicker {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--hm-purple, #6c4cff);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.hm-funnel-heading h2 {
  margin: 0;
  color: var(--hm-navy, #17233d);
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.2;
}
.hm-funnel-heading p {
  margin: 9px auto 0;
  color: #69758a;
  font-size: 14px;
  line-height: 1.55;
}
.hm-funnel-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.hm-funnel-step {
  position: relative;
  display: flex;
  min-height: 205px;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px 20px 18px;
  border: 1px solid var(--hm-border, #e4e8ef);
  border-radius: 20px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 7px 22px rgba(30,45,70,.055);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.hm-funnel-step:hover,
.hm-funnel-step:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--hm-shadow, 0 12px 30px rgba(30,45,70,.10));
  border-color: #cfc3ff;
}
.hm-funnel-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 13px;
  border-radius: 50%;
  background: #f1edff;
  font-size: 25px;
}
.hm-funnel-step:nth-child(2) .hm-funnel-icon { background: #e9f8ef; }
.hm-funnel-step:nth-child(3) .hm-funnel-icon { background: #fff2e5; }
.hm-funnel-step-number {
  position: absolute;
  top: 13px;
  right: 14px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f1edff;
  color: var(--hm-purple, #6c4cff);
  font-size: 11px;
  font-weight: 900;
}
.hm-funnel-step strong {
  color: var(--hm-navy, #17233d);
  font-size: 16px;
  line-height: 1.3;
}
.hm-funnel-step > span:not(.hm-funnel-icon):not(.hm-funnel-step-number):not(.hm-funnel-cta) {
  margin-top: 8px;
  color: #69758a;
  font-size: 12px;
  line-height: 1.5;
}
.hm-funnel-cta {
  margin-top: auto;
  padding-top: 14px;
  color: var(--hm-purple, #6c4cff);
  font-size: 12px;
  font-weight: 850;
}
@media (max-width: 700px) {
  .hm-funnel-steps { grid-template-columns: 1fr; }
  .hm-funnel-step { min-height: 175px; }
}


/* Article-guide cards: keep each guide's content left aligned for easier scanning and SEO-friendly reading. */
.hm-article-list .article-card {
  text-align: left;
  align-items: flex-start;
}
.hm-article-list .article-card .icon {
  margin-left: 0;
}
.hm-article-list .article-card .tag {
  align-self: flex-start;
}

/* With the left learning menu, use the full right panel width. */
body.hm-shell-app main.hm-page,
body.hm-shell-app .app-main > main.hm-page,
body.hm-shell-app .app-main .hm-page {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 20px 28px 56px !important;
  box-sizing: border-box;
}

body.hm-shell-app .hm-actions,
body.hm-shell-app .hm-feature-grid,
body.hm-shell-app .hm-category-grid,
body.hm-shell-app .article-grid,
body.hm-shell-app .hm-article-funnel,
body.hm-shell-app .hm-note,
body.hm-shell-app .articles-seo-intro {
  max-width: none !important;
  width: 100%;
}

body.hm-shell-app .hm-actions,
body.hm-shell-app .hm-feature-grid,
body.hm-shell-app .hm-category-grid,
body.hm-shell-app .article-grid,
body.hm-shell-app .hm-article-funnel {
  margin-left: 0;
  margin-right: 0;
}

@media (max-width: 900px) {
  body.hm-shell-app main.hm-page,
  body.hm-shell-app .app-main > main.hm-page,
  body.hm-shell-app .app-main .hm-page {
    padding: 16px 16px 40px !important;
  }
}
