:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-color: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
}

h2 {
    font-size: 2rem;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 0.3rem;
    margin-bottom: 1.5rem;
}

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

.sub-title {
    margin-top: 3rem;
}

/* Header */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

/* Background animated glow */
.hero::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-color), transparent 70%);
    border-radius: 50%;
    opacity: 0.1;
    animation: pulseGlow 8s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
    0% { transform: scale(0.8) translate(10%, 10%); opacity: 0.1; }
    100% { transform: scale(1.2) translate(-10%, -10%); opacity: 0.2; }
}

.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 800px;
    z-index: 10;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease-out;
}

.glass-container h1 {
    font-size: 3.5rem;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-container p {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 2rem;
}

.scroll-down {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.scroll-down:hover {
    background: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-3px);
}

/* Navigation */
#navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}

#navbar ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

#navbar a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

#navbar a:hover {
    color: var(--accent-color);
}

/* Main Content Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 3rem;
    margin-bottom: 3rem;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
}

/* Lists */
.styled-list {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.styled-list li {
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.styled-list strong {
    color: var(--accent-color);
}

/* Grid & Layout Utilities */
.comparison-grid, .flex-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .comparison-grid, .flex-content {
        grid-template-columns: 1fr 1fr;
    }
}

.comparison-box {
    background: rgba(0,0,0,0.2);
    padding: 2rem;
    border-radius: 12px;
    border-left: 4px solid var(--accent-color);
}

.comparison-box:last-child {
    border-left-color: #ef4444; /* Distinguishing Risk */
}

/* Images & Galleries */
.gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

@media (min-width: 768px) {
    .gallery { grid-template-columns: 1fr 1fr; }
    .gallery-3col { grid-template-columns: repeat(3, 1fr); }
    .gallery-2col { grid-template-columns: repeat(2, 1fr); }
}

.gallery-item {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--glass-border);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

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

.gallery-item figcaption {
    padding: 1rem;
    background: rgba(15, 23, 42, 0.9);
    position: absolute;
    bottom: 0;
    width: 100%;
    color: #e2e8f0;
    font-size: 0.9rem;
    border-top: 1px solid var(--glass-border);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover figcaption {
    transform: translateY(0);
}

.large-image {
    margin: 2rem 0;
}

/* Formula Highlight */
.formula-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(192, 132, 252, 0.1));
    border: 1px solid var(--accent-color);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin: 2rem 0;
}

.formula {
    font-size: 2rem;
    font-family: 'Courier New', Courier, monospace;
    color: #c084fc;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background: #020617;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Back to Home Button */
.back-home-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(56, 189, 248, 0.5);
    color: #f8fafc;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    z-index: 1000;
}
.back-home-btn:hover {
    background: #38bdf8;
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(56, 189, 248, 0.4);
}
