/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    font-size: 16px;
}

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

/* 头部样式 */
header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background-color: #333;
    color: #fff;
    padding: 10px 0;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-main {
    padding: 20px 0;
}

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li {
    margin-left: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #e74c3c;
}

/* 搜索框 */
.search-box {
    display: flex;
    margin-left: 30px;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    width: 200px;
}

.search-box button {
    padding: 8px 16px;
    background-color: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* 主要内容 */
.main-content {
    padding: 40px 0;
}

/* 新闻列表 */
.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.news-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.news-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-content {
    padding: 20px;
}

.news-category {
    display: inline-block;
    padding: 4px 12px;
    background-color: #f3f3f3;
    color: #666;
    border-radius: 12px;
    font-size: 12px;
    margin-bottom: 10px;
}

.news-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-title a {
    text-decoration: none;
    color: #333;
}

.news-title a:hover {
    color: #e74c3c;
}

.news-excerpt {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination a {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 5px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.pagination a:hover,
.pagination .active {
    background-color: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

/* 新闻详情页 */
.news-detail {
    background-color: #fff;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.news-detail h1 {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.3;
}

.news-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    color: #999;
    font-size: 14px;
}

.news-detail-content {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 40px;
}

.news-detail-content p {
    margin-bottom: 20px;
}

.news-detail-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
}

/* 相关新闻 */
.related-news {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.related-news h3 {
    font-size: 20px;
    margin-bottom: 20px;
}

/* 侧边栏 */
.sidebar {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.sidebar h3 {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e74c3c;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 15px;
}

.sidebar a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s;
}

.sidebar a:hover {
    color: #e74c3c;
}

/* 页脚 */
footer {
    background-color: #333;
    color: #fff;
    padding: 40px 0;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.footer-section p,
.footer-section li {
    margin-bottom: 10px;
}

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

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 40px;
    margin-top: 40px;
    border-top: 1px solid #444;
    color: #999;
}

/* 后台管理 */
.admin-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.admin-header {
    background-color: #333;
    color: #fff;
    padding: 20px;
    border-radius: 8px 8px 0 0;
}

.admin-content {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

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

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

.form-group textarea {
    height: 200px;
    resize: vertical;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #555;
}

.btn-primary {
    background-color: #e74c3c;
}

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

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.table tr:hover {
    background-color: #f8f9fa;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 基础样式调整 */
    body {
        font-size: 14px;
    }
    
    /* 头部调整 */
    .header-main {
        padding: 15px 0;
    }
    
    .header-main .container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 20px;
        background-color: #f8f9fa;
        padding: 10px 0;
        border-radius: 4px;
    }
    
    .nav-menu li {
        margin: 10px 20px;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: block;
        position: absolute;
        top: 15px;
        right: 20px;
    }
    
    .search-box {
        margin-left: 0;
        margin-top: 20px;
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
    
    /* 主要内容调整 */
    .main-content {
        padding: 20px 0;
    }
    
    /* 新闻列表调整 */
    .news-list {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .news-item img {
        height: 180px;
    }
    
    .news-title {
        font-size: 16px;
    }
    
    /* 新闻详情页调整 */
    .news-detail {
        padding: 20px;
    }
    
    .news-detail h1 {
        font-size: 22px;
    }
    
    .news-detail-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    /* 侧边栏调整 */
    .sidebar {
        padding: 20px;
    }
    
    /* 分页调整 */
    .pagination {
        margin-top: 30px;
    }
    
    .pagination a {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    /* 后台管理调整 */
    .admin-container {
        margin: 20px;
    }
    
    .admin-content {
        padding: 20px;
    }
    
    /* 表格调整 */
    .table {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 8px;
    }
    
    /* 按钮调整 */
    .btn {
        padding: 8px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    /* 头部调整 */
    .header-top .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .header-top {
        padding: 8px 0;
    }
    
    /* 新闻列表调整 */
    .news-item img {
        height: 150px;
    }
    
    .news-content {
        padding: 15px;
    }
    
    .news-title {
        font-size: 15px;
    }
    
    /* 新闻详情页调整 */
    .news-detail {
        padding: 15px;
    }
    
    .news-detail h1 {
        font-size: 20px;
    }
    
    .news-detail-content {
        font-size: 15px;
        line-height: 1.7;
    }
    
    /* 侧边栏调整 */
    .sidebar {
        padding: 15px;
    }
    
    .sidebar h3 {
        font-size: 16px;
    }
    
    /* 页脚调整 */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 15px;
    }
    
    .footer-section h3 {
        font-size: 16px;
    }
    
    .footer-bottom {
        padding-top: 30px;
        margin-top: 30px;
        font-size: 14px;
    }
    
    /* 后台管理调整 */
    .admin-header {
        padding: 15px;
    }
    
    .admin-header h1 {
        font-size: 18px;
    }
    
    .admin-content {
        padding: 15px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 8px;
        font-size: 14px;
    }
}

/* 移动端触摸反馈 */
@media (hover: none) and (pointer: coarse) {
    .news-item {
        transition: none;
    }
    
    .news-item:active {
        transform: scale(0.98);
    }
    
    .btn {
        transition: none;
    }
    
    .btn:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
    
    .nav-menu a:active {
        background-color: rgba(231, 76, 60, 0.1);
    }
}

/* 字体大小调整 */
@media (max-width: 360px) {
    body {
        font-size: 13px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .news-title {
        font-size: 14px;
    }
    
    .news-detail h1 {
        font-size: 18px;
    }
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-item {
    animation: fadeIn 0.3s ease-out;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 禁用文本选择（可选） */
@media (max-width: 768px) {
    /* 可以在这里添加禁用文本选择的样式 */
}