/* --- 1. 基础重置与全局变量 --- */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

:root {
    --bg-color: #121212;
    --accent-color: #DAA520; /* 统一使用高级金 */
    --nav-height: 85px;
    --text-color: #ffffff;
    --nav-bg: #ffffff;
}

html, body {
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    position: relative;
}

/* 强制子页面 body 透明，透出底纹 */
.sub-page { 
    overflow-y: auto; 
    background: transparent !important;
}

/* --- 全站统一底纹 --- */
body::before {
    content: "";
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: url('../assets/background-pattern-2.svg') center center / cover no-repeat;
    opacity: 0.3; 
    z-index: 0;   
    pointer-events: none; 
}

/* --- 2. 导航栏布局 --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    background: var(--nav-bg);
    display: flex;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-content-wrapper {
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    height: 100%;
}

.logo-container {
    flex-shrink: 0;
    z-index: 10;
    min-width: 300px;
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    width: 55px;
    height: 55px;
    display: block;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-text .brand-name {
    display: block;
    color: #1a1a1a;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.1;
}

.logo-text .brand-tagline {
    display: block;
    color: var(--accent-color); 
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.nav-links {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
    list-style: none;
    z-index: 5;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: 0.3s;
}

.nav-links a.active {
    color: var(--accent-color);
    font-weight: 900;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 5px;
}

.nav-links a:hover { color: var(--accent-color); }

/* --- 3. 右侧搜索 --- */
.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

.search-form {
    display: flex;
    background: #f4f4f4;
    border-radius: 20px;
    padding: 5px 12px;
    border: 1px solid #ddd;
}

.search-form input {
    border: none;
    background: transparent;
    outline: none;
    width: 90px;
    font-size: 0.8rem;
    transition: 0.3s;
}

.search-form input:focus { width: 140px; }

.search-form button {
    background: none;
    border: none;
    cursor: pointer;
}

/* --- 4. 页面核心结构 --- */
.scroll-container { 
    width: 100%; 
    scroll-snap-type: y mandatory; 
}

.screen {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    scroll-snap-align: start;
    position: relative;
    padding-top: var(--nav-height);
}

.content { 
    z-index: 10; 
    position: relative; 
    width: 90%; 
    max-width: 1100px; 
}

h1 { font-size: 3.5rem; margin-bottom: 20px; font-weight: 900; }
.highlight { color: var(--accent-color); }

/* --- 5. WhatsApp 悬浮按钮 (已在 footer.php 包含) --- */

/* --- 6. 产品列表 (products.php) --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.product-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 15px;
    transition: 0.3s;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.06);
}

.product-img-wrapper {
    display: block;
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-radius: 8px;
}

.product-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.product-card:hover img { transform: scale(1.08); }

.product-title {
    margin: 15px 0;
    font-size: 1.1rem;
    color: #fff;
    min-height: 2.8em;
}

.inquiry-btn {
    background: var(--accent-color);
    color: #000;
    text-align: center;
    padding: 12px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 6px;
    margin-top: auto;
}

/* --- 7. 产品详情 (product-detail.php) --- */
.detail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 30px;
    text-align: left;
}

.detail-gallery { flex: 1; min-width: 300px; }
.main-img { width: 100%; height: 400px; object-fit: cover; border-radius: 8px; }
.thumb-list { display: flex; gap: 10px; margin-top: 15px; overflow-x: auto; }
.thumb-img { width: 80px; height: 80px; object-fit: cover; cursor: pointer; border-radius: 4px; border: 2px solid transparent; }
.thumb-img:hover { border-color: var(--accent-color); }

.detail-info { flex: 1; min-width: 300px; display: flex; flex-direction: column; }
.detail-title { font-size: 1.6rem; color: #ffffff; margin-bottom: 20px; }
.detail-desc { color: #ccc; line-height: 1.6; margin-bottom: 30px; white-space: pre-wrap; }

/* --- 8. 询盘表单 (inquiry.php) --- */
.form-container {
    max-width: 600px;
    margin: 40px auto;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    padding: 40px;
    border-radius: 12px;
    text-align: left;
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: #ccc; }
.form-control {
    width: 100%;
    padding: 12px;
    background: #111;
    border: 1px solid #333;
    color: #fff;
    border-radius: 6px;
}

.form-control:focus { border-color: var(--accent-color); outline: none; }
.submit-btn {
    width: 100%;
    background: var(--accent-color);
    padding: 15px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    border-radius: 6px;
}

/* --- 9. 响应式适配 (核心修复区域) --- */

/* 新增：汉堡按钮基础样式 (默认隐藏) */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 1001;
    margin-left: 15px;
}
.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: #333;
    transition: 0.3s;
}

@media (max-width: 992px) {
    /* 允许导航栏高度在手机端自适应 */
    .navbar { height: auto; min-height: 75px; }
    .nav-content-wrapper { padding: 10px 15px; }

    /* 优化 Logo 区域防止挤压 */
    .logo-container { min-width: auto; flex: 1; }
    .brand-tagline { display: none; } /* 手机端隐藏口号 */
    
    /* 显示汉堡按钮并排版 */
    .menu-toggle { display: flex; order: 2; }
    .nav-right { order: 1; margin-left: auto; }
    .search-form input { width: 60px; }
    .search-form input:focus { width: 90px; }

    /* 改造下拉菜单 */
    .nav-links {
        position: absolute;
        top: 100%; /* 紧贴导航栏底部 */
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        padding: 0;
        max-height: 0; /* 默认隐藏 */
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        transform: none; /* 移除桌面居中偏移 */
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    }
    
    /* 激活状态 */
    .nav-links.active {
        max-height: 300px;
        padding: 15px 0;
    }

    .nav-links li { width: 100%; text-align: center; margin: 5px 0; }
    .nav-links a { display: block; padding: 10px; font-size: 1.1rem; }
    .nav-links a.active { border-bottom: none; }

    h1 { font-size: 2.2rem; }
}

@media (max-width: 768px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .product-img-wrapper { height: 180px; }
    .detail-container { padding: 20px; }
    .main-img { height: 300px; }
}

/* --- 10. 相关产品区域 --- */
.related-section {
    margin-top: 80px;
    padding-top: 50px;
    border-top: 1px solid #333;
    width: 100%;
}

.related-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
    color: var(--accent-color);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 25px;
}

.related-card {
    text-decoration: none;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}

.related-card:hover {
    transform: translateY(-5px);
}

.related-card img {
    width: 100%;
    aspect-ratio: 1 / 1; 
    object-fit: cover;   
    border-radius: 8px;
    border: 1px solid #333;
    margin-bottom: 12px;
}

.related-card h4 {
    color: #fff;
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 5px;
}

@media (max-width: 992px) {
    .related-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .related-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .related-title { font-size: 1.5rem; }
    .related-card img { aspect-ratio: 1 / 1; }
}

/* --- 11. 询盘页面提交按钮 (inquiry.php) --- */
.btn-inquiry {
    display: block;
    width: 100%;
    background-color: var(--accent-color) !important; 
    color: #000 !important;                            
    padding: 15px;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}

.btn-inquiry:hover {
    background-color: #b8860b !important;            
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: translateY(-2px);                     
}