/* Homepage: quiet paper surfaces, shared typography and a single learning entry. */
body.home-page {
  --home-ink: #113e45;
  --home-soft: #e9f0ec;
  --home-warm: #f4f0e7;
  --home-paper: #fcfaf4;
  --home-paper-line: #e5e3d7;
  --home-motto-initial: #c45112;
}

body.theme-dark.home-page {
  --home-ink: #d1ece7;
  --home-soft: #193138;
  --home-warm: #2a302d;
  --home-paper: #23332f;
  --home-paper-line: #40524a;
  --home-motto-initial: #ffc875;
}

body.home-page .home-dashboard-main {
  display: block;
  width: min(100%, 1600px);
  margin-inline: auto !important;
  padding-top: 122px !important;
  padding-inline: clamp(22px, 3.4vw, 58px) !important;
  min-height: auto;
}

body.home-page .home-dashboard-main::before {
  content: '首页 / 开始探索';
  font: 500 0.94rem/1.5 var(--font-ui);
  color: var(--ui-muted);
  letter-spacing: 0.06em;
}

body.home-page .home-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

body.home-page .home-eyebrow {
  margin: 0 0 12px;
  font: 700 0.84rem/1.5 var(--font-ui);
  letter-spacing: 0.12em;
  color: var(--ui-accent);
}

body.home-page .home-welcome .home-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4em;
  font-size: clamp(0.92rem, 1.2vw, 1.08rem);
  letter-spacing: 0.03em;
}

body.home-page .home-identity a {
  padding: 3px 9px;
  margin-left: -9px;
  border-radius: 7px;
  color: inherit;
  text-decoration: none;
  transition: background 160ms ease;
}

body.home-page .home-identity a:hover {
  background: var(--home-soft);
}

body.home-page .home-welcome h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2.65vw, 2.6rem);
  line-height: 1.35;
  letter-spacing: -0.045em;
  color: var(--home-ink);
}

body.home-page .home-welcome h1 span {
  color: var(--ui-accent);
}

body.home-page .home-welcome-note {
  flex-shrink: 0;
  border-left: 1px solid var(--ui-line-strong);
  padding-left: 18px;
  color: var(--ui-muted);
  font-size: 0.91rem;
  line-height: 1.85;
}

body.home-page .home-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, 1fr);
  gap: 20px;
}

body.home-page .home-learning {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #416963;
  border-radius: 24px;
  background: radial-gradient(ellipse at 86% 47%, #315f5b 0%, transparent 58%), #0b373f;
  box-shadow: 0 14px 34px #06364112;
  color: #f6f5e9;
}

body.home-page .home-learning-copy {
  z-index: 2;
  width: 57%;
  padding: 30px 0 26px 32px;
}

body.home-page .home-learning .home-eyebrow {
  color: #a3cec7;
  font-size: 0.77rem;
}

body.home-page .home-learning h2 {
  margin: 18px 0 14px;
  font: 700 clamp(1.8rem, 2.8vw, 2.6rem)/1.26 var(--font-display);
  letter-spacing: -0.035em;
  color: #f7f3e6;
}

body.home-page .home-learning-description {
  margin: 0 0 22px;
  color: #c2d9d4;
  font-size: 1.06rem;
  line-height: 1.85;
}

body.home-page .home-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 48px;
  max-width: 100%;
  padding: 12px 18px;
  border-radius: 11px;
  background: #f2efdb;
  color: #123e40;
  font: 700 1.06rem/1.45 var(--font-ui);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

body.home-page .home-primary-link:hover {
  background: #fffbea;
  transform: translateY(-2px);
}

body.home-page .home-resume-note {
  margin: 12px 0 0;
  color: #bed4cf;
  font-size: 0.8rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

body.home-page [hidden] {
  display: none !important;
}

body.home-page .home-islands {
  position: absolute;
  width: 48%;
  height: 100%;
  right: 0;
  top: 0;
  pointer-events: none;
}

body.home-page .home-island-main {
  position: absolute;
  z-index: 1;
  width: 110%;
  height: 90%;
  right: -6%;
  top: 12%;
  object-fit: contain;
  filter: drop-shadow(0 22px 16px #001d2899);
}

body.home-page .home-island-small {
  position: absolute;
  width: 39%;
  height: auto;
  left: -13%;
  top: 3%;
  opacity: 0.68;
  filter: drop-shadow(0 12px 12px #001d2866);
}

body.home-page .home-orbit {
  position: absolute;
  border: 1px solid #a3cec72e;
  border-radius: 50%;
  transform: rotate(-23deg);
  width: 135%;
  height: 49%;
  left: -31%;
  top: 29%;
}

body.home-page .home-orbit-two {
  width: 154%;
  height: 67%;
  left: -41%;
  top: 21%;
  border-style: dashed;
  opacity: 0.5;
}

body.home-page .home-quick-actions {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 14px;
}

body.home-page .home-action-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--ui-line);
  border-radius: 19px;
  background: var(--ui-surface);
  text-decoration: none;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

body.home-page .home-action-card:hover {
  border-color: var(--ui-accent);
  transform: translateY(-2px);
}

body.home-page .home-max-card {
  background: var(--home-paper);
  border-color: var(--home-paper-line);
}

body.home-page .home-action-card strong {
  display: block;
  margin-block: 4px 6px;
  font: 700 1.34rem/1.4 var(--font-display);
  color: var(--home-ink);
}

body.home-page .home-action-card small {
  color: var(--ui-accent);
  font: 500 0.84rem/1.6 var(--font-ui);
}

body.home-page .home-action-description {
  display: block;
  color: var(--ui-muted);
  font-size: 0.88rem;
  line-height: 1.8;
}

body.home-page .home-action-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: var(--home-soft);
}

body.home-page .home-action-icon img {
  width: 22px;
  height: 22px;
  opacity: 0.75;
}

body.theme-dark.home-page .home-action-icon img {
  filter: brightness(0) invert(1);
}

body.home-page .home-action-arrow {
  color: var(--ui-accent);
  font-size: 1.32rem;
}

body.home-page .home-principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-block: 26px 48px;
  padding: 26px 22px;
  border: 1px solid var(--home-paper-line);
  border-radius: 20px;
  background: var(--home-paper);
}

body.home-page .home-principles > div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-content: start;
  gap: 6px 12px;
  padding-inline: 20px;
  border-left: 1px solid var(--home-paper-line);
}

body.home-page .home-principles > div:first-child {
  padding-left: 0;
  border-left: 0;
}

body.home-page .home-principle-number {
  display: grid;
  place-items: center;
  align-self: start;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--home-soft);
  color: var(--ui-accent);
  font: 500 0.88rem/1.8 var(--font-ui);
}

body.home-page .home-principles h2 {
  margin: 0 0 6px;
  font: 700 1.13rem/1.45 var(--font-display);
  color: var(--home-ink);
}

body.home-page .home-principles p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.9;
  color: var(--ui-muted);
}

body.home-page .home-principle-label {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font: 600 0.7rem/1.5 var(--font-ui);
  letter-spacing: 0.07em;
  color: var(--ui-accent);
  text-underline-offset: 4px;
}

body.home-page .home-community-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 8px;
  margin-bottom: 24px;
  text-align: left;
}

body.home-page .home-dashboard-main .home-community-motto {
  margin: 0;
  max-width: 100%;
  color: var(--ui-accent) !important;
  font: 700 clamp(1.14rem, 1.8vw, 1.6rem)/1.55 var(--font-latin);
  letter-spacing: 0.01em;
}

body.home-page .home-dashboard-main .home-community-motto .home-motto-initial {
  color: var(--home-motto-initial) !important;
  font-size: 1.2em;
  line-height: 1;
}

body.home-page .home-community-heading h2 {
  margin: 0;
  max-width: 100%;
  font: 600 clamp(1.12rem, 1.5vw, 1.45rem)/1.8 var(--font-display);
  color: var(--home-ink);
  overflow-wrap: anywhere;
}

body.home-page .home-dashboard {
  --home-heat-row-height: max(72px, 4rem);
  --home-board-row-height: max(112px, 6.5rem);
  height: auto;
  min-height: 0;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 20px;
}

body.home-page .home-dashboard-panel {
  border-radius: 19px;
  box-shadow: none !important;
  padding: 22px;
}

@media (min-width: 901px) {
  body.home-page .home-dashboard {
    grid-template-areas: 'feed boards' 'feed heat';
    grid-template-rows: auto auto;
    height: auto;
    min-height: 0;
  }
  body.home-page .home-heat-list {
    display: flex;
    flex-direction: column;
  }
}

/* Shared legacy rules force text colors with !important. Keep overrides local,
   especially the always-dark learning illustration, in both site themes. */
body.home-page .home-dashboard-main .home-eyebrow,
body.home-page .home-dashboard-main .home-principle-number,
body.home-page .home-dashboard-main .home-principle-label,
body.home-page .home-dashboard-main .home-action-card small,
body.home-page .home-dashboard-main .home-action-arrow,
body.home-page .home-dashboard-main .home-welcome h1 span {
  color: var(--ui-accent) !important;
}

body.home-page .home-dashboard-main .home-welcome h1,
body.home-page .home-dashboard-main .home-action-card strong,
body.home-page .home-dashboard-main .home-principles h2,
body.home-page .home-dashboard-main .home-community-heading h2,
body.home-page .home-dashboard-main .home-notice-link h2 {
  color: var(--home-ink) !important;
}

body.home-page .home-dashboard-main .home-action-description {
  color: var(--ui-muted) !important;
}

body.home-page .home-dashboard-main .home-learning h2 {
  color: #f7f3e6 !important;
}

body.home-page .home-dashboard-main .home-learning .home-eyebrow {
  color: #a3cec7 !important;
}

body.home-page .home-dashboard-main .home-learning-description,
body.home-page .home-dashboard-main .home-resume-note {
  color: #c2d9d4 !important;
}

body.home-page .home-dashboard-main .home-primary-link,
body.home-page .home-dashboard-main .home-primary-link span {
  color: #123e40 !important;
}

body.home-page .site-footer {
  opacity: 1 !important;
  animation: none !important;
  transform: none !important;
}

body.home-page .home-heat-list {
  flex: none;
  height: calc(5 * var(--home-heat-row-height));
  max-height: calc(5 * var(--home-heat-row-height));
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  overscroll-behavior-y: contain;
  scroll-snap-type: y proximity;
}

body.home-page .home-heat-list > li {
  flex: 0 0 var(--home-heat-row-height);
  height: var(--home-heat-row-height);
  min-height: var(--home-heat-row-height);
  box-sizing: border-box;
  scroll-snap-align: start;
}

body.home-page .home-heat-item > a {
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  padding-block: 6px;
}

body.home-page .home-heat-user-copy :is(strong, small) {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.4;
}

body.home-page :is(.home-feed-panel, .home-board-panel) {
  height: clamp(480px, 68vh, 680px);
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.home-page :is(.home-feed-list, .home-board-activity) {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  overscroll-behavior-y: contain;
  align-content: start;
}

@media (min-width: 901px) {
  body.home-page :is(.home-feed-panel, .home-board-panel, .home-heat-panel) {
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body.home-page .home-heat-list {
    flex: none;
    min-height: 0;
    overflow-y: auto;
    scrollbar-gutter: stable;
    overscroll-behavior-y: contain;
  }
  body.home-page .home-heat-list > li {
    flex-shrink: 0;
  }
}

body.home-page .home-feed-item,
body.home-page .home-board-item {
  flex-shrink: 0;
}

body.home-page .home-board-panel {
  height: auto;
}

body.home-page .home-board-activity {
  flex: none;
  height: calc(4 * var(--home-board-row-height));
  scroll-snap-type: y proximity;
}

body.home-page .home-board-item {
  height: var(--home-board-row-height);
  box-sizing: border-box;
  align-content: center;
  scroll-snap-align: start;
}

@media (min-width: 901px) {
  body.home-page .home-feed-panel {
    contain: size;
    align-self: stretch;
  }
}

body.home-page .home-panel-header {
  flex-shrink: 0;
  flex-wrap: wrap;
  min-height: 3.6rem;
}

body.home-page .home-feed-sort .home-feed-toggle {
  color: var(--ui-text);
  background: var(--ui-surface);
  font: inherit;
  padding: 8px 12px;
  max-width: 100%;
  cursor: pointer;
}

body.home-page .home-feed-item {
  min-height: 0;
  padding-block: 20px;
}

body.home-page .home-panel-header h2,
body.home-page .home-feed-title,
body.home-page .home-board-name {
  font-family: var(--font-display);
}

body.home-page .home-panel-header h2 {
  font-size: 1.36rem;
}

body.home-page .home-feed-title {
  font-size: 1.22rem;
  line-height: 1.6;
}

body.home-page .home-heat-explainer {
  margin-block: 14px 2px;
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--ui-muted);
}

body.home-page .home-notice-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 28px;
  padding: 25px 28px;
  border: 1px solid var(--ui-line);
  border-radius: 19px;
  background: var(--home-soft);
}

body.home-page .home-notice-link h2 {
  margin: 0 0 8px;
  font: 700 1.34rem/1.5 var(--font-display);
  color: var(--home-ink);
}

body.home-page .home-notice-link p:last-child {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ui-muted);
}

body.home-page .home-notice-actions {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: 10px;
}

body.home-page .home-notice-actions a {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  min-height: 46px;
  padding: 10px 17px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 10px;
  background: var(--ui-surface);
  color: var(--ui-accent);
  font-size: 0.94rem;
  text-decoration: none;
}

body.home-page .home-dashboard-main :is(a, button, summary):focus-visible {
  outline: 3px solid var(--ui-focus);
  outline-offset: 4px;
}

body.home-page .home-learning a:focus-visible {
  outline-color: #f6efbd;
}

@media (max-width: 1200px) {
  body.home-page .home-actions {
    grid-template-columns: minmax(0, 1.6fr) minmax(250px, 1fr);
  }
  body.home-page .home-action-card {
    padding: 18px;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  body.home-page .home-action-icon {
    display: none;
  }
  body.home-page .home-learning-copy {
    padding-left: 24px;
    width: 65%;
  }
  body.home-page .home-islands {
    width: 42%;
  }
  body.home-page .home-island-main {
    top: 24%;
  }
  body.home-page .home-island-small {
    display: none;
  }
}

@media (max-width: 900px) {
  body.home-page .home-dashboard-main {
    padding-top: calc(132px + env(safe-area-inset-top, 0px)) !important;
    padding-inline: 24px !important;
  }
  body.home-page .home-welcome {
    gap: 12px;
  }
  body.home-page .home-welcome-note {
    font-size: 0.79rem;
  }
  body.home-page .home-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
  }
  body.home-page .home-quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 12px;
  }
  body.home-page .home-action-card {
    padding: 17px 14px;
    gap: 7px;
  }
  body.home-page .home-action-card strong {
    font-size: 1.2rem;
  }
  body.home-page .home-learning-copy {
    width: 55%;
    padding: 28px;
  }
  body.home-page .home-islands {
    width: 44%;
  }
  body.home-page .home-island-main {
    width: 105%;
    top: 6%;
    right: 1%;
  }
  body.home-page .home-dashboard {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas: 'feed' 'boards' 'heat';
  }
  body.home-page .home-board-panel {
    display: flex !important;
  }
}

@media (max-width: 600px) {
  body.home-page .home-dashboard-main {
    padding-inline: 16px !important;
  }
  body.home-page .home-welcome {
    margin-bottom: 20px;
  }
  body.home-page .home-welcome h1 {
    font-size: clamp(1.78rem, 6vw, 1.95rem);
    letter-spacing: -0.04em;
  }
  body.home-page .home-welcome .home-identity {
    font-size: 0.9rem;
    letter-spacing: 0.015em;
  }
  body.home-page .home-welcome-note {
    display: none;
  }
  body.home-page .home-learning {
    border-radius: 19px;
  }
  body.home-page .home-learning-copy {
    width: 72%;
    padding: 20px 0 18px 20px;
    background: linear-gradient(90deg, #0b373f 65%, #0b373f00);
  }
  body.home-page .home-learning h2 {
    font-size: 1.65rem;
    margin-block: 10px 12px;
  }
  body.home-page .home-learning-description {
    font-size: 0.94rem;
  }
  body.home-page .home-learning .home-eyebrow {
    font-size: 0.66rem;
    letter-spacing: 0.06em;
  }
  body.home-page .home-islands {
    width: 39%;
    top: 42px;
    opacity: 0.8;
  }
  body.home-page .home-island-main {
    width: 145%;
    top: 12%;
    right: -49%;
  }
  body.home-page .home-island-small {
    display: none;
  }
  body.home-page .home-primary-link {
    font-size: 0.94rem;
    gap: 10px;
    padding-inline: 14px;
  }
  body.home-page .home-quick-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  body.home-page .home-action-card {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    border-radius: 14px;
    padding: 16px;
    gap: 12px;
  }
  body.home-page .home-action-icon {
    display: grid;
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }
  body.home-page .home-action-card small {
    display: block;
  }
  body.home-page .home-action-card strong {
    font-size: 0.98rem;
    margin: 0 0 4px;
  }
  body.home-page .home-action-description {
    display: block;
    font-size: 0.84rem;
  }
  body.home-page .home-action-arrow {
    display: block;
  }
  body.home-page .home-principles {
    grid-template-columns: minmax(0, 1fr);
    gap: 17px;
    margin-bottom: 34px;
    padding: 22px 18px;
  }
  body.home-page .home-principles > div {
    grid-template-columns: 26px minmax(0, 1fr);
    padding: 0;
    border: 0;
    gap: 0 10px;
  }
  body.home-page .home-principles > div + div {
    padding-top: 18px;
    border-top: 1px solid var(--home-paper-line);
  }
  body.home-page .home-principle-label {
    min-height: 26px;
  }
  body.home-page .home-dashboard-panel {
    padding: 18px;
  }
  body.home-page .home-notice-link {
    align-items: stretch;
    flex-direction: column;
    padding: 22px;
  }
  body.home-page .home-notice-link h2 {
    font-size: 1.2rem;
  }
  body.home-page .home-notice-actions a {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.home-page .home-primary-link,
  body.home-page .home-action-card {
    transition: none;
    transform: none;
  }
}

/* Discovery data and footer also use readable, scalable text on the homepage. */
body.home-page .home-feed-meta,
body.home-page .home-panel-link,
body.home-page .home-feed-toggle,
body.home-page .home-board-meta,
body.home-page .home-board-interactions,
body.home-page .home-heat-rank,
body.home-page .home-heat-score,
body.home-page .site-footer {
  font-size: 0.9rem;
  line-height: 1.75;
}

body.home-page .footer-links {
  flex-wrap: wrap;
  gap: 12px 20px;
}

body.home-page .home-panel-kicker,
body.home-page .home-feed-toggle-label,
body.home-page .home-heat-user-copy small {
  font-size: 0.84rem;
  line-height: 1.6;
}

body.home-page .home-board-name,
body.home-page .home-heat-user-copy strong {
  font-size: 1.08rem;
}
