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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    min-height: 100vh;
}

/* 左侧主内容 */
.main-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 头部 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.site-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.site-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* 文章列表 */
.articles {
    padding: 0;
}

.article-item {
    padding: 30px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-bottom: 10px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    cursor: pointer;
}

.article-item:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-bottom-color: transparent;
}

.article-item:last-child {
    border-bottom: none;
}

.article-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
}

.article-date {
    font-weight: 500;
}

.article-views {
    color: #999;
}

.article-title {
    margin-bottom: 15px;
}

.article-item .article-title a {
    color: #2c3e50 !important;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
    transition: all 0.3s ease;
    display: block;
    padding: 5px 0;
    border-radius: 4px;
    position: relative;
}

.article-item .article-title a:hover {
    color: #667eea !important;
    transform: translateX(5px);
    text-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.article-title a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.article-title a:hover::after {
    width: 100%;
}

.article-excerpt {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
}

/* 右侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.qr-section,
.about-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    text-align: center;
}

.qr-title,
.about-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.qr-code {
    margin-bottom: 20px;
}

.qr-image {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.qr-desc {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

.about-desc {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: left;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }
    
    .header {
        padding: 30px 20px;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .article-item {
        padding: 20px;
    }
    
    .article-title a {
        font-size: 1.2rem;
    }
    
    .qr-image {
        width: 150px;
        height: 150px;
    }
    
    .sidebar {
        order: -1;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px 15px;
    }
    
    .site-title {
        font-size: 1.8rem;
    }
    
    .article-item {
        padding: 15px;
    }
    
    .article-title a {
        font-size: 1.1rem;
    }
    
    .qr-section,
    .about-section {
        padding: 20px;
    }
    
    .qr-image {
        width: 120px;
        height: 120px;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 链接样式 */
a {
    transition: color 0.2s ease;
}

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

.article-item {
    animation: fadeIn 0.6s ease-out;
}

.article-item:nth-child(1) { animation-delay: 0.1s; }
.article-item:nth-child(2) { animation-delay: 0.2s; }
.article-item:nth-child(3) { animation-delay: 0.3s; }
.article-item:nth-child(4) { animation-delay: 0.4s; }
.article-item:nth-child(5) { animation-delay: 0.5s; }
.article-item:nth-child(6) { animation-delay: 0.6s; }
.article-item:nth-child(7) { animation-delay: 0.7s; }
.article-item:nth-child(8) { animation-delay: 0.8s; }

/* 加载动画 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 30px;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 加载更多按钮 */
.load-more-container {
    text-align: center;
    padding: 30px;
    background: white;
    border-top: 1px solid #f0f0f0;
}

.load-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.load-more-btn:active {
    transform: translateY(0);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 错误状态 */
.error-message {
    text-align: center;
    padding: 40px 30px;
    color: #e74c3c;
    background: #fdf2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin: 20px 30px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 30px;
    color: #666;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #333;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .loading {
        padding: 40px 20px;
    }
    
    .load-more-container {
        padding: 20px;
    }
    
    .load-more-btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
}

/* 文章详情页样式 */
.article-detail {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border: 1px solid #f0f0f0;
}

.article-header {
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 2rem;
    margin-bottom: 2.5rem;
    position: relative;
}

.article-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 1px;
}

.article-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #666;
    flex-wrap: wrap;
}

.article-meta span {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.article-meta span:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.article-detail .article-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #2c3e50;
    margin: 0 0 1.5rem 0;
    line-height: 1.2;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-description {
    font-size: 1.2rem;
    color: #7f8c8d;
    line-height: 1.7;
    margin: 0;
    font-weight: 400;
    font-style: italic;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.9;
    color: #2c3e50;
    margin-bottom: 3rem;
    font-weight: 400;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    color: #2c3e50;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    position: relative;
}

.article-content h1 {
    font-size: 2rem;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 0.5rem;
}

.article-content h2 {
    font-size: 1.7rem;
    color: #667eea;
}

.article-content h3 {
    font-size: 1.4rem;
    color: #764ba2;
}

.article-content p {
    margin-bottom: 1.8rem;
    text-align: justify;
    word-spacing: 0.1em;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.8rem;
    padding-left: 2.5rem;
}

.article-content li {
    margin-bottom: 0.8rem;
    line-height: 1.7;
}

.article-content blockquote {
    border-left: 4px solid #667eea;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0 8px 8px 0;
    color: #495057;
    font-style: italic;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.article-content blockquote::before {
    content: '"';
    font-size: 4rem;
    color: #667eea;
    position: absolute;
    top: -10px;
    left: 10px;
    opacity: 0.3;
    font-family: serif;
}

.article-content code {
    background: linear-gradient(135deg, #f1f3f4 0%, #e8eaed 100%);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: #d63384;
    border: 1px solid #e9ecef;
    font-weight: 500;
}

.article-content pre {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #4a5568;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
    border: none;
    font-size: 0.9rem;
    line-height: 1.6;
}

.article-footer {
    border-top: 2px solid #f8f9fa;
    padding-top: 2rem;
    margin-top: 3rem;
    position: relative;
}

.article-footer::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 1px;
}

.article-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.action-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 140px;
    text-align: center;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.action-btn.secondary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    border: 2px solid #dee2e6;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.action-btn.secondary:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.back-to-home {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #f0f0f0;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid #dee2e6;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.back-btn::before {
    content: '←';
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.back-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: #343a40;
}

.back-btn:hover::before {
    transform: translateX(-3px);
}

/* 详情页响应式设计 */
@media (max-width: 768px) {
    .article-detail {
        padding: 2rem 1.5rem;
        margin: 1rem;
        border-radius: 8px;
    }
    
    .article-title {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .article-description {
        font-size: 1.1rem;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 0.8rem;
        margin-bottom: 1.2rem;
    }
    
    .article-meta span {
        align-self: flex-start;
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .article-content {
        font-size: 1rem;
        line-height: 1.8;
    }
    
    .article-content h1 {
        font-size: 1.6rem;
    }
    
    .article-content h2 {
        font-size: 1.4rem;
    }
    
    .article-content h3 {
        font-size: 1.2rem;
    }
    
    .article-content blockquote {
        padding: 1rem 1.5rem;
        margin: 1.5rem 0;
    }
    
    .article-content pre {
        padding: 1rem;
        margin: 1.5rem 0;
        border-radius: 8px;
    }
    
    .article-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .action-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        min-width: auto;
    }
    
    .back-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .article-detail {
        padding: 1.5rem 1rem;
        margin: 0.5rem;
    }
    
    .article-title {
        font-size: 1.5rem;
    }
    
    .article-description {
        font-size: 1rem;
    }
    
    .article-content {
        font-size: 0.95rem;
    }
    
    .article-content h1 {
        font-size: 1.4rem;
    }
    
    .article-content h2 {
        font-size: 1.2rem;
    }
    
    .article-content h3 {
        font-size: 1.1rem;
    }
}

/* 广告区域样式 */
.ad-section {
    margin-top: 15px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    text-align: center;
    min-height: 90px;
    max-height: 250px;
    overflow: hidden;
}

.ad-section .adsbygoogle {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

/* 移动端广告样式 */
@media (max-width: 768px) {
    .ad-section {
        margin-top: 10px;
        padding: 6px;
        min-height: 80px;
        max-height: 200px;
    }
}