﻿:root {
  --color-primary: #8f5bff;
  --color-primary-strong: #6f3ed9;
  --color-surface: #0b0c10;
  --color-surface-soft: #12131a;
  --color-panel: #141620;
  --color-panel-soft: #1a1d28;
  --color-divider: #2d3140;
  --color-text: #e8e9f2;
  --color-text-strong: #f7f8ff;
  --color-muted: #a9aec2;
  --nav-height: 60px;
  --nav-offset: 82px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Noto Sans TC", sans-serif;
  color: var(--color-text);
  background: var(--color-surface);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-offset);
}

body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% -2%, rgba(143, 91, 255, 0.16), transparent 34%),
    radial-gradient(circle at 100% 14%, rgba(111, 62, 217, 0.12), transparent 40%),
    linear-gradient(180deg, #0b0c10 0%, #0f1118 55%, #0b0c10 100%);
}

#home,
#assignments,
#preview,
#about {
  scroll-margin-top: calc(var(--nav-offset) + 8px);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.03);
}

#scroll-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #6ea8ff);
  box-shadow: 0 0 12px rgba(143, 91, 255, 0.55);
  transition: width 0.12s linear;
}

.bg-grid,
.bg-vignette,
.bg-noise,
.bg-spot,
.aura {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-grid {
  z-index: -5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, #000 34%, transparent 88%);
}

.bg-vignette {
  z-index: -4;
  background: radial-gradient(circle at center, transparent 44%, rgba(0, 0, 0, 0.68) 100%);
}

.bg-noise {
  z-index: -2;
  opacity: 0.035;
  background-image:
    radial-gradient(#ffffff 0.4px, transparent 0.4px),
    radial-gradient(#ffffff 0.4px, transparent 0.4px);
  background-size: 2px 2px;
  background-position: 0 0, 1px 1px;
}

.bg-spot {
  z-index: -3;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.18;
}

.spot-a {
  width: 420px;
  height: 420px;
  top: -180px;
  left: -140px;
  background: #7b46eb;
}

.spot-b {
  width: 380px;
  height: 380px;
  right: -140px;
  bottom: -140px;
  background: #5d7cff;
}

.aura {
  z-index: -1;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(143, 91, 255, 0.24) 0%, rgba(143, 91, 255, 0) 72%);
  mix-blend-mode: screen;
  opacity: 0.3;
}

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 10px 12px 0;
}

.nav-inner,
.mobile-nav {
  max-width: 1140px;
  margin: 0 auto;
  border: 1px solid rgba(143, 91, 255, 0.36);
  border-radius: 14px;
  background: rgba(17, 19, 28, 0.78);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38);
}

.site-nav.scrolled .nav-inner,
.site-nav.scrolled .mobile-nav {
  background: rgba(13, 15, 23, 0.92);
  border-color: rgba(143, 91, 255, 0.48);
}

.nav-inner {
  min-height: var(--nav-height);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--color-text-strong);
  border-radius: 10px;
  padding: 8px 10px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--color-primary), #73afff);
  box-shadow: 0 0 10px rgba(143, 91, 255, 0.65);
}

.brand-text {
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}

.nav-link,
.menu-toggle,
.hero-cta {
  text-decoration: none;
  color: var(--color-text);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 12px;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus,
.menu-toggle:hover,
.menu-toggle:focus,
.hero-cta:hover,
.hero-cta:focus {
  border-color: rgba(143, 91, 255, 0.66);
  background-color: rgba(143, 91, 255, 0.12);
}

.nav-link.active,
.mobile-link.active {
  color: #ffffff;
  border-color: rgba(143, 91, 255, 0.78);
  background: linear-gradient(130deg, rgba(143, 91, 255, 0.18), rgba(111, 62, 217, 0.1));
}

.nav-spotlight {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.nav-spotlight::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 170%;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(143, 91, 255, 0.34) 0%, rgba(143, 91, 255, 0) 68%);
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
  pointer-events: none;
  z-index: 0;
}

.nav-spotlight:hover::before,
.nav-spotlight:focus-visible::before {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.nav-spotlight > * {
  position: relative;
  z-index: 1;
}

.nav-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 130;
  padding: 0.44rem 0.72rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(143, 91, 255, 0.56);
  background: rgba(18, 20, 28, 0.95);
  color: var(--color-text-strong);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.96);
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.menu-toggle {
  display: none;
  justify-self: end;
  min-width: 40px;
  min-height: 40px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
}

.mobile-nav {
  margin-top: 8px;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.mobile-link {
  text-decoration: none;
  color: var(--color-text);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.mobile-link:hover {
  border-color: rgba(143, 91, 255, 0.66);
  background: rgba(143, 91, 255, 0.12);
}

.page-content {
  padding-top: var(--nav-offset);
}

.hero,
.layout,
.about {
  max-width: 1140px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.hero {
  position: relative;
  min-height: clamp(240px, 36vh, 320px);
  padding-top: 18px;
  padding-bottom: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  border: 1px solid rgba(143, 91, 255, 0.3);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(14, 15, 21, 0.58) 0%, rgba(14, 15, 21, 0.78) 46%, rgba(14, 15, 21, 0.94) 100%),
    linear-gradient(125deg, #1a1631 0%, #111523 46%, #131722 100%);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.46);
  overflow: hidden;
}

.hero-flare {
  position: absolute;
  left: -10%;
  top: -28%;
  width: 44%;
  height: 62%;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(143, 91, 255, 0.2) 0%, rgba(143, 91, 255, 0) 74%);
  filter: blur(14px);
  pointer-events: none;
}

.eyebrow {
  margin: 0;
  display: inline-block;
  border: 1px solid rgba(143, 91, 255, 0.54);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e0d2ff;
  background: rgba(143, 91, 255, 0.13);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--color-text-strong);
  letter-spacing: -0.02em;
}

h1 {
  margin-top: 4px;
  margin-bottom: 6px;
  font-size: clamp(34px, 5.7vw, 62px);
  line-height: 1;
  text-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.hero-copy {
  margin: 0;
  max-width: 700px;
  color: var(--color-muted);
  font-size: clamp(15px, 1.8vw, 19px);
  line-height: 1.48;
}

.hero-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-date {
  margin: 0;
  font-size: 13px;
  color: var(--color-text);
}

.hero-pill {
  border: 1px solid var(--color-divider);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  color: #cdd2df;
  background: rgba(255, 255, 255, 0.03);
}

.hero-cta {
  color: #ffffff;
  border-color: rgba(143, 91, 255, 0.72);
  background: linear-gradient(106deg, var(--color-primary), var(--color-primary-strong));
  box-shadow: 0 8px 20px rgba(143, 91, 255, 0.36);
}

.layout-wrap {
  padding-bottom: 10px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  padding-top: 14px;
  padding-bottom: 26px;
}

.timeline,
.panel,
.about-card {
  border: 1px solid var(--color-divider);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--color-panel), #10131d);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}

.timeline {
  position: sticky;
  top: calc(var(--nav-offset) + 10px);
  align-self: start;
  max-height: calc(100vh - var(--nav-offset) - 24px);
  padding: 16px;
  overflow: auto;
}

.timeline h2 {
  font-size: 24px;
}

.timeline-help {
  margin: 6px 0 14px;
  color: var(--color-muted);
  font-size: 13px;
}

.timeline ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.assignment-btn {
  width: 100%;
  text-align: left;
  border: 1px solid #353a4c;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.assignment-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(143, 91, 255, 0.7);
  background: rgba(143, 91, 255, 0.12);
}

.assignment-btn.active {
  border-color: rgba(143, 91, 255, 0.86);
  background: linear-gradient(130deg, rgba(143, 91, 255, 0.2), rgba(111, 62, 217, 0.1));
  box-shadow: inset 0 0 0 1px rgba(143, 91, 255, 0.24);
}

.assignment-btn .date {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c1c6d7;
}

.assignment-btn .title {
  display: block;
  margin-top: 3px;
  font-weight: 600;
  color: #f4f5ff;
}

.workspace {
  display: grid;
  gap: 12px;
}

.workspace-head h2 {
  font-size: clamp(28px, 4vw, 44px);
}

.workspace-head p {
  margin: 7px 0 0;
  color: var(--color-muted);
}

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

.panel {
  padding: 14px;
  min-height: 520px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  border: 1px solid rgba(143, 91, 255, 0.6);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: #dfd3ff;
  background: rgba(143, 91, 255, 0.12);
}

#code-editor,
#output {
  width: 100%;
  margin: 0;
  border: 1px solid #363a4a;
  border-radius: 12px;
  background: linear-gradient(180deg, #0f121a 0%, #0d1018 100%);
  color: #edf1ff;
  padding: 14px;
  font-family: Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
  font-size: 14px;
  line-height: 1.55;
  min-height: 260px;
}

#code-editor {
  resize: vertical;
}

#code-editor[readonly] {
  cursor: default;
  opacity: 0.98;
}

#code-editor[readonly]:focus {
  outline: none;
}

#output {
  white-space: pre-wrap;
  overflow: auto;
}

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

.run-btn,
.ghost-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.run-btn {
  color: #ffffff;
  background: linear-gradient(106deg, var(--color-primary), var(--color-primary-strong));
  box-shadow: 0 8px 18px rgba(143, 91, 255, 0.32);
}

.run-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(143, 91, 255, 0.42);
}

.run-btn:disabled {
  opacity: 0.68;
  cursor: not-allowed;
}

.ghost-btn {
  color: var(--color-text-strong);
  border: 1px solid var(--color-divider);
  background: rgba(255, 255, 255, 0.03);
}

.ghost-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(143, 91, 255, 0.62);
  background: rgba(143, 91, 255, 0.13);
}

.status {
  font-size: 13px;
  color: var(--color-muted);
}

.about {
  padding-bottom: 56px;
}

.about-card {
  padding: 22px;
}

.about-card h2 {
  margin-bottom: 10px;
  font-size: clamp(24px, 4vw, 36px);
}

.about-card p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.72;
}

.about-card p + p {
  margin-top: 12px;
}

.section-reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.56s cubic-bezier(0.16, 1, 0.3, 1), transform 0.56s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.hide-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

@media (max-width: 1024px) {
  .desktop-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .timeline {
    position: static;
    max-height: none;
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: auto;
  }
}

@media (min-width: 1025px) {
  .mobile-nav {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --nav-height: 56px;
    --nav-offset: 76px;
  }

  .site-nav {
    padding-left: 8px;
    padding-right: 8px;
  }

  .nav-inner {
    padding-left: 10px;
    padding-right: 10px;
  }

  .hero,
  .layout,
  .about {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero {
    min-height: auto;
    padding-top: 16px;
    padding-bottom: 18px;
    border-radius: 18px;
    gap: 7px;
  }

  h1 {
    margin-top: 2px;
    margin-bottom: 4px;
    font-size: clamp(32px, 10.5vw, 48px);
    line-height: 1.03;
  }

  .hero-copy {
    font-size: 16px;
    line-height: 1.5;
  }

  .hero-meta {
    margin-top: 4px;
    gap: 8px;
  }

  .timeline {
    padding: 14px;
  }

  .timeline ul {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 2px;
  }

  .timeline li {
    flex: 0 0 auto;
    min-width: 220px;
  }

  #code-editor,
  #output {
    min-height: 220px;
  }

  .about-card {
    padding: 18px;
  }

  .bg-spot {
    opacity: 0.12;
  }

  .aura {
    width: 250px;
    height: 250px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
