/* 單一深色主題系統 - v4.0 (Restored & Refactored) */

:root {
    /* 背景色 */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-accent: #334155;
    --bg-hover: rgba(59, 130, 246, 0.1);

    /* 文字顏色 */
    --text-primary: #f8fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --text-link: #60a5fa;
    --text-link-hover: #f8fafc;
    --text-inverted: #111827;
    --text-code: #f472b6;

    /* 主題強調色 */
    --primary-blue: #3b82f6;
    --secondary-blue: #06b6d4;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-purple: #a855f7;
    --accent-red: #ef4444;

    /* 邊框與分隔線 */
    --border-color: #334155;
    --border-active: #3b82f6;

    /* Navbar */
    --navbar-bg: rgba(15, 23, 42, 0.7);
    --navbar-border: rgba(59, 130, 246, 0.1);
    --navbar-text: #e2e8f0;
    --navbar-text-hover: #ffffff;
}

body {
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'SF Pro Display', system-ui, sans-serif;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

/* --- Navigation Bar --- */
.navbar {
    background: var(--navbar-bg) !important;
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--navbar-border);
}

.nav-link {
    color: var(--navbar-text) !important;
}

.nav-link:hover,
.nav-link.active {
    color: var(--navbar-text-hover) !important;
}

/* --- Hero & Flow Sections --- */
.flow-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    filter: blur(1.5px) brightness(0.7) saturate(1.2);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    z-index: 2;
}

.flow-text-container {
    position: relative;
    z-index: 10;
    text-align: center;
    width: 100%;
    max-width: 1200px;
    padding: 0 2rem;
}

.flow-title {
    font-family: 'Inter', sans-serif;
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 50%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
    line-height: 1.1;
}

.subtitle-primary {
    font-weight: 700;
    color: var(--text-primary);
    font-size: clamp(1.875rem, 4vw, 3rem);
    margin: clamp(1.5rem, 3vw, 2rem) 0 clamp(1rem, 2vw, 1.5rem) 0;
    line-height: 1.2;
}

.flow-divider {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--primary-blue) 20%, var(--secondary-blue) 50%, var(--primary-blue) 80%, transparent 100%);
    margin: clamp(1.5rem, 3vw, 2rem) auto;
    width: clamp(200px, 50%, 400px);
    opacity: 0.8;
}

.subtitle-secondary {
    font-weight: 500;
    color: var(--text-muted);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    margin: clamp(1rem, 2vw, 1.5rem) 0 0 0;
    line-height: 1.4;
}

/* --- Content Sections --- */
.content-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.tech-showcase {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
}

.section-image {
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* --- Feature Cards --- */
.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    /* Fix image sticking out */
    height: 100%;
    display: flex;
    flex-direction: column;
}

.feature-icon {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.5rem;
    margin: 1rem auto 1.5rem;
}

.feature-title {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.feature-text {
    color: var(--text-muted);
    line-height: 1.6;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tech-item {
    background: var(--bg-accent);
    border-radius: 16px;
    padding: 1.75rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

/* --- Refactoring Utility Classes (v4.1) --- */

/* Text Colors */
.text-light {
    color: var(--text-primary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-accent-green {
    color: var(--accent-green) !important;
}

.text-accent-yellow {
    color: var(--accent-yellow) !important;
}

.text-accent-purple {
    color: var(--accent-purple) !important;
}

.text-accent-red {
    color: var(--accent-red) !important;
}

.text-primary-blue {
    color: var(--primary-blue) !important;
}

.text-secondary-blue {
    color: var(--secondary-blue) !important;
}

.text-gold {
    color: #ffd700 !important;
}

/* Backgrounds */
.bg-soft-blue {
    background: rgba(59, 130, 246, 0.1) !important;
}

.bg-soft-green {
    background: rgba(16, 185, 129, 0.1) !important;
}

.bg-soft-purple {
    background: rgba(168, 85, 247, 0.1) !important;
}

.bg-soft-red {
    background: rgba(239, 68, 68, 0.1) !important;
}

.bg-soft-amber {
    background: rgba(245, 158, 11, 0.1) !important;
}

.bg-gradient-blue-green {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(16, 185, 129, 0.15)) !important;
}

.bg-gradient-red {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
}

.bg-gradient-primary-secondary {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue)) !important;
}

.bg-gradient-green-secondary {
    background: linear-gradient(135deg, var(--accent-green), var(--secondary-blue)) !important;
}

.bg-gradient-soft-blue-green {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.1)) !important;
}

.bg-gradient-soft-green-blue {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(59, 130, 246, 0.1)) !important;
}

/* Borders */
.border-accent-green {
    border: 2px solid var(--accent-green) !important;
}

.border-primary-blue {
    border: 2px solid var(--primary-blue) !important;
}

.border-secondary-blue {
    border: 2px solid var(--secondary-blue) !important;
}

.border-accent-amber {
    border: 2px solid var(--accent-yellow) !important;
}

/* Icon Backgrounds */
.icon-bg-green {
    background: linear-gradient(135deg, var(--accent-green), #059669) !important;
}

.icon-bg-blue {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue)) !important;
}

.icon-bg-cyan {
    background: linear-gradient(135deg, var(--secondary-blue), #0891b2) !important;
}

.icon-bg-amber {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

/* Layout Helpers (restoring missing classes) */
.height-match-container {
    display: flex;
    align-items: stretch;
}

.height-match-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.height-match-image {
    display: flex;
    align-items: center;
    justify-content: center;
}