:root {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #ff5252;
  --accent-dark: #d84315;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-soft: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 32rem),
    radial-gradient(circle at top right, rgba(124, 58, 237, 0.06), transparent 28rem),
    var(--bg);
  font-family: "Outfit", "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 2rem;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(226, 232, 240, 0.88);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: normal;
}

.brand::before {
  content: "";
  width: 1.85rem;
  height: 1.85rem;
  flex: 0 0 auto;
  border-radius: 0.55rem;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.26);
}

.brand span {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary-hover);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.25rem 0.55rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.mobile-preview-btn {
  width: 2.625rem;
  height: 2.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.mobile-preview-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--primary-hover);
  transform: translateY(-1px);
}

.mobile-preview-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(17rem, 19rem) minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow: auto;
  padding: 1.25rem 0.9rem 2.25rem;
  background: rgba(255, 255, 255, 0.82);
  border-right: 1px solid rgba(226, 232, 240, 0.9);
}

.nav-title {
  margin: 0.3rem 0.7rem 0.9rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.site-nav a {
  display: block;
  margin: 0.08rem 0;
  padding: 0.45rem 0.7rem;
  border-radius: 0.65rem;
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.35;
  text-decoration: none;
}

.site-nav a:hover {
  background: #eff6ff;
  color: var(--primary-hover);
}

.site-nav a.current {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.site-nav .lv1 {
  font-weight: 800;
}

.site-nav .lv2 {
  padding-left: 1.35rem;
}

.site-nav .lv3 {
  padding-left: 2.1rem;
  font-size: 0.86rem;
}

.site-nav .lv4,
.site-nav .lv5 {
  padding-left: 2.75rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.content-wrap,
.nav-home {
  padding: 3rem 1.5rem 5rem;
}

.content,
.nav-panel {
  max-width: 1060px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-md);
}

.nav-home {
  max-width: 1120px;
  margin: 0 auto;
}

.nav-panel {
  padding: 2rem;
}

.nav-panel h1 {
  margin: 0 0 1.2rem;
  color: var(--text);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.nav-home-list a {
  max-width: 100%;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 4.25rem 3rem 3rem;
  text-align: center;
  color: #ffffff;
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -35% -20%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.22), transparent 58%);
  pointer-events: none;
}

.hero > * {
  position: relative;
}

.hero h1 {
  margin: 0.35rem 0;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero h2,
.hero h3 {
  margin: 0.35rem 0;
  color: #dbeafe;
  font-weight: 700;
}

.hero p {
  max-width: 46rem;
  margin: 0.35rem auto;
  color: #cbd5e1;
  font-size: 1.08rem;
}

.block {
  padding: 2rem 3rem;
  border-bottom: 1px solid #e2e8f0;
}

.block:last-child {
  border-bottom: 0;
}

.block h1,
.block h2,
.block h3 {
  color: var(--text);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.block h1 {
  font-size: 2.05rem;
}

.block h2 {
  font-size: 1.7rem;
}

.block h3 {
  font-size: 1.35rem;
}

.block p {
  margin: 0.65em 0;
  color: #334155;
  font-size: 1rem;
}

.block a,
.notice a {
  color: var(--primary-hover) !important;
  font-weight: 700;
  text-decoration: underline !important;
  text-underline-offset: 0.15em;
}

.block a:hover,
.notice a:hover {
  color: #1d4ed8 !important;
}

.block img {
  display: block;
  max-width: 100% !important;
  height: auto !important;
  margin: 1.25rem auto;
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
}

.block table {
  display: block;
  width: 100%;
  overflow: auto;
  border-collapse: collapse;
}

.block td,
.block th {
  padding: 0.65rem 0.75rem;
  border: 1px solid #cbd5e1;
  vertical-align: top;
}

.block th {
  background: #f1f5f9;
  font-weight: 800;
}

.block iframe {
  max-width: 100%;
}

.block .C9DxTc,
.block .zfr3Q,
.block [class*="CDt4Ke"] {
  font-family: inherit !important;
}

.footer {
  max-width: 1060px;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
}

.notice {
  max-width: 1060px;
  margin: 0 auto 1rem;
  padding: 0.85rem 1rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 0.9rem;
  color: #9a3412;
  font-size: 0.86rem;
}

body.course-mobile-prototype {
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  overflow-x: hidden;
  background: var(--bg);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.18);
}

html:has(body.course-mobile-prototype) {
  background: #e2e8f0;
}

body.course-mobile-prototype .topbar {
  min-height: 0;
  align-items: center;
  padding: 0.75rem 1rem;
}

body.course-mobile-prototype .brand {
  flex: 1 1 auto;
  gap: 0.5rem;
  min-width: 0;
  font-size: 0;
  line-height: 1;
}

body.course-mobile-prototype .brand::after {
  content: "清水高中課程諮詢";
  font-size: 0.95rem;
  line-height: 1.25;
}

body.course-mobile-prototype .brand::before {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 0.45rem;
}

body.course-mobile-prototype .brand span {
  display: none;
}

body.course-mobile-prototype .mobile-preview-btn {
  display: none;
}

body.course-mobile-prototype .layout {
  grid-template-columns: 1fr;
  min-height: auto;
}

body.course-mobile-prototype .sidebar {
  position: relative;
  top: 0;
  height: auto;
  max-height: 42vh;
  border-right: 0;
  border-bottom: 1px solid var(--line);
}

body.course-mobile-prototype .content-wrap,
body.course-mobile-prototype .nav-home {
  padding: 0.875rem 0.75rem 2.5rem;
}

body.course-mobile-prototype .content,
body.course-mobile-prototype .nav-panel {
  border-radius: 1rem;
}

body.course-mobile-prototype .nav-panel {
  padding: 1.25rem 1rem;
}

body.course-mobile-prototype .hero {
  padding: 2.75rem 1rem 2.25rem;
}

body.course-mobile-prototype .hero h1 {
  font-size: 1.8rem;
}

body.course-mobile-prototype .hero p {
  font-size: 0.96rem;
}

body.course-mobile-prototype .block {
  padding: 1.35rem 1rem;
}

body.course-mobile-prototype .block h1 {
  font-size: 1.65rem;
}

body.course-mobile-prototype .block h2 {
  font-size: 1.35rem;
}

body.course-mobile-prototype .block h3 {
  font-size: 1.15rem;
}

body.course-mobile-prototype .block p {
  font-size: 0.94rem;
}

body.course-mobile-prototype .block img {
  border-radius: 0.75rem;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    top: 0;
    height: auto;
    max-height: 45vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content-wrap,
  .nav-home {
    padding: 1.25rem 0.75rem 3rem;
  }

  .content,
  .nav-panel {
    border-radius: 1rem;
  }

  .nav-panel {
    padding: 1.35rem 1rem;
  }

  .hero {
    padding: 3rem 1.25rem 2.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .block {
    padding: 1.45rem 1.25rem;
  }

  .topbar {
    padding: 0.75rem 1rem;
  }

  .brand {
    font-size: 0.98rem;
  }

  .brand span {
    display: none;
  }

}
