/* 
  基本設定與 CSS 變數定義 
  使用 CSS 變數 (Custom Properties) 方便統一管理顏色 
*/
:root {
    /* 顏色配置 (Color System) - 依據 Logo (紅/黑) */
    --primary-color: #c1272d; /* 主色調：Logo 紅色 */
    --primary-light: #fbecec; /* 淺色版 (用於背景) */
    --primary-dark: #8b1c20;  /* 深色版 (用於文字與 active 狀態) */
    
    --secondary-color: #4b5563; /* 次要按鈕灰色系 */
    --secondary-light: #f3f4f6;
    --secondary-dark: #374151;

    --bg-color: #ffffff; /* 背景色：純白色 */
    --text-color: #1a1a1a; /* 文字色：Logo 黑色，確保對比度符合 WCAG AA */
    --text-light: #475569; /* 次要文字色 */
    --card-bg: #f8fafc; /* 卡片背景色 */

    /* 語意色彩 */
    --success-color: #22c55e;
    --error-color: #ef4444;
    --warning-color: #eab308;

    /* 圓角統一設定 */
    --border-radius: 8px;
    --transition-speed: 0.2s;
}

/* 重置瀏覽器預設樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans TC', sans-serif;
}

/* 網頁主體樣式 (Mobile First 手機優先) */
body {
    background-color: var(--bg-color);
    /* 科技感網格背景 */
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    color: var(--text-color);
    line-height: 1.6;
    letter-spacing: 0.5px;
    overflow-x: hidden;
}

/* 字級階層 (Typography) */
h1 { font-size: 2rem; font-weight: 900; line-height: 1.2; color: var(--text-color); }
h2 { font-size: 1.75rem; font-weight: 700; line-height: 1.3; color: var(--text-color); }
h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.4; color: var(--text-color); }
h4 { font-size: 1.1rem; font-weight: 500; line-height: 1.4; color: var(--text-color); }
p { font-size: 1rem; color: var(--text-light); line-height: 1.6; }
.small-text { font-size: 0.875rem; color: var(--text-light); }

/* 程式碼區塊字體 */
code, pre {
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
}

/* -------------------
   導覽列設計 (Header)
-------------------- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 50px;
    width: auto;
    transition: transform var(--transition-speed) ease;
}

/* 微動畫平滑過渡 */
.logo img:hover {
    transform: scale(1.05);
}

/* 手機版導覽列先隱藏，透過 Media Query 在平板顯示 */
.nav {
    display: none;
}

.nav a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    transition: color var(--transition-speed) ease;
}

.nav a:hover {
    color: var(--primary-color);
}

/* -------------------
   主視覺區塊 (Hero Section)
-------------------- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 120px 5% 50px;
}

.hero-content {
    z-index: 10;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.hero-text {
    width: 100%;
}

.hero-image {
    width: 100%;
    display: flex;
    justify-content: center;
}

.hero-image img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(193, 39, 45, 0.15);
    border: 1px solid rgba(193, 39, 45, 0.1);
    animation: float 6s ease-in-out infinite;
}

.hero-title {
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* -------------------
   按鈕共用樣式與微動畫
-------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    /* transition: 0.2s ease 平滑過渡效果 */
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, background var(--transition-speed) ease;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(193, 39, 45, 0.2);
}

.btn-secondary {
    background: var(--secondary-light);
    color: var(--secondary-dark);
}

.btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
}

/* -------------------
   區塊共用樣式
-------------------- */
section {
    padding: 60px 5%;
}

.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
}

/* -------------------
   關於我們區塊 (About)
-------------------- */
.about {
    background-color: var(--card-bg);
    text-align: center;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

/* -------------------
   功能介紹區塊 (Features)
-------------------- */
.features {
    background-color: var(--bg-color);
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary-color);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

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

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* -------------------
   產品圖片區塊 (Products)
-------------------- */
.products {
    background-color: var(--card-bg);
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* 確保卡片與圖片適應螢幕寬度 */
.gallery-item {
    border-radius: var(--border-radius);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background: var(--secondary-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 500;
    padding: 1rem;
}

.image-placeholder i {
    font-size: 2rem;
    color: var(--primary-color);
}

/* -------------------
   成功案例影片區塊 (Cases)
-------------------- */
.cases {
    background-color: var(--bg-color);
}

.video-container {
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0,0,0,0.05);
}

.video-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--secondary-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-speed) ease;
}

.video-player:hover {
    background: #e5e7eb;
}

.video-player:hover .play-button {
    transform: scale(1.1);
    background: var(--primary-color);
}

.play-button {
    width: 60px;
    height: 60px;
    background: rgba(193, 39, 45, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: all var(--transition-speed) ease;
}

.play-button i {
    color: white;
    font-size: 1.5rem;
    margin-left: 5px; /* 圖示微調置中 */
}

.video-title {
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 500;
}

/* -------------------
   呼籲行動區塊 (CTA)
-------------------- */
.cta {
    text-align: center;
    background: var(--primary-light);
    color: var(--text-color);
}

.cta h2 {
    color: var(--primary-dark);
}

.cta p {
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

/* -------------------
   頁尾 (Footer)
-------------------- */
.footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    color: var(--text-light);
    background-color: var(--bg-color);
    font-size: 0.875rem;
}

/* -------------------
   動態背景光暈 (裝飾用)
-------------------- */
.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
    opacity: 0.1;
    pointer-events: none;
}

.glow-1 {
    width: 200px;
    height: 200px;
    background: var(--primary-color);
    top: 20%;
    left: -50px;
    animation: float 8s ease-in-out infinite;
}

.glow-2 {
    width: 150px;
    height: 150px;
    background: var(--secondary-color);
    bottom: 10%;
    right: -25px;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
    100% { transform: translateY(0px) scale(1); }
}

/* -------------------
   響應式設計 (RWD 斷點 768px: 平板) 
-------------------- */
@media (min-width: 768px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2rem; }
    
    .logo img { height: 70px; }
    
    .nav {
        display: flex;
    }

    .hero {
        padding: 140px 5% 60px;
    }

    .hero-title {
        font-size: 3.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }

    section {
        padding: 80px 5%;
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .glow-1 {
        width: 300px;
        height: 300px;
        left: -100px;
    }
    
    .glow-2 {
        width: 250px;
        height: 250px;
        right: -50px;
    }
    
    .btn {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
}

/* -------------------
   響應式設計 (RWD 斷點 1200px: 桌面) 
-------------------- */
@media (min-width: 1200px) {
    h1 { font-size: 4rem; }
    h2 { font-size: 2.5rem; }

    .logo img { height: 90px; }

    .hero-content {
        flex-direction: row;
        text-align: left;
        gap: 4rem;
    }
    
    .hero-text {
        width: 50%;
    }
    
    .hero-image {
        width: 50%;
        justify-content: flex-end;
    }

    section {
        padding: 100px 5%;
    }

    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .glow-1 {
        width: 400px;
        height: 400px;
    }
    
    .glow-2 {
        width: 300px;
        height: 300px;
    }
}
