/* 變量定義 */
:root {
    --primary-green: #006400; /* 深綠色 */
    --accent-red: #cc0000;   /* 鮮紅色 */
    --pure-black: #000000;
    --pure-white: #ffffff;
    --light-gray: #f4f4f4;
    --text-color: #333333;
}

/* 基礎樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--pure-white);
}

/* 頂部跑馬燈 */
.top-marquee {
    background-color: var(--accent-red);
    color: var(--pure-white);
    height: 40px;
    line-height: 40px;
    overflow: hidden;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1100;
    font-weight: bold;
    font-size: 14px;
}

.marquee-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    padding: 0 20px;
}

.marquee-container {
    position: relative;
    flex: 1;
    height: 100%;
    margin-right: 20px;
}

.marquee-btn {
    background-color: var(--pure-white);
    color: var(--accent-red);
    padding: 0 15px;
    height: 28px;
    line-height: 28px;
    border-radius: 14px;
    text-decoration: none;
    font-size: 12px;
    white-space: nowrap;
    transition: background-color 0.3s;
}

.marquee-btn:hover {
    background-color: var(--light-gray);
}

.marquee-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.8s ease-in-out;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.marquee-item.active {
    opacity: 1;
    transform: translateY(0);
}

.marquee-item.exit {
    opacity: 0;
    transform: translateY(-100%);
}

/* 導航欄 */
header {
    background-color: var(--pure-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 40px; /* 跑馬燈高度 */
    left: 0;
    right: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo h1 {
    color: var(--primary-green);
    font-size: 28px;
    font-weight: 800;
}

.logo p {
    font-size: 12px;
    color: var(--accent-red);
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 25px;
}

.nav-links a {
    text-decoration: none;
    color: var(--pure-black);
    font-size: 16px;
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-green);
}

/* 輪播圖橫幅 */
.banner {
    height: 90vh;
    margin-top: 100px; /* 跑馬燈 + 導航欄高度 */
    overflow: hidden;
    position: relative;
    background-color: var(--pure-black);
}

.banner-slider {
    width: 100%;
    height: 100%;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-slide.active {
    opacity: 1;
    z-index: 2;
}

.banner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-content {
    position: absolute;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
    z-index: 10;
    color: var(--pure-white);
    max-width: 600px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.banner-content h2 {
    font-size: 42px;
    margin-bottom: 20px;
    color: var(--pure-white);
    border-left: 5px solid var(--accent-red);
    padding-left: 15px;
}

.banner-content p {
    font-size: 18px;
    margin-bottom: 30px;
}

.banner-btns {
    display: flex;
    gap: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: bold;
    transition: transform 0.3s, background-color 0.3s;
    cursor: pointer;
}

.btn:hover {
    transform: scale(1.05);
}

.btn-red {
    background-color: var(--accent-red);
    color: var(--pure-white);
}

.btn-green {
    background-color: var(--primary-green);
    color: var(--pure-white);
}

/* 控制器與指示器 */
.banner-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    transform: translateY(-50%);
    z-index: 20;
}

.banner-prev, .banner-next {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
}

.banner-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 20;
}

.banner-indicator {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
}

.banner-indicator.active {
    background: var(--accent-red);
    width: 30px;
    border-radius: 10px;
}

/* 通用標題樣式 */
section h2 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 50px;
    color: var(--pure-black);
    position: relative;
}

section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-green);
    margin: 15px auto 0;
}

/* 核心優勢 */
.trust-section {
    background-color: var(--primary-green);
    color: var(--pure-white);
    padding: 80px 20px;
    text-align: center;
}

.trust-section h2 {
    color: var(--pure-white);
}

.trust-section h2::after {
    background: var(--accent-red);
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.trust-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.3s;
}

.trust-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.trust-item h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--pure-white);
}

.trust-item p {
    font-size: 16px;
    opacity: 0.9;
}

/* 關於我們 */
.services, .products, .about, .contact {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.services-container, .products-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card, .product-card {
    background: var(--pure-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    border: 1px solid #eee;
}

.service-card:hover, .product-card:hover {
    transform: translateY(-10px);
}

.service-card img, .product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.service-card h3, .product-card h3 {
    padding: 20px 20px 10px;
    color: var(--primary-green);
}

.service-card p, .product-card p {
    padding: 0 20px 20px;
    color: #666;
}

/* 買家秀 */
.buyer-show {
    padding: 80px 20px;
    background-color: var(--pure-white);
    text-align: center;
}

.buyer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.buyer-card {
    background: var(--pure-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    border: 1px solid #eee;
    padding: 0; /* 移除內邊距，使圖片鋪滿 */
}

.buyer-card:hover {
    transform: translateY(-10px);
}

.buyer-card img {
    width: 100%;
    height: 250px; /* 限制高度與產品卡片一致 */
    object-fit: cover;
}

.buyer-card p {
    padding: 15px 20px 20px;
    font-style: italic;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

/* 聯繫方式強調 */
.contact {
    background-color: var(--light-gray);
    max-width: 100%;
}

.contact-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--pure-white);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-top: 5px solid var(--primary-green);
}

.contact-info p {
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: bold;
    color: var(--pure-black);
}

.whatsapp-info {
    text-align: center;
}

.whatsapp-info p {
    font-size: 20px;
    color: var(--primary-green);
    margin-bottom: 15px;
}

/* 頁腳 */
footer {
    background-color: var(--pure-black);
    color: var(--pure-white);
    text-align: center;
    padding: 40px;
}

/* 手機端自適應 */
@media (max-width: 768px) {
    .top-marquee { font-size: 12px; }
    .marquee-wrapper { padding: 0 10px; }
    .marquee-btn { padding: 0 8px; font-size: 10px; margin-left: 5px; }
    .marquee-container { margin-right: 5px; }
    header { top: 36px; }
    nav { flex-direction: column; padding: 10px; }
    .nav-links { margin-top: 15px; flex-wrap: wrap; justify-content: center; }
    .nav-links li { margin: 5px 10px; }
    .logo h1 { font-size: 22px; }
    
    .banner { height: 60vh; margin-top: 120px; }
    .banner-content { left: 5%; right: 5%; text-align: center; }
    .banner-content h2 { font-size: 28px; border-left: none; padding-left: 0; }
    .banner-btns { justify-content: center; flex-direction: column; gap: 10px; }
    
    .contact-container { flex-direction: column; padding: 20px; }
    .contact-info { margin-bottom: 30px; text-align: center; }
    .contact-info p { font-size: 18px; }
}

/* 微信懸浮按鈕 */
.wechat-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.wechat-float a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: #25d366;
    color: white;
    text-decoration: none;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s;
    font-size: 12px;
    font-weight: bold;
}

.wechat-float a:hover {
    transform: scale(1.1);
}

.wechat-float img {
    width: 35px;
    height: 35px;
    margin-bottom: 5px;
}

/* 複製提示樣式 */
.copy-toast {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
