/* ===== 修复滚动条造成的宽度跳动 ===== */
html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

* {
    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;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* ===== 头部 ===== */
.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;
    max-width: 300px;
    height: auto;
}

.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;
}

/* ===== 返回按钮 ===== */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffffcc;
    backdrop-filter: blur(4px);
    border: 1px solid #bdcbe2;
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #40557a;
    margin-bottom: 1.8rem;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
}

.btn-back:hover {
    background: #fff;
    border-color: #8fa1c2;
    color: #253c60;
}

/* ===== 文章卡片 ===== */
.article-detail {
    background: #ffffffdd;
    backdrop-filter: blur(4px);
    border-radius: 32px;
    padding: 2rem 2rem 2.8rem;
    box-shadow: 0 10px 25px -12px rgba(0,0,0,0.1);
    border: 1px solid rgba(165, 185, 215, 0.5);
    min-height: 400px;
}

/* ===== 文章头部 ===== */
.detail-header {
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e9eef4;
    padding-bottom: 1.2rem;
}

.detail-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1f2e4a;
    margin-bottom: 0.8rem;
}

.detail-meta {
    display: flex;
    gap: 1.8rem;
    font-size: 0.9rem;
    color: #6f7e9b;
}

/* ===== 文章正文 ===== */
.detail-content {
    font-size: 1rem;
    color: #1f2a44;
    line-height: 1.65;
}

.detail-content h1,
.detail-content h2,
.detail-content h3 {
    margin: 1.5rem 0 0.8rem;
    font-weight: 600;
}

.detail-content p {
    margin: 1rem 0;
}

.detail-content blockquote {
    border-left: 4px solid #a9c0e6;
    background: #f5f9ff;
    padding: 0.8rem 1.2rem;
    border-radius: 20px;
    margin: 1rem 0;
}

.detail-content ul,
.detail-content ol {
    padding-left: 1.8rem;
    margin: 0.8rem 0;
}

.detail-content li {
    margin: 0.3rem 0;
    line-height: 1.6;
}

.detail-content img {
    max-width: 100%;
    border-radius: 24px;
    margin: 1rem 0;
    box-shadow: 0 5px 12px rgba(0,0,0,0.05);
}

.detail-content pre {
    background: #eef2fa;
    padding: 1rem;
    border-radius: 20px;
    overflow-x: auto;
}

.detail-content code {
    background: #eef2fa;
    padding: 0.2rem 0.4rem;
    border-radius: 12px;
    font-size: 0.9em;
}

/* ===== 文章内链接样式（蓝色系，覆盖浏览器默认紫色） ===== */
.detail-content a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.detail-content a:visited {
    color: #1d4ed8;
}

.detail-content a:hover {
    color: #3b82f6;
}

.detail-content a:active {
    color: #1e40af;
}

/* ===== 提示信息框 ===== */
.info-box {
    background: #eef3ff;
    border-radius: 24px;
    padding: 1.2rem 1.5rem;
    margin: 1.2rem 0;
    border-left: 6px solid #7c93c7;
}

/* ===== 图片卡片 ===== */
.image-card {
    background: #f8faff;
    border-radius: 28px;
    padding: 0.8rem;
    text-align: center;
    margin: 1.4rem 0;
    border: 1px solid #dce5f2;
}

.image-card img {
    border-radius: 20px;
    margin: 0;
}

/* ===== 状态提示 ===== */
.error-message {
    color: #b91c1c;
    padding: 2rem;
    text-align: center;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: #6f7d95;
}

/* ===== 页脚 ===== */
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;
}

/* ===== 骨架屏 ===== */
.skeleton-title {
    height: 2.2rem;
    width: 70%;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 0.8rem;
}

.skeleton-meta {
    display: inline-block;
    height: 1rem;
    width: 6rem;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

.skeleton-line {
    height: 1rem;
    width: 100%;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.skeleton-line.short {
    width: 60%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== 夜间模式 ===== */
@media (prefers-color-scheme: dark) {
    body {
        background: #121826;
        color: #e2e8f0;
    }

    .article-detail {
        background: #1e293b;
        border-color: #2d3748;
    }

    .detail-title {
        color: #f1f5f9;
    }

    .detail-meta,
    .detail-content {
        color: #cbd5e1;
    }

    .detail-content blockquote {
        background: #0f172a;
        border-left-color: #6b7280;
        color: #e2e8f0;
    }

    .detail-content pre,
    .detail-content code {
        background: #0f172a;
        color: #e2e8f0;
    }

    /* 夜间模式链接颜色 */
    .detail-content a {
        color: #60a5fa;
    }

    .detail-content a:visited {
        color: #93bbfc;
    }

    .detail-content a:hover {
        color: #93c5fd;
    }

    .detail-content a:active {
        color: #bfdbfe;
    }

    .info-box {
        background: #0f172a;
        border-left-color: #818cf8;
    }

    .image-card {
        background: #0f172a;
        border-color: #334155;
    }

    .btn-back {
        background: #1e293b;
        border-color: #475569;
        color: #cbd5e6;
    }

    .btn-back:hover {
        background: #2d3a5e;
        border-color: #818cf8;
        color: white;
    }

    .header {
        border-bottom-color: rgba(100, 116, 139, 0.3);
    }

    .sub {
        color: #9ca3af;
    }

    .skeleton-title,
    .skeleton-meta,
    .skeleton-line {
        background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    }
}

/* ===== 响应式 ===== */
@media (max-width: 700px) {
    .container {
        padding: 1rem;
    }
    .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;
    }
    .detail-title {
        font-size: 1.6rem;
    }
}
