/* ========== 全局变量与基础样式 ========== */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --text: #333;
    --bg: #f8fafc;
    --white: #fff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

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

/* ========== 头部 ========== */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 20px;
    flex-wrap: nowrap;
}

/* Logo 区域 */
.logo {
    flex-shrink: 0;
    max-width: none;              /* 完全不限制宽度 */
    min-width: 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    white-space: nowrap;         /* 保持文字不换行 */
    overflow: visible;           /* 不裁剪 */
}

.logo-img {
    height: 50px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.logo-slogan {
    font-size: 15px;
    color: #666;
    white-space: nowrap;
    overflow: visible;           /* 关键：不裁剪文字 */
    text-overflow: clip;         /* 关键：不用省略号 */
    max-width: none;             /* 关键：不限制宽度 */
    flex-shrink: 0;              /* 关键：不被压缩 */
}

/* 导航 */
.main-nav {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
    margin-left: auto;
}

.main-nav a {
    padding: 8px 14px;
    text-decoration: none;
    color: var(--text);
    border-radius: 4px;
    transition: 0.3s;
    font-size: 15px;
    white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--primary);
    color: #fff;
}

/* 汉堡按钮 */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
}

/* ========== Hero 区域 ========== */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
    padding: 80px 20px;
}

.hero h2 {
    font-size: 40px;
    margin-bottom: 15px;
    white-space: nowrap;
}

.hero .slogan {
    font-size: 22px;
    margin-bottom: 10px;
    opacity: 0.9;
    white-space: nowrap;
}

.hero .desc {
    margin-bottom: 30px;
    opacity: 0.8;
    white-space: nowrap;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    transition: 0.3s;
    font-weight: bold;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: #fff;
    color: var(--primary);
}

.btn-primary:hover {
    transform: scale(1.05);
}

/* ========== 通用区块 ========== */
.section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 30px;
    margin-bottom: 40px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary);
    margin: 10px auto 0;
}

.bg-gray {
    background: #f1f5f9;
}

/* ========== 卡片 ========== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: var(--white);
    border-radius: 8px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card .category {
    display: inline-block;
    background: #e0e7ff;
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    margin-bottom: 10px;
}

.card h3 {
    margin-bottom: 10px;
}

.card h3 a {
    color: var(--text);
    text-decoration: none;
}

.card h3 a:hover {
    color: var(--primary);
}

.card .date {
    color: #999;
    font-size: 14px;
    display: block;
    margin-top: 15px;
}

/* ========== 列表 ========== */
.list-item {
    background: var(--white);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.list-item h3 {
    margin-bottom: 8px;
}

.list-item h3 a {
    color: var(--primary);
    text-decoration: none;
}

.list-item .date {
    color: #999;
    font-size: 14px;
}

/* ========== 详情页 ========== */
.page-content {
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: 40px auto;
    max-width: 900px;
}

.page-content h1 {
    margin-bottom: 20px;
    color: var(--primary);
}

.page-content .meta {
    color: #999;
    margin-bottom: 30px;
}

.page-content .body {
    line-height: 1.8;
}

/* 文章图片自适应 */
.page-content .body img,
.about-content img,
.list-item p img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    min-height: 120px;
}

.btn-submit {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.btn-submit:hover {
    background: var(--primary-dark);
}

/* ========== 页脚 ========== */
.site-footer {
    background: #1f2937;
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 25px;
}

.footer-col h3 {
    margin-bottom: 15px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col a {
    color: #9ca3af;
    text-decoration: none;
}

.footer-col a:hover {
    color: #fff;
}

.copyright {
    text-align: center;
    border-top: 1px solid #374151;
    padding-top: 20px;
    color: #9ca3af;
}

/* ========== 响应式设计（手机端） ========== */
@media (max-width: 768px) {
    /* 头部 */
    .header-inner {
        padding: 10px 12px;
        gap: 8px;
    }

    .logo {
        max-width: none;
        flex: 1;
    }

    .logo a {
        gap: 8px;
    }

    /* Logo 增大30% */
    .logo-img {
        height: 65px;              /* 原来50px，增大30% */
        max-width: 180px;          /* 原来160px，增大 */
    }

    /* 右侧文字调整合适大小 */
    .logo-slogan {
        display: block;            /* 手机端显示 */
        font-size: 13px;           /* 适中大小 */
        color: #555;
        max-width: none;
        white-space: normal;       /* 允许换行显示完整 */
        line-height: 1.3;
    }

    /* 汉堡按钮显示 */
    .nav-toggle {
        display: block;
        margin-left: auto;
    }

    /* 导航折叠菜单 */
    .main-nav {
        position: fixed;
        top: 72px;                 /* 适配变高后的header */
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 10px 20px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        display: none;
        gap: 5px;
        z-index: 99;
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav a {
        padding: 12px 20px;
        font-size: 16px;
    }

    /* Hero */
    .hero {
        padding: 50px 15px;
    }

    .hero h2 {
        font-size: clamp(20px, 5vw, 28px);
        white-space: normal;
    }

    .hero .slogan {
        font-size: clamp(12px, 3vw, 16px);
        white-space: nowrap;
    }

    .hero .desc {
        font-size: clamp(11px, 2.8vw, 14px);
        white-space: nowrap;
    }

    /* 区块 */
    .section {
        padding: 40px 0;
    }

    .section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }

    /* 卡片 */
    .card-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* 详情页 */
    .page-content {
        padding: 20px;
        margin: 20px auto;
    }

    /* 表单按钮 */
    .btn-submit {
        width: 100%;
        padding: 14px;
    }

    /* 页脚 */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* 超小屏 */
@media (max-width: 400px) {
    .logo-img {
        height: 52px;              /* 超小屏稍微缩小，但比原来大 */
        max-width: 130px;
    }
    .logo-slogan {
        font-size: 12px;
    }
}