/* 基礎設置 */
:root {
    --primary-color: #e60012;
    --secondary-color: #ffcc00;
    --accent-color: #f49b20;
    --dark-color: #333;
    --light-color: #f4f4f4;
    --success-color: #5cb85c;
    --danger-color: #d9534f;
    --max-width: 1200px;
    --gradient-primary: linear-gradient(135deg, #e60012, #ff4b4b);
    --gradient-secondary: linear-gradient(135deg, #ffcc00, #ffd740);
    --gradient-dark: linear-gradient(135deg, #222, #444);
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --box-shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.2);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans HK', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background: #fff;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--dark-color);
    transition: 0.3s;
}

ul {
    list-style: none;
}

img {
    width: 100%;
    height: auto;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* 加載動畫 */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: 0.6s;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 8px solid rgba(230, 0, 18, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    position: relative;
}

.spinner::before,
.spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    animation: pulse 2s ease-out infinite;
}

.spinner::before {
    width: 100%;
    height: 100%;
    background: rgba(230, 0, 18, 0.05);
}

.spinner::after {
    width: 70%;
    height: 70%;
    background: rgba(230, 0, 18, 0.1);
    animation-delay: 0.3s;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* 按鈕樣式 */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    cursor: pointer;
    border-radius: 50px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    z-index: 1;
    letter-spacing: 1px;
}

.btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    z-index: -1;
}

.btn:hover::before {
    width: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 5px 15px rgba(230, 0, 18, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(230, 0, 18, 0.4);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-submit {
    background: var(--gradient-primary);
    color: #fff;
    width: 100%;
    padding: 15px;
    border-radius: 5px;
    font-size: 18px;
    box-shadow: 0 5px 15px rgba(230, 0, 18, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(45deg);
    animation: buttonShine 3s infinite;
}

@keyframes buttonShine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.btn-submit:hover {
    background: #d10010;
}

.btn-view {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    padding: 6px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(230, 0, 18, 0.25);
    position: relative;
    overflow: hidden;
    align-self: center;
    margin-top: 2px;
    margin-bottom: 3px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;

}

.btn-view::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(45deg);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-view:hover {
    background: #d35400;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(211, 84, 0, 0.3);
}

.btn-view:hover::before {
    opacity: 1;
    animation: btnShine 1s forwards;
}

@keyframes btnShine {
    0% {
        transform: translate(-100%, -100%) rotate(45deg);
    }
    100% {
        transform: translate(100%, 100%) rotate(45deg);
    }
}

.product-card:hover .product-info h3 {
    color: var(--primary-color);
}

/* 產品卡片前面添加標籤裝飾 */
.product-front::before {
    content: '精选';
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--primary-color);
    color: white;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 4px;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* 添加原產地標記 */
.product-image::before {
    content: '进口';
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: rgba(0,0,0,0.6);
    color: white;
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 3px;
    z-index: 5;
}

.btn-back {
    background: #f1f1f1;
    color: #333;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    display: inline-block;
    font-size: 14px;
    z-index: 10;
    position: relative;
}

.btn-back:hover {
    background: #d10010;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* 頭部導航 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 100;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header.scrolled {
    padding: 10px 0;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 28px;
    color: var(--primary-color);
    margin: 0;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.main-nav ul {
    display: flex;
}

.main-nav ul li {
    margin: 0 15px;
}

.main-nav ul li a {
    font-size: 16px;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

.main-nav ul li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: 0.3s;
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
    color: var(--primary-color);
}

.main-nav ul li a:hover::after,
.main-nav ul li a.active::after {
    width: 100%;
}

.mobile-menu-btn {
    font-size: 24px;
    cursor: pointer;
    display: none;
}

/* 英雄橫幅區 */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: #000;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    background-color: #000;
}

.hero-video video {
    position: absolute;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.7), rgba(0,0,0,0.5));
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.3));
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h2 {
    font-size: 56px;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    letter-spacing: 1px;
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from {
        text-shadow: 0 0 10px rgba(255,255,255,0.8);
    }
    to {
        text-shadow: 0 0 20px rgba(255,255,255,0.4);
    }
}

.hero-content p {
    font-size: 24px;
    margin-bottom: 30px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* 通用部分樣式 */
.section-padding {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 40px;
    margin-bottom: 20px;
    color: var(--dark-color);
    font-weight: 700;
}

.section-header p {
    font-size: 18px;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

.divider {
    height: 3px;
    width: 80px;
    background: var(--primary-color);
    margin: 0 auto 30px;
}

/* 關於我們區 */
.about-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.8;
}

.about-image {
    flex: 1;
}

.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(230, 0, 18, 0.2);
    opacity: 0;
    transition: 0.3s;
    z-index: 1;
}

.image-container:hover::before {
    opacity: 1;
}

/* 產品展示區 */
.products {
    background: #f9f9f9;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.product-card {
    position: relative;
    width: 100%;
    height: 520px;
    margin-bottom: 40px;
    perspective: 1500px;
    cursor: pointer;
    transition: transform 0.4s ease-out, box-shadow 0.4s ease-out;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.product-card.hovered {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.product-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-radius: 15px;
}

.product-card.flipped .product-card-inner {
    transform: rotateY(180deg);
}

.product-front, .product-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    overflow: hidden;
    border-radius: 15px;
}

.product-front {
    background-color: #ffffff;
    color: #333;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.product-back {
    background-color: #ffffff;
    color: #333;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 20px;
}

.product-card:not(.flipped):hover .product-img img {
    transform: scale(1.08);
}

.product-img {
    height: 300px;
    overflow: hidden;
    position: relative;
    border-radius: 15px 15px 0 0;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease-out;
}

.product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
}

.product-price {
    font-weight: 700;
    color: #e67e22;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.product-details {
    overflow-y: auto;
    max-height: 320px;
    padding-right: 8px;
    margin-bottom: 15px;
    text-align: left;
    scrollbar-width: thin;
    scrollbar-color: rgba(230, 126, 34, 0.5) transparent;
}

.product-details::-webkit-scrollbar {
    width: 6px;
}

.product-details::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.product-details::-webkit-scrollbar-thumb {
    background-color: rgba(230, 126, 34, 0.5);
    border-radius: 3px;
}

.product-details h4 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.product-details p {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #555;
}

.specs-list {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    text-align: left;
}

.specs-list li {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.specs-list li:before {
    content: "•";
    color: #e67e22;
    font-weight: bold;
    margin-right: 10px;
    font-size: 1.2em;
}

.btn-view, .btn-back {
    display: inline-block;
    padding: 10px 20px;
    background-color: #e67e22;
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    outline: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

.btn-view:hover, .btn-back:hover {
    background-color: #d35400;
    box-shadow: 0 5px 15px rgba(211, 84, 0, 0.3);
}

/* 按鈕漣漪效果 */
.ripple {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 響應式調整 */
@media (max-width: 768px) {
    .product-card {
        height: 420px;
    }

    .product-img {
        height: 250px;
    }

    .product-details {
        max-height: 280px;
    }
}

/* 產品標籤 */
.product-tag {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.tag-new {
    background: var(--gradient-primary);
}

.tag-hot {
    background: linear-gradient(135deg, #ff6b08, #ffbb00);
}

.tag-sale {
    background: linear-gradient(135deg, #8e43e7, #b347e8);
}

/* 產品評分 */
.product-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 3px;
    margin-bottom: 5px;
}

.rating-stars {
    color: #ffc107;
    font-size: 0.8rem;
    margin-right: 5px;
}

.rating-count {
    font-size: 0.75rem;
    color: #777;
    font-weight: 500;
}

/* 促銷計時器 */
.product-timer {
    position: absolute;
    top: 230px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 3px 5px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--primary-color);
    z-index: 5;
    border-top: 1px dashed rgba(230, 0, 18, 0.3);
    border-bottom: 1px dashed rgba(230, 0, 18, 0.3);
}

.timer-title {
    color: #333;
    font-weight: 600;
    font-size: 0.7rem;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.timer-countdown {
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* 產品圖示 */
.product-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
    margin-bottom: 3px;
}

.product-icon {
    color: #777;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.03);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.product-icon:hover {
    color: var(--primary-color);
    background: rgba(230, 0, 18, 0.1);
    transform: translateY(-2px);
}

/* 產品規格選擇 */
.product-sizes {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.size-option {
    font-size: 0.7rem;
    padding: 3px 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.size-option:hover, .size-option.active {
    border-color: var(--primary-color);
    background: rgba(230, 0, 18, 0.08);
    color: var(--primary-color);
}

/* 產品價格顯示 */
.product-price {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 3px;
    margin-bottom: 5px;
}

.price-current {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 8px;
}

.price-original {
    font-size: 0.85rem;
    color: #999;
    text-decoration: line-through;
}

.price-discount {
    background: rgba(230, 0, 18, 0.1);
    color: var(--primary-color);
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 10px 10px;
    margin-top: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.product-info h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: #333;
    transition: color 0.3s ease;
    text-align: center;
    position: relative;
    padding-bottom: 5px;
    font-weight: 600;
}

.product-info h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: var(--primary-color);
}

.product-info p {
    color: #666;
    margin-bottom: 8px;
    line-height: 1.3;
    text-align: center;
    font-size: 0.85rem;
}

/* 讓初始顯示的產品標題也可見 */
.product-back .details-content h4 {
    opacity: 1 !important;
    visibility: visible !important;
}

/* 隱藏動畫類不應該影響標題的可見性 */
.product-back.animated .details-content h4 {
    opacity: 1 !important;
    animation: slideInDown 0.5s forwards;
    visibility: visible !important;
    display: block !important;
}

.details-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    justify-content: flex-start;
    padding: 0;
    gap: 5px;
    padding-bottom: 50px;
}

.details-content h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--primary-color);
    border-bottom: 2px dashed rgba(230, 0, 18, 0.2);
    padding-bottom: 8px;
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 10;
    padding-top: 5px;
    margin-top: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    font-weight: 600;
    text-align: center;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.details-content ul {
    list-style: none;
    padding: 0;
    margin: 3px 0;
}

.details-content ul li {
    margin-bottom: 4px;
    color: #555;
    position: relative;
    padding-left: 16px;
    transition: transform 0.3s ease;
    font-size: 0.9rem;
    line-height: 1.4;
}

.details-content ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.product-specs {
    margin-top: 3px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(248, 249, 250, 0.5);
    border-top: 1px solid #eee;
}

.product-specs p {
    margin-bottom: 3px;
    color: #666;
    position: relative;
    padding-left: 16px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.product-specs p::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-size: 0.8rem;
}

.product-story {
    margin-top: 3px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(230, 0, 18, 0.03);
    border-left: 2px solid var(--primary-color);
    margin-bottom: 15px;
}

.product-story h5 {
    font-size: 0.95rem;
    margin-bottom: 5px;
    color: var(--primary-color);
    font-weight: 600;
}

.product-story p {
    font-size: 0.8rem;
    line-height: 1.4;
    color: #555;
    margin-bottom: 0;
}

.product-back.animated .product-story {
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInUp 0.6s 0.5s forwards;
}

.product-back.animated .details-content h4 {
    opacity: 0;
    animation: slideInDown 0.5s forwards;
}

.product-back.animated .details-content ul li {
    opacity: 0;
    transform: translateX(-20px);
    animation: fadeInRight 0.5s forwards;
}

.product-back.animated .details-content ul li:nth-child(1) { animation-delay: 0.1s; }
.product-back.animated .details-content ul li:nth-child(2) { animation-delay: 0.2s; }
.product-back.animated .details-content ul li:nth-child(3) { animation-delay: 0.3s; }
.product-back.animated .details-content ul li:nth-child(4) { animation-delay: 0.4s; }

.product-back.animated .product-specs {
    opacity: 0;
    animation: fadeIn 0.5s 0.4s forwards;
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInRight {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.btn-back {
    margin-top: 5px;
    align-self: center;
    padding: 6px 15px;
    font-size: 13px;
    position: fixed;
    bottom: 15px;
    width: 80px;
    text-align: center;
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 20;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 20px;
}

.btn-back:hover {
    background: #d10010;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .product-card {
        height: 540px;
    }

    .product-back {
        padding: 12px;
        max-height: 540px;
    }

    .details-content {
        padding-bottom: 60px;
    }

    .details-content h4 {
        font-size: 1rem;
        margin-bottom: 5px;
        padding-bottom: 3px;
    }

    .details-content ul li {
        margin-bottom: 3px;
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .product-specs p {
        font-size: 0.75rem;
        margin-bottom: 2px;
        line-height: 1.3;
    }

    .product-story {
        padding: 6px;
        margin-bottom: 10px;
    }

    .product-story h5 {
        font-size: 0.9rem;
        margin-bottom: 3px;
    }

    .product-story p {
        font-size: 0.75rem;
        line-height: 1.3;
    }

    .btn-back {
        padding: 5px 12px;
        font-size: 12px;
        bottom: 10px;
    }
}

@media (max-width: 480px) {
    .product-card {
        height: 520px;
    }

    .product-back {
        padding: 10px;
        max-height: 520px;
    }

    .details-content h4 {
        font-size: 0.95rem;
    }

    .details-content ul li {
        font-size: 0.75rem;
        padding-left: 12px;
    }

    .details-content ul li::before {
        font-size: 0.9rem;
    }

    .product-specs p {
        font-size: 0.7rem;
        padding-left: 12px;
    }

    .product-specs p::before {
        font-size: 0.7rem;
    }

    .product-story p {
        font-size: 0.7rem;
    }
}

/* 翻轉動畫效果加強 */
@keyframes flipIn {
    from {
        opacity: 0;
        transform: rotateY(180deg) translateZ(-50px);
    }
    to {
        opacity: 1;
        transform: rotateY(180deg) translateZ(0);
    }
}

.product-card.flipped .product-card-inner {
    animation: cardGlow 2s infinite alternate;
}

@keyframes cardGlow {
    from {
        box-shadow: 0 0 10px rgba(230, 0, 18, 0.2);
    }
    to {
        box-shadow: 0 0 20px rgba(230, 0, 18, 0.4);
    }
}

/* 調整滾動條樣式 */
.product-back::-webkit-scrollbar {
    width: 4px;
}

.product-back::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.product-back::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.product-back::-webkit-scrollbar-thumb:hover {
    background: #d10010;
}

/* 服務範圍區塊 */
.services {
    background: #fff;
}

.services-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.service-box {
    background: #fff;
    padding: 40px 20px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.service-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-primary);
    z-index: -1;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.service-box:hover::before {
    height: 100%;
    opacity: 0.05;
}

.service-box .icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: var(--light-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--primary-color);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.service-box:hover .icon {
    background: var(--primary-color);
    color: #fff;
    transform: rotateY(360deg);
}

.service-box h3 {
    font-size: 22px;
    margin-bottom: 15px;
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
}

.service-box h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}

.service-box p {
    color: #666;
    margin-bottom: 0;
    line-height: 1.6;
}

/* 視差滾動區塊 */
.parallax {
    height: 350px;
    background: url('../images/parallax-bg.jpg') no-repeat fixed center center/cover;
    position: relative;
    display: flex;
    align-items: center;
    color: #fff;
    text-align: center;
    margin: 80px 0;
}

.parallax::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(230,0,18,0.8), rgba(0,0,0,0.7));
    z-index: 1;
}

.parallax .container {
    position: relative;
    z-index: 2;
}

.parallax-content h2 {
    font-size: 42px;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.parallax-content p {
    font-size: 22px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* 客戶評價區塊 */
.testimonials {
    background: #f9f9f9;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.testimonial-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.testimonial-content {
    padding: 30px;
    position: relative;
}

.quote-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    color: rgba(230, 0, 18, 0.1);
    font-size: 30px;
}

.testimonial-content p {
    margin-bottom: 20px;
    color: #555;
    font-style: italic;
    line-height: 1.6;
    position: relative;
    padding-right: 20px;
}

.rating {
    color: #ffc107;
    margin-bottom: 15px;
}

.testimonial-author {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 15px 30px;
    border-top: 1px solid #eee;
}

.author-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--dark-color);
}

.author-info p {
    margin: 0;
    font-size: 14px;
    color: #777;
}

.author-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

/* 聯絡我們區塊 */
.contact {
    background: #fff;
}

.contact-content {
    display: flex;
    gap: 50px;
    flex-wrap: wrap;
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

.info-item {
    display: flex;
    margin-bottom: 30px;
    align-items: flex-start;
}

.info-item i {
    width: 50px;
    height: 50px;
    background: var(--light-color);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 20px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.info-item:hover i {
    background: var(--primary-color);
    color: #fff;
    transform: rotateY(360deg);
}

.info-item h3 {
    font-size: 20px;
    margin: 0 0 5px;
    font-weight: 600;
}

.info-item p {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

.contact-form {
    flex: 1;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05);
    min-width: 300px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    color: var(--dark-color);
    transition: all 0.3s ease;
    font-family: 'Noto Sans HK', sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(230, 0, 18, 0.3);
    outline: none;
}

.form-group textarea {
    height: 150px;
    resize: none;
}

/* 頁腳樣式 */
.footer {
    background: #222;
    color: #fff;
    padding: 70px 0 0;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 50px;
}

.footer-main {
    flex: 2;
    min-width: 300px;
}

.footer-logo {
    margin-bottom: 20px;
}

.footer-logo img {
    max-width: 110px;
    height: auto;
}
.logo img{
    max-width: 60px;
    height: auto;
}

.footer-description {
    color: #aaa;
    margin-bottom: 20px;
    line-height: 1.6;
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #bbb;
    transition: all 0.3s ease;
}

.footer-contact-item:hover {
    color: var(--primary-color);
}

.footer-contact-item i {
    color: var(--primary-color);
}

.footer-nav {
    flex: 1;
    display: flex;
    gap: 40px;
    min-width: 300px;
}

.footer-nav-group h3 {
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
    color: #fff;
}

.footer-nav-group h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}

.footer-nav-group ul li {
    margin-bottom: 10px;
}

.footer-nav-group ul li a {
    color: #aaa;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.footer-nav-group ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-nav-group ul li a i {
    margin-right: 8px;
    font-size: 12px;
    color: var(--primary-color);
}

.footer-subscribe {
    flex: 1;
    min-width: 300px;
}

.footer-subscribe h3 {
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
    color: #fff;
}

.footer-subscribe h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}

.footer-subscribe p {
    color: #aaa;
    margin-bottom: 20px;
    line-height: 1.6;
}

#subscribe-form {
    display: flex;
    position: relative;
}

#subscribe-form input {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 5px 0 0 5px;
    font-size: 14px;
    background: #333;
    color: #fff;
}

#subscribe-form input:focus {
    outline: none;
    background: #444;
}

#subscribe-form button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0 20px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

#subscribe-form button:hover {
    background: #d10010;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    gap: 20px;
}

.footer-copyright {
    color: #aaa;
    font-size: 14px;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.footer-social a {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s ease;
}

.footer-social a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: #aaa;
    font-size: 14px;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* 回到頂部按鈕 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 99;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #d10010;
    transform: translateY(-5px);
}

/* 媒體查詢 */
@media (max-width: 1200px) {
    .hero-content h2 {
        font-size: 48px;
    }

    .parallax-content h2 {
        font-size: 38px;
    }
}

@media (max-width: 992px) {
    .about-content {
        flex-direction: column;
    }

    .about-text {
        margin-bottom: 40px;
    }

    .contact-content {
        flex-direction: column;
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
    }

    .footer-nav {
        flex-direction: column;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 250px;
        height: calc(100vh - 80px);
        background: #fff;
        z-index: 999;
        transition: 0.3s;
        padding: 20px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    .main-nav.active {
        left: 0;
    }

    .main-nav ul {
        flex-direction: column;
    }

    .main-nav ul li {
        margin: 15px 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero-content h2 {
        font-size: 36px;
    }

    .hero-content p {
        font-size: 20px;
    }

    .section-header h2 {
        font-size: 32px;
    }

    .parallax-content h2 {
        font-size: 32px;
    }

    .parallax-content p {
        font-size: 18px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* 為什麼選擇新星泰區塊 */
.why-us {
    background: #f8f9fa;
    position: relative;
    padding: 70px 0;
    overflow: hidden;
}

.why-us::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/pattern.png') repeat;
    opacity: 0.05;
    z-index: 0;
}

.why-us::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(230,0,18,0.05) 0%, rgba(230,0,18,0) 70%);
    border-radius: 50%;
    z-index: 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
    margin-top: 40px;
}

.feature-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    padding: 35px 25px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    border-color: rgba(230, 0, 18, 0.1);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #e60012, #ff6b6b);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    position: relative;
    margin-bottom: 25px;
    height: 80px;
}

.icon-wrapper {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e60012, #ff6b6b);
    border-radius: 50%;
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 26px;
    transition: all 0.4s ease;
    box-shadow: 0 8px 15px rgba(230, 0, 18, 0.15);
}

.icon-circle {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    top: -10px;
    left: -10px;
    border: 2px dashed rgba(230, 0, 18, 0.3);
    animation: spin 15s linear infinite;
    z-index: 1;
}

.feature-card:hover .icon-wrapper {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 10px 20px rgba(230, 0, 18, 0.25);
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: 700;
    color: #333;
    position: relative;
    transition: all 0.3s ease;
}

.feature-card p {
    color: #777;
    margin-bottom: 15px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.feature-list {
    margin-top: 20px;
    padding-left: 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
    opacity: 0.85;
    transition: all 0.3s ease;
}

.feature-list li i {
    color: #e60012;
    margin-right: 10px;
    font-size: 12px;
}

.feature-hover {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: rgba(230, 0, 18, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 12px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.feature-card:hover .feature-hover {
    opacity: 1;
    transform: scale(1);
}

/* 統計數字區塊 */
.stats-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
    position: relative;
    z-index: 1;
}

.stat-item {
    flex: 1;
    min-width: 180px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    padding: 25px 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 42px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.stat-number::after {
    content: '+';
    position: absolute;
    top: 0;
    right: -15px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-item p {
    color: #555;
    font-size: 1rem;
    margin: 0;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 992px) {
    .features-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .stats-container {
        flex-wrap: wrap;
    }

    .stat-item {
        min-width: 140px;
    }
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
        max-width: 450px;
        margin-left: auto;
        margin-right: auto;
    }

    .stat-item {
        flex: 0 0 calc(50% - 15px);
    }
}

@media (max-width: 480px) {
    .stat-number {
        font-size: 36px;
    }

    .stat-item {
        flex: 0 0 100%;
        margin-bottom: 15px;
    }
}

/* 視頻加載狀態 */
.hero.video-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3;
}

.hero.video-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    z-index: 4;
}

.hero.video-loaded .hero-video video {
    opacity: 1;
}

@keyframes videoFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 視頻錯誤提示 */
.video-error-message {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 10;
    animation: fadeIn 0.5s;
    display: flex;
    align-items: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.video-error-message i {
    color: #ffcc00;
    margin-right: 8px;
    font-size: 16px;
}

.video-error-message.fade-out {
    animation: fadeOut 0.5s;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 低性能設備優化 */
@media (prefers-reduced-motion: reduce) {
    .hero-video video {
        display: none;
    }

    .hero {
        background-image: url('../images/hero-bg.jpg');
        background-size: cover;
        background-position: center;
    }
}
