/* 现代化设计风格 - 工人博客 */

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --success: #10b981;
    --danger: #ef4444;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #f8fafc;
    --text-dark: #0f172a;
    --text-normal: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-hover: 0 10px 40px rgba(0,0,0,0.12);
    --shadow-float: 0 20px 50px rgba(0,0,0,0.15);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-normal);
    background: var(--bg-main);
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header - 玻璃态设计 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

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

.logo {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-dark);
}

.logo a {
    color: var(--text-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo a::before {
    content: '⚒️';
    font-size: 1.5rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.nav a:hover {
    color: var(--text-dark);
    background: var(--bg-hover);
}

.nav a.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.nav .user-info {
    color: var(--text-muted);
    padding: 8px 0;
}

/* Hero - 简洁大气 */
.hero {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
    padding: 60px 40px;
    border-radius: var(--radius-xl);
    text-align: center;
    margin: 32px 0;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.03) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    position: relative;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.15rem;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.main {
    min-height: calc(100vh - 300px);
    padding: 16px 0 60px;
}

/* Section Title */
.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--primary);
    border-radius: 2px;
}

/* Article Grid - 网格布局 */
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.article-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-float);
    border-color: transparent;
}

.article-cover {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .article-cover img {
    transform: scale(1.1);
}

.article-content {
    padding: 20px;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
    line-height: 1.4;
}

.article-title a {
    color: inherit;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.article-excerpt {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-light);
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.article-meta .rating {
    color: var(--accent);
    font-weight: 600;
}

/* Article Detail */
.article-detail {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border-light);
    margin-bottom: 32px;
}

.article-detail-cover {
    height: 400px;
    overflow: hidden;
    position: relative;
}

.article-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-detail-header {
    padding: 32px;
}

.article-detail-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 20px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.article-detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-info .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-light);
}

.author-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

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

.article-stats {
    display: flex;
    gap: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.article-detail-content {
    padding: 32px;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-normal);
}

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

/* Comments */
.comments-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 32px;
    border: 1px solid var(--border-light);
    margin-bottom: 32px;
}

.comment-form {
    background: var(--bg-hover);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--bg-card);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.rating-select {
    display: flex;
    gap: 12px;
}

.rating-star {
    cursor: pointer;
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: var(--bg-card);
}

.rating-star:hover {
    border-color: var(--accent);
    background: rgba(245, 158, 11, 0.05);
}

.rating-star input {
    display: none;
}

.rating-star:has(input:checked) {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-submit {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item {
    padding: 20px;
    background: var(--bg-hover);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.comment-item:hover {
    background: var(--bg-card);
    border-color: var(--border);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-header .avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-author {
    font-weight: 600;
    color: var(--text-dark);
}

.comment-rating {
    color: var(--accent);
    font-weight: 600;
}

.comment-date {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-left: auto;
}

.comment-content {
    color: var(--text-normal);
    line-height: 1.6;
}

/* Categories - 精美卡片 */
.categories-section {
    margin-bottom: 48px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.category-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.category-card-header {
    padding: 24px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-bottom: 1px solid var(--border-light);
}

.category-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

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

.category-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
}

.category-count {
    font-size: 0.75rem;
    color: white;
    background: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.category-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-top: 12px;
}

.category-articles {
    padding: 16px 24px;
}

.category-article-link {
    display: block;
    color: var(--text-normal);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-article-link::before {
    content: '•';
    color: var(--primary-light);
    margin-right: 6px;
    transition: all 0.2s ease;
}

.category-article-link:hover {
    color: var(--primary);
    padding-left: 8px;
}

.category-article-link:hover::before {
    background: var(--primary);
    width: 8px;
    height: 8px;
}

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

.category-footer {
    padding: 16px 24px 24px;
}

.category-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    background: rgba(99, 102, 241, 0.1);
}

.category-more:hover {
    background: var(--primary);
    color: white;
}

/* Article Navigation */
.article-nav {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.article-nav-item {
    flex: 1;
}

.article-nav-item.prev {
    text-align: left;
}

.article-nav-item.next {
    text-align: right;
}

.nav-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.article-nav-item a {
    color: var(--primary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.article-nav-item a:hover {
    color: var(--primary-dark);
}

.nav-disabled {
    color: var(--text-light);
    opacity: 0.5;
}

/* Recommended Articles */
.recommended-section {
    margin-bottom: 48px;
}

.recommended-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.recommended-item {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.recommended-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.recommended-cover {
    height: 140px;
    overflow: hidden;
}

.recommended-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.recommended-item:hover .recommended-cover img {
    transform: scale(1.1);
}

.recommended-content {
    padding: 12px;
}

.recommended-title {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.recommended-item:hover .recommended-title {
    color: var(--primary);
}

/* Ad Container */
.ad-container {
    background: var(--bg-hover);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 24px 0;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.ad-placeholder {
    color: var(--text-light);
    font-size: 0.85rem;
}

.ad-label {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 40px 0;
    margin-top: 60px;
}

.footer .seo-links {
    margin-top: 12px;
}

.footer .seo-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    margin: 0 12px;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer .seo-links a:hover {
    color: var(--primary-light);
}

/* Messages */
.message {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.no-articles, .no-comments, .no-recommend {
    text-align: center;
    color: var(--text-light);
    padding: 40px;
    background: var(--bg-hover);
    border-radius: var(--radius-lg);
}

.error {
    text-align: center;
    color: var(--danger);
    padding: 40px;
    background: rgba(239, 68, 68, 0.05);
    border-radius: var(--radius-lg);
}

/* Responsive */
@media (max-width: 1024px) {
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .recommended-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        height: auto;
        padding: 16px;
        gap: 12px;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero {
        padding: 40px 24px;
        margin: 24px 0;
    }
    
    .hero h2 {
        font-size: 1.75rem;
    }
    
    .article-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .article-detail-cover {
        height: 280px;
    }
    
    .article-detail-title {
        font-size: 1.5rem;
    }
    
    .article-detail-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .recommended-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .article-nav {
        flex-direction: column;
        gap: 16px;
    }
    
    .article-nav-item.next {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .recommended-list {
        grid-template-columns: 1fr;
    }
    
    .rating-select {
        flex-wrap: wrap;
    }
}