:root{
  --bg: #0b0b11;
  --bg-elev: #11121a;
  --card: #131422;
  --muted: #a3a7b7;
  --text: #e9ebff;
  --primary: #7c5cff;
  --primary-2: #915bff;
  --ring: rgba(124,92,255,.45);
  --shadow: 0 10px 30px rgba(0,0,0,.6);
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0; color:var(--text); background: radial-gradient(1200px 400px at 50% -120px, rgba(124,92,255,.18), transparent 60%), var(--bg);
  font: 16px/1.6 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", "Heiti TC", Arial, sans-serif;
}
a{ color:inherit; text-decoration:none; }
.container{ width:min(1100px, 92vw); margin:0 auto; }

/* Header */
.site-header{ position:sticky; top:0; z-index:50; background:linear-gradient(180deg, rgba(11,11,17,.9), rgba(11,11,17,.65)); backdrop-filter: blur(6px); border-bottom:1px solid rgba(255,255,255,.06); }
.header-inner{ display:flex; align-items:center; justify-content:space-between; padding:12px 0; }
.brand{ font-weight:700; letter-spacing:.5px; }
.nav a{ opacity:.8; margin-left:18px; padding:6px 10px; border-radius:8px; }
.nav a:hover{ background:rgba(255,255,255,.06); opacity:1; }

/* Hero */
.hero{ position:relative; padding:96px 0 48px; overflow:hidden; border-bottom:1px solid rgba(255,255,255,.06); }
.hero-bg{ position:absolute; inset:0; background: radial-gradient(500px 220px at 50% 100%, rgba(124,92,255,.8), rgba(124,92,255,.15) 55%, transparent 60%), radial-gradient(260px 160px at 20% 10%, rgba(124,92,255,.35), transparent 60%), radial-gradient(260px 160px at 80% 20%, rgba(60,90,255,.25), transparent 60%); filter: blur(18px); opacity:.9; pointer-events:none; }
.hero-content{ position:relative; text-align:center; }
.pill-row{ display:flex; gap:8px; justify-content:center; margin-bottom:18px; }
.pill{ background:linear-gradient(180deg, #fff, #ddd); color:#111; padding:6px 10px; border-radius:999px; font-size:12px; font-weight:700; }
.pill-soft{ background:linear-gradient(180deg, rgba(124,92,255,.16), rgba(124,92,255,.06)); color:#c8c3ff; border:1px solid rgba(124,92,255,.3); }
.hero-title{ font-size:52px; letter-spacing:1px; margin:0 0 6px; font-weight:800; }
.hero-sub{ margin:6px 0 10px; font-weight:600; color:#d9dbff; opacity:.95; }
.hero-desc{ margin:0 auto; opacity:.8; width:min(780px, 92%); }

/* Section */
.section{ padding:48px 0; }
.section-title{ margin:0 0 16px; font-size:24px; letter-spacing:.5px; }

/* Card */
.card{ background: radial-gradient(600px 200px at 0% 0%, rgba(124,92,255,.18), transparent 40%), var(--card); border:1px solid rgba(255,255,255,.08); border-radius:20px; box-shadow:var(--shadow); }
.intro-card{ padding:24px; }
.card-title{ font-weight:700; font-size:18px; margin-bottom:10px; }
.card-body{ color:#e9ebff; opacity:.95; }
.prose p{ margin: 10px 0; color:#dfe2ff; }
.prose h1,.prose h2,.prose h3{ margin: 18px 0 8px; }
.prose ul{ padding-left: 1.1em; }
.prose code{ background: rgba(255,255,255,.06); padding:2px 6px; border-radius:6px; }
.prose pre{ background: rgba(255,255,255,.06); padding:12px; border-radius:12px; overflow:auto; }
.muted{ color:var(--muted); }

/* Intro styling improvements */
.intro-prose{ max-width: 900px; margin: 0 auto; }
.intro-prose.center{ text-align:center; }
.intro-prose .lead-xl{ font-size:26px; line-height:1.35; font-weight:800; letter-spacing:.2px; }
.intro-prose .lead{ font-size:20px; line-height:1.5; font-weight:700; }
.intro-prose .accent{ color:#ece8ff; opacity:1; }
.intro-prose .accent-strong{ font-weight:800; letter-spacing:.3px; margin-top:4px; }
.text-gradient{ background: linear-gradient(90deg, var(--primary), #c18aff); -webkit-background-clip:text; background-clip:text; color:transparent; }
.intro-prose .bullet-wrap{ margin-top:8px; }
.intro-prose .bullet-title{ opacity:.9; margin:8px 0; font-weight:700; }
.intro-prose .hero-bullets{ display:inline-block; text-align:left; margin:0 auto; }
.intro-prose .hero-bullets li{ margin:8px 0; }

/* Courses */
.course-groups{ display:grid; gap:28px; }
.course-group{ display:grid; gap:18px; }
.group-header{ display:flex; align-items:center; gap:10px; }
.group-title{ font-size:20px; font-weight:700; }
.grid{ display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:16px; }
@media (max-width: 960px){ .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px){ .grid{ grid-template-columns: 1fr; } }

.course-card{ position:relative; background:linear-gradient(180deg, rgba(124,92,255,.08), rgba(124,92,255,.02)); border:1px solid rgba(255,255,255,.08); border-radius:16px; overflow:hidden; transition: transform .2s ease, border-color .2s ease; }
.course-card:hover{ transform: translateY(-2px); border-color: rgba(124,92,255,.35); }
.cover{ width:100%; aspect-ratio: 16/10; object-fit: cover; display:block; }
.card-pad{ padding:14px; }
.course-title{ font-weight:700; margin:2px 0 6px; cursor:pointer; }
.course-desc{ color:#cbd0ff; opacity:.9; font-size:14px; height: 40px; overflow:hidden; }
.actions{ display:flex; justify-content:flex-end; margin-top:8px; }

/* Buttons */
.btn{ background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.1); color:var(--text); padding:8px 12px; border-radius:10px; cursor:pointer; }
.btn:hover{ background:rgba(255,255,255,.1); }
.btn.primary{ background:linear-gradient(180deg, var(--primary), var(--primary-2)); border:none; color:#fff; box-shadow:0 6px 22px var(--ring); }
.btn.ghost{ background:transparent; border:1px solid rgba(255,255,255,.18); }
.btn.w-100{ width:100%; }

/* Carousel */
.carousel{ display:grid; grid-auto-flow: column; grid-auto-columns: min(84%, 420px); gap:16px; overflow-x:auto; padding:6px 4px 6px 0; scroll-snap-type:x mandatory; }
.carousel::-webkit-scrollbar{ height:8px; }
.carousel::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.12); border-radius:999px; }
.carousel .slide{ scroll-snap-align:center; background:linear-gradient(180deg, rgba(124,92,255,.12), rgba(124,92,255,.04)); border:1px solid rgba(255,255,255,.1); border-radius:16px; overflow:hidden; }
.slide-banner{ aspect-ratio: 16/6; width:100%; object-fit:cover; display:block; }
.slide-pad{ padding:14px; }
.carousel-controls{ display:flex; gap:8px; justify-content:flex-end; margin-bottom:6px; }

/* Footer */
.footer{ padding:24px 0 40px; border-top:1px solid rgba(255,255,255,.06); background:linear-gradient(180deg, rgba(124,92,255,.06), transparent); }
.footer-inner{ display:flex; align-items:center; justify-content:space-between; }

/* Modal */
.modal{ position:fixed; inset:0; display:none; align-items:center; justify-content:center; z-index:100; }
.modal[aria-hidden="false"]{ display:flex; }
.modal-backdrop{ position:absolute; inset:0; background:rgba(0,0,0,.6); backdrop-filter: blur(3px); }
.modal-dialog{ position:relative; width:min(560px, 92vw); background:var(--bg-elev); border:1px solid rgba(255,255,255,.1); border-radius:16px; box-shadow:var(--shadow); padding:18px; }
.modal-lg{ width:min(980px, 95vw); }
.modal-close{ position:absolute; right:8px; top:8px; background:transparent; border:1px solid rgba(255,255,255,.2); color:var(--text); border-radius:8px; padding:4px 8px; cursor:pointer; }
.modal-header{ margin-bottom:12px; }
.modal-title{ font-weight:800; font-size:20px; }
.modal-subtitle{ color:var(--muted); }

/* Forms */
.form-row{ display:flex; flex-direction:column; gap:6px; margin:10px 0; }
input, textarea{ background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.15); color:var(--text); padding:10px 12px; border-radius:10px; outline:none; }
input:focus, textarea:focus{ border-color: rgba(124,92,255,.45); box-shadow: 0 0 0 3px rgba(124,92,255,.2); }
.form-actions{ display:flex; gap:8px; justify-content:flex-end; }
.form-msg{ margin-top:8px; font-size:14px; color:#b9ffcc; }
.form.compact .form-row{ margin:6px 0; }

/* Detail modal layout */
.detail-layout{ display:grid; grid-template-columns: 340px 1fr; gap:18px; }
@media (max-width: 900px){ .detail-layout{ grid-template-columns: 1fr; } }
.detail-left{ display:flex; flex-direction:column; gap:12px; }
.detail-cover{ width:100%; border-radius:12px; border:1px solid rgba(255,255,255,.12); }
.detail-right{ min-height: 300px; max-height: 70vh; overflow:hidden; display:flex; flex-direction:column; }
.detail-title{ font-size:22px; font-weight:800; margin-bottom:6px; }
.scroll{ overflow:auto; padding-right:6px; }
