/* CSS 代碼 */

/* ========= 全域變數與基本設定 ========= */
:root {
    --primary-color: #005a8d; /* 專業藍 */
    --secondary-color: #f0f8ff; /* 淡藍背景 */
    --text-color: #333333;
    --light-gray: #f4f4f4;
    --white: #ffffff;
}

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

body {
    font-family: 'Noto Sans TC', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

/* ========= 頁首與導覽列 ========= */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--white);
    border-bottom: 1px solid var(--light-gray);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

.main-nav {
    display: none; /* 預設隱藏 */
    position: fixed;
    top: 0;
    right: 0;
    width: 70%;
    height: 100%;
    background-color: var(--primary-color);
    padding-top: 5rem;
    z-index: 999;
}

.main-nav.is-open {
    display: block; /* 點擊後顯示 */
}

.main-nav ul {
    list-style: none;
}

.main-nav ul li a {
    display: block;
    color: var(--white);
    text-decoration: none;
    font-size: 1.2rem;
    padding: 1rem 2rem;
    transition: background-color 0.3s;
}

.main-nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}


/* ========= 通用區塊與按鈕設定 ========= */
section {
    padding: 3rem 1.5rem;
}

h1, h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

h2 {
    font-size: 1.8rem;
}

p.subtitle {
    text-align: center;
    margin-bottom: 2rem;
    color: #666;
}

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s, transform 0.2s;
}

.cta-button:hover {
    background-color: #004a74;
    transform: translateY(-2px);
}


/* ========= 各區塊詳細設定 ========= */
.hero-section {
    background-color: var(--secondary-color);
    text-align: center;
    padding-top: 4rem;
}

.hero-section h1 {
    font-size: 2.2rem;
    line-height: 1.3;
}

.hero-section p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.features {
    display: flex;
    justify-content: space-around;
    margin-top: 3rem;
}

.feature-item {
    flex: 1;
    padding: 0 0.5rem;
}

.feature-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.feature-item h3 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}
.feature-item p {
    font-size: 0.8rem;
    color: #666;
}

.quote-section {
    background-color: var(--white);
}

#quote-form .form-group {
    margin-bottom: 1.5rem;
}

#quote-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

#quote-form input, #quote-form select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

#quote-form button {
    width: 100%;
}

.quote-result {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--secondary-color);
    border-radius: 5px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    display: none; /* 預設隱藏 */
}

.cases-section {
    background-color: var(--light-gray);
}

.about-section {
    text-align: center;
}

.main-footer-contact {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
}

.main-footer-contact h2, .main-footer-contact p {
    color: var(--white);
}

.main-footer-contact p {
    margin-bottom: 1rem;
}

.main-footer-contact i {
    margin-right: 0.5rem;
}

.social-links {
    margin: 2rem 0;
}

.social-links a {
    color: var(--white);
    font-size: 1.5rem;
    margin: 0 1rem;
    text-decoration: none;
}

.copyright {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 2rem;
}

/* ========= 經典案例 CSS (自動輪播) ========= */
.slider-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.slider-wrapper {
    display: flex;
    /* 動畫: 名稱, 時間, 速度曲線, 無限次 */
    animation: scroll-cases 20s linear infinite;
}

/* 定義案例輪播動畫 (由左到右) */
@keyframes scroll-cases {
    0% {
        transform: translateX(0);
    }
    100% {
        /* 移動一個輪播組的距離 (50% 因 JS 中會複製一組) */
        transform: translateX(-50%);
    }
}

/* 隱藏手動切換按鈕 */
.slider-btn {
    display: none;
}

.slide {
    flex-shrink: 0;
    width: 100%;
    padding: 0 10px; /* 讓圖片之間有點間距 */
}

.slide a {
    display: block;
    width: 100%;
    height: 100%;
}

.slide img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
}

/* ========= 最新消息 CSS (自動輪播) ========= */
.news-section {
    padding: 3rem 1.5rem;
    background-color: #e6f7ff; /* 淡藍色背景 */
}

.news-ticker-container {
    background-color: var(--white);
    border: 1px solid #b3e0ff;
    border-radius: 8px;
    padding: 1rem 1.5rem;
}

.news-ticker-viewport {
    height: 4em; /* 調整高度以容納兩行文字 */
    overflow: hidden; /* 隱藏超出範圍的新聞 */
    position: relative;
}

.news-list-scrolling {
    list-style: none;
    padding-left: 0;
    margin: 0;
    position: absolute;
    width: 100%;
    /* 動畫 */
    animation: scroll-news 24s linear infinite;
}

.news-list-scrolling li {
    height: 4em; /* 確保每個項目高度一致 */
    display: flex;
    align-items: center;
}

.news-list-scrolling li a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.news-list-scrolling .news-icon {
    font-size: 1.2rem;
    margin-right: 1rem;
}

/* 公告圖示使用不同顏色 */
.news-list-scrolling .announcement-icon {
    color: #d90429;
}
.news-list-scrolling .news-item-icon {
    color: var(--primary-color);
}

.news-list-scrolling .news-content {
    flex: 1;
}

.news-list-scrolling .news-headline {
    display: block;
    font-weight: 500;
}

.news-list-scrolling .news-datetime {
    display: block;
    font-size: 0.8rem;
    color: #888;
}

/* 定義新聞輪播動畫 (由下到上) */
@keyframes scroll-news {
    0% {
        transform: translateY(0%);
    }
    100% {
        /* 向上移動 50% 的高度 (因為我們複製了一份新聞) */
        transform: translateY(-50%);
    }
}
