:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --secondary: #f43f5e;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --bg-light: #f8fafc;
    --text-light-main: #0f172a;
    --text-light-muted: #475569;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: 'Noto Sans TC', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
}

body {
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .logo {
    font-family: 'Outfit', 'Noto Sans TC', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
}

.section-dark {
    background-color: #0b1120;
}

.bg-light {
    background-color: var(--bg-light);
    color: var(--text-light-main);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.bg-light .section-title {
    color: var(--text-light-main);
}

.section-title span {
    display: block;
    font-size: 1rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links li a {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
    position: relative;
}

.nav-links li a:hover {
    color: #fff;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary);
    transition: var(--transition);
}

.nav-links li a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
    z-index: -2;
}

.hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(rgba(14, 165, 233, 0.15) 1px, transparent 1px),
        radial-gradient(rgba(14, 165, 233, 0.15) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    z-index: -1;
    animation: backgroundMove 30s linear infinite;
}

@keyframes backgroundMove {
    0% { background-position: 0 0, 20px 20px; }
    100% { background-position: 400px 400px, 420px 420px; }
}

.hero-content {
    text-align: center;
    z-index: 1;
    padding: 0 2rem;
    max-width: 800px;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: #fff;
}

.hero .highlight {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: 0 10px 20px -10px var(--primary);
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px -10px var(--primary);
}

/* Typography & Layout */
.text-block {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.text-block p {
    margin-bottom: 1.5rem;
}

.theory-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2.5rem;
    border-radius: 20px;
    margin: 3rem 0;
    backdrop-filter: blur(10px);
}

.theory-card h3 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 1rem;
}

.theory-card p {
    color: var(--text-muted);
}

.subsection-title {
    font-size: 2rem;
    margin: 4rem 0 2rem;
    text-align: center;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 20px;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    width: 50px;
    height: 50px;
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.card h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #fff;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.highlight-block {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(244, 63, 94, 0.1));
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.highlight-block h3 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    grid-auto-rows: 250px;
}

.gallery-item {
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.gallery-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item.tall {
    grid-row: span 2;
}

.gallery-item.wide {
    grid-column: span 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Image Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
}

/* Reflection Section */
.reflection-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.reflection-block {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 20px;
    position: relative;
    border-left: 4px solid var(--primary);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.reflection-block:nth-child(2) {
    border-left-color: var(--secondary);
}

.reflection-block:nth-child(3) {
    border-left-color: #10b981;
}

.quote-mark {
    position: absolute;
    top: 1rem;
    right: 2rem;
    font-size: 6rem;
    font-family: serif;
    color: rgba(255, 255, 255, 0.05);
    line-height: 1;
}

.reflection-block p {
    color: var(--text-muted);
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

/* Accordion (Q&A) */
.bg-light .accordion-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.accordion-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #fff;
    transition: var(--transition);
}

.accordion-header:hover {
    background: #f8fafc;
}

.accordion-header h3 {
    font-size: 1.1rem;
    color: var(--text-light-main);
    font-weight: 600;
    padding-right: 2rem;
}

.accordion-header .icon {
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-header .icon {
    transform: rotate(45deg);
}

.accordion-body {
    padding: 0 2rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background: #fff;
}

.accordion-item.active .accordion-body {
    padding: 0 2rem 1.5rem;
    max-height: 1000px; /* arbitrary large value */
}

.accordion-body p {
    color: var(--text-light-muted);
    margin-bottom: 1rem;
}

.accordion-body ul, .accordion-body ol {
    color: var(--text-light-muted);
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.accordion-body li {
    margin-bottom: 0.5rem;
}

.accordion-body h4 {
    color: var(--text-light-main);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background: #0b1120;
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
}

footer p {
    color: var(--text-muted);
}

/* Animations */
.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1rem; }
    
    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    
    .hamburger span {
        width: 30px;
        height: 2px;
        background: #fff;
        transition: 0.3s;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        text-align: center;
        padding: 2rem 0;
        clip-path: circle(0 at 50% -20%);
        transition: 0.5s ease-out;
    }
    
    .nav-links.active {
        clip-path: circle(150% at 50% 0);
    }
    
    .gallery-item.large, .gallery-item.wide, .gallery-item.tall {
        grid-column: span 1;
        grid-row: span 1;
    }
}
