:root {
  --ink: #172126;
  --muted: #5b6870;
  --line: #d7dee2;
  --surface: #ffffff;
  --soft: #f5f7f4;
  --teal: #0b5c63;
  --teal-dark: #073f45;
  --red: #a7342f;
  --amber: #c88b1d;
  --green: #347b5b;
  --shadow: 0 18px 50px rgba(18, 33, 38, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", Arial, sans-serif;
  color: var(--ink);
  background: var(--soft);
  line-height: 1.65;
}

a {
  color: inherit;
}

.hero {
  position: relative;
  min-height: 86vh;
  overflow: hidden;
  color: #fff;
  display: grid;
  align-items: end;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(5, 29, 34, 0.86), rgba(5, 29, 34, 0.45) 52%, rgba(5, 29, 34, 0.2)),
    linear-gradient(0deg, rgba(5, 29, 34, 0.75), transparent 48%);
}

.topbar {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px clamp(18px, 5vw, 64px);
}

.topbar a {
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.34);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  background: rgba(8, 39, 45, 0.38);
  backdrop-filter: blur(10px);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  padding: 0 clamp(22px, 7vw, 86px) 12vh;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--amber);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.1rem, 6vw, 5rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.18;
  margin-bottom: 10px;
}

.subtitle {
  width: min(680px, 100%);
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.08rem;
}

.teacher {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.08rem;
  font-weight: 700;
}

.hero-actions,
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-action,
.secondary-action,
.filter,
.week-link,
.resource-tile {
  min-height: 42px;
  border-radius: 8px;
  text-decoration: none;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  font-weight: 700;
}

.primary-action {
  background: #fff;
  color: var(--teal-dark);
}

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

main {
  width: min(1180px, calc(100% - 32px));
  margin: -56px auto 0;
  position: relative;
  z-index: 3;
}

.dashboard,
.resource-grid,
.week-grid,
.exam-cards {
  display: grid;
  gap: 14px;
}

.dashboard {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
}

.dashboard article,
.panel,
.week-card,
.resource-tile,
.exam-cards article {
  background: var(--surface);
  border: 1px solid rgba(23, 33, 38, 0.08);
  box-shadow: var(--shadow);
}

.dashboard article {
  padding: 20px;
  border-radius: 8px;
}

.stat-number {
  display: block;
  color: var(--teal);
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
}

.stat-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.panel {
  border-radius: 8px;
  padding: clamp(20px, 4vw, 34px);
  margin-bottom: 24px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.resource-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.resource-tile {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 18px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.resource-tile:hover,
.week-card:hover {
  transform: translateY(-2px);
  border-color: rgba(11, 92, 99, 0.35);
}

.tile-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--teal);
  color: #fff;
  border-radius: 8px;
  font-weight: 800;
}

small {
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.search-box span {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.search-box input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit;
  background: #fff;
}

.filter {
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

.filter.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

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

.week-card {
  border-radius: 8px;
  padding: 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.week-number {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font-weight: 800;
}

.week-card.exam .week-number {
  background: var(--red);
}

.week-card h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  line-height: 1.35;
}

.week-topic {
  color: var(--muted);
  margin-bottom: 12px;
}

.week-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.week-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.9rem;
}

.week-link.primary {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.week-link.local-file-link {
  border-color: rgba(167, 52, 47, 0.28);
  color: var(--red);
}

.complete-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.complete-control input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.exam-panel {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  align-items: center;
}

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

.exam-cards article {
  border-radius: 8px;
  padding: 18px;
  box-shadow: none;
}

.exam-cards span {
  display: block;
  color: var(--red);
  font-weight: 800;
}

.exam-cards strong {
  display: block;
  font-size: 1.15rem;
  margin: 4px 0;
}

footer {
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 42px;
  color: var(--muted);
  font-size: 0.9rem;
}

.file-notice {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  width: min(520px, calc(100% - 28px));
  transform: translateX(-50%);
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(11, 92, 99, 0.28);
  border-left: 6px solid var(--teal);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(18, 33, 38, 0.22);
  padding: 14px 16px;
}

.file-notice strong,
.file-notice span {
  display: block;
}

.file-notice span {
  color: var(--muted);
  font-size: 0.94rem;
}

@media (max-width: 880px) {
  .dashboard,
  .resource-grid,
  .week-grid,
  .exam-panel,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: block;
  }

  .hero {
    min-height: 78vh;
  }
}

@media (max-width: 560px) {
  .topbar {
    justify-content: flex-start;
    overflow-x: auto;
  }

  main,
  footer {
    width: min(100% - 20px, 1180px);
  }

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

  .week-card {
    grid-template-columns: 1fr;
  }
}
