/* ==================================================
   智銘居家美化｜前端樣式表（高質感暗黑風）
   設計理念：極深灰藍調色盤 + 金色點綴，營造奢華質感
   結構相容：保留原有 class 名稱，確保 JS/後台功能不變
   響應式：完整支援手機 / 平板 / 桌機
================================================== */

:root {
    /* 品牌調色盤（暗黑質感） */
    --bg-primary: #0B0F19;
    /* 極深藍黑 - 主背景 */
    --bg-secondary: #111827;
    /* 深藍灰 - 次背景 */
    --bg-tertiary: #1A2233;
    /* 卡片/區塊背景 */
    --bg-elevated: #1F2937;
    /* 浮起層背景 */
    --bg-hover: #243044;
    /* 懸停背景 */

    --primary-color: #E8EAF0;
    /* 主文字（亮白灰） */
    --secondary-color: #A8B0C0;
    /* 次要文字 */
    --text-dark: #E8EAF0;
    /* 主要文字 */
    --text-light: #9AA5BB;
    /* 輔助文字（提升對比，行動裝置可讀性） */
    --text-muted: #7C87A0;
    /* 弱化文字（提升對比，符合 WCAG AA） */

    --accent-color: #D4AF37;
    /* 金色 - 品牌強調色 */
    --accent-hover: #E8C84A;
    /* 金色懸停 */
    --accent-glow: rgba(212, 175, 55, 0.15);
    /* 金色光暈 */

    --border-color: #2A3448;
    /* 邊框 */
    --border-light: #3A4660;
    /* 亮邊框 */

    /* 陰影與圓角 */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.45);
    --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.2);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    /* 佈局 */
    --header-height: 80px;

    /* 漸層 */
    --gradient-primary: linear-gradient(135deg, #0B0F19 0%, #111827 50%, #1A2233 100%);
    --gradient-card: linear-gradient(145deg, #1A2233 0%, #111827 100%);
    --gradient-gold: linear-gradient(135deg, #D4AF37 0%, #E8C84A 50%, #B8962E 100%);

    /* 字體系統（現代中文排版：襯線標題 + 無襯線內文） */
    --font-sans: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Noto Serif TC', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', serif;
}

/* ============ Base ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    line-height: 1.75;
    letter-spacing: 0.02em;
    color: var(--text-dark);
    background-color: var(--bg-primary);
    background-image: var(--gradient-primary);
    background-attachment: fixed;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

::selection {
    background: var(--accent-color);
    color: var(--bg-primary);
}

/* ============ 字體排版系統 ============ */
/* 標題採用襯線字體（Noto Serif TC）：高質感、具品牌調性 */
h1,
h2,
h3,
h4 {
    font-family: var(--font-serif);
    letter-spacing: 0.06em;
    text-wrap: balance;
}

/* 段落文字避免孤行孤字，閱讀節奏更舒適 */
p {
    text-wrap: pretty;
}

/* 自訂捲軸 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* ============ Header ============ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(11, 15, 25, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.2));
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-color);
    letter-spacing: 1px;
    line-height: 1.3;
    background: linear-gradient(135deg, #E8EAF0 0%, #D4AF37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text p {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.2;
    letter-spacing: 0.5px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
    padding: 8px 0;
}

.nav-link:hover {
    color: var(--accent-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-gold);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.nav-toggle span {
    width: 100%;
    height: 2px;
    background: var(--accent-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ============ Hero ============ */
.hero {
    min-height: 100vh;
    margin-top: var(--header-height);
    background-color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

/* 背景圖層：filter 統一調整為暖金暗調，與品牌金色調性融合 */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/background.jpg');
    background-size: cover;
    background-position: center;
    filter: sepia(0.45) saturate(1.2) hue-rotate(-8deg) brightness(0.72) contrast(1.06);
    transform: scale(1.03);
    z-index: 0;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(11, 15, 25, 0.9) 0%, rgba(17, 24, 39, 0.8) 50%, rgba(11, 15, 25, 0.68) 100%);
    z-index: 1;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 50% 120%, rgba(212, 175, 55, 0.08) 0%, transparent 60%);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}

.hero-title {
    font-size: clamp(1.95rem, 0.95rem + 4vw, 4rem);
    font-weight: 900;
    margin-bottom: 1.2rem;
    color: #ffffff;
    line-height: 1.28;
    letter-spacing: 0.05em;
    text-indent: 0.05em;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* 主標題逐行優雅淡入：淡入 + 上浮 + 模糊轉清晰，交錯登場 */
.hero-line {
    display: block;
    opacity: 0;
    animation: heroLineIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    will-change: transform, opacity, filter;
}

.hero-line:nth-child(1) {
    animation-delay: 0.15s;
}

.hero-line:nth-child(2) {
    animation-delay: 0.45s;
}

@keyframes heroLineIn {
    from {
        opacity: 0;
        transform: translateY(40px);
        filter: blur(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* 標題第二行：金色漸層文字，強調「生活的藝術品」 */
.hero-title .hero-line:nth-child(2) {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(0.95rem, 0.83rem + 0.55vw, 1.25rem);
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.9;
    letter-spacing: 0.18em;
    text-indent: 0.18em;
    animation: fadeInUp 1s ease 0.75s backwards;
}

.hero-subtitle i {
    color: var(--accent-color);
    font-style: normal;
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.9s backwards;
}

/* 雙 CTA 視覺優先級：主按鈕「高對比實色」、次按鈕「Ghost 外框」 */
.hero-actions .btn-primary {
    background: #E8C84A;
    font-size: 1.1rem;
    padding: 16px 44px;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(212, 175, 55, 0.45);
}

.hero-actions .btn-primary:hover {
    background: #F0D45C;
    transform: translateY(-3px);
    box-shadow: 0 12px 38px rgba(212, 175, 55, 0.55);
}

.hero-actions .btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.1rem;
    padding: 15px 40px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hero-actions .btn-outline:hover {
    border-color: var(--accent-color);
    background: rgba(212, 175, 55, 0.08);
}

/* 箭頭引導：hover 時向右滑動，暗示「前往觀看」 */
.btn-arrow {
    display: inline-block;
    font-weight: 900;
    transition: transform 0.3s ease;
}

.btn-outline:hover .btn-arrow {
    transform: translateX(6px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ Buttons ============ */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid transparent;
    cursor: pointer;
    letter-spacing: 0.08em;
}

.btn-primary {
    background: var(--gradient-gold);
    color: var(--bg-primary);
    box-shadow: var(--shadow-gold);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #E8C84A 0%, #D4AF37 50%, #C9A227 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.35);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    backdrop-filter: blur(4px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
}

/* ============ Sections ============ */
.section {
    padding: 100px 0;
    position: relative;
}

.section-title {
    font-size: clamp(1.6rem, 1.05rem + 1.4vw, 2.2rem);
    font-weight: 900;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 1.1rem;
    letter-spacing: 0.12em;
    text-indent: 0.12em;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient-gold);
    border-radius: 2px;
    box-shadow: var(--shadow-gold);
}

/* 錨點導覽時預留固定 Header 高度，避免標題被 Header 遮住 */
section[id] {
    scroll-margin-top: calc(var(--header-height) + 12px);
}

/* ============ About ============ */
.about {
    background: var(--bg-primary);
    position: relative;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.about-text p {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    line-height: 1.8;
}

.about-features {
    list-style: none;
    margin-top: 1.5rem;
}

.about-features li {
    padding: 0.5rem 0;
    color: var(--primary-color);
    font-weight: 500;
}

.about-features li::before {
    content: '✓';
    color: var(--accent-color);
    font-weight: 900;
    margin-right: 8px;
}

.about-stats {
    display: grid;
    gap: 1.5rem;
}

.stat-item {
    background: var(--gradient-card);
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid var(--border-color);
    border-bottom: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-bottom-color: var(--accent-color);
    border-color: rgba(212, 175, 55, 0.3);
}

.stat-number {
    font-size: clamp(2.1rem, 1.6rem + 1.6vw, 2.5rem);
    font-weight: 900;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    letter-spacing: 0.04em;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
    font-variant-numeric: tabular-nums;
}

/* 跳表完成：金色微彈跳，強化數據「達成」的儀式感 */
.stat-number.count-done {
    animation: statPop 0.5s ease;
}

@keyframes statPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.12);
    }

    100% {
        transform: scale(1);
    }
}

.stat-label {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* ============ Services ============ */
.services {
    background: var(--bg-secondary);
    position: relative;
}

.services::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--gradient-card);
    padding: 2rem 1.75rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: center;
    border: 1px solid var(--border-color);
    border-bottom: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-bottom-color: var(--accent-color);
    border-color: rgba(212, 175, 55, 0.3);
}

.service-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 50%;
    color: var(--accent-color);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.3s ease, box-shadow 0.3s ease;
}

/* 線性 SVG 圖示（取代 emoji，金色品牌風格） */
.service-icon svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.service-card:hover .service-icon {
    transform: scale(1.12);
    background: rgba(212, 175, 55, 0.22);
    box-shadow: 0 0 26px rgba(212, 175, 55, 0.3);
}

.service-card h3 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.service-card p {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 0.95rem;
}

/* 微互動：hover 時描述淡出、職人引言升起（同區交錯切換，版面不跳動） */
.service-desc {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.service-quote {
    position: absolute;
    left: 1.75rem;
    right: 1.75rem;
    bottom: 1.9rem;
    margin: 0;
    color: var(--accent-color);
    font-size: 0.98rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

.service-card:hover .service-desc {
    opacity: 0;
    transform: translateY(-12px);
}

.service-card:hover .service-quote {
    opacity: 1;
    transform: translateY(0);
}

/* 服務卡觸控視覺乾淨化（移除瀏覽器預設觸控高亮） */
.service-card {
    -webkit-tap-highlight-color: transparent;
}

/* 複製卡片群（Clone Layout）預設隱藏，僅手機版跑馬燈時顯示 */
.service-card-clone {
    display: none;
}

/* 無縫跑馬燈動畫（全域定義，確保所有瀏覽器支援） */
@keyframes services-marquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* 施工案例跑馬燈動畫（全域定義） */
@keyframes portfolio-marquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* ============ Portfolio ============ */
.portfolio {
    background: var(--bg-primary);
    position: relative;
}

.portfolio::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(212, 175, 55, 0.3);
}

.portfolio-image {
    height: 300px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}

/* 沒有圖片案例的覆蓋層（深色漸層，確保文字清晰） */
.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(11, 15, 25, 0.98) 0%, rgba(11, 15, 25, 0.6) 60%, transparent 100%);
    color: white;
    padding: 2rem;
    z-index: 2;
    pointer-events: none;
}

.portfolio-overlay h3 {
    font-size: 1.15rem;
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.portfolio-overlay p {
    font-size: 0.85rem;
    opacity: 0.85;
    color: var(--secondary-color);
}

.portfolio-overlay .portfolio-desc {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    opacity: 0.8;
    white-space: pre-line;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portfolio-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-size: 1.125rem;
}

.portfolio-loading p {
    color: var(--text-light);
}

.portfolio-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.portfolio-empty .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ============ Portfolio Carousel ============ */
.portfolio-carousel {
    position: relative;
    height: 300px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    z-index: 1;
    border: 1px solid var(--border-color);
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease, transform 0.5s ease;
}

.carousel-slide .carousel-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.portfolio-image .carousel-placeholder {
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    z-index: 2;
}

.carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(11, 15, 25, 0.98) 0%, rgba(11, 15, 25, 0.6) 60%, transparent 100%);
    color: white;
    padding: 2rem;
    z-index: 5;
    pointer-events: none;
}

.carousel-overlay h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.carousel-overlay p {
    font-size: 0.875rem;
    opacity: 0.9;
    color: var(--secondary-color);
}

.carousel-overlay .portfolio-desc {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    opacity: 0.85;
    white-space: pre-line;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Carousel Nav */
.carousel-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    transform: translateY(-50%);
    z-index: 10;
    pointer-events: none;
}

.carousel-nav-btn {
    pointer-events: auto;
    background: rgba(11, 15, 25, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: var(--accent-color);
    font-size: 1.2rem;
    backdrop-filter: blur(4px);
}

.carousel-nav-btn:hover {
    background: var(--accent-color);
    color: var(--bg-primary);
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}

.carousel-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Carousel Dots */
.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    display: flex;
    gap: 8px;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
}

.carousel-dot {
    pointer-events: auto;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.carousel-dot.active {
    background: var(--accent-color);
    transform: scale(1.2);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

/* Carousel Counter */
.carousel-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(11, 15, 25, 0.7);
    color: var(--accent-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    z-index: 10;
    pointer-events: none;
    border: 1px solid rgba(212, 175, 55, 0.2);
    backdrop-filter: blur(4px);
}

/* 相片數量徽章（卡片左上角，多圖時顯示） */
.carousel-photos-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 11;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(11, 15, 25, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: #ffffff;
    font-size: 0.75rem;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

/* 查看完整案例提示（覆蓋層內，引導點擊） */
.carousel-view-hint {
    margin-top: 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent-color);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: transform 0.3s ease, text-shadow 0.3s ease;
}

.portfolio-item:hover .carousel-view-hint {
    transform: translateX(4px);
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
}

/* ============ Contact ============ */
.contact {
    background: var(--bg-secondary);
    position: relative;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
}

.contact-info h3 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.info-item:hover {
    background: var(--bg-hover);
    box-shadow: var(--shadow);
    transform: translateX(5px);
    border-color: rgba(212, 175, 55, 0.3);
}

.info-icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 50%;
    font-size: 1.3rem;
    box-shadow: var(--shadow);
}

.info-item h4 {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: var(--text-light);
    font-weight: 600;
    letter-spacing: 0.08em;
}

.info-item p {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 700;
}

.contact-form {
    background: var(--gradient-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    position: relative;
}

.contact-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.4), transparent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.contact-form h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-align: center;
    position: relative;
    padding-bottom: 0.75rem;
}

.contact-form h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--gradient-gold);
    border-radius: 2px;
}

.contact-form .form-hint {
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-light);
    margin-top: -0.75rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    color: var(--primary-color);
    background: var(--bg-primary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23D4AF37' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-group select option {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
    background: var(--bg-secondary);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 1.5rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

/* ============ 自訂下拉選單（工程需求） ============ */
.custom-select {
    position: relative;
}

.custom-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    color: var(--primary-color);
    background: var(--bg-primary);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.custom-select-trigger:hover {
    border-color: var(--border-light);
}

.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus-visible {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
    background: var(--bg-secondary);
}

.custom-select-value.is-placeholder {
    color: var(--text-muted);
}

.custom-select-arrow {
    flex-shrink: 0;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid var(--accent-color);
    transition: transform 0.25s ease;
}

.custom-select.open .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    list-style: none;
    margin: 0;
    padding: 0.375rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 280px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.custom-select.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select-option {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s ease;
}

.custom-select-option:hover,
.custom-select-option.selected {
    background: rgba(212, 175, 55, 0.12);
}

.custom-select-option .option-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
}

.custom-select-option.selected .option-label {
    color: var(--accent-color);
}

.custom-select-option .option-desc {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-muted);
}

/* 聯絡表單單欄置中（聯絡資訊已移至頁腳，轉換動線更聚焦） */
.contact-content--solo {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin: 0 auto;
}

/* ============ FAQ 手風琴 ============ */
.faq-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 0.95rem;
    max-width: 640px;
    margin: -0.5rem auto 2.5rem;
    line-height: 1.7;
}

.faq-list {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.faq-item {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.faq-item:hover {
    border-color: var(--border-light);
}

.faq-item.open {
    border-color: rgba(212, 175, 55, 0.45);
    box-shadow: var(--shadow-gold);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1.1rem 1.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: var(--primary-color);
}

.faq-num {
    flex-shrink: 0;
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: 0.05em;
}

.faq-question-text {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
}

.faq-icon {
    flex-shrink: 0;
    position: relative;
    width: 22px;
    height: 22px;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    transition: transform 0.35s ease, border-color 0.35s ease;
}

.faq-icon::before,
.faq-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 1.5px;
    background: var(--accent-color);
    transform: translate(-50%, -50%);
    transition: transform 0.35s ease;
}

.faq-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

/* 展開時：＋ 旋轉為 × */
.faq-item.open .faq-icon {
    transform: rotate(135deg);
    border-color: var(--accent-color);
}

/* 答案區：grid-rows 平滑展開動畫 */
.faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.faq-answer-inner {
    overflow: hidden;
    min-height: 0;
    visibility: hidden;
    transition: visibility 0.35s;
}

.faq-item.open .faq-answer {
    grid-template-rows: 1fr;
}

.faq-item.open .faq-answer-inner {
    visibility: visible;
}

.faq-answer-text {
    padding: 0 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--secondary-color);
}

.faq-answer-text:first-child {
    padding-top: 0.25rem;
}

.faq-answer-text:last-child {
    margin-bottom: 1.25rem;
}

.faq-answer-text strong {
    color: var(--accent-color);
    font-weight: 600;
}

/* 服務地區標籤 */
.faq-areas {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1.25rem;
    margin-bottom: 1.25rem;
}

.faq-areas li {
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-color);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 999px;
}

/* FAQ 底部 CTA */
.faq-cta {
    max-width: 760px;
    margin: 2.5rem auto 0;
    padding: 2rem 1.5rem;
    text-align: center;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.faq-cta-text {
    font-size: 1.05rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.faq-cta-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.875rem;
}

@media (max-width: 768px) {
    .faq-question {
        padding: 1rem;
        gap: 0.75rem;
    }

    .faq-question-text {
        font-size: 0.95rem;
    }

    .faq-answer-text {
        padding: 0 1rem;
    }

    .faq-answer-text:first-child {
        padding-top: 0.25rem;
    }

    .faq-answer-text:last-child,
    .faq-areas {
        margin-bottom: 1.1rem;
    }

    .faq-areas {
        padding: 0 1rem;
    }

    .faq-cta {
        padding: 1.5rem 1.25rem;
    }

    .faq-cta-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============ Portfolio Lightbox ============ */
.portfolio-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.portfolio-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 8, 15, 0.95);
    backdrop-filter: blur(8px);
}

.lightbox-container {
    position: relative;
    width: min(960px, 92vw);
    height: min(86vh, 840px);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    z-index: 1;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* 圖片預覽區：縮放顯示，點擊可開啟放大預覽 */
.lightbox-main {
    flex: 0 0 auto;
    height: 40%;
    min-height: 180px;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-primary);
    cursor: zoom-in;
    touch-action: pan-y;
}

.lightbox-main .lightbox-img {
    transition: transform 0.35s ease;
}

.lightbox-main:hover .lightbox-img {
    transform: scale(1.04);
}

.lightbox-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.85);
}

/* 點擊圖片可放大預覽提示 */
.lightbox-zoom-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(11, 15, 25, 0.78);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--accent-color);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 3;
    backdrop-filter: blur(4px);
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 案例資訊：自動填滿剩餘空間，內容過長時可捲動，確保描述完整可讀 */
.lightbox-info {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1.5rem 1.75rem;
    color: #ffffff;
}

/* 案例描述保留後台輸入的換行排版（與 textarea 顯示行為一致） */
.lightbox-desc {
    white-space: pre-line;
}

.lightbox-info h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.lightbox-info p {
    color: var(--secondary-color);
    font-size: 1rem;
    line-height: 1.75;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(11, 15, 25, 0.7);
    color: var(--accent-color);
    border: 1px solid rgba(212, 175, 55, 0.3);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.lightbox-close:hover {
    background: var(--accent-color);
    color: var(--bg-primary);
    transform: scale(1.1);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(11, 15, 25, 0.7);
    color: var(--accent-color);
    border: 1px solid rgba(212, 175, 55, 0.3);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--accent-color);
    color: var(--bg-primary);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 15px;
}

.lightbox-next {
    right: 15px;
}

.lightbox-prev:disabled,
.lightbox-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%);
}

.lightbox-thumbs {
    display: flex;
    gap: 8px;
    padding: 1rem 1.5rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.lightbox-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    flex-shrink: 0;
    border: 2px solid transparent;
}

.lightbox-thumb:hover,
.lightbox-thumb.active {
    opacity: 1;
    border: 2px solid var(--accent-color);
}

/* ============ 案例切換列（上一則 / 下一則案例） ============ */
.lightbox-case-nav {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0.9rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.lightbox-case-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 20px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-case-btn:hover:not(:disabled) {
    background: var(--accent-color);
    color: var(--bg-primary);
    box-shadow: var(--shadow-gold);
}

.lightbox-case-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.lightbox-case-counter {
    color: var(--text-light);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* ============ 圖片放大預覽（點擊圖片開啟） ============ */
.lightbox-zoom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox-zoom.active {
    opacity: 1;
    visibility: visible;
}

.zoom-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 8, 15, 0.96);
    backdrop-filter: blur(6px);
}

.zoom-img {
    position: relative;
    z-index: 1;
    max-width: 92vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.zoom-counter {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    padding: 5px 16px;
    border-radius: 20px;
    background: rgba(11, 15, 25, 0.75);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: var(--accent-color);
    font-size: 0.85rem;
    letter-spacing: 1px;
    pointer-events: none;
}

.contact-form .btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.05rem;
}

/* ============ Footer ============ */
.footer {
    background: #070A12;
    color: var(--secondary-color);
    padding: 4rem 0 1.5rem;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
}

/* 公司資訊（行內式排版，參考傳統企業頁腳格式） */
.footer-main {
    margin-bottom: 1.75rem;
}

.footer-brand {
    display: inline-block;
    font-size: 1.35rem;
    font-weight: 900;
    margin-bottom: 0.9rem;
    background: linear-gradient(135deg, #E8EAF0 0%, #D4AF37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-meta {
    list-style: none;
}

.footer-meta li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    padding: 0.3rem 0;
    font-size: 0.95rem;
    line-height: 1.75;
}

.meta-label {
    color: var(--text-light);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.meta-value {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

a.meta-value:hover {
    color: var(--accent-color);
}

.meta-note {
    color: var(--text-light);
    font-size: 0.85rem;
}

.meta-divider {
    color: var(--text-muted);
    margin: 0 10px;
    user-select: none;
}

/* 金色分隔線 */
.footer-divider {
    height: 1px;
    border: none;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.3) 0%, rgba(255, 255, 255, 0.08) 55%, transparent 100%);
    margin-bottom: 1.4rem;
}

/* 快速連結 / 營業時間（項目符號行內式） */
.footer-nav,
.footer-hours {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    padding: 0.3rem 0;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.75;
}

.footer-nav::before,
.footer-hours::before {
    content: '•';
    color: var(--accent-color);
    font-weight: 900;
    margin-right: 8px;
}

.footer-nav a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: var(--accent-color);
}

.footer-hours {
    color: var(--primary-color);
    font-weight: 600;
}

/* 版權 + 瀏覽人數 */
.footer-legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-legal .footer-copy {
    margin: 0;
}

.footer-bottom {
    font-size: 0.92rem;
    color: var(--secondary-color);
}

/* ============ Visitor Counter（瀏覽人數） ============ */
.footer-legal .visitor-count {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
}

.footer-legal .visitor-icon {
    font-size: 1.05em;
    line-height: 1;
}

.footer-legal .visitor-number {
    color: var(--accent-color);
    font-weight: 700;
    letter-spacing: 0.06em;
    min-width: 3ch;
    text-align: left;
    transition: opacity 0.3s ease;
}

/* ============ Floating Action Buttons（聯繫轉換按鈕） ============ */
.float-actions {
    position: fixed;
    right: 20px;
    bottom: max(30px, calc(env(safe-area-inset-bottom, 0px) + 20px));
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    z-index: 999;
}

.float-btn {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #ffffff;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    -webkit-tap-highlight-color: transparent;
}

.float-btn svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.float-btn:hover {
    transform: translateY(-4px) scale(1.05);
    filter: brightness(1.08);
}

/* 電話（主要聯繫管道）：品牌金色 + 脈動光暈動畫，全站最醒目 */
.float-call {
    background: var(--gradient-gold);
    color: #14100A;
    font-weight: 900;
    animation: float-pulse 2.2s ease-out infinite;
}

@keyframes float-pulse {
    0% {
        box-shadow: 0 6px 22px rgba(212, 175, 55, 0.5), 0 0 0 0 rgba(212, 175, 55, 0.55);
    }

    70% {
        box-shadow: 0 6px 26px rgba(212, 175, 55, 0.6), 0 0 0 14px rgba(212, 175, 55, 0);
    }

    100% {
        box-shadow: 0 6px 22px rgba(212, 175, 55, 0.5), 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

/* LINE（輔助聯繫管道）：白底襯托品牌綠 logo，清晰醒目 */
.float-line {
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(6, 199, 85, 0.35);
}

.float-line:hover {
    background: #EAFBF0;
}

/* LINE 品牌圖片 */
.float-btn img {
    width: 30px;
    height: 30px;
    display: block;
}

/* 回首頁：低調深色膠囊，不搶主要聯繫按鈕的視覺焦點 */
.float-home {
    background: rgba(26, 34, 51, 0.92);
    color: var(--accent-color);
    border: 1px solid rgba(212, 175, 55, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ============ Back to Top ============ */
.back-to-top {
    width: 56px;
    height: 56px;
    background: var(--gradient-gold);
    color: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 900;
    box-shadow: var(--shadow-gold);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    border: none;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    background: linear-gradient(135deg, #E8C84A 0%, #D4AF37 50%, #C9A227 100%);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.4);
}

/* ============ Notification ============ */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 500;
    z-index: 9999;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.notification.success {
    background: rgba(46, 204, 113, 0.9);
}

.notification.error {
    background: rgba(231, 76, 60, 0.9);
}

/* Form Success Message */
.form-success {
    display: none;
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    text-align: center;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.form-success.show {
    display: block;
    animation: fadeInUp 0.5s ease;
}

/* Loading State */
.btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--bg-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }

    .section {
        padding: 80px 0;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: rgba(11, 15, 25, 0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0;
        padding: 40px 24px;
        box-shadow: var(--shadow-lg);
        transition: left 0.3s ease;
        overflow-y: auto;
        border-top: 1px solid rgba(212, 175, 55, 0.1);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin-bottom: 5px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-link {
        font-size: 1.2rem;
        display: block;
        padding: 16px 0;
        color: var(--secondary-color);
    }

    .nav-link:hover {
        color: var(--accent-color);
    }

    .nav-toggle {
        display: flex;
    }

    .hero {
        min-height: 80vh;
    }

    /* 標題字級已由 clamp() 流式縮放，行動裝置不需覆寫 */

    .section {
        padding: 60px 0;
    }

    /* 頁面第一個內容區塊需讓出固定 Header 高度（手機版 Header 80px > 原 padding 60px，會遮住 h2 標題） */
    body>.section:first-of-type {
        padding-top: calc(var(--header-height) + 28px);
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    /* 手機模式：服務項目改為純 CSS 無縫跑馬燈（自動無限循環） */
    .services {
        overflow: hidden;
    }

    .services-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        width: max-content;
        gap: 1rem;
        padding: 0.25rem 0 1rem;
        animation: services-marquee 30s linear infinite;
        -webkit-animation: services-marquee 30s linear infinite;
        will-change: transform;
    }

    /* 強制覆蓋行內樣式，防止卡片隱形或位移破版 */
    .service-card {
        width: 78vw;
        max-width: 320px;
        flex-shrink: 0;
        opacity: 1 !important;
        transform: none !important;
        display: block;
        overflow: visible;
        height: auto;
        min-height: 0;
    }

    /* 複製卡片群（Clone Layout）在手機版顯示，用於無縫接軌 */
    .service-card-clone {
        display: block;
    }

    /* 減少動畫偏好時，跑馬燈降速但不停止（避免功能失效） */
    @media (prefers-reduced-motion: reduce) {
        .services-grid {
            animation-duration: 45s !important;
            animation-iteration-count: infinite !important;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
            -ms-overflow-style: none;
        }

        .services-grid::-webkit-scrollbar {
            display: none;
        }

        .service-card {
            scroll-snap-align: center;
        }
    }

    /* 手機模式：案例改為純 CSS 自動跑馬燈（隱藏滑動條） */
    .portfolio {
        overflow: hidden;
    }

    .portfolio-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        width: max-content;
        gap: 1rem;
        padding: 0.25rem 0 1rem;
        animation: portfolio-marquee 40s linear infinite;
        -webkit-animation: portfolio-marquee 40s linear infinite;
        will-change: transform;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .portfolio-grid::-webkit-scrollbar {
        display: none;
    }

    .portfolio-item {
        width: 85vw;
        max-width: 400px;
        flex-shrink: 0;
    }

    .portfolio-item:hover {
        transform: none;
        box-shadow: var(--shadow);
    }

    /* 查看全部案例按鈕 */
    .portfolio-view-all {
        text-align: center;
        margin-top: 2rem;
    }

    .portfolio-view-all .btn {
        min-width: 200px;
    }

    /* 行動裝置：放大聯繫按鈕（符合 48px 觸控目標），支援 iPhone 底部安全區域 */
    .float-actions {
        right: 14px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        gap: 10px;
    }

    .float-btn {
        width: 60px;
        height: 60px;
    }

    .float-btn svg {
        width: 26px;
        height: 26px;
    }

    .float-btn img {
        width: 32px;
        height: 32px;
    }

    .back-to-top {
        width: 60px;
        height: 60px;
        font-size: 1.25rem;
    }

    .notification {
        top: 90px;
        right: 15px;
        left: 15px;
        max-width: none;
        padding: 0.875rem 1.5rem;
    }

    .lightbox-container {
        width: 96vw;
        height: 92vh;
        border-radius: var(--radius-md);
    }

    .lightbox-main {
        height: 34%;
        min-height: 150px;
    }

    .lightbox-info {
        padding: 1.1rem 1.1rem;
    }

    .lightbox-info h3 {
        font-size: 1.2rem;
    }

    .lightbox-info p {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .lightbox-case-nav {
        padding: 0.7rem 1rem;
    }

    .lightbox-case-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .lightbox-zoom-hint {
        font-size: 0.72rem;
        padding: 5px 12px;
    }

    .zoom-img {
        max-width: 96vw;
        max-height: 76vh;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-thumbs {
        padding: 0.75rem 1rem;
    }

    .lightbox-thumb {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero {
        min-height: 70vh;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
        gap: 12px;
    }

    .hero-actions .btn-primary,
    .hero-actions .btn-outline {
        font-size: 1.05rem;
        padding: 15px 28px;
    }

    .btn {
        width: 100%;
        text-align: center;
        padding: 14px 24px;
    }

    .logo-text p {
        display: none;
    }

    .logo-text h1 {
        font-size: 1.25rem;
    }

    .logo-img {
        width: 40px;
        height: 40px;
    }

    .section {
        padding: 50px 0;
    }

    .section-title {
        margin-bottom: 2rem;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .stat-item {
        padding: 1.25rem 0.5rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .service-card {
        padding: 1.5rem 1.25rem;
    }

    /* 手機版跑馬燈卡片寬度調整 */
    .services-grid .service-card {
        width: 80vw;
        max-width: 300px;
    }

    .contact-form {
        padding: 1.75rem 1.25rem;
    }

    /* 手機版：欄位放寬加高，好點擊的垂直單欄排列 */
    .form-group input,
    .form-group select,
    .custom-select-trigger {
        padding: 0.9rem 1rem;
        min-height: 48px;
        font-size: 1rem;
    }

    .custom-select-option {
        padding: 0.85rem 0.9rem;
    }

    .contact-form button[type="submit"] {
        width: 100%;
        padding: 0.95rem 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 0;
    }

    .form-row .form-group {
        margin-bottom: 1.5rem;
    }

    .form-row .form-group:last-child {
        margin-bottom: 0;
    }

    .portfolio-image {
        height: 240px;
    }

    .portfolio-carousel {
        height: 240px;
    }

    .carousel-nav-btn {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .carousel-dot {
        width: 10px;
        height: 10px;
    }

    .footer {
        padding: 3rem 0 1.25rem;
    }

    .footer-brand {
        font-size: 1.2rem;
    }

    .float-actions {
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .float-btn {
        width: 58px;
        height: 58px;
    }

    .back-to-top {
        width: 54px;
        height: 54px;
        font-size: 1.2rem;
    }
}

/* 導覽錨點偏移修正 */
section[id] {
    scroll-margin-top: calc(var(--header-height) + 10px);
}

/* ============ 額外質感細節 ============ */

/* 卡片微光暈效果 */
.service-card,
.stat-item,
.contact-form,
.portfolio-item {
    position: relative;
}

/* 區塊分隔線 */
.section+.section {
    border-top: 1px solid rgba(212, 175, 55, 0.05);
}

/* 減少動畫偏好（排除跑馬燈動畫） */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* 排除跑馬燈動畫不受 prefers-reduced-motion 影響 */
    .services-grid,
    .portfolio-grid {
        animation-duration: 30s !important;
        animation-iteration-count: infinite !important;
    }
}

/* 觸控裝置優化 */
@media (hover: none) {

    .service-card:hover,
    .stat-item:hover,
    .portfolio-item:hover,
    .info-item:hover {
        transform: none;
    }

    /* 觸控裝置：預設顯示描述；按住卡片（:active）浮起並顯示職人引言 */
    .service-card:hover .service-desc {
        opacity: 1;
        transform: none;
    }

    .service-card:not(.service-card-clone):active {
        transform: translateY(-8px) scale(0.985);
        box-shadow: var(--shadow-lg);
        border-bottom-color: var(--accent-color);
        border-color: rgba(212, 175, 55, 0.3);
    }

    .service-card:not(.service-card-clone):active .service-desc {
        opacity: 0;
        transform: translateY(-12px);
    }

    .service-card:not(.service-card-clone):active .service-quote {
        opacity: 1;
        transform: translateY(0);
    }
}