/* =============================================
   恋上蓝花楹 - 主样式文件
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* 颜色变量 */
:root {
    --primary-500: #0073f5;
    --primary-600: #005cc4;
    --primary-900: #001731;
    --secondary-500: #9900f5;
    --dark-500: #2b2b2b;
    --dark-600: #222222;
    --dark-700: #1a1a1a;
    --dark-800: #111111;
    --dark-900: #080808;
    --text-light: rgba(255,255,255,0.9);
    --text-muted: rgba(255,255,255,0.6);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--dark-800);
    color: var(--text-light);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* 背景画布 */
#bg-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
}

/* 玻璃拟态卡片 */
.glass-card {
    background: rgba(25, 25, 50, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

/* 导航栏 */
.glass-nav {
    background: rgba(15, 15, 30, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    z-index: 1000;
    padding: 12px 0;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-logo img { height: 40px; width: 40px; margin-right: 12px; border-radius: 50%; }

.site-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary-500), var(--secondary-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 桌面导航菜单 */
.main-nav { display: flex; gap: 32px; list-style: none; margin: 0; padding: 0; }
.main-nav a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}
.main-nav a:hover { color: var(--primary-500); }

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* 移动端侧边菜单 */
.mobile-menu {
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    width: 80%;
    max-width: 320px;
    background: var(--dark-700);
    z-index: 2000;
    padding: 24px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}
.mobile-menu.active { transform: translateX(0); }
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}
.mobile-menu nav a {
    display: block;
    color: var(--text-light);
    text-decoration: none;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: color 0.2s;
}
.mobile-menu nav a:hover { color: var(--primary-500); }

/* 渐变文字 */
.text-gradient {
    background: linear-gradient(90deg, var(--primary-500), var(--secondary-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 按钮 */
.btn-primary {
    background: var(--primary-500);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}
.btn-primary:hover {
    background: var(--primary-600);
    box-shadow: 0 0 10px var(--primary-500), 0 0 20px var(--primary-500);
    color: white;
}
.btn-outline {
    border: 1px solid var(--primary-500);
    color: var(--primary-500);
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}
.btn-outline:hover {
    background: var(--primary-500);
    color: white;
}

/* 主内容区 */
.site-content { padding-top: 64px; }

/* 分区通用 */
.section { padding: 80px 0; }
.section-dark { background: var(--dark-700); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.section-header { text-align: center; margin-bottom: 64px; }
.section-header h2 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 700; margin-bottom: 16px; }
.section-divider {
    width: 96px; height: 4px;
    background: linear-gradient(90deg, var(--primary-500), var(--secondary-500));
    margin: 0 auto 24px;
    border-radius: 2px;
}
.section-header p { color: var(--text-muted); max-width: 600px; margin: 0 auto; }

/* Hero 区 */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 64px;
}
.hero-inner {
    display: flex;
    align-items: center;
    gap: 48px;
    flex-wrap: wrap;
}
.hero-text { flex: 1; min-width: 280px; }
.hero-text h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; line-height: 1.2; margin-bottom: 16px; }
.hero-text p { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 32px; }
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-avatar { flex: 0 0 auto; }
.avatar-wrap {
    position: relative;
    width: 280px; height: 280px;
}
.avatar-glow {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.3;
    animation: pulse 4s ease-in-out infinite;
}
.avatar-wrap img {
    position: relative; z-index: 1;
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--dark-800);
}
.scroll-hint {
    position: absolute;
    bottom: 40px; left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    color: rgba(255,255,255,0.6);
    font-size: 1.5rem;
    text-decoration: none;
}

/* 博客文章卡片 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}
.post-card {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}
.post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.4);
}
.post-thumb {
    position: relative;
    height: 200px;
    overflow: hidden;
}
.post-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.post-card:hover .post-thumb img { transform: scale(1.08); }
.post-thumb-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(8,8,8,0.8), transparent);
}
.post-category {
    position: absolute; bottom: 12px; left: 12px;
    background: var(--primary-500);
    color: white;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 4px;
}
.post-body { padding: 20px; }
.post-body h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.post-body p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 12px; line-height: 1.6; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.post-tag {
    background: var(--dark-600);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
}
.post-meta { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-muted); }

/* 搜索筛选栏 */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap input {
    width: 100%;
    background: var(--dark-600);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 12px 44px 12px 16px;
    color: white;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.search-wrap input:focus { border-color: var(--primary-500); }
.search-btn {
    position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    font-size: 1rem;
}
.filter-select {
    background: var(--dark-600);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: white;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
}
.filter-select:focus { border-color: var(--primary-500); }

/* 加载更多 */
.load-more-wrap { text-align: center; margin-top: 48px; }
.btn-load-more {
    background: var(--dark-600);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-load-more:hover { background: var(--dark-500); }

/* 单篇文章页 */
.single-post { max-width: 800px; margin: 0 auto; padding: 40px 24px; }
.post-header { margin-bottom: 32px; }
.post-header h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; margin-bottom: 16px; }
.post-featured-img { width: 100%; border-radius: 12px; margin-bottom: 32px; }
.post-content { line-height: 1.8; color: rgba(255,255,255,0.85); }
.post-content h2, .post-content h3 { color: white; margin-top: 32px; }
.post-content a { color: var(--primary-500); }
.post-content img { max-width: 100%; border-radius: 8px; }
.post-content pre {
    background: var(--dark-700);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
}
.post-content code {
    background: var(--dark-600);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.post-content blockquote {
    border-left: 4px solid var(--primary-500);
    padding-left: 16px;
    color: var(--text-muted);
    margin: 24px 0;
}

/* 评论区 */
.comments-section { margin-top: 48px; }
.comments-section h3 { font-size: 1.4rem; margin-bottom: 24px; }
.comment-list { list-style: none; padding: 0; }
.comment-item { margin-bottom: 24px; }
.comment-body {
    padding: 16px;
    border-radius: 8px;
}
.comment-author { font-weight: 600; margin-bottom: 4px; }
.comment-date { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.comment-text { color: rgba(255,255,255,0.8); line-height: 1.6; }

/* 评论表单 */
.comment-form { margin-top: 32px; }
.comment-form h3 { font-size: 1.2rem; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 0.9rem; color: var(--text-muted); }
.form-group input,
.form-group textarea {
    width: 100%;
    background: var(--dark-600);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: white;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--primary-500); }
.form-group textarea { min-height: 120px; resize: vertical; }

/* 侧边栏 */
.sidebar-widget { margin-bottom: 32px; }
.widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-500);
}
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
    background: rgba(0,115,245,0.15);
    color: rgba(0,115,245,1);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
}
.tag-cloud a:hover { background: var(--primary-500); color: white; }

/* 订阅区 */
.subscribe-form { display: flex; gap: 12px; flex-wrap: wrap; }
.subscribe-form input {
    flex: 1;
    min-width: 200px;
    background: var(--dark-600);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: white;
    font-size: 0.95rem;
    outline: none;
}
.subscribe-form input:focus { border-color: var(--primary-500); }

/* 页脚 */
.site-footer {
    background: var(--dark-900);
    padding: 48px 0 24px;
    margin-top: 0;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 32px;
    margin-bottom: 32px;
}
.footer-brand p { color: var(--text-muted); margin-top: 8px; font-size: 0.9rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-nav a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.footer-nav a:hover { color: var(--primary-500); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.footer-copy { color: var(--text-muted); font-size: 0.85rem; }
.footer-social { display: flex; gap: 16px; }
.footer-social a { color: var(--text-muted); font-size: 1.1rem; transition: color 0.2s; text-decoration: none; }
.footer-social a:hover { color: var(--primary-500); }

/* 返回顶部 */
#back-to-top {
    position: fixed;
    bottom: 32px; right: 32px;
    background: var(--primary-500);
    color: white;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}
#back-to-top.visible { opacity: 1; visibility: visible; }
#back-to-top:hover { background: var(--primary-600); }

/* 滚动动画 */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark-800); }
::-webkit-scrollbar-thumb { background: var(--primary-500); border-radius: 3px; }

/* 动画 */
@keyframes pulse { 0%,100% { opacity: 0.3; } 50% { opacity: 0.6; } }
@keyframes bounce { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-8px); } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* 响应式 */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .menu-toggle { display: block; }
    .hero-inner { flex-direction: column; text-align: center; }
    .hero-buttons { justify-content: center; }
    .avatar-wrap { width: 200px; height: 200px; }
    .posts-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; }
    .footer-bottom { flex-direction: column; text-align: center; }
}
