:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #687386;
  --line: #d9e0ea;
  --accent: #1f6feb;
  --accent-soft: #e8f1ff;
  --shadow: 0 18px 60px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Nunito,
    Inter,
    "Noto Sans TC",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 251, 0.92);
}

.home-page {
  min-height: 100vh;
}

.home-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.home-nav a,
.primary-link,
.module-card > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: #334155;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.home-nav a:hover,
.home-nav a:focus-visible,
.module-card > a:hover,
.module-card > a:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.home-main {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 32px 32px 64px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
  align-items: center;
  gap: 28px;
  min-height: calc(100vh - 178px);
  padding: 8px 0 36px;
}

.home-hero-copy {
  min-width: 0;
}

.home-hero h2,
.home-section h2 {
  margin: 0;
  letter-spacing: 0;
}

.home-hero h2 {
  max-width: 720px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.08;
}

.home-hero-copy > p:not(.eyebrow) {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.primary-link {
  min-height: 46px;
  padding: 0 18px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary-link:hover,
.primary-link:focus-visible {
  background: #1456c8;
  color: #fff;
  outline: none;
}

.home-preview {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.home-preview:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 4px;
}

.home-preview img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.home-section {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.home-section h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.module-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 28px rgba(23, 32, 51, 0.06);
}

.module-card-body {
  display: grid;
  gap: 10px;
}

.module-status {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.module-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.module-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.module-card > a {
  align-self: start;
  margin-top: 22px;
}

.module-card-placeholder {
  background: rgba(255, 255, 255, 0.58);
  border-style: dashed;
}

.module-card-placeholder .module-status {
  background: #eef2f7;
  color: var(--muted);
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .home-nav {
    justify-content: flex-start;
  }

  .home-main {
    padding: 24px 18px 48px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 10px;
  }

  .home-preview {
    order: -1;
  }
}

@media (max-width: 700px) {
  .home-hero h2 {
    font-size: 34px;
  }

  .home-hero-copy > p:not(.eyebrow) {
    font-size: 16px;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .home-actions,
  .home-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .home-actions .primary-link,
  .home-nav a {
    width: 100%;
  }
}
