/* ============================================
   全站样式：液态玻璃 + 线性动画 + 动态组件
   ============================================ */

/* ---------- CSS 变量 ---------- */
:root {
    --primary: #0a84ff;
    --primary-light: #409cff;
    --purple: #bf5af2;
    --pink: #ff375f;
    --orange: #ff9f0a;
    --green: #30d158;
    --bg: #f2f2f7;
    --text: #1c1c1e;
    --text-secondary: #6e6e73;
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    --radius: 24px;
    --radius-sm: 16px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto,
            "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* ---------- 基础重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at 20% 20%, rgba(10, 132, 255, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 10%, rgba(191, 90, 242, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(255, 55, 95, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(48, 209, 88, 0.15) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ---------- 背景动态光球 ---------- */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
    animation: float 12s ease-in-out infinite;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: #0a84ff;
    top: -150px;
    left: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 450px;
    height: 450px;
    background: #bf5af2;
    top: 30%;
    right: -150px;
    animation-delay: -4s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: #ff375f;
    bottom: -100px;
    left: 30%;
    animation-delay: -8s;
}

.blob-4 {
    width: 350px;
    height: 350px;
    background: #30d158;
    top: 60%;
    left: -100px;
    animation-delay: -2s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -40px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 30px) scale(0.9);
    }
}

/* ---------- 阅读进度条 ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--purple), var(--pink));
    z-index: 1000;
    transition: width 0.1s linear;
}

/* ---------- 液态玻璃通用类 ---------- */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
}

.glass-sm {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ---------- 导航栏 ---------- */
.navbar {
    position: sticky;
    top: 10px;
    margin: 10px auto;
    max-width: 1200px;
    width: calc(100% - 20px);
    z-index: 100;
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.7);
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 1.8rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--purple));
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.active {
    color: var(--primary);
}

.nav-links a.active::after {
    width: 100%;
}

.search-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.3s;
    border: 1px solid rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.3);
}

.search-btn:hover {
    color: var(--primary);
    background: rgba(255,255,255,0.8);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: none;
    gap: 5px;
    padding: 8px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

/* ---------- 英雄区 ---------- */
.hero {
    max-width: 1200px;
    margin: 2rem auto 3rem;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
}

.hero-badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1.5rem;
    background: rgba(10, 132, 255, 0.1);
    border: 1px solid rgba(10, 132, 255, 0.2);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #1c1c1e 0%, #3a3a3c 40%, #0a84ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .typewriter {
    font-size: 1.4rem;
    color: var(--text-secondary);
    min-height: 2em;
    margin-bottom: 1.5rem;
}

.hero .typewriter .cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--primary);
    vertical-align: middle;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.7rem 1.8rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: white;
    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(10, 132, 255, 0.5);
}

.btn-secondary {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.8);
    color: var(--text);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.9);
    transform: translateY(-2px);
}

/* ---------- 主布局 ---------- */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
}

/* ---------- 文章卡片 ---------- */
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    content: '';
    width: 6px;
    height: 28px;
    background: linear-gradient(180deg, var(--primary), var(--purple));
    border-radius: 3px;
    display: inline-block;
}

.post-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--purple), var(--pink));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.8);
}

.post-card:hover::before {
    transform: scaleX(1);
}

.post-tag {
    display: inline-block;
    background: rgba(10, 132, 255, 0.1);
    color: var(--primary);
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.7rem;
    letter-spacing: 0.5px;
}

.post-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.3px;
}

.post-card h2 a {
    transition: color 0.3s;
}

.post-card h2 a:hover {
    color: var(--primary);
}

.post-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

.post-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.read-more {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: gap 0.3s;
}

.read-more:hover {
    gap: 0.6rem;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 80px;
    align-self: start;
}

.sidebar-card {
    padding: 1.5rem;
}

.sidebar-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.3px;
}

.sidebar-card h3::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(0,0,0,0.1), transparent);
}

.profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(10,132,255,0.3);
    flex-shrink: 0;
}

.profile-info h4 {
    font-size: 1.1rem;
}

.profile-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.about-me p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    gap: 0.8rem;
}

.social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.6);
    transition: all 0.3s;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.social-links a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(10,132,255,0.4);
}

/* 技能条 */
.skill-item {
    margin-bottom: 1rem;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.skill-bar {
    height: 6px;
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--purple));
    width: 0%;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.skill-progress.animate {
    width: var(--target-width);
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-cloud span {
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.tag-cloud span:hover {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10,132,255,0.3);
}

/* 最新文章列表 */
.recent-list {
    list-style: none;
}

.recent-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.recent-list li:hover {
    color: var(--primary);
    transform: translateX(5px);
}

.recent-list li:last-child {
    border-bottom: none;
}

.recent-list .emoji {
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* ---------- 文章详情页 ---------- */
.article-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
}

.article-header {
    text-align: center;
    margin-bottom: 2rem;
}

.article-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.article-header .post-meta {
    justify-content: center;
}

.article-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    letter-spacing: -0.5px;
}

.article-content h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 0.8rem;
}

.article-content ul,
.article-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.article-content img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.article-content code {
    background: rgba(0,0,0,0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9em;
}

.article-content pre {
    background: #1c1c1e;
    color: #f8f8f8;
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.article-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* ---------- 关于页 ---------- */
.about-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    text-align: center;
}

.about-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
    box-shadow: 0 8px 24px rgba(10,132,255,0.3);
}

.about-container h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 1rem;
}

.about-container .about-intro {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.skills-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    text-align: left;
    margin-top: 1rem;
}

/* ---------- 页脚 ---------- */
.footer {
    text-align: center;
    padding: 2rem 1.5rem;
    margin-top: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer a {
    color: var(--primary);
}

/* ========== 以下为动态功能新增样式 ========== */

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.modal .close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal input, .modal textarea {
    width: 100%;
    padding: 0.7rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.8);
    font-family: var(--font);
}

.modal button {
    width: 100%;
}

/* 评论区 */
.comments-container {
    max-width: 900px;
    margin: 0 auto 2rem;
    padding: 2rem;
}

.comments-container textarea {
    width: 100%;
    padding: 0.7rem;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    margin-bottom: 0.5rem;
    font-family: var(--font);
}

.comment-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.comment-item .comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.comment-item .comment-username {
    font-weight: 600;
}

.comment-item .comment-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.comment-item .comment-content {
    margin-left: 1.5rem;
}

.comment-item .reply-btn {
    font-size: 0.8rem;
    color: var(--primary);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    margin-left: 0.5rem;
}

.comment-item .delete-comment {
    font-size: 0.8rem;
    cursor: pointer;
}

.comment-replies {
    margin-left: 2rem;
    border-left: 2px solid rgba(0,0,0,0.1);
    padding-left: 1rem;
}

/* 分页 */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
}

.pagination button {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    cursor: pointer;
    background: white;
    font-family: var(--font);
}

.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* 后台管理页面的补充样式（部分已在 HTML 内联，这里可省略） */

/* 响应式补充 */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 10px;
        right: 10px;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 1.5rem;
        box-shadow: 0 12px 40px rgba(0,0,0,0.15);
        border-radius: var(--radius-sm);
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero .typewriter {
        font-size: 1.1rem;
    }

    .main-container {
        grid-template-columns: 1fr;
        padding: 0 1rem 2rem;
    }

    .sidebar {
        position: static;
    }

    .skills-container {
        grid-template-columns: 1fr;
    }

    .article-container {
        padding: 1rem;
    }

    .comments-container {
        padding: 1rem;
    }
}