/* =========================================
   1. Reset & Variables (保留原始)
   ========================================= */
html { scroll-behavior: smooth; }
:root {
    --color-header: #73a5aa;
    --color-white: #ffffff;
    --color-vision: #bceae8;
    --color-footer: #14242c;
    --text-dark: #333333;
    --text-light: #ffffff;
    --card-radius: 20px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Noto Sans TC', sans-serif; overflow-x: hidden; background: var(--color-white); }
ul { list-style: none; }
a { text-decoration: none; color: inherit; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; position: relative; z-index: 2; }

/* =========================================
   2. Header Section (保留原始)
   ========================================= */
.hero { position: relative; height: 80vh; color: var(--color-white); display: flex; flex-direction: column; overflow: hidden; }
.hero-video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(115, 165, 170, 0.4); z-index: 1; }
.wave-top { position: absolute; bottom: -1px; left: 0; width: 100%; overflow: hidden; line-height: 0; transform: rotate(180deg); z-index: 4; }
.wave-top svg { display: block; width: calc(100% + 1.3px); height: 80px; }
.wave-top .shape-fill { fill: var(--color-white); }
.top-nav { display: flex; justify-content: space-between; padding: 20px 5%; position: relative; z-index: 10; }
.nav-links { display: flex; gap: 30px; }
.nav-links a { font-size: 0.95rem; font-weight: 500; opacity: 0.9; }
.nav-links a:hover { opacity: 1; text-decoration: underline; }
.hero-content { flex: 1; display: flex; justify-content: center; align-items: center; position: relative; z-index: 5; text-align: center; padding-bottom: 80px; }
.title-logo-wrapper { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 20px; }
.hero-logo { height: 60px; width: auto; filter: brightness(0) invert(1) drop-shadow(0 4px 6px rgba(0,0,0,0.3)); transform: translateY(-2px); }
.brand-text h1 { font-family: 'Playfair Display', serif; font-style: italic; font-size: 3.8rem; font-weight: 500; margin: 0; letter-spacing: 1px; text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); }
.brand-text p { font-size: 1.2rem; letter-spacing: 3px; opacity: 0.95; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); }
.white-triangle { position: absolute; bottom: 50px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 20px solid transparent; border-right: 20px solid transparent; border-top: 25px solid rgba(255, 255, 255, 0.6); z-index: 20; cursor: pointer; transition: transform 0.3s ease, border-top-color 0.3s ease; }
.white-triangle::after { content: ''; position: absolute; top: -30px; left: -30px; width: 60px; height: 60px; background: transparent; }
.white-triangle:hover { transform: translateX(-50%) scale(1.2); border-top-color: rgba(255, 255, 255, 0.9); }

/* =========================================
   3. White Section (修正：捲動位移與手機標題一行)
   ========================================= */
#關於艾薇爾 { scroll-margin-top: 80px; } /* 新增：讓捲動不貼頂 */

.white-section { background-color: var(--color-white); padding: 60px 0 80px; position: relative; z-index: 5; }
.company-intro { margin-bottom: 60px; }
.company-header { display: flex; align-items: center; gap: 20px; }
.intro-logo { height: 50px; width: auto; }
.title-group h2 { 
    color: var(--color-header); 
    font-size: 1.6rem; 
    margin-bottom: 5px; 
    white-space: nowrap; /* 修正：強制不換行 */
}
.title-group span { font-size: 0.8rem; color: #888; letter-spacing: 1px; display: block; }
.features-scroller { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.feature-card { background: #fff; padding: 40px 30px; border-radius: 50px 10px 10px 10px; border: 1px solid #eee; box-shadow: 0 5px 15px rgba(0,0,0,0.05); transition: transform 0.3s ease; }
.feature-card.active:hover { transform: translateY(-10px); transition: transform 0.3s ease !important; }
.card-icon { font-size: 2rem; margin-bottom: 20px; color: #333; }
.feature-card h3 { margin-bottom: 15px; font-size: 1.1rem; color: #000; font-weight: bold; }
.feature-card p { font-size: 0.9rem; color: #555; line-height: 1.7; }

/* =========================================
   4. Vision Section (修正：捲動位移)
   ========================================= */
#願景使命 { scroll-margin-top: 100px; } /* 新增：讓捲動不貼頂 */

.vision-section { background-image: url('images/bottom_img.png'); background-size: cover; background-position: top center; background-repeat: no-repeat; overflow: hidden; padding: 80px 0 150px; position: relative; border-top-left-radius: 30px; border-top-right-radius: 30px; margin-top: -30px; }
.section-title-dark { color: var(--color-header); font-size: 1.5rem; margin-bottom: 40px; font-weight: bold; }
.mission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.mission-box { background: rgba(255,255,255,0.7); border-radius: 20px; padding: 40px; overflow: hidden; }
.mission-box:first-child { border-radius: 50px 10px 10px 10px; }
.mission-box h3 { margin: 0 0 20px 0; color: var(--color-header); font-size: 1.3rem; font-weight: bold; padding-bottom: 10px; border-bottom: 1px solid rgba(0,0,0,0.1); }
.mission-content ul li { list-style: disc; margin-left: 20px; margin-bottom: 10px; color: #333; }
.mission-content p { color: #333; line-height: 1.8; text-align: justify; }
.wave-bottom { position: absolute; bottom: -1px; left: 0; width: 100%; overflow: hidden; line-height: 0; z-index: 5; }
.wave-bottom svg { display: block; width: 100%; min-width: 1000px; height: 150px; }
.circle-login-btn { position: absolute; bottom: 50px; right: 20%; width: 140px; height: 140px; background: #3e606f; border-radius: 50%; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #fff; box-shadow: 0 10px 20px rgba(0,0,0,0.15); z-index: 30; transition: 0.3s; }
.circle-login-btn:hover { transform: scale(1.05); background: #2f4a56; }
.btn-main { font-size: 1.2rem; font-weight: bold; }
.btn-sub { font-size: 0.8rem; opacity: 0.8; }

/* =========================================
   5. Footer Section (保留原始)
   ========================================= */
.main-footer { background-color: var(--color-footer); color: #fff; padding: 40px 0 60px; position: relative; z-index: 10; }
.footer-layout { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 15px; }
.footer-logo-img { height: 50px; width: auto; filter: brightness(0) invert(1); }
.footer-text h4 { font-size: 1.2rem; margin-bottom: 5px; }
.footer-text span { font-size: 0.7rem; opacity: 0.6; letter-spacing: 1px; }
.footer-right { text-align: right; font-size: 0.85rem; line-height: 1.8; opacity: 0.8; }

/* =========================================
   6. Floating Clinic Button (保留原始)
   ========================================= */
.floating-clinic-btn { position: fixed; right: 20px; top: 45%; transform: translateY(-50%); z-index: 100; width: 90px; outline: none; background: transparent; border: none; -webkit-tap-highlight-color: transparent; transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); }
.floating-clinic-btn img { width: 100%; height: auto; display: block; filter: drop-shadow(0 4px 5px rgba(158, 118, 73, 0.4)); transition: filter 0.3s ease; }
.floating-clinic-btn:hover { transform: translateY(-50%) scale(1.1); cursor: pointer; }
.floating-clinic-btn:hover img { filter: drop-shadow(0 6px 8px rgba(158, 118, 73, 0.7)); }

/* =========================================
   Animation (動作加大且安全版)
   ========================================= */
.reveal-up { 
    opacity: 0; 
    /* 維持您喜歡的大動作 100px */
    transform: translateY(100px) scale(0.9); 
    /* 確保元素佔位存在，不會被瀏覽器忽視 */
    visibility: visible; 
    transition: all 1.0s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    will-change: transform, opacity; /* 告訴瀏覽器這東西會動，請準備好渲染 */
}

.reveal-up.active { 
    opacity: 1 !important; 
    transform: translateY(0) scale(1) !important; 
}

.reveal-up.active { 
    opacity: 1 !important; 
    /* 回歸原位，並恢復原本大小 */
    transform: translateY(0) scale(1) !important; 
}

/* =========================================
   8. Responsive (手機版修正：標題字體與一行展示)
   ========================================= */
.scroll-indicators { display: none; }

@media (max-width: 768px) {
    .hero { height: 60vh; }
    .nav-links { display: flex; justify-content: center; width: 100%; gap: 15px; margin-top: 10px; }
    .nav-links a { font-size: 0.85rem; padding: 5px; }
    .white-triangle { bottom: 30px; border-top-width: 15px; border-left-width: 15px; border-right-width: 15px; }
    .title-logo-wrapper { gap: 15px; margin-bottom: 15px; }
    .hero-logo { height: 40px; }
    .brand-text h1 { font-size: 1.8rem; }
    
    /* 修正手機版標題 */
    .title-group h2 { 
        font-size: 1.25rem; 
        white-space: nowrap; 
        letter-spacing: -0.5px;
    }

    .brand-text p { font-size: 1em; }
    .title-group span { font-size: 0.7rem; }
    .features-scroller { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 20px; gap: 15px; }
    .feature-card { min-width: 90%; scroll-snap-align: center; }
    .scroll-indicators { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
    .dot { width: 8px; height: 8px; background: #ddd; border-radius: 50%; transition: 0.3s; }
    .dot.active { width: 20px; background: var(--color-header); border-radius: 10px; }
    
    .mission-grid { grid-template-columns: 1fr; gap: 20px; }
    .mission-box { padding: 30px 25px; height: auto; }
    
    .footer-layout { flex-direction: column; align-items: flex-start; gap: 30px; }
    .footer-right { text-align: left; }
    .circle-login-btn { width: 100px; height: 100px; top: auto; right: auto; left: 50%; transform: translateX(-50%); bottom: 30px; }
    .btn-main { font-size: 1rem; }
    .floating-clinic-btn { width: 65px; right: 10px; }
    
.reveal-up {
        /* 手機版動作稍微收斂一點，避免跑出畫面外太遠導致空白 */
        transform: translateY(60px) scale(0.95) !important;
    }
    .reveal-up.active {
        transform: translateY(0) scale(1) !important;
    }
}