/* ---------- 全局重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(145deg, #f4f7fc 0%, #eef2f7 100%);
    color: #1f2a3e;
    line-height: 1.5;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex: 1;
    gap: 2rem;
}

/* 左侧导航栏 */
.sidebar {
    flex: 0 0 240px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 32px;
    padding: 1.5rem 0.8rem;
    border: 1px solid rgba(156, 180, 209, 0.3);
    height: fit-content;
    position: sticky;
    top: 2rem;
    transition: all 0.2s;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1.2rem;
    margin: 0.3rem 0;
    border-radius: 28px;
    font-weight: 500;
    color: #2c3e66;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-item i {
    width: 1.6rem;
    font-size: 1.2rem;
    text-align: center;
}

.nav-item:hover {
    background: rgba(165, 185, 215, 0.3);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(120deg, #a5c9ff, #c7b9ff);
    color: #1f2a44;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    .sidebar {
        background: rgba(30, 36, 48, 0.7);
        border-color: #2d3748;
    }
    .nav-item {
        color: #cbd5e6;
    }
    .nav-item.active {
        background: linear-gradient(120deg, #4a5b82, #6c5b9b);
        color: #ffffff;
    }
    .nav-item:hover {
        background: rgba(100, 116, 139, 0.4);
    }
}

/* 右侧主内容 */
.main-content {
    flex: 1;
    min-width: 0;
}

.header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
}

.logo-area {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.about-image img {
    border-radius: 12px;
}

.title-zone {
    text-align: right;
}

.typing-title {
    font-size: 2.0rem;
    font-weight: 600;
    background: linear-gradient(120deg, #3b4b6e, #6c5b9b);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: -0.3px;
    border-right: 3px solid #8b7bb5;
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
    animation: blinkCursor 0.75s step-end infinite;
}

@keyframes blinkCursor {
    0%, 100% { border-color: #8b7bb5; }
    50% { border-color: transparent; }
}

.sub {
    font-size: 0.8rem;
    color: #6f7d95;
    margin-top: 8px;
}

/* 外部资源卡片 */
.resources-section {
    margin: 1.5rem 0 2rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 28px;
    padding: 1.2rem 1.5rem;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(156, 180, 209, 0.3);
}

.resources-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e66;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px dashed #b4c8f0;
}

.resources-tip {
    font-size: 0.7rem;
    font-weight: normal;
    color: #8c9bbb;
}

.resources-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.resource-card {
    flex: 1 1 240px;
    background: white;
    border-radius: 20px;
    padding: 0.8rem 1rem;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: #1f2a3e;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.resource-card:hover {
    transform: translateY(-3px);
    border-color: #a9c0e6;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
}

.resource-icon {
    font-size: 1.8rem;
    width: 2.2rem;
    text-align: center;
}

.resource-info {
    flex: 1;
}

.resource-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.resource-desc {
    font-size: 0.7rem;
    color: #6f7d95;
    word-break: break-all;
}

/* 文章列表 */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    margin-top: 1rem;
}

.blog-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    border-radius: 28px;
    padding: 1.6rem 2rem;
    transition: all 0.25s ease;
    border: 1px solid rgba(156, 180, 209, 0.3);
    cursor: pointer;
    position: relative;
}

.top-badge {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: #ffb347;
    color: #2d1f00;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.blog-card:hover {
    transform: translateY(-4px);
    background: #ffffff;
    border-color: #cbddee;
}

.card-title {
    font-size: 1.7rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    letter-spacing: -0.2px;
}

.card-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.card-meta i {
    width: 1.2rem;
    color: #8d9bc2;
}

.excerpt {
    line-height: 1.55;
    font-size: 0.95rem;
    border-left: 3px solid #b4c8f0;
    padding-left: 1rem;
    margin-top: 0.5rem;
}

/* 加载状态 */
.loading-placeholder {
    text-align: center;
    padding: 3rem;
    color: #6f7d95;
    font-size: 1rem;
}

footer {
    text-align: center;
    margin-top: 3rem;
    font-size: 0.75rem;
    color: #8c9bbb;
    border-top: 1px solid rgba(128, 147, 175, 0.2);
    padding-top: 2rem;
}

/* 夜间模式 */
@media (prefers-color-scheme: dark) {
    body {
        background: #121826;
        color: #e2e8f0;
    }
    .blog-card, .resources-section {
        background: rgba(30, 36, 48, 0.85);
        border-color: #2d3748;
    }
    .blog-card:hover {
        background: #1e293b;
        border-color: #4a5568;
    }
    .card-title {
        color: #f1f5f9;
        background: linear-gradient(120deg, #cbd5e6, #a5b4fc);
        background-clip: text;
        -webkit-background-clip: text;
        color: transparent;
    }
    .card-meta, .sub, .excerpt {
        color: #cbd5e1;
    }
    .excerpt {
        border-left-color: #4a5568;
    }
    .resource-card {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }
    .resource-card:hover {
        background: #2d3a5e;
        border-color: #818cf8;
    }
    .resource-desc {
        color: #9ca3af;
    }
    .resources-header {
        color: #cbd5e6;
        border-bottom-color: #4a5568;
    }
    footer {
        color: #6b7280;
        border-top-color: #2d3748;
    }
}

/* 响应式 */
@media (max-width: 860px) {
    .container {
        flex-direction: column;
        gap: 1.5rem;
    }
    .sidebar {
        flex: auto;
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 1rem;
        justify-content: center;
    }
    .nav-item {
        padding: 0.5rem 1rem;
        margin: 0;
    }
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .title-zone {
        text-align: left;
        width: 100%;
    }
    .typing-title {
        font-size: 1.4rem;
        white-space: normal;
        border-right: none;
        animation: none;
    }
    .blog-card {
        padding: 1.2rem;
    }
    .card-title {
        font-size: 1.4rem;
    }
    .resources-grid {
        flex-direction: column;
    }
}
