/* IoT物联网博客 - 连接节点科技风格 */

:root {
    --iot-blue: #2563EB;
    --iot-green: #059669;
    --iot-cyan: #06B6D4;
    --iot-dark: #0F172A;
    --iot-surface: #1E293B;
    --iot-border: #334155;
    --iot-text: #E2E8F0;
    --iot-muted: #94A3B8;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--iot-dark);
    color: var(--iot-text);
    line-height: 1.7;
}

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

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--iot-border);
    z-index: 1000;
    padding: 16px 0;
}

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

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--iot-cyan);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo::before {
    content: '◉';
    color: var(--iot-green);
}

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

.nav-links a {
    color: var(--iot-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

/* 英雄区域 */
.hero {
    padding: 140px 0 80px;
    text-align: center;
    position: relative;
    background: linear-gradient(180deg, var(--iot-dark) 0%, var(--iot-surface) 100%);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(5, 150, 105, 0.15) 0%, transparent 40%);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    position: relative;
}

.hero h1 span {
    color: var(--iot-cyan);
}

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

/* 分类卡片 */
.categories-section {
    padding: 60px 0;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::before {
    content: '◎';
    color: var(--iot-green);
}

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

.category-card {
    background: var(--iot-surface);
    border: 1px solid var(--iot-border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    display: block;
    position: relative;
}

.category-card::before {
    content: '◉';
    position: absolute;
    top: 16px;
    right: 16px;
    color: var(--iot-blue);
    opacity: 0.5;
}

.category-card:hover {
    border-color: var(--iot-cyan);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(6, 182, 212, 0.15);
}

.category-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--iot-text);
}

.category-card p {
    color: var(--iot-muted);
    font-size: 0.9rem;
}

.category-count {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(37, 99, 235, 0.2);
    color: var(--iot-blue);
    border-radius: 12px;
    font-size: 0.8rem;
    margin-top: 12px;
}

/* 文章列表 */
.articles-section {
    padding: 60px 0;
}

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

.article-card {
    background: var(--iot-surface);
    border: 1px solid var(--iot-border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.article-card:hover {
    border-color: var(--iot-green);
    transform: translateY(-4px);
}

.article-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--iot-text);
}

.article-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--iot-muted);
}

.article-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(5, 150, 105, 0.2);
    color: var(--iot-green);
    border-radius: 10px;
    font-size: 0.75rem;
    margin-top: 12px;
}

/* 文章内容页 */
.article-header {
    padding: 120px 0 60px;
    background: linear-gradient(180deg, var(--iot-dark) 0%, var(--iot-surface) 100%);
}

.article-header .category {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(37, 99, 235, 0.2);
    color: var(--iot-blue);
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.article-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.article-header .meta {
    display: flex;
    gap: 20px;
    color: var(--iot-muted);
    font-size: 0.9rem;
}

.article-content {
    padding: 40px 0;
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    margin-top: 32px;
    color: var(--iot-cyan);
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-content h2::before {
    content: '◎';
    color: var(--iot-green);
}

.article-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
    margin-top: 24px;
    color: var(--iot-text);
}

.article-content p {
    margin-bottom: 16px;
    color: var(--iot-muted);
}

.article-content ul {
    margin-bottom: 16px;
    padding-left: 24px;
    color: var(--iot-muted);
}

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

.article-content li::before {
    content: '◉';
    position: absolute;
    left: -16px;
    color: var(--iot-green);
}

.tip-box {
    background: rgba(5, 150, 105, 0.1);
    border: 1px solid rgba(5, 150, 105, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
}

.tip-box h4 {
    color: var(--iot-green);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tip-box h4::before {
    content: '⦿';
}

.tip-box p {
    color: var(--iot-text);
}

blockquote {
    background: rgba(37, 99, 235, 0.1);
    border-left: 4px solid var(--iot-blue);
    padding: 16px 20px;
    margin: 24px 0;
    border-radius: 8px;
    color: var(--iot-text);
    font-style: italic;
}

blockquote::before {
    content: '◉ ';
    color: var(--iot-cyan);
}

/* 外链区域 */
.links-section {
    padding: 60px 0;
    background: var(--iot-surface);
}

.links-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--iot-text);
}

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

.link-category {
    background: var(--iot-dark);
    border: 1px solid var(--iot-border);
    border-radius: 12px;
    padding: 20px;
}

.link-category-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--iot-cyan);
}

.link-category-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.link-item {
    color: var(--iot-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.link-item::before {
    content: '◉';
    color: var(--iot-green);
    font-size: 0.7rem;
}

.link-item:hover {
    color: var(--iot-cyan);
}

/* 页脚 */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--iot-border);
    text-align: center;
}

.footer-bottom {
    color: var(--iot-muted);
    font-size: 0.9rem;
}

/* 分类页 */
.category-header {
    padding: 120px 0 60px;
    background: linear-gradient(180deg, var(--iot-dark) 0%, var(--iot-surface) 100%);
}

.category-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.category-header p {
    color: var(--iot-muted);
}

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

    .nav-links {
        display: none;
    }

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

/* 动画 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--iot-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--iot-cyan);
}