/* ========================================
   优选生活建站 - 全局样式
   雨伞简约风 | 纯黑 + 浅灰 + 纯白
   ======================================== */

/* CSS Reset & 基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background-color: #ffffff;
    color: #1a1a1a;
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   顶部导航栏
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid #e8e8e8;
    transition: all 0.4s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.99);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #1a1a1a;
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-link:hover::before {
    width: 80%;
}

.nav-link:hover {
    background: #f5f5f5;
}

.nav-link.active {
    background: #1a1a1a;
    color: #fff;
}

.nav-link.active::before {
    width: 0;
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: #1a1a1a;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* 移动端菜单 */
@media (max-width: 968px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        padding: 20px;
        gap: 4px;
        transform: translateY(-150%);
        opacity: 0;
        transition: all 0.4s ease;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
    }

    .nav-link {
        padding: 14px 20px;
        width: 100%;
        border-radius: 8px;
    }

    .hamburger {
        display: flex;
    }
}

/* ========================================
   页脚
   ======================================== */
.footer {
    background: #1a1a1a;
    color: #fff;
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.footer-section p {
    color: #b0b0b0;
    line-height: 1.8;
    margin-bottom: 12px;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #b0b0b0;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom p {
    color: #888;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: #fff;
    color: #1a1a1a;
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   通用组件
   ======================================== */
/* 按钮 */
.btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: #1a1a1a;
    color: #fff;
}

.btn-primary:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-outline {
    background: transparent;
    border: 2px solid #1a1a1a;
    color: #1a1a1a;
}

.btn-outline:hover {
    background: #1a1a1a;
    color: #fff;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.4s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.card-content {
    padding: 24px;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1a1a1a;
}

.card-text {
    color: #666;
    line-height: 1.7;
    margin-bottom: 16px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #999;
    font-size: 0.85rem;
}

/* 网格布局 */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 968px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* 章节标题 */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.section-subtitle {
    color: #666;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* 间距类 */
.section {
    padding: 80px 0;
}

.section-light {
    background: #fafafa;
}

/* 动画 */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 面包屑 */
.breadcrumb {
    padding: 20px 0;
    margin-top: 80px;
}

.breadcrumb-list {
    display: flex;
    gap: 10px;
    align-items: center;
    color: #666;
    font-size: 0.9rem;
}

.breadcrumb-list a:hover {
    color: #1a1a1a;
}

.breadcrumb-separator {
    color: #ccc;
}

/* 页面标题区 */
.page-header {
    background: #fafafa;
    padding: 60px 0;
    text-align: center;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.page-subtitle {
    color: #666;
    font-size: 1.1rem;
}

/* 侧边栏布局 */
.sidebar-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}

@media (max-width: 968px) {
    .sidebar-layout {
        grid-template-columns: 1fr;
    }
}

/* 资讯列表特殊样式 */
.news-list-item {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    padding: 24px;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}

.news-list-item:hover {
    background: #fafafa;
}

.news-list-item:last-child {
    border-bottom: none;
}

.news-list-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
}

.news-list-content h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.news-list-excerpt {
    color: #666;
    margin-bottom: 16px;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .news-list-item {
        grid-template-columns: 1fr;
    }
    
    .news-list-image {
        height: 200px;
    }
}

/* 详情页面 */
.article-content {
    font-size: 1.1rem;
    line-height: 1.9;
    color: #333;
}

.article-content img {
    max-width: 100%;
    height: auto;
    margin: 30px 0;
    border-radius: 8px;
}

.article-content p {
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    gap: 24px;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

/* 相关新闻区域 */
.related-news {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.related-news h3 {
    font-size: 1.5rem;
    margin-bottom: 24px;
}
