/**
 * 深圳上航综合门诊部新闻网站样式表
 * 响应式设计 - 适配PC和移动端
 */

/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

a {
    color: #1a73e8;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0d47a1;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==================== 容器 ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ==================== 头部导航 ==================== */
.header {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 3px;
}

.logo h1 a {
    color: #fff;
}

.logo .tagline {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
}

.nav-menu a {
    color: #fff;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: background-color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 移动端菜单按钮 */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #fff;
    border-radius: 2px;
    transition: transform 0.3s ease;
}

/* ==================== Banner ==================== */
.banner {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: #fff;
    padding: 60px 0;
    text-align: center;
}

.banner h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.banner p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ==================== 主要内容区 ==================== */
.main {
    padding: 30px 0;
}

/* 推荐区域 */
.featured-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.5rem;
    color: #1976d2;
    padding-bottom: 10px;
    border-bottom: 3px solid #1976d2;
    margin-bottom: 20px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.featured-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.featured-image {
    height: 180px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-content {
    padding: 15px;
}

.featured-content h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.featured-content h3 a {
    color: #333;
}

.featured-content h3 a:hover {
    color: #1976d2;
}

.featured-summary {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.featured-meta {
    font-size: 0.85rem;
    color: #999;
    display: flex;
    gap: 15px;
}

/* 文章列表 */
.articles-section {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.articles-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-item {
    display: flex;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.article-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.article-image {
    flex-shrink: 0;
    width: 200px;
    height: 130px;
    border-radius: 6px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    flex: 1;
}

.article-category {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.article-content h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.article-content h3 a {
    color: #333;
}

.article-content h3 a:hover {
    color: #1976d2;
}

.article-summary {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.7;
}

.article-meta {
    font-size: 0.85rem;
    color: #999;
    display: flex;
    gap: 15px;
}

.more-link {
    text-align: center;
    margin-top: 25px;
}

.btn-more {
    display: inline-block;
    background: #1976d2;
    color: #fff;
    padding: 10px 30px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.btn-more:hover {
    background: #1565c0;
    color: #fff;
}

/* ==================== 新闻列表页 ==================== */
.page-header {
    margin-bottom: 25px;
}

.page-header h1 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 10px;
}

.breadcrumb {
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb a {
    color: #1976d2;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

.main-content {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* 侧边栏 */
.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.widget {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.widget-title {
    font-size: 1.1rem;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #1976d2;
    margin-bottom: 15px;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    display: block;
    padding: 8px 12px;
    color: #666;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.category-list a:hover,
.category-list a.active {
    background: #e3f2fd;
    color: #1976d2;
}

.hot-list {
    list-style: none;
}

.hot-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

.hot-list li:last-child {
    border-bottom: none;
}

.hot-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #1976d2;
    color: #fff;
    border-radius: 50%;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.hot-list li:nth-child(1) .hot-num {
    background: #f44336;
}

.hot-list li:nth-child(2) .hot-num {
    background: #ff9800;
}

.hot-list li:nth-child(3) .hot-num {
    background: #ffc107;
}

.hot-list a {
    color: #333;
    font-size: 0.9rem;
    line-height: 1.5;
}

.hot-list a:hover {
    color: #1976d2;
}

/* ==================== 文章详情页 ==================== */
.article-detail {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.article-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.article-header h1 {
    font-size: 1.8rem;
    color: #333;
    line-height: 1.4;
    margin-bottom: 15px;
}

.article-header .article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #666;
}

.article-header .article-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-thumbnail {
    margin-bottom: 25px;
    text-align: center;
}

.article-thumbnail img {
    max-width: 100%;
    border-radius: 8px;
}

.article-summary {
    background: #f5f5f5;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 25px;
    font-size: 0.95rem;
    color: #666;
}

.article-body {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
    margin: 25px 0 15px;
    color: #333;
}

.article-body p {
    margin-bottom: 15px;
}

.article-body ul,
.article-body ol {
    margin: 15px 0;
    padding-left: 30px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 15px 0;
}

/* 相关文章 */
.related-articles {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    margin-top: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.related-articles h3 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1976d2;
}

.related-articles ul {
    list-style: none;
}

.related-articles li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

.related-articles li:last-child {
    border-bottom: none;
}

.related-articles a {
    color: #333;
    flex: 1;
}

.related-articles a:hover {
    color: #1976d2;
}

.related-articles .date {
    color: #999;
    font-size: 0.85rem;
    margin-left: 15px;
}

/* ==================== 分页 ==================== */
.pagination-wrapper {
    margin-top: 30px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #1976d2;
    border-color: #1976d2;
    color: #fff;
}

.pagination .current {
    background: #1976d2;
    border-color: #1976d2;
    color: #fff;
}

/* ==================== 页脚 ==================== */
.footer {
    background: #263238;
    color: #b0bec5;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-info h3 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.footer-links h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #b0bec5;
}

.footer-links a:hover {
    color: #fff;
}

.footer-copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #37474f;
    font-size: 0.9rem;
}

/* ==================== 后台管理样式 ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 15px;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-box h1 {
    font-size: 1.5rem;
    color: #1976d2;
    text-align: center;
    margin-bottom: 5px;
}

.login-box h2 {
    font-size: 1rem;
    color: #666;
    text-align: center;
    margin-bottom: 30px;
    font-weight: normal;
}

.login-hint {
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    margin-top: 20px;
}

/* 后台布局 */
.admin-page {
    background: #f5f5f5;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: #263238;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #37474f;
}

.sidebar-header h2 {
    font-size: 1.2rem;
}

.sidebar-nav {
    padding: 15px 0;
}

.sidebar-nav a {
    display: block;
    padding: 12px 20px;
    color: #b0bec5;
    transition: all 0.3s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: #1976d2;
    color: #fff;
}

/* 主内容 */
.main-content {
    flex: 1;
    padding: 25px;
    overflow-x: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.admin-header h1 {
    font-size: 1.5rem;
    color: #333;
}

.user-info {
    color: #666;
    font-size: 0.9rem;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: #1976d2;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.data-table tr:hover {
    background: #fafafa;
}

.data-table .actions {
    display: flex;
    gap: 10px;
}

/* 表单样式 */
.article-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1976d2;
}

.form-group textarea {
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.checkbox-row {
    align-items: center;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.required {
    color: #f44336;
}

.current-thumbnail {
    margin-bottom: 10px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

/* 按钮样式 */
.btn-login,
.btn-submit {
    background: #1976d2;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-login:hover,
.btn-submit:hover {
    background: #1565c0;
}

.btn-add {
    background: #4caf50;
    color: #fff;
    padding: 8px 20px;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.btn-add:hover {
    background: #388e3c;
    color: #fff;
}

.btn-edit,
.btn-view,
.btn-delete,
.btn-cancel {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.btn-edit {
    background: #ff9800;
    color: #fff;
}

.btn-edit:hover {
    background: #f57c00;
    color: #fff;
}

.btn-view {
    background: #1976d2;
    color: #fff;
}

.btn-view:hover {
    background: #1565c0;
    color: #fff;
}

.btn-delete {
    background: #f44336;
    color: #fff;
}

.btn-delete:hover {
    background: #d32f2f;
    color: #fff;
}

.btn-cancel {
    background: #9e9e9e;
    color: #fff;
}

.btn-cancel:hover {
    background: #757575;
    color: #fff;
}

/* 状态标签 */
.status-published {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 0.85rem;
}

.status-draft {
    background: #fff3e0;
    color: #e65100;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 0.85rem;
}

.featured {
    background: #e3f2fd;
    color: #1565c0;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 0.85rem;
}

/* 消息提示 */
.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.no-data {
    text-align: center;
    color: #999;
    padding: 40px;
}

.recent-articles {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.recent-articles h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1976d2;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .sidebar-right {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .widget {
        flex: 1;
        min-width: 250px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* 导航菜单 */
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1565c0;
        flex-direction: column;
        padding: 10px 0;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu a {
        padding: 12px 20px;
        border-radius: 0;
    }
    
    /* Banner */
    .banner {
        padding: 40px 0;
    }
    
    .banner h2 {
        font-size: 1.5rem;
    }
    
    /* 推荐区域 */
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    /* 文章列表 */
    .article-item {
        flex-direction: column;
    }
    
    .article-image {
        width: 100%;
        height: 180px;
    }
    
    /* 后台布局 */
    .admin-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: relative;
    }
    
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        padding: 10px;
    }
    
    .sidebar-nav a {
        padding: 10px 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* 表格响应式 */
    .data-table {
        display: block;
        overflow-x: auto;
    }
    
    /* 页脚 */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .article-header h1 {
        font-size: 1.4rem;
    }
    
    .article-detail {
        padding: 20px;
    }
    
    .login-box {
        padding: 25px;
    }
}
