:root {
  --bg: #f6f7f2;
  --surface: #ffffff;
  --surface-2: #eef3ef;
  --text: #18201d;
  --muted: #66736d;
  --line: #d8ded7;
  --accent: #0f766e;
  --accent-2: #b42318;
  --accent-3: #6f5b20;
  --dark: #12312e;
  --shadow: 0 18px 45px rgba(22, 40, 36, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
}

.app-header {
  background:
    linear-gradient(115deg, rgba(18, 49, 46, 0.92), rgba(21, 72, 65, 0.86)),
    url("https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=1800&q=80")
      center / cover;
  color: #fff;
  min-height: 94vh;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 9px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: #fff;
  margin: 5px 0;
}

.hero {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  min-height: calc(94vh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: center;
  gap: 48px;
  padding: 56px 0 96px;
}

.eyebrow {
  color: #d7a928;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 10px;
  font-size: 13px;
}

.hero h1 {
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1.02;
  letter-spacing: 0;
  margin: 0;
}

.hero-text {
  max-width: 640px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  margin: 24px 0 0;
}

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

.primary-action,
.ghost-action {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  text-decoration: none;
  font-weight: 800;
}

.primary-action {
  background: #f2c94c;
  color: #1f241a;
}

.ghost-action {
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #fff;
}

.hero-panel {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  backdrop-filter: blur(16px);
  padding: 24px;
  box-shadow: var(--shadow);
}

.score-ring {
  width: 146px;
  height: 146px;
  margin: 0 auto 22px;
  border: 12px solid rgba(242, 201, 76, 0.88);
  border-left-color: rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
}

.score-ring span {
  display: block;
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
}

.score-ring small {
  color: rgba(255, 255, 255, 0.8);
}

.hero-stats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.hero-stats li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stats span {
  color: rgba(255, 255, 255, 0.76);
  text-align: right;
}

.section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading.compact {
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 4.8vw, 46px);
  line-height: 1.12;
  letter-spacing: 0;
}

.section-heading p:last-child {
  color: var(--muted);
  margin: 14px 0 0;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.day-card,
.study-card,
.template-card,
.topic-card,
.snippet-card,
.quick-card,
.essay-template {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(22, 40, 36, 0.06);
}

.day-card {
  padding: 18px;
}

.day-card h3,
.study-card h3,
.template-card h3,
.topic-card h3,
.snippet-card h3,
.quick-card h3,
.essay-template h3 {
  margin: 0 0 10px;
  line-height: 1.28;
}

.day-card time {
  display: inline-flex;
  color: var(--accent);
  font-weight: 900;
  font-size: 13px;
}

.day-card ul,
.study-card ul,
.template-card ul,
.topic-card ul,
.quick-card ul,
.essay-template ol,
.checklist ul {
  padding-left: 20px;
  margin: 10px 0 0;
}

.command-center {
  padding-top: 44px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 14px;
}

.search-box,
.progress-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}

.search-box span,
.progress-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.search-box input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  min-width: 0;
}

.progress-box {
  justify-content: space-between;
}

.search-results {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.search-results a {
  display: block;
  text-decoration: none;
  padding: 10px 8px;
  border-radius: 8px;
}

.search-results a:hover {
  background: var(--surface-2);
}

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

.study-card {
  overflow: hidden;
}

.study-card button {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 16px;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.study-card button strong {
  display: block;
  line-height: 1.35;
}

.study-card button span {
  color: var(--accent);
  font-weight: 900;
}

.study-card .card-body {
  display: none;
  padding: 0 16px 18px;
  color: var(--muted);
}

.study-card.open .card-body {
  display: block;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e6f1ee;
  color: #105c55;
  font-size: 12px;
  font-weight: 800;
}

.mastered {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.template-list,
.snippet-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.template-card,
.snippet-card {
  padding: 18px;
}

.template-card p,
.snippet-card p {
  color: var(--muted);
  margin: 0;
}

.deep-list {
  display: grid;
  gap: 16px;
}

.deep-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(22, 40, 36, 0.06);
}

.deep-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  background: linear-gradient(90deg, #eef3ef, #fff);
  border-bottom: 1px solid var(--line);
}

.deep-card h3 {
  margin: 0;
  line-height: 1.28;
}

.deep-index {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--dark);
  color: #fff;
  font-weight: 900;
}

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

.deep-block {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}

.deep-block:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.deep-block h4 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 14px;
}

.deep-block p {
  margin: 0;
  color: var(--muted);
}

.deep-block ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.project-bank {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.project-card h3 {
  margin: 0 0 10px;
}

.project-card dl {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 9px 12px;
  margin: 0;
}

.project-card dt {
  color: var(--accent);
  font-weight: 900;
}

.project-card dd {
  margin: 0;
  color: var(--muted);
}

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

.memory-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.memory-card h3 {
  margin: 0 0 10px;
  line-height: 1.28;
}

.memory-card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.memory-card strong {
  color: var(--text);
}

.memory-card code {
  display: block;
  white-space: normal;
  background: #eef3ef;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: #24423c;
  font-family: inherit;
}

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

.essay-template {
  position: sticky;
  top: 14px;
  padding: 20px;
}

.topic-list,
.knowledge-list {
  display: grid;
  gap: 14px;
}

.topic-card,
.knowledge-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.topic-card dl,
.knowledge-card dl {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 10px 0 0;
}

.topic-card dt,
.knowledge-card dt {
  color: var(--accent);
  font-weight: 900;
}

.topic-card dd,
.knowledge-card dd {
  margin: 0;
  color: var(--muted);
}

.quick-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.quick-card {
  padding: 20px;
}

.keyword-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}

.keyword-cloud li {
  background: #fff7df;
  color: var(--accent-3);
  border: 1px solid #ead89c;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.check-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  gap: 12px;
}

.check-item input {
  width: 20px;
  height: 20px;
  margin-top: 4px;
  accent-color: var(--accent);
}

.check-item strong {
  display: block;
  margin-bottom: 4px;
}

.check-item span {
  color: var(--muted);
}

.source-section {
  padding-bottom: 90px;
}

.source-section p,
.source-section li {
  color: var(--muted);
}

.back-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  font-weight: 900;
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.back-top.show {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-top: 36px;
  }

  .timeline,
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .essay-layout,
  .quick-layout,
  .project-bank {
    grid-template-columns: 1fr;
  }

  .essay-template {
    position: static;
  }
}

@media (max-width: 680px) {
  .app-header {
    min-height: auto;
  }

  .topbar {
    width: min(100% - 24px, 1120px);
    min-height: 62px;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 62px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border-radius: 8px;
    background: rgba(18, 49, 46, 0.98);
    z-index: 10;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    border-radius: 8px;
    padding: 12px;
  }

  .hero,
  .section {
    width: min(100% - 24px, 1120px);
  }

  .hero {
    min-height: auto;
    padding: 42px 0 58px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero-text {
    font-size: 16px;
  }

  .hero-panel {
    padding: 18px;
  }

  .section {
    padding-top: 52px;
  }

  .timeline,
  .card-grid,
  .template-list,
  .snippet-grid,
  .checklist,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .topic-card dl,
  .knowledge-card dl,
  .project-card dl {
    grid-template-columns: 1fr;
  }

  .topic-card dt,
  .knowledge-card dt,
  .project-card dt {
    margin-top: 6px;
  }

  .deep-body,
  .memory-grid {
    grid-template-columns: 1fr;
  }

  .deep-block:nth-child(odd) {
    border-right: 0;
  }

  .search-box,
  .progress-box {
    min-height: 56px;
  }
}
