/* ================================================
   芋头CMS - 家具定制企业网站模板 - 响应式样式
   ================================================ */

/* ===== 变量 & 重置 ===== */
:root {
    --primary: #8B6914;
    --primary-dark: #6B4F0F;
    --primary-light: #C4A35A;
    --accent: #D4AF37;
    --dark: #1a1a1a;
    --gray-dark: #2c2c2c;
    --gray: #666;
    --gray-light: #999;
    --border: #e0d8c8;
    --bg-light: #faf8f5;
    --bg-warm: #f5f0e8;
    --white: #fff;
    --text: #333;
    --text-light: #777;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: color 0.3s; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, textarea { font-family: inherit; outline: none; }

/* ===== 通用容器 ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 0; }
.section-title {
    text-align: center;
    margin-bottom: 40px;
}
.section-title h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}
.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}
.section-title p {
    color: var(--gray);
    margin-top: 10px;
    font-size: 14px;
}

/* ===== 导航栏 ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--white);
    box-shadow: 0 1px 0 var(--border);
    transition: box-shadow 0.3s;
}
.header.scrolled { box-shadow: 0 2px 12px rgba(0,0,0,0.1); }

.nav-top {
    background: var(--dark);
    color: #ccc;
    font-size: 13px;
    padding: 6px 0;
}
.nav-top .container { display: flex; justify-content: space-between; align-items: center; }
.nav-top a { color: #aaa; }
.nav-top a:hover { color: var(--white); }
.nav-top span { margin-right: 20px; }

.nav-main {
    background: var(--white);
    position: relative;
}
.nav-main .container { display: flex; align-items: center; justify-content: space-between; height: 70px; }

.logo { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; color: var(--dark); }
.logo img { height: 40px; }
.logo-text { line-height: 1.2; }
.logo-text small { font-size: 11px; color: var(--gray); font-weight: 400; display: block; }

.nav-menu { display: flex; align-items: center; gap: 0; }

.nav-item {
    position: relative;
}
.nav-item > a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 24px 20px;
    font-size: 15px;
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s;
}
.nav-item > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--gray);
    margin-left: 4px;
    transition: transform 0.3s;
}
.nav-item:hover > a { color: var(--primary); }
.nav-item:hover > a::after { transform: rotate(180deg); border-top-color: var(--primary); }

.nav-sub {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--white);
    border-top: 2px solid var(--accent);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 100;
}
.nav-item:hover .nav-sub {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-sub li a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid #f0ede6;
    transition: all 0.2s;
}
.nav-sub li:last-child a { border-bottom: none; }
.nav-sub li a:hover { background: var(--bg-light); color: var(--primary); padding-left: 26px; }

/* 移动端菜单按钮 */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--dark);
    transition: all 0.3s;
}

/* ===== 幻灯片 ===== */
.slider {
    position: relative;
    margin-top: 0;
    height: 500px;
    overflow: hidden;
}
.slider-wrapper {
    display: flex;
    height: 100%;
    transition: transform 0.6s ease;
}
.slider-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
}
.slider-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.slider-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 100%);
}
.slider-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
    color: var(--white);
}
.slider-content h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.slider-content p {
    font-size: 18px;
    margin-bottom: 28px;
    opacity: 0.9;
}
.slider-btn {
    display: inline-block;
    padding: 12px 36px;
    background: var(--accent);
    color: var(--white);
    font-size: 15px;
    border-radius: 4px;
    transition: all 0.3s;
}
.slider-btn:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }

.slider-dots {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 20;
}
.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}
.slider-dot.active { background: var(--accent); transform: scale(1.2); }

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(0,0,0,0.4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    border-radius: 50%;
    transition: background 0.3s;
}
.slider-arrow:hover { background: rgba(0,0,0,0.6); }
.slider-arrow.prev { left: 20px; }
.slider-arrow.next { right: 20px; }

/* ===== 产品中心 ===== */
.products-section { background: var(--bg-light); padding: 60px 0; }

.product-categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}
.product-cat-btn {
    padding: 8px 24px;
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 14px;
    color: var(--text);
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s;
}
.product-cat-btn:hover,
.product-cat-btn.active {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

.product-group { display: none; }
.product-group.active { display: block; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}
.product-grid:last-child { margin-bottom: 0; }
.product-grid + .product-grid { display: none; }

.product-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s;
    cursor: pointer;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.product-card-img {
    position: relative;
    height: 200px;
    overflow: hidden;
}
.product-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.product-card:hover .product-card-img img { transform: scale(1.05); }
.product-card-img .product-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent);
    color: white;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 3px;
}
.product-card-info { padding: 16px; }
.product-card-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.product-card-info .price {
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
}
.product-card-info .price small { font-size: 12px; font-weight: 400; color: var(--gray-light); margin-left: 4px; }

/* ===== 关于我们 ===== */
.about-section { background: var(--white); }
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.about-img { border-radius: 12px; overflow: hidden; }
.about-img img { width: 100%; height: 400px; object-fit: cover; }
.about-text h3 { font-size: 22px; color: var(--dark); margin-bottom: 16px; }
.about-text p { color: var(--gray); line-height: 1.8; margin-bottom: 14px; font-size: 15px; }
.about-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 24px;
}
.about-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text);
}
.about-feature::before {
    content: '✓';
    width: 20px;
    height: 20px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 11px;
    flex-shrink: 0;
}

/* ===== 案例展示 ===== */
.cases-section { background: var(--bg-warm); padding: 60px 0; overflow: hidden; }
.cases-marquee-wrapper {
    position: relative;
    overflow: hidden;
}
.cases-marquee {
    display: flex;
    gap: 20px;
    animation: marquee 30s linear infinite;
    width: max-content;
}
.cases-marquee:hover { animation-play-state: paused; }
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.case-card {
    width: 300px;
    flex-shrink: 0;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.case-card-img { height: 200px; overflow: hidden; }
.case-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.case-card:hover .case-card-img img { transform: scale(1.05); }
.case-card-info { padding: 14px; }
.case-card-info h3 { font-size: 14px; color: var(--dark); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-card-info p { font-size: 12px; color: var(--gray-light); margin-top: 4px; }

/* ===== 新闻资讯 ===== */
.news-section { background: var(--white); }
.news-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}
.news-featured {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    height: 340px;
    cursor: pointer;
}
.news-featured img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.news-featured:hover img { transform: scale(1.03); }
.news-featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}
.news-featured-overlay h3 { font-size: 18px; margin-bottom: 6px; line-height: 1.4; }
.news-featured-overlay span { font-size: 12px; opacity: 0.7; }

.news-list {}
.news-item {
    display: flex;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}
.news-item:last-child { border-bottom: none; }
.news-item:hover { background: var(--bg-light); padding-left: 10px; }
.news-item-date {
    flex-shrink: 0;
    width: 50px;
    text-align: center;
    padding: 8px;
    background: var(--bg-warm);
    border-radius: 6px;
}
.news-item-date .day { font-size: 20px; font-weight: 700; color: var(--accent); display: block; }
.news-item-date .month { font-size: 11px; color: var(--gray); display: block; }
.news-item-info h3 { font-size: 15px; color: var(--dark); font-weight: 500; margin-bottom: 6px; line-height: 1.4; }
.news-item-info p { font-size: 13px; color: var(--gray-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 留言 ===== */
.guestbook-section { background: var(--bg-light); }
.guestbook-form {
    max-width: 600px;
    margin: 0 auto;
    display: grid;
    gap: 16px;
}
.guestbook-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.guestbook-form input,
.guestbook-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    background: var(--white);
}
.guestbook-form input:focus,
.guestbook-form textarea:focus { border-color: var(--accent); }
.guestbook-form textarea { height: 120px; resize: vertical; }
.guestbook-form button {
    padding: 14px;
    background: var(--accent);
    color: white;
    font-size: 16px;
    border-radius: 6px;
    transition: all 0.3s;
}
.guestbook-form button:hover { background: var(--primary-dark); transform: translateY(-2px); }
.guestbook-tip { text-align: center; font-size: 13px; color: var(--gray); margin-top: 10px; }

/* ===== Footer ===== */
.footer {
    background: var(--dark);
    color: #aaa;
    padding-top: 50px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #333;
}
.footer-col h4 {
    color: var(--white);
    font-size: 16px;
    margin-bottom: 20px;
    font-weight: 600;
}
.footer-col p, .footer-col li { font-size: 14px; line-height: 2; color: #888; }
.footer-col li:hover { color: var(--accent); cursor: pointer; }
.footer-col a { color: #888; }
.footer-col a:hover { color: var(--accent); }
.footer-contact li { display: flex; align-items: flex-start; gap: 10px; }
.footer-contact li span:first-child { font-size: 16px; }

.footer-bottom {
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    color: #555;
}
.footer-bottom a { color: #555; }
.footer-bottom a:hover { color: var(--accent); }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .about-content { grid-template-columns: 1fr; gap: 30px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .slider { height: 350px; }
    .slider-content h1 { font-size: 28px; }

    .nav-toggle { display: flex; }
    .nav-menu {
        position: fixed;
        top: 0;
        right: -300px;
        width: 280px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        box-shadow: -4px 0 20px rgba(0,0,0,0.2);
        transition: right 0.3s;
        z-index: 2000;
        overflow-y: auto;
    }
    .nav-menu.open { right: 0; }
    .nav-menu::before {
        content: '×';
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 28px;
        cursor: pointer;
    }
    .nav-item { width: 100%; }
    .nav-item > a { padding: 14px 0; border-bottom: 1px solid var(--border); justify-content: space-between; }
    .nav-sub {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        border: none;
        box-shadow: none;
        background: var(--bg-light);
        border-radius: 6px;
        margin-top: 6px;
    }
    .nav-sub li a { padding: 8px 16px; }

    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .news-layout { grid-template-columns: 1fr; }
    .about-features { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .guestbook-form .form-row { grid-template-columns: 1fr; }

    .section { padding: 40px 0; }
    .section-title h2 { font-size: 22px; }
    .cases-marquee { animation-duration: 20s; }

    .nav-top { display: none; }
    .header { top: 0; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .slider-content h1 { font-size: 22px; }
    .slider-content p { font-size: 14px; }
    .logo-text { display: none; }
}

/* ===== 辅助类 ===== */
.fade-in { animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }