/* ========== 鍏ㄥ眬 CSS 鍙橀噺 ========== */
:root {
    --brand-primary: #715398;
    --brand-secondary: #9D7BCB;
    --brand-accent-orange: #ff8f1c;
    --brand-accent-green: #d0df00;
    --brand-accent-red: #c82272;
    --brand-accent-purple: #43237B;
    
    --color-dark: #1d1d1f;
    --color-light: #ffffff;
    --color-gray-100: #fafafc;
    --color-gray-200: #f5f5f7;
    --color-gray-300: #d0d3d4;
    --color-gray-500: #666666;
    --color-gray-600: #1d1d1f;
    
    --nav-height: 60px;
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.12);
    
    --container-max: min(92vw, 1600px); 
    --container-padding: clamp(20px, 4vw, 40px);
}

/* ========== 鍩虹閲嶇疆 ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overflow-x: hidden; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--color-gray-600); background-color: var(--color-gray-100); line-height: 1.6; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a, button { text-decoration: none; border: none; background: transparent; cursor: pointer; color: inherit; font-family: inherit; outline: none; }
img { max-width: 100%; height: auto; display: block; object-fit: cover; }

.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--container-padding); }

/* ========== 瀵艰埅鏍?========== */
.header { position: fixed; top: 0; left: 0; width: 100vw; max-width: 100vw; box-sizing: border-box; z-index: 1000; background-color: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--color-dark); height: var(--nav-height); display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 5vw, 80px); transition: box-shadow var(--transition-base); border-bottom: 1px solid rgba(0,0,0,0.05); }
.header.scrolled { box-shadow: 0 4px 20px rgba(0,0,0,0.05); }

.brand-logo { display: flex; align-items: center; height: 100%; z-index: 1002; }
.brand-logo img { height: 26px; width: auto; transition: opacity var(--transition-base); }
.brand-logo:hover img { opacity: 0.7; }

.desktop-nav { display: none; align-items: center; gap: clamp(20px, 3vw, 40px); }
.desktop-nav-link { font-weight: 500; font-size: 15px; position: relative; padding: 5px 0; transition: var(--transition-base); color: var(--color-dark); }
.desktop-nav-link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; transition: width 0.3s ease; }
.desktop-nav-link[data-nav="home"]::after { background: var(--color-gray-300); }
.desktop-nav-link[data-nav="services"]::after { background: var(--brand-accent-orange); }
.desktop-nav-link[data-nav="cases"]::after { background: var(--brand-secondary); }
.desktop-nav-link[data-nav="about"]::after { background: var(--brand-accent-green); }
.desktop-nav-link[data-nav="contact"]::after { background: var(--brand-accent-red); }
.desktop-nav-link:hover::after, .desktop-nav-link.active::after { width: 100%; }

.lang-switcher { position: relative; }
.lang-btn { border: 1px solid rgba(0,0,0,0.15); border-radius: 20px; padding: 6px 14px; font-size: 13px; display: flex; align-items: center; gap: 6px; font-weight: 500; transition: var(--transition-base); color: var(--color-dark); letter-spacing: 1px; }
.lang-btn:hover { background: rgba(0,0,0,0.05); }

.lang-dropdown { position: absolute; top: calc(100% + 10px); right: 0; background: #fff; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); min-width: 120px; opacity: 0; visibility: hidden; transform: translateY(10px); transition: var(--transition-base); z-index: 1001; border: 1px solid rgba(0,0,0,0.05); }
.lang-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-option { padding: 12px 20px; display: block; color: #333; font-size: 13px; font-weight: 500; transition: var(--transition-base); border-bottom: 1px solid rgba(0,0,0,0.03); letter-spacing: 1px; }
.lang-option:last-child { border-bottom: none; }
.lang-option:hover { background: var(--color-gray-200); color: var(--brand-primary); }
.lang-option.active { color: var(--brand-primary); font-weight: 700; }

.mobile-controls { display: flex; align-items: center; gap: 12px; }
.menu-toggle { width: 38px; height: 38px; border: 1px solid rgba(0,0,0,0.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--color-dark); transition: var(--transition-base); }
.menu-toggle:active { transform: scale(0.95); background: rgba(0,0,0,0.05); }

.mobile-nav-panel { position: fixed; top: var(--nav-height); right: 0; bottom: 0; width: min(80vw, 320px); background: #fff; box-shadow: -5px 0 30px rgba(0,0,0,0.1); z-index: 999; transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; padding: 20px 0; overflow-y: auto; }
.mobile-nav-panel.active { transform: translateX(0); }
.mobile-link { position: relative; padding: 15px 30px; font-size: 16px; color: var(--color-gray-600); font-weight: 500; display: block; border-bottom: 1px solid rgba(0,0,0,0.03); text-transform: uppercase; letter-spacing: 2px;}
.mobile-link::after { content: ''; position: absolute; bottom: 0; left: 30px; width: 0; height: 2px; transition: width 0.3s ease; }
.mobile-link[data-nav="home"]::after { background: var(--brand-primary); }
.mobile-link[data-nav="services"]::after { background: var(--brand-accent-orange); }
.mobile-link[data-nav="cases"]::after { background: var(--brand-secondary); }
.mobile-link[data-nav="about"]::after { background: var(--brand-accent-green); }
.mobile-link[data-nav="contact"]::after { background: var(--brand-accent-red); }
.mobile-link:hover::after, .mobile-link.active::after { width: calc(100% - 60px); }
.mobile-link.active { font-weight: 700; color: var(--brand-secondary); }

@media (min-width: 769px) { .desktop-nav { display: flex; } .mobile-controls { display: none; } }

/* ========== 椤佃剼 ========== */
.footer { background: var(--brand-accent-purple); padding: 60px 0 20px; color: var(--color-light); margin-top: auto;}
.footer > .container { max-width: none; padding-left: clamp(20px, 5vw, 80px); padding-right: clamp(20px, 5vw, 80px); }
.footer-main { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; }
.footer-left { display: flex; flex-direction: column; gap: 15px; text-align: left; max-width: 400px; }
.footer-logo { height: 28px; width: auto; filter: brightness(0) invert(1); object-fit: contain; margin-bottom: 5px; }
.footer-slogan { font-size: 14px; opacity: 0.8; letter-spacing: 2px; margin: 0; }

.footer-right { display: flex; flex-direction: column; align-items: flex-end; gap: 30px; }
.footer-links { display: flex; gap: 30px; }
.footer-link { font-size: 14px; color: var(--color-light); opacity: 0.85; font-weight: 500; transition: var(--transition-base); text-transform: uppercase; letter-spacing: 1px; position: relative; padding: 5px 0;}
.footer-link:hover, .footer-link.active { opacity: 1; color: var(--brand-secondary); transform: translateY(-2px);}
.footer-link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 1px; background: currentColor; transition: width 0.3s ease; }
.footer-link:hover::after, .footer-link.active::after { width: 100%; }

.footer-social { display: flex; gap: 15px; }
.social-icon { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.3); display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--color-light); transition: var(--transition-base); background: transparent; }
.social-icon:hover { background: var(--color-light); color: var(--brand-accent-purple); border-color: var(--color-light); transform: translateY(-3px); }

.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; text-align: left; }
.footer-copyright { font-size: 10px; opacity: 0.42; margin: 0; line-height: 1.5; }
.footer-copyright a { color: inherit; text-decoration: none; transition: opacity 0.3s; }
.footer-copyright a:hover { opacity: 1; text-decoration: underline; }
.footer-records { display: flex; align-items: center; flex-wrap: wrap; gap: 0 7px; vertical-align: middle; }
.footer-record-item { display: inline-flex; align-items: center; gap: 4px; line-height: 1.35; white-space: nowrap; }
.footer-record-sep { opacity: 0.55; line-height: 1.35; }
.footer-beian { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; line-height: 1.4; }
.footer-beian-icon { width: 12px; height: 12px; object-fit: contain; flex: 0 0 auto; display: block; }

@media (max-width: 768px) {
    .footer-main { flex-direction: column; align-items: center; text-align: center; gap: 40px; }
    .footer-left { align-items: center; text-align: center; }
    .footer-right { align-items: center; }
    .footer-links { flex-wrap: wrap; justify-content: center; gap: 20px; }
    .footer-bottom { text-align: left; }
    .footer-copyright { font-size: 9px; }
}

/* ========== 浜岀淮鐮佸脊绐?========== */
.qrcode-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); z-index: 2000; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease;}
.qrcode-content { background: var(--color-light); padding: 30px; border-radius: 8px; text-align: center; max-width: 300px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); position: relative; }
.qrcode-content h3 { margin-bottom: 15px; color: var(--brand-primary); font-size: 18px; }
.qrcode-content img { width: 200px; height: 200px; margin-bottom: 15px; }
.close-qrcode { position: absolute; top: 10px; right: 15px; font-size: 24px; cursor: pointer; color: var(--color-gray-500); }

/* =========================================================
   ========== 娌夋蹈寮忛珮绾х敾寤婂脊绐?(鍏ㄥ眬閫氱敤鎻愬彇) ========== 
   ========================================================= */
.modal-overlay { 
    position: fixed; inset: 0; z-index: 2000; 
    background: rgba(0, 0, 0, 0.2); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); 
    display: flex; align-items: center; justify-content: center; 
    visibility: hidden; opacity: 0; transition: opacity 0.5s ease, visibility 0.5s ease; padding: clamp(20px, 5vw, 60px); 
    overscroll-behavior-x: none; 
}
.modal-overlay.active { visibility: visible; opacity: 1; }

.modal-close-btn { position: fixed; top: 25px; right: 30px; width: 36px; height: 36px; background: rgba(0,0,0,0.05); border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 2010; color: var(--color-dark); font-size: 18px; cursor: pointer; border: 1px solid rgba(0,0,0,0.1); transition: all 0.3s ease; backdrop-filter: blur(4px); }
.modal-close-btn:hover { transform: scale(1.1) rotate(90deg); background: var(--color-light); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.modal-container { width: 100%; max-width: 1600px; height: 90vh; background: #fff; border-radius: 12px; overflow: hidden; display: block; position: relative; box-shadow: 0 40px 80px rgba(0,0,0,0.15); transform: scale(0.96) translateY(20px); transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); overscroll-behavior-x: none;}
.modal-overlay.active .modal-container { transform: scale(1) translateY(0); }

.modal-scroll-wrapper { display: flex; flex-direction: row; width: 100%; height: 100%; }

/* 寮哄埗鍏ㄧ宸﹀榻愶紝鍘婚櫎鍑屼贡鎰?*/
.modal-left { width: 35%; min-width: 360px; padding: 60px 50px; background: #fff; display: flex; flex-direction: column; z-index: 2; border-right: 1px solid rgba(0,0,0,0.05); overflow-y: auto; text-align: left; }
.modal-left::-webkit-scrollbar { width: 0px; }

/* 銆愬ぇ鍙峰瓧銆戯細浠呯敤浜庢€绘爣棰?*/
.modal-title { font-size: clamp(24px, 3vw, 32px); color: var(--color-dark); margin-bottom: 50px; line-height: 1.3; }
.modal-divider { width: 40px; height: 3px; margin-bottom: 25px; border-radius: 2px; visibility: hidden; }

/* 銆愬皬鍙峰瓧銆戯細缁熶竴 14px锛屽埄鐢?400/600 绮楃粏鍙婃繁娴呴鑹插仛灞傜骇 */
.modal-desc { font-size: 14px; color: #555; line-height: 1.7; margin-bottom: 35px; font-weight: 400; text-align: justify; word-break: break-word;}

/* 鏈嶅姟椤电壒鏈夌壒寰佸垪琛?*/
/* 妗岄潰绔厓鏁版嵁妯悜鎺掔増 */
.modal-meta-grid { display: flex; flex-direction: row; flex-wrap: wrap; gap: 25px; margin-top: auto; padding-top: 25px; border-top: 1px solid #eeeeee; }
.modal-meta-item { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 110px;}
.modal-meta-label { font-size: 14px; color: #111; font-weight: 600; text-transform: none; letter-spacing: 0; }
.modal-meta-value { font-size: 14px; font-weight: 400; color: #555; line-height: 1.5; text-transform: none; letter-spacing: 0;}

.modal-right { width: 65%; padding: 25px 15px; background: #fff; overflow-y: auto; display: flex; flex-direction: column; align-items: center; scroll-behavior: smooth; }
.modal-right::-webkit-scrollbar { width: 6px; }
.modal-right::-webkit-scrollbar-track { background: transparent; border-radius: 10px; }
.modal-right::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 10px; }
.modal-right::-webkit-scrollbar-thumb:hover { background: #bbb; }

@keyframes pulse-bg {
    0% { background-color: #f0f2f5; }
    50% { background-color: #e2e8f0; }
    100% { background-color: #f0f2f5; }
}

.modal-img-wrapper { 
    width: 100%; border-radius: 8px; overflow: hidden; margin-bottom: 15px; flex-shrink: 0; box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    transition: aspect-ratio 0.3s cubic-bezier(0.4, 0, 0.2, 1); position: relative; background-color: #f0f2f5;
}
.modal-img-wrapper:not(.loaded-wrapper) { animation: pulse-bg 1.5s infinite ease-in-out; }
.modal-img-wrapper img { width: 100%; height: 100%; display: block; object-fit: cover; opacity: 0; transition: opacity 0.5s ease; }
.modal-img-wrapper img.show { opacity: 1; }

@media (min-width: 1025px) {
    .modal-img-wrapper { aspect-ratio: 4/3; } 
    .modal-img-wrapper.is-wide { aspect-ratio: 4/3; }
    .modal-img-wrapper.is-tall { aspect-ratio: 1/1; }
}

@media (max-width: 1024px) {
    .modal-scroll-wrapper::-webkit-scrollbar { width: 4px; height: 4px; }
    .modal-scroll-wrapper::-webkit-scrollbar-track { background: rgba(0,0,0,0.05); border-radius: 10px; }
    .modal-scroll-wrapper::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
    .modal-scroll-wrapper::-webkit-scrollbar-thumb:hover { background: #aaa; }
}

/* Pad 绔脊绐楁帓鐗?*/
@media (min-width: 641px) and (max-width: 1024px) { 
    .modal-overlay { padding: clamp(40px, 6vw, 80px); align-items: center; } 
    .modal-container { max-width: 85%; width: 100%; height: 85vh; border-radius: 16px; transform: scale(0.96) translateY(20px); } 
    .modal-overlay.active .modal-container { transform: scale(1) translateY(0); }
    
    .modal-scroll-wrapper { flex-direction: column; overflow-y: auto; overflow-x: hidden; }
    .modal-left, .modal-right { width: 100%; height: auto; overflow-y: visible; border: none; }

    .modal-left { padding: 60px 40px 30px; border-radius: 16px 16px 0 0; text-align: left; }
    .modal-title { font-size: 24px; margin-top: 0; margin-bottom: 40px; }
    
    .modal-meta-grid { flex-direction: row; justify-content: flex-start; gap: 40px; padding-top: 25px; border-top: 1px solid #eee; width: 100%; }
    .modal-meta-item { flex: none; align-items: flex-start; text-align: left; }

    .modal-right { padding: 10px 24px 40px; align-items: center; border-radius: 0 0 16px 16px; }
    .modal-img-wrapper { margin-bottom: 20px; aspect-ratio: 1/1; } 
    .modal-img-wrapper.is-wide { aspect-ratio: 1/1; }
    .modal-img-wrapper.is-tall { aspect-ratio: 3/4; }
}

/* 鎵嬫満绔脊绐楁帓鐗?*/
@media (max-width: 640px) {
    .modal-overlay { padding: 60px 0 0 0; align-items: flex-end; }
    .modal-container { height: 90vh; max-height: 90vh; width: 100%; border-radius: 16px 16px 0 0; transform: translateY(100%); } 
    .modal-overlay.active .modal-container { transform: translateY(0); }
    
    .modal-scroll-wrapper { flex-direction: column; overflow-y: auto; overflow-x: hidden; }
    .modal-left, .modal-right { width: 100%; height: auto; overflow-y: visible; border: none; }
    
    .modal-left { padding: 45px 20px 20px; border-radius: 16px 16px 0 0; text-align: left; }
    .modal-title { font-size: 22px; margin-top: 0; margin-bottom: 30px; }
    
    .modal-meta-grid { flex-direction: column; gap: 20px; flex-wrap: nowrap; padding-top: 20px; }
    .modal-meta-item { width: 100%; }
    
    .modal-close-btn { top: 16px; right: 16px; width: 32px; height: 32px; font-size: 16px; background: rgba(255,255,255,0.95); border: none; color: #333; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
    
    .modal-right { padding: 10px 10px 40px; align-items: center; border-radius: 0; }
    .modal-img-wrapper { margin-bottom: 12px; border-radius: 8px; width: 100%; aspect-ratio: 1/1;}
    .modal-img-wrapper.is-wide { aspect-ratio: 1/1; }
    .modal-img-wrapper.is-tall { aspect-ratio: 3/4; }
}

/* ========== 鍏ㄧ珯绋冲畾鎬т笌鍙闂€цˉ寮?========== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 4px;
}

.desktop-nav-link,
.mobile-link,
.footer-link,
.lang-btn,
.social-icon {
    -webkit-tap-highlight-color: transparent;
}

@media (hover: none) {
    .desktop-nav-link:hover,
    .footer-link:hover,
    .social-icon:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== Case modal restore ========== */
.modal-title {
    margin-bottom: 18px;
    font-weight: 400;
}

.modal-desc {
    margin-bottom: 32px;
    line-height: 1.75;
}

.modal-img-wrapper {
    transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.modal-img-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

@media (min-width: 1025px) {
    .modal-title {
        font-size: clamp(20px, 3.5vw, 24px);
        line-height: 1.3;
    }

    .modal-left {
        width: 36%;
        min-width: 390px;
        padding: clamp(54px, 5vw, 74px) clamp(42px, 4vw, 62px);
    }

    .modal-right {
        width: 64%;
        padding: 24px 16px;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .modal-title {
        font-size: 24px;
        line-height: 1.3;
        margin-bottom: 16px;
    }

    .modal-desc {
        max-width: 58em;
    }
}

@media (max-width: 640px) {
    .modal-title {
        font-size: 22px;
        line-height: 1.3;
        margin-bottom: 14px;
    }

    .modal-desc {
        margin-bottom: 26px;
        font-size: 13px;
        line-height: 1.75;
    }
}
