:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --secondary: #10b981;
    --accent: #f59e0b;
    --bg-color: #0f172a;
    --bg-light: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-hover-y: -10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Noto Sans TC', 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
h1, h2, h3, h4 {
    font-family: 'Outfit', 'Noto Sans TC', sans-serif;
    font-weight: 700; line-height: 1.2;
}
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.container { max-width: 1280px; margin: 0 auto; padding: 0 2rem; }
.section { padding: 6rem 0; }
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.8rem 1.8rem; border-radius: 50px; font-weight: 600;
    font-size: 1rem; transition: var(--transition); cursor: pointer;
    border: 2px solid transparent;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px); box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
}
.btn-outline {
    background: transparent; border-color: var(--text-muted); color: var(--text-main);
}
.btn-outline:hover {
    border-color: var(--primary); color: var(--primary);
}

/* Navbar */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    padding: 1rem 0; transition: var(--transition);
    border-bottom: 1px solid transparent;
}
.navbar.scrolled {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.8rem 0; box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}
.nav-container {
    max-width: 1280px; margin: 0 auto; padding: 0 2rem;
    display: flex; justify-content: space-between; align-items: center;
}
.logo { display: flex; align-items: center; gap: 0.8rem; }
.logo-icon { font-size: 2rem; }
.logo-text { display: flex; flex-direction: column; }
.logo-title { font-weight: 800; font-size: 1.2rem; letter-spacing: 1px; color:#fff;}
.logo-subtitle { font-size: 0.75rem; color: var(--primary); font-weight: 500; }
.nav-links { display: flex; gap: 2rem; }
.nav-links li a {
    font-size: 1rem; font-weight: 500; color: var(--text-muted);
    position: relative; padding: 0.5rem 0; transition: var(--transition);
}
.nav-links li a::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0;
    height: 2px; background-color: var(--primary);
    transition: var(--transition); border-radius: 2px;
}
.nav-links li a:hover, .nav-links li a.active { color: var(--text-main); }
.nav-links li a:hover::after, .nav-links li a.active::after { width: 100%; }

/* Mobile Menu & Overlay */
.mobile-menu-btn {
    display: none; flex-direction: column; gap: 6px; cursor: pointer; z-index: 1001;
}
.mobile-menu-btn span {
    width: 30px; height: 3px; background: var(--text-main);
    border-radius: 3px; transition: var(--transition);
}
.mobile-menu-btn.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
.mobile-menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px);
    z-index: 999; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: var(--transition);
}
.mobile-menu-overlay.active { opacity: 1; pointer-events: all; }
.mobile-nav-links {
    display: flex; flex-direction: column; gap: 2rem; text-align: center;
    transform: translateY(20px); transition: var(--transition);
}
.mobile-menu-overlay.active .mobile-nav-links { transform: translateY(0); }
.mobile-nav-links a { font-size: 1.5rem; font-weight: 600; color: var(--text-main); }

/* Hero Section */
.hero {
    position: relative; min-height: 100vh; display: flex;
    align-items: center; justify-content: center;
    padding: 8rem 2rem 4rem; overflow: hidden;
}
.hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center; background-repeat: no-repeat;
    z-index: -2; transform: scale(1.05);
    animation: slowZoom 20s ease-in-out infinite alternate;
}
@keyframes slowZoom {
    0% { transform: scale(1.05); } 100% { transform: scale(1.1); }
}
.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.95));
    z-index: -1;
}
.hero-content {
    text-align: center; max-width: 800px; z-index: 1;
    display: flex; flex-direction: column; align-items: center;
    opacity: 0; transform: translateY(30px);
    animation: fadeUp 1s ease forwards 0.3s;
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
.badge {
    background: rgba(14, 165, 233, 0.2); border: 1px solid rgba(14, 165, 233, 0.5);
    color: #38bdf8; padding: 0.4rem 1rem; border-radius: 30px;
    font-size: 0.85rem; font-weight: 600; letter-spacing: 1px; margin-bottom: 1.5rem;
}
.hero-title { font-size: clamp(3rem, 5vw, 4.5rem); margin-bottom: 1.5rem; line-height: 1.1; }
.hero-subtitle {
    font-size: 1.1rem; color: var(--text-muted); margin-bottom: 2.5rem; max-width: 600px;
}
.hero-cta { display: flex; gap: 1rem; }
.scroll-indicator {
    position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    opacity: 0.7; animation: bounce 2s infinite;
}
.scroll-indicator .mouse {
    width: 24px; height: 36px; border: 2px solid var(--text-muted);
    border-radius: 12px; position: relative;
}
.scroll-indicator .mouse::before {
    content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
    width: 4px; height: 6px; background: var(--text-main); border-radius: 2px;
    animation: scrollWheel 1.5s infinite;
}
.scroll-indicator p { font-size: 0.75rem; letter-spacing: 1px; color: var(--text-muted); }
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-10px) translateX(-50%); }
    60% { transform: translateY(-5px) translateX(-50%); }
}
@keyframes scrollWheel {
    0% { opacity: 1; top: 6px; } 100% { opacity: 0; top: 16px; }
}

/* Sections Common */
.section-header { text-align: center; margin-bottom: 4rem; }
.section-header h2 {
    font-size: 2.5rem; margin-bottom: 1rem; display: inline-block; position: relative;
}
.section-header h2::after {
    content: ''; position: absolute; bottom: -10px; left: 50%;
    transform: translateX(-50%); width: 60px; height: 3px;
    background: var(--primary); border-radius: 2px;
}
.section-header p {
    color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto;
}

/* Units Grid */
.units-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 2rem;
}
.unit-card {
    background: var(--bg-light); border-radius: 16px; overflow: hidden;
    border: 1px solid var(--glass-border); transition: var(--transition);
    display: flex; flex-direction: column; height: 100%; position: relative;
}
.unit-card:hover {
    transform: translateY(var(--card-hover-y));
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--unit-accent);
}
.unit-card-img { height: 220px; position: relative; overflow: hidden; }
.unit-card-img img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease;
}
.unit-card:hover .unit-card-img img { transform: scale(1.05); }
.unit-number {
    position: absolute; top: 1rem; left: 1rem;
    background: var(--unit-accent); color: #fff;
    font-weight: 800; font-size: 1.2rem; padding: 0.3rem 1rem;
    border-radius: 30px; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.unit-card-body {
    padding: 2rem; display: flex; flex-direction: column; flex-grow: 1;
}
.unit-card-body h3 { font-size: 1.4rem; margin-bottom: 0.8rem; color: var(--text-main); }
.unit-card-body p {
    color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; flex-grow: 1;
}
.unit-enter {
    color: var(--unit-accent); font-weight: 600; display: flex;
    align-items: center; gap: 0.5rem; transition: var(--transition);
    align-self: flex-start;
}
.unit-card:hover .unit-enter { gap: 0.8rem; }

/* Unit Detail Pages */
.unit-hero {
    position: relative; padding: 10rem 2rem 6rem;
    min-height: 50vh; display: flex; align-items: flex-end; overflow: hidden;
}
.unit-hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -2;
}
.unit-hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.unit-hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.4), var(--bg-color)); z-index: -1;
}
.unit-hero-content {
    max-width: 1280px; margin: 0 auto; width: 100%; z-index: 1;
}
.back-link {
    display: inline-block; color: var(--text-muted); font-size: 0.9rem;
    margin-bottom: 2rem; transition: var(--transition);
}
.back-link:hover { color: var(--text-main); transform: translateX(-5px); }
.unit-badge {
    display: inline-block; background: var(--unit-accent); color: #fff;
    padding: 0.3rem 1rem; border-radius: 20px; font-weight: 700; font-size: 0.9rem;
    margin-bottom: 1rem;
}
.unit-hero-content h1 {
    font-size: clamp(2.5rem, 4vw, 4rem); margin-bottom: 1rem; color: #fff;
}
.unit-hero-desc {
    font-size: 1.2rem; color: var(--text-muted); max-width: 700px;
}
.unit-content-section { padding: 4rem 0 6rem; }
.unit-content-grid {
    display: grid; grid-template-columns: 1fr 300px; gap: 4rem; max-width: 1280px; margin: 0 auto;
}
.unit-main { display: flex; flex-direction: column; gap: 3rem; }
.content-block h2 {
    font-size: 1.8rem; margin-bottom: 1.5rem; padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--glass-border); display: flex; align-items: center; gap: 0.8rem;
}
.content-block p {
    font-size: 1.05rem; color: var(--text-muted); line-height: 1.8;
}
.learning-objectives { list-style: none; padding: 0; }
.learning-objectives li {
    position: relative; padding-left: 2rem; margin-bottom: 1rem;
    color: var(--text-muted); font-size: 1.05rem;
}
.learning-objectives li::before {
    content: '✓'; position: absolute; left: 0; top: 2px;
    color: var(--unit-accent, var(--primary)); font-weight: bold;
}
.concept-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 1.5rem;
}
.concept-card {
    background: var(--bg-light); border: 1px solid var(--glass-border);
    border-radius: 12px; padding: 1.5rem; transition: var(--transition);
}
.concept-card:hover { transform: translateY(-5px); border-color: var(--unit-accent, var(--primary)); }
.concept-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.concept-card h4 { font-size: 1.2rem; margin-bottom: 0.5rem; color: var(--text-main); }
.concept-card p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }
.unit-sidebar { display: flex; flex-direction: column; gap: 2rem; }
.sidebar-card {
    background: var(--bg-light); border: 1px solid var(--glass-border);
    border-radius: 12px; padding: 1.5rem;
}
.sidebar-card h3 {
    font-size: 1.2rem; margin-bottom: 1.2rem; padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--glass-border);
}
.unit-nav-list { display: flex; flex-direction: column; gap: 0.8rem; }
.unit-nav-item {
    display: flex; align-items: center; gap: 0.8rem; color: var(--text-muted);
    font-size: 0.95rem; transition: var(--transition); padding: 0.5rem; border-radius: 8px;
}
.nav-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.unit-nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-main); }
.unit-nav-item.active { background: rgba(255, 255, 255, 0.1); color: var(--text-main); font-weight: 600; }
.sidebar-note { font-size: 0.9rem; color: var(--text-muted); font-style: italic; }
.unit-pagination {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--glass-border);
}
.pagination-btn {
    display: inline-flex; align-items: center; padding: 0.8rem 1.5rem;
    background: var(--bg-light); border: 1px solid var(--glass-border);
    border-radius: 50px; color: var(--text-main); font-weight: 500; transition: var(--transition);
}
.pagination-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.3); transform: translateY(-2px);
}
.pagination-btn.disabled { opacity: 0.5; cursor: not-allowed; }

/* Games Section */
.dark-section {
    background-color: var(--bg-light); border-top: 1px solid var(--glass-border); position: relative;
}
.dark-section::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.1) 0%, transparent 40%); pointer-events: none;
}
.game-showcase {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center;
}
.game-info { padding-right: 2rem; }
.game-badge {
    display: inline-block; padding: 0.3rem 0.8rem; background: rgba(245, 158, 11, 0.2);
    color: var(--accent); border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 20px; font-size: 0.8rem; font-weight: 600; margin-bottom: 1rem;
}
.game-title { font-size: 2.5rem; margin-bottom: 1.2rem; }
.game-desc { color: var(--text-muted); margin-bottom: 2rem; font-size: 1.05rem; }
.feature-list { margin-bottom: 2.5rem; }
.feature-list li {
    margin-bottom: 0.8rem; display: flex; align-items: center; gap: 0.8rem; color: var(--text-main);
}
.check {
    color: var(--secondary); background: rgba(16, 185, 129, 0.1);
    width: 24px; height: 24px; display: flex; align-items: center;
    justify-content: center; border-radius: 50%; font-size: 0.8rem;
}
.action-wrap { display: flex; align-items: center; gap: 1.5rem; }
.play-btn { font-size: 1.1rem; padding: 1rem 2.5rem; }
.play-icon { margin-right: 0.5rem; font-size: 0.9em; }
.hint { font-size: 0.8rem; color: var(--text-muted); }
.game-preview { position: relative; }
.glass-frame {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 16px; padding: 12px; backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative; overflow: hidden;
}
.mock-browser {
    height: 30px; display: flex; align-items: center; padding: 0 10px; margin-bottom: 12px;
}
.dots { display: flex; gap: 6px; }
.dots span { width: 10px; height: 10px; border-radius: 50%; }
.dots span:nth-child(1) { background: #ef4444; }
.dots span:nth-child(2) { background: #f59e0b; }
.dots span:nth-child(3) { background: #10b981; }
.preview-img-container {
    position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 16/9;
}
.preview-img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease;
}
.play-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.5); display: flex; align-items: center;
    justify-content: center; opacity: 0; transition: var(--transition);
}
.glass-frame:hover .play-overlay { opacity: 1; }
.glass-frame:hover .preview-img { transform: scale(1.05); }
.pulse-play {
    width: 70px; height: 70px; background: var(--primary);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: white; box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 20px rgba(14, 165, 233, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}

/* Footer */
.footer {
    background: #0b1120; padding: 3rem 0; border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.footer-content {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.8rem; opacity: 0.8; }
.copyright { color: var(--text-muted); font-size: 0.9rem; }

/* Responsive Media Queries */
@media (max-width: 968px) {
    .game-showcase { grid-template-columns: 1fr; gap: 3rem; }
    .game-info { padding-right: 0; }
    .unit-content-grid { grid-template-columns: 1fr; margin-left: auto; margin-right: auto; padding: 0 1rem; }
}
@media (max-width: 768px) {
    .section { padding: 4rem 0; }
    .container { padding: 0 1.5rem; }
    .hero { padding: 6rem 1.5rem 3rem; }
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1rem; }
    
    .unit-hero { padding: 7rem 1.5rem 3rem; min-height: 40vh; }
    .unit-hero-desc { font-size: 1rem; }
    .unit-content-section { padding: 3rem 0; }
    .unit-content-grid { padding: 0; gap: 2rem; }
    
    .nav-links { display: none; }
    .mobile-menu-btn { display: flex; }
    .action-wrap { flex-direction: column; align-items: flex-start; }
    
    .content-block h2 { font-size: 1.5rem; }
    .concept-card { padding: 1.2rem; }
    .sidebar-card { padding: 1.2rem; }
    
    .unit-pagination { flex-direction: column; gap: 1rem; margin-top: 2rem; }
    .pagination-btn { width: 100%; justify-content: center; text-align: center; }
}
@media (max-width: 480px) {
    .units-grid { gap: 1.5rem; }
    .unit-card-img { height: 180px; }
    .unit-card-body { padding: 1.5rem; }
    .game-title { font-size: 2rem; }
    .logo-title { font-size: 1.1rem; }
}
