/* =======================================================
   康懿國際官網：日式簡約風 ＆ 全站 RWD 響應式優化樣式表
   ======================================================= */

/* --- 1. 全域基本設定 (Foundation) --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Noto Sans HK', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.8;
    color: #2b2b2b;       /* 暖炭黑，比純黑更柔和 */
    background-color: #fbfaf7; /* 和紙般的柔和溫暖白 */
    letter-spacing: 0.05em;   /* 微寬的字距，營造日式呼吸感 */
    -webkit-font-smoothing: antialiased;
}
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}
.text-center { text-align: center; }
a { text-decoration: none; color: inherit; transition: all 0.3s ease; }

/* --- 2. 導覽列與 Logo 自動縮小 (Header & Responsive Logo) --- */
.main-header {
    background-color: rgba(251, 250, 247, 0.95);
    border-bottom: 1px solid #e6e4df;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: padding 0.3s ease;
}
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    display: flex;
    align-items: center;
}
.logo-img {
    height: 55px;     /* 桌機版標準高度 */
    width: auto;      /* 寬度依比例自動縮放，絕不變形 */
    max-width: 100%;
    display: block;
    transition: height 0.3s ease; /* 縮放時的流暢動態效果 */
}
.main-nav ul {
    display: flex;
    list-style: none;
}
.main-nav ul li a {
    padding: 8px 16px;
    font-weight: 500;
    color: #575551;
    font-size: 0.95rem;
    position: relative;
}
.main-nav ul li a:hover {
    color: #2c3a47;
}
/* 日式下劃線動態效應 */
.main-nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    width: 0;
    height: 1px;
    background-color: #2c3a47;
    transition: width 0.3s ease;
}
.main-nav ul li a:hover::after {
    width: calc(100% - 32px);
}

/* --- 3. 首頁 Hero 主視覺屏 (Hero Section) --- */
.hero-section {
    padding: 100px 0;
    background-color: #f4f2ed; /* 微深茶白，沉穩踏實 */
    border-bottom: 1px solid #e6e4df;
}
.hero-section h1 {
    font-size: 2.4rem;
    font-weight: 500;
    color: #1e272e;
    margin-bottom: 25px;
    letter-spacing: 3px;
    line-height: 1.4;
}
.hero-lead {
    font-size: 1.05rem;
    max-width: 750px;
    margin: 0 auto;
    color: #575551;
}

/* 核心按鈕 (Buttons) */
.btn {
    display: inline-block;
    padding: 10px 28px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 0; /* 日式直角設計，展現沉穩 */
}
.btn-primary {
    border: 1px solid #2c3a47;
    background-color: #2c3a47;
    color: #fbfaf7;
}
.btn-primary:hover {
    background-color: transparent;
    color: #2c3a47;
}

/* --- 4. 內頁/區塊 通用標題 (Section Titles) --- */
.section-title {
    font-size: 1.75rem;
    font-weight: 500;
    color: #1e272e;
    margin-bottom: 35px;
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background-color: #8c8a84;
    margin: 15px auto 0 auto;
}
.section-subtitle {
    font-size: 1rem;
    color: #706e68;
    margin-top: -15px;
    margin-bottom: 60px;
}

/* 務實敘事區塊 */
.brief-section {
    padding: 80px 0;
    background-color: #fbfaf7;
}
.brief-text {
    max-width: 780px;
    margin: 0 auto;
    font-size: 1.05rem;
    color: #403f3c;
    text-align: justify;
}

/* --- 5. 業務矩陣網格 RWD 核心 (Ecosystem Grid) --- */
.ecosystem-section {
    padding: 80px 0;
    background-color: #fbfaf7;
    border-top: 1px solid #e6e4df;
}
.ecosystem-grid {
    display: grid;
    /* 運用 RWD 網格技術：當寬度不足 320px 時會自動擠到下一行 */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}
.project-card {
    background-color: #ffffff;
    padding: 40px 30px;
    border: 1px solid #e6e4df;
    display: flex;
    flex-direction: column;
}
.project-card .icon {
    font-size: 1.8rem;
    color: #2c3a47;
    margin-bottom: 20px;
    opacity: 0.8;
}
.project-card h3 {
    font-size: 1.2rem;
    font-weight: 500;
    color: #1e272e;
    margin-bottom: 15px;
}
.project-card p {
    color: #575551;
    font-size: 0.92rem;
    margin-bottom: 30px;
    line-height: 1.7;
    flex-grow: 1;
}
.project-card.featured {
    border: 1px solid #2c3a47; /* 用稍深線條強調主營業務 */
}
.project-tag {
    align-self: flex-start;
    border: 1px solid #8c8a84;
    color: #575551;
    padding: 2px 10px;
    font-size: 0.75rem;
    margin-bottom: 15px;
}
.project-link {
    color: #2c3a47;
    font-weight: 500;
    font-size: 0.9rem;
}
.project-link:hover {
    letter-spacing: 1px;
}
.project-card.placeholder {
    background-color: #f4f2ed;
    border: 1px solid #e6e4df;
}
.status-tag {
    align-self: flex-start;
    color: #8c8a84;
    font-size: 0.8rem;
    border-bottom: 1px solid #8c8a84;
    padding-bottom: 2px;
}

/* 合作洽談區塊 */
.partner-section {
    padding: 80px 0;
    background-color: #f4f2ed;
    border-top: 1px solid #e6e4df;
}
.partner-section p { color: #575551; margin-bottom: 20px; font-size: 1rem; }

/* --- 6. 內頁專屬樣式 (Internal Pages) --- */
.page-header {
    background-color: #1e272e; /* 沉穩暗炭色 */
    color: #fbfaf7;
    padding: 60px 0;
}
.page-header h1 { font-size: 2rem; font-weight: 500; margin-bottom: 10px; letter-spacing: 2px; }
.page-header p { opacity: 0.7; font-size: 0.95rem; }

.about-content { padding: 80px 0; background-color: #ffffff; border-bottom: 1px solid #e6e4df;}
.about-block { max-width: 750px; margin: 0 auto 60px auto; }
.about-block h2 { margin-bottom: 20px; font-weight: 500; font-size: 1.4rem; color: #1e272e; }
.about-block p { margin-bottom: 20px; font-size: 1rem; color: #403f3c; }

.about-values { max-width: 950px; margin: 0 auto; border-top: 1px solid #e6e4df; padding-top: 60px; }
.about-values h2 { text-align: center; margin-bottom: 50px; font-weight: 500; }
.values-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 35px; }
.value-item { border-left: 2px solid #8c8a84; padding-left: 20px; }
.value-item h3 { color: #1e272e; margin-bottom: 12px; font-size: 1.1rem; font-weight: 500; }
.value-item p { font-size: 0.9rem; color: #575551; }

.services-list { padding: 60px 0; }
.service-row { background-color: #ffffff; padding: 45px; border: 1px solid #e6e4df; margin-bottom: 35px; }
.service-row h2 { color: #1e272e; font-size: 1.3rem; font-weight: 500; margin-bottom: 15px; }
.service-row p { font-size: 0.98rem; color: #575551; }

/* 聯絡我們與極簡表單 RWD */
.contact-section { padding: 80px 0; background-color: #ffffff; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 60px; }
.contact-info h2 { margin-bottom: 25px; font-weight: 500; }
.contact-meta { color: #706e68; margin-bottom: 35px; font-size: 0.95rem; }
.info-details p { margin-bottom: 15px; font-size: 0.98rem; }
.project-info-box { background-color: #f4f2ed; padding: 25px; margin-top: 35px; border-left: 2px solid #2c3a47; }
.project-info-box h4 { color: #1e272e; margin-bottom: 8px; font-weight: 500; }

.corporate-form .form-group { margin-bottom: 25px; }
.corporate-form label { display: block; margin-bottom: 8px; font-size: 0.9rem; color: #575551; }
.corporate-form input, .corporate-form select, .corporate-form textarea {
    width: 100%; padding: 12px 0; border: none; border-bottom: 1px solid #cbd5e1; background-color: transparent; font-family: inherit; font-size: 0.95rem; border-radius: 0; transition: border-color 0.3s;
}
.corporate-form input:focus, .corporate-form select:focus, .corporate-form textarea:focus {
    outline: none; border-bottom: 1px solid #1e272e;
}
.btn-submit { background-color: #1e272e; color: #fbfaf7; width: 100%; font-weight: 500; cursor: pointer; border: 1px solid #1e272e; padding: 12px; margin-top: 10px;}
.btn-submit:hover { background-color: transparent; color: #1e272e; }

/* --- 7. 頁尾 (Footer) --- */
.main-footer {
    background-color: #1e272e; color: #a4a29c; padding: 60px 0 30px 0; font-size: 0.9rem;
}
.footer-grid {
    display: grid; grid-template-columns: 1.4fr 1fr; gap: 60px; padding-bottom: 40px; border-bottom: 1px solid #333d46;
}
.footer-brand h3, .footer-contact h3 { color: #fbfaf7; margin-bottom: 20px; font-size: 1.05rem; font-weight: 500; }
.footer-desc { font-size: 0.85rem; line-height: 1.8; }
.footer-contact p { margin-bottom: 10px; }
.footer-contact a:hover { color: #fbfaf7; }
.footer-bottom { padding-top: 25px; font-size: 0.8rem; opacity: 0.6; }


/* =======================================================
   --- 8. RWD 響應式關鍵中斷點設定 (Media Queries) ---
   ======================================================= */

/* 【平板與大螢幕手機適應中斷點】 */
@media (max-width: 900px) {
    .contact-grid { 
        grid-template-columns: 1fr; /* 聯絡資訊與表單由左右改為上下排列 */
        gap: 40px; 
    }
    .footer-grid {
        grid-template-columns: 1fr; /* 頁尾改為單欄垂直 */
        gap: 40px;
    }
}

/* 【智慧型手機適應中斷點：768px 以下全面啟動】 */
@media (max-width: 768px) {
    /* Header 改為上下置中結構 */
    .header-flex { 
        flex-direction: column; 
        text-align: center; 
        gap: 15px;
    }
    
    /* 🌟 重點：Logo 在手機版上自動縮小至 42px，保持畫面和諧 */
    .logo-img { 
        height: 42px; 
    }
    
    /* 手機版選單自動並列、置中 */
    .main-nav ul { 
        padding: 0; 
        justify-content: center;
        flex-wrap: wrap; /* 寬度不夠時自動換行 */
    }
    .main-nav ul li a { 
        padding: 6px 12px; 
        font-size: 0.9rem; 
    }
    .main-nav ul li a::after {
        display: none; /* 手機版關閉動態下劃線，避免誤觸 */
    }

    /* 首頁與內頁文字縮小，更利於手機閱讀 */
    .hero-section { padding: 60px 0; }
    .hero-section h1 { font-size: 1.65rem; letter-spacing: 1px; }
    .hero-lead { font-size: 0.95rem; }
    
    .section-title { font-size: 1.4rem; margin-bottom: 25px; }
    .section-subtitle { margin-bottom: 40px; font-size: 0.95rem; }
    
    .brief-section { padding: 50px 0; }
    .ecosystem-section { padding: 50px 0; }
    
    /* 核心業務卡片在手機上改為單欄滿版排列 */
    .ecosystem-grid { 
        grid-template-columns: 1fr; 
        gap: 20px; 
    }
    .project-card { padding: 30px 20px; }
    
    /* 服務項目詳情頁優化 */
    .service-row { padding: 25px; margin-bottom: 20px; }
}