/* =========================================
   Homepage - Category Cards & Device Grid
   ========================================= */

/* Hero Section - 优化版 */
.hero-section {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    padding: 100px 40px;
    border-radius: 28px;
    margin-bottom: 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-title {
    font-size: 64px;
    font-weight: 800;
    color: white;
    margin-bottom: 24px;
    line-height: 1.15;
    letter-spacing: -1px;
}

.hero-title-accent {
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 22px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 40px;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
    font-weight: 400;
}

/* 分类卡片增强 */
.category-card {
    background: var(--apple-bg-secondary);
    border-radius: 20px;
    padding: 32px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid var(--apple-border-light);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--apple-blue), #5856D6);
    opacity: 0;
    transition: opacity 0.3s;
}

.category-card:hover::before {
    opacity: 1;
}

.category-card {
    background: var(--apple-bg-secondary);
    border-radius: 16px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid var(--apple-border-light);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

.category-icon {
    width: 48px;
    height: 48px;
    background: var(--apple-blue);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: white;
}

.category-icon.nas { background: #5856D6; }
.category-icon.ai { background: linear-gradient(135deg, #5856D6, #AF52DE); }
.category-icon.calculator { background: #FF9500; }

/* Device Grid - 统一图片尺寸 */
.device-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 24px 0;
}

.device-card {
    background: var(--apple-bg-secondary);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.device-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

.device-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.device-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.device-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.device-score {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--apple-green);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.device-content {
    padding: 16px;
}

.device-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.device-specs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.device-spec {
    font-size: 12px;
    color: var(--apple-text-secondary);
    background: var(--apple-bg);
    padding: 4px 8px;
    border-radius: 4px;
}

.device-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.device-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--apple-error);
}

/* Article List - 统一图片尺寸 */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 24px 0;
}

.article-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--apple-bg-secondary);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.article-item:hover {
    background: var(--apple-border-light);
}

.article-item .article-image {
    width: 160px;
    height: 100px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    overflow: hidden;
}

.article-item .article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-item .article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.article-item .article-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-item .article-meta {
    font-size: 13px;
    color: var(--apple-text-secondary);
}
   Color Palette:
   - Background: #FFFFFF
   - Secondary: #F5F5F7
   - Accent: #0071E3 (Apple Blue)
   - Success: #34C759 (Green)
   - Text: #1D1D1F
   - Secondary: #86868B
   - Border: #D2D2D7
   ========================================= */

:root {
    --apple-bg: #FFFFFF;
    --apple-bg-secondary: #F5F5F7;
    --apple-blue: #0071E3;
    --apple-blue-hover: #0077ED;
    --apple-green: #34C759;
    --apple-text: #1D1D1F;
    --apple-text-secondary: #86868B;
    --apple-border: #D2D2D7;
    --apple-border-light: #E5E5E5;
    --apple-success: #34C759;
    --apple-error: #FF3B30;
    --apple-warning: #FF9500;
    --font-cn: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    --font-en: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    --font-mono: "SF Mono", "Menlo", monospace;
    --font-rounded: "SF Pro Rounded", -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-cn);
    background-color: var(--apple-bg);
    color: var(--apple-text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--apple-blue); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--apple-blue-hover); }

/* Button Styles */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: var(--apple-blue);
    color: white;
    border-radius: 980px;
    font-size: 17px;
    font-weight: 400;
    transition: all 0.3s;
}
.btn-primary:hover {
    background: var(--apple-blue-hover);
    transform: scale(1.02);
}

/* Navigation */
nav {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: rgba(251, 251, 253, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--apple-border-light);
    height: 48px;
}

.nav-container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 22px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 19px;
    font-weight: 600;
    color: var(--apple-text);
}
.logo .highlight { color: var(--apple-blue); }

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}
.nav-links a {
    color: var(--apple-text);
    opacity: 0.8;
    font-size: 15px;
    font-weight: 500;
    transition: opacity 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
    opacity: 1;
    color: var(--apple-blue);
}

/* Search */
.search-box {
    display: flex;
    align-items: center;
    background: var(--apple-bg-secondary);
    border-radius: 8px;
    padding: 6px 12px;
    gap: 8px;
}
.search-icon { font-size: 14px; }
.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    width: 120px;
}

/* Main */
main {
    max-width: 1024px;
    margin: 0 auto;
    padding: 40px 22px;
}

/* Cards */
.card {
    background: var(--apple-bg);
    border: 1px solid var(--apple-border-light);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}
.card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Section Titles */
.section-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--apple-text);
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    .nav-links { display: none; }
    
    /* 移动端优化 */
    .hero-section {
        padding: 60px 20px;
        border-radius: 20px;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    /* 栏目卡片移动端 */
    .category-grid,
    .device-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    
    /* 热门设备移动端 */
    .device-grid {
        grid-template-columns: 1fr;
    }
    
    /* 最新文章移动端 */
    .article-item {
        flex-direction: column;
    }
    
    .article-item .article-image {
        width: 100%;
        height: 160px;
    }
}

/* Footer */
footer {
    background: var(--apple-bg-secondary);
    padding: 40px 0;
    margin-top: 80px;
    border-top: 1px solid var(--apple-border-light);
}
.footer-content {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 22px;
}
.footer-logo {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.footer-links {
    display: flex;
    gap: 20px;
}
.footer-links a {
    color: var(--apple-text-secondary);
    font-size: 12px;
}
.footer-copyright {
    color: var(--apple-text-secondary);
    font-size: 12px;
}

/* =========================================
   Article Content Styles
   ========================================= */

/* Article Header */
.article-header {
    margin-bottom: 32px;
}
.article-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--apple-text-secondary);
    margin-bottom: 16px;
}
.meta-category {
    background: var(--apple-bg-secondary);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
}

/* Article Featured Image */
.article-featured-image {
    margin: 0 0 32px 0;
    border-radius: 12px;
    overflow: hidden;
}
.article-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}
.article-featured-image figcaption {
    text-align: center;
    padding: 12px;
    font-size: 13px;
    color: var(--apple-text-secondary);
    background: var(--apple-bg-secondary);
}

/* Article Summary */
.article-summary {
    font-size: 18px;
    line-height: 1.7;
    color: var(--apple-text-secondary);
    padding: 20px;
    background: var(--apple-bg-secondary);
    border-radius: 12px;
    margin-bottom: 32px;
    border-left: 4px solid var(--apple-blue);
}

/* Article Content */
.article-content {
    font-size: 17px;
    line-height: 1.8;
}

.article-content h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 48px 0 24px 0;
    line-height: 1.3;
}

.article-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 40px 0 20px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--apple-border-light);
}

.article-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 16px 0;
}

.article-content h4 {
    font-size: 17px;
    font-weight: 600;
    margin: 24px 0 12px 0;
}

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

.article-content ul,
.article-content ol {
    margin: 0 0 20px 24px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content strong {
    font-weight: 600;
}

.article-content em {
    font-style: italic;
}

/* Article Tables */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
}

.article-content th,
.article-content td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid var(--apple-border-light);
}

.article-content th {
    background: var(--apple-bg-secondary);
    font-weight: 600;
}

.article-content tr:nth-child(even) {
    background: var(--apple-bg-secondary);
}

/* Article Code Blocks */
.article-content code {
    font-family: var(--font-mono);
    font-size: 14px;
    background: var(--apple-bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
}

.article-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 24px 0;
}

.article-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Article Blockquotes */
.article-content blockquote {
    border-left: 4px solid var(--apple-blue);
    padding: 16px 20px;
    margin: 24px 0;
    background: var(--apple-bg-secondary);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--apple-text-secondary);
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Article Images */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

/* Article Links */
.article-content a {
    color: var(--apple-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-content a:hover {
    color: var(--apple-blue-hover);
}

/* Article Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--apple-border-light);
}
.tags-label {
    font-size: 14px;
    color: var(--apple-text-secondary);
    line-height: 28px;
}

/* Related Articles */
.related-articles {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--apple-border-light);
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.related-card {
    border: 1px solid var(--apple-border-light);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}
.related-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.related-image {
    height: 120px;
    background: var(--apple-bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}
.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.related-title {
    font-size: 14px;
    font-weight: 600;
    padding: 12px;
}

@media (max-width: 768px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
    .article-title {
        font-size: 28px;
    }
    .article-content h1 { font-size: 26px; }
    .article-content h2 { font-size: 20px; }
    .article-content h3 { font-size: 17px; }
}

/* =========================================
   Common Components
   ========================================= */

/* Breadcrumb */
.breadcrumb {
    font-size: 13px;
    color: var(--apple-text-secondary);
    margin-bottom: 20px;
}
.breadcrumb a { color: var(--apple-text-secondary); }
.breadcrumb a:hover { color: var(--apple-blue); }
.breadcrumb span { margin: 0 8px; }

/* Tags */
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--apple-bg-secondary);
    border-radius: 100px;
    font-size: 12px;
    color: var(--apple-text-secondary);
    transition: all 0.2s;
}
.tag:hover {
    background: var(--apple-blue);
    color: white;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    margin: 20px 0;
}
.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--apple-border);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}
.action-btn:hover {
    border-color: var(--apple-blue);
    color: var(--apple-blue);
}
.action-btn.active {
    background: var(--apple-blue);
    color: white;
    border-color: var(--apple-blue);
}

/* Comments Section */
.comments-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--apple-border-light);
}
.comment-form {
    margin-bottom: 30px;
}
.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--apple-border);
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    font-size: 15px;
}
.comment-form .btn-primary {
    margin-top: 12px;
}
.comment-list { margin-top: 20px; }
.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--apple-border-light);
}
.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--apple-bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.comment-content { flex: 1; }
.comment-author {
    font-weight: 600;
    font-size: 14px;
}
.comment-time {
    font-size: 12px;
    color: var(--apple-text-secondary);
    margin-left: 8px;
}
.comment-text {
    font-size: 14px;
    margin-top: 4px;
}

/* Affiliate Box */
.affiliate-box {
    background: var(--apple-bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
    border: 1px solid var(--apple-border-light);
}
.affiliate-box h3 {
    font-size: 18px;
    margin-bottom: 8px;
}
.affiliate-box p {
    color: var(--apple-text-secondary);
    margin-bottom: 16px;
    font-size: 14px;
}
.affiliate-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.affiliate-btn {
    display: flex;
    flex-direction: column;
    padding: 12px 20px;
    background: var(--apple-blue);
    color: white !important;
    border-radius: 8px;
    transition: all 0.2s;
    min-width: 140px;
}
.affiliate-btn:hover {
    background: var(--apple-blue-hover);
    transform: translateY(-2px);
}
.affiliate-name {
    font-weight: 600;
    font-size: 14px;
}
.affiliate-price {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 4px;
}
