:root {
  --bg: #f7faf8;
  --surface: #ffffff;
  --surface-strong: #edf7f0;
  --ink: #1f2a24;
  --muted: #5c6b61;
  --line: #d8e3dc;
  --green: #2f8f5b;
  --green-dark: #17633b;
  --yellow: #f0c96a;
  --blue: #4b8ed8;
  --pink: #e07b91;
  --shadow: 0 20px 45px rgba(31, 42, 36, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 250, 248, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.nav {
  width: min(1120px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  font-weight: 800;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 0.96rem;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--green-dark);
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  align-items: center;
  gap: 44px;
  padding: 54px 0 42px;
}

.hero-copy {
  max-width: 650px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(2.45rem, 7vw, 5.3rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  line-height: 1.14;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.hero-text {
  max-width: 58ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(47, 143, 91, 0.22);
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--green-dark);
}

.hero-visual {
  min-height: 410px;
  display: grid;
  place-items: center;
}

.desk-scene {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)),
    var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.desk-scene::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 16%;
  height: 18px;
  border-radius: 8px;
  background: #b88456;
}

.window-shape {
  position: absolute;
  top: 42px;
  right: 44px;
  width: 116px;
  height: 116px;
  border-radius: 8px;
  background: #d8ebff;
  border: 10px solid #ffffff;
  box-shadow: inset 0 -28px 0 rgba(75, 142, 216, 0.22);
}

.screen {
  position: absolute;
  left: 60px;
  bottom: 126px;
  width: 210px;
  height: 134px;
  border-radius: 8px;
  background: #23332b;
  border: 12px solid #ffffff;
  box-shadow: 0 16px 26px rgba(31, 42, 36, 0.16);
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 24px;
}

.screen::after {
  content: "";
  position: absolute;
  left: 83px;
  bottom: -58px;
  width: 42px;
  height: 46px;
  background: #ffffff;
}

.code-line {
  display: block;
  height: 10px;
  border-radius: 8px;
  background: #74d99a;
}

.code-line.short {
  width: 68%;
  background: var(--yellow);
}

.code-line.tiny {
  width: 46%;
  background: #86d3ff;
}

.book {
  position: absolute;
  bottom: 84px;
  width: 116px;
  height: 22px;
  border-radius: 8px;
  background: var(--pink);
}

.book.one {
  right: 60px;
}

.book.two {
  right: 84px;
  bottom: 112px;
  background: var(--blue);
}

.pencil {
  position: absolute;
  left: 70px;
  bottom: 76px;
  width: 136px;
  height: 14px;
  border-radius: 8px;
  background: var(--yellow);
  transform: rotate(-10deg);
}

.section {
  padding: 62px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  max-width: 650px;
  margin-bottom: 24px;
}

.section-heading p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
}

.weather-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.weather-controls,
.weather-card,
.info-card,
.work-item,
.journal-form,
.journal-post,
.game-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(31, 42, 36, 0.06);
}

.weather-controls {
  padding: 22px;
}

.weather-controls label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 800;
}

.weather-controls select + label {
  margin-top: 16px;
}

select,
input,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}

select:focus,
input:focus,
textarea:focus,
.button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(47, 143, 91, 0.25);
  outline-offset: 3px;
}

textarea {
  resize: vertical;
}

.weather-card {
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
}

.weather-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.weather-main {
  min-width: 128px;
  padding: 16px;
  border-radius: 8px;
  background: var(--surface-strong);
  text-align: center;
}

.weather-main p {
  margin: 0;
  font-size: 2rem;
  font-weight: 900;
}

.weather-main span {
  color: var(--muted);
}

.weather-details {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.weather-details div {
  padding: 14px;
  border-radius: 8px;
  background: #f5f8f6;
}

.weather-details dt {
  color: var(--muted);
  font-size: 0.88rem;
}

.weather-details dd {
  margin: 4px 0 0;
  font-weight: 800;
}

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

.info-card {
  padding: 22px;
}

.info-card p,
.work-item p {
  margin: 0;
  color: var(--muted);
}

.work-list {
  display: grid;
  gap: 14px;
}

.work-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  align-items: start;
  padding: 18px;
}

.work-item span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--green-dark);
  font-weight: 900;
}

.journal-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.journal-form {
  padding: 22px;
  display: grid;
  gap: 12px;
}

.journal-form label,
.comment-form label {
  color: var(--muted);
  font-weight: 800;
}

.journal-form .button {
  width: 100%;
  margin-top: 4px;
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.journal-feed {
  display: grid;
  gap: 16px;
}

.empty-feed {
  margin: 0;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
}

.journal-post {
  padding: 22px;
}

.post-meta,
.post-actions,
.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.post-meta {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.journal-post h3 {
  margin-bottom: 10px;
}

.post-content {
  margin: 0;
  white-space: pre-wrap;
}

.post-actions {
  margin-top: 18px;
}

.like-button {
  min-height: 38px;
  padding: 8px 12px;
}

.like-button.is-liked {
  background: var(--surface-strong);
  border-color: var(--green);
  color: var(--green-dark);
}

.comments {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.comment {
  padding: 12px;
  border-radius: 8px;
  background: #f5f8f6;
}

.comment-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.comment p {
  margin: 6px 0 0;
}

.comment-form {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(120px, 0.32fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.comment-form label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

.goal-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.goal-section p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.site-footer {
  margin-top: 24px;
  padding: 28px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.game-main {
  width: min(760px, calc(100% - 32px));
}

.game-hero {
  min-height: auto;
  grid-template-columns: 1fr;
  padding-bottom: 24px;
}

.game-panel {
  padding: 24px;
  margin-bottom: 42px;
}

.game-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.game-form label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.game-message {
  min-height: 32px;
  margin: 18px 0 0;
  color: var(--green-dark);
  font-weight: 800;
}

.game-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tries {
  color: var(--muted);
}

@media (max-width: 820px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .hero,
  .weather-layout,
  .journal-layout,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 40px;
  }

  .hero-visual {
    min-height: 310px;
  }

  .goal-section {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  main,
  .nav,
  .game-main {
    width: min(100% - 24px, 1120px);
  }

  .hero-actions,
  .game-form,
  .comment-form {
    grid-template-columns: 1fr;
  }

  .hero-actions .button,
  .game-form .button,
  .comment-form .button,
  .goal-section .button {
    width: 100%;
  }

  .weather-card,
  .weather-details {
    grid-template-columns: 1fr;
  }

  .weather-main {
    text-align: left;
  }

  .desk-scene {
    width: min(100%, 320px);
  }
}
