/**
 * 公共样式文件 - 包含导航栏、页脚等全局样式
 */

/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', 'SimSun', serif;
}

body {
    background-color: #fff;
    color: #333;
    line-height: 1.6;
}
/* 防止横向滚动与图片撑破布局 */
html, body { overflow-x: hidden; }
img, video { max-width: 100%; height: auto; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== 导航栏样式 ========== */
nav {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 9999;
    min-height: 56px;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    position: relative;
}

.logo {
    font-size: 16px;
    font-weight: bold;
    color: #c82333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.logo a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.logo img {
    height: 52px;
    width: auto;
    display: block;
    max-width: 120px;
}

.logo span {
    font-size: 18px;
    color: #c82333;
}

.logo.has-image span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.nav-links li {
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #c82333;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

/* 移动端汉堡按钮（默认隐藏，移动端显示） */
.nav-toggle {
    display: none;
    font-size: 22px !important;
    width: 38px !important;
    height: 38px !important;
    line-height: 38px !important;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    z-index: 10001;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    box-sizing: border-box;
    pointer-events: auto;
}

.nav-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #ff8800;
    color: white;
}

.btn-primary:hover {
    background-color: #e67700;
}

.btn-danger {
    background-color: #c82333;
    color: white;
}

.btn-danger:hover {
    background-color: #a71d2a;
}

/* 在线咨询卡片样式 */
.online-consult-card {
    position: fixed;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9998;
    width: 180px;
    background: linear-gradient(180deg, #8B6F47 0%, #6B4E37 100%);
    border-radius: 16px 16px 8px 8px;
    padding: 20px 16px 16px;
    box-shadow: 0 8px 24px rgba(107, 78, 55, 0.4);
}

.consult-card-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.consult-card-close:hover {
    opacity: 1;
}

.consult-card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: #D4C4A8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.consult-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.consult-card-icon-placeholder {
    width: 100%;
    height: 100%;
    background: #D4C4A8;
    border-radius: 50%;
}

.consult-card-title {
    color: #fff;
    font-size: 14px;
    text-align: center;
    margin-bottom: 8px;
    font-weight: normal;
}

.consult-card-phone {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.consult-card-btn {
    width: 100%;
    background: #fff;
    color: #6B4E37;
    border: none;
    border-radius: 6px;
    padding: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.consult-card-btn:hover {
    background: #f5f5f5;
    transform: translateY(-1px);
}

.consult-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10000;
    padding: 20px;
}

.consult-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.consult-overlay-dialog {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.consult-overlay-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.consult-overlay-close:hover {
    color: #c82333;
}

.consult-overlay-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.consult-overlay-placeholder {
    color: #666;
    font-size: 14px;
    margin: 0;
}

body.consult-overlay-open {
    overflow: hidden;
}

/* ========== 页脚样式 ========== */
footer {
    background-color: #2c2c2c;
    color: #fff;
    padding: 60px 0 30px;
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-left-content {
    padding-right: 40px;
}

.footer-logo {
    font-size: 24px;
    margin-bottom: 20px;
    color: #c82333;
}

.footer-description {
    color: #999;
    line-height: 2;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.footer-section {
    flex: 1 1 160px;
    min-width: 160px;
}

.footer-section h4 {
    font-size: 16px;
    margin-bottom: 20px;
    color: #fff;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    color: #999;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.footer-section ul li a:hover {
    color: #c82333;
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 30px;
    text-align: center;
}

.footer-bottom p {
    color: #999;
    font-size: 14px;
}

/* ========== 响应式布局 ========== */
@media (max-width: 992px) {
    .nav-container {
        flex-wrap: wrap;
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        margin-top: 15px;
        justify-content: center;
    }
    
    .footer-main {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    /* 手机端：使用汉堡展开菜单 */
    .nav-links { display: none; }
    .nav-toggle { display: inline-flex; align-items:center; justify-content:center; margin-left:auto; }
    .nav-links.mobile-open {
        display: flex;
        position: absolute;
        left: 0;
        right: 0;
        top: 56px;
        background: #fff;
        border-top: 1px solid #eee;
        padding: 10px 16px;
        flex-direction: column;
        gap: 10px;
        z-index: 1000;
    }

    .nav-links { gap: 15px; font-size: 12px; }
    
    .nav-buttons {
        flex-wrap: wrap;
    }
    
    .footer-content {
        gap: 20px;
    }
    .footer-section { flex: 1 1 100%; max-width: 100%; }

    .online-consult-card {
        right: 12px;
        top: auto;
        bottom: 120px;
        transform: none;
        width: 160px;
        padding: 16px 12px 12px;
    }

    .consult-card-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 12px;
    }

    .consult-card-title {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .consult-card-phone {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .consult-card-btn {
        padding: 8px;
        font-size: 13px;
    }
}

