/* 医疗管理与器械博客 - 主题配色方案 */
/* 专业、严谨、科技感 */

:root {
    --primary-color: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary-color: #06b6d4;
    --secondary-dark: #0891b2;
    --accent-color: #10b981;
    --accent-dark: #059669;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --surface-hover: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-color: rgba(30, 64, 175, 0.1);
    --gradient-primary: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --gradient-hero: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #3b82f6 100%);
    --gradient-card: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
}

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

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 16px 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px var(--shadow-color);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.3s ease;
}

.logo:hover {
    color: var(--primary-dark);
}

.logo-icon {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* 英雄区域 */
.hero {
    padding: 160px 0 100px;
    background: var(--gradient-hero);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    position: relative;
    animation: fadeInUp 0.8s ease;
}

.hero .subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto 40px;
    position: relative;
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    position: relative;
    animation: fadeInUp 0.8s ease 0.4s backwards;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* 分类网格 */
.categories-section {
    padding: 80px 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.category-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px 24px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px var(--shadow-color);
    border-color: var(--primary-light);
}

.category-card:hover::before {
    transform: scaleY(1);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    display: block;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.category-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.category-count {
    display: inline-block;
    margin-top: 16px;
    padding: 6px 12px;
    background: var(--surface-hover);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* 文章列表 */
.articles-section {
    padding: 60px 0;
    background: var(--surface-hover);
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.article-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px var(--shadow-color);
}

.article-header {
    padding: 24px;
    background: var(--gradient-card);
    color: white;
}

.article-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 12px;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.5;
}

.article-body {
    padding: 24px;
}

.article-excerpt {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.article-tag {
    padding: 4px 10px;
    background: var(--surface-hover);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 0.75rem;
}

.article-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 文章页面 */
.article-page {
    padding-top: 100px;
}

.article-header-section {
    padding: 60px 0;
    background: var(--gradient-hero);
    color: white;
}

.article-header-content {
    max-width: 800px;
    margin: 0 auto;
}

.article-category {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.article-main-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 20px;
}

.article-meta-info {
    display: flex;
    gap: 24px;
    font-size: 0.95rem;
    opacity: 0.9;
}

.article-body-section {
    padding: 60px 0;
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
}

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 40px 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.article-content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 30px 0 15px;
}

.article-content p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.article-content ul, .article-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.article-content li {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 10px;
}

/* 外链区域 */
.external-links {
    padding: 60px 0;
    background: var(--surface-hover);
    border-top: 1px solid var(--border-color);
}

.external-links h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 30px;
    text-align: center;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.links-grid a {
    display: block;
    padding: 12px 16px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.links-grid a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* 页脚 */
.footer {
    padding: 40px 0;
    background: var(--primary-dark);
    color: white;
    text-align: center;
}

.footer p {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px var(--shadow-color);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-4px);
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.6s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 30px;
    }

    .nav-links {
        display: none;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .article-grid {
        grid-template-columns: 1fr;
    }

    .links-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .article-main-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .links-grid {
        grid-template-columns: 1fr;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* 选择文本样式 */
::selection {
    background: var(--primary-color);
    color: white;
}
