/* qulin博客主样式文件 - 主题色与主站qulin.xyz一致 */

:root {
    --bg-primary: #08080e;
    --bg-secondary: #0f0f18;
    --bg-card: #14141f;
    --bg-card-hover: #1a1a28;
    --text-primary: #e8eaed;
    --text-secondary: #8b8fa3;
    --text-muted: #5a5d6e;
    --accent-from: #3b82f6;
    --accent-mid: #4f8af9;
    --accent-to: #06b6d4;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overscroll-behavior-y: none;
}

/* 背景氛围光效 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(59, 130, 246, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 40%, rgba(6, 182, 212, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 20% 70%, rgba(59, 130, 246, 0.04) 0%, transparent 50%);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px;
    position: relative;
    z-index: 1;
}

/* 头部样式 */
.header {
    background: rgba(8, 8, 14, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    text-decoration: none;
}

.logo h1 {
    font-size: 1.35rem;
    color: var(--text-primary);
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-from), var(--accent-mid));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 6px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.search-box form {
    display: flex;
    gap: 8px;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    width: 200px;
    background: var(--bg-card);
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-from);
}

.search-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.search-btn:hover {
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

.header-nav-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition);
    margin: 0 auto;
}

body.mobile-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
body.mobile-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
}
body.mobile-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* 主内容区 */
.main {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

/* 文章卡片 */
.posts-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 30px;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 28px;
    transition: all var(--transition);
    cursor: pointer;
}

.post-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.post-title {
    font-size: 20px;
    margin-bottom: 12px;
}

.post-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition);
}

.post-title a:hover {
    color: var(--accent-mid);
}

.post-meta {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.post-meta a {
    color: var(--accent-mid);
    text-decoration: none;
}

.post-meta a:hover {
    color: var(--accent-from);
    text-decoration: underline;
}

.post-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
}

.sidebar-title {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-from);
}

.category-list, .tag-list {
    list-style: none;
}

.category-list li, .tag-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.category-list li:last-child, .tag-list li:last-child {
    border-bottom: none;
}

.category-list a, .tag-list a {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    transition: color var(--transition);
}

.category-list a:hover, .tag-list a:hover {
    color: var(--accent-mid);
}

.post-count {
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.latest-posts-list {
    list-style: none;
}

.latest-posts-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.latest-posts-list li:last-child {
    border-bottom: none;
}

.latest-posts-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition);
}

.latest-posts-list a:hover {
    color: var(--accent-mid);
}

/* 文章详情页 */
.post-detail {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 40px;
}

.post-detail-title {
    font-size: 32px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.post-detail-meta {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.post-detail-meta a {
    color: var(--accent-mid);
    text-decoration: none;
}

.post-detail-meta a:hover {
    color: var(--accent-from);
    text-decoration: underline;
}

.post-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.post-content h1, .post-content h2, .post-content h3 {
    margin-top: 24px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.post-content h1 {
    font-size: 28px;
}

.post-content h2 {
    font-size: 24px;
}

.post-content h3 {
    font-size: 20px;
}

.post-content p {
    margin-bottom: 16px;
}

.post-content code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--accent-mid);
}

.post-content pre {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    margin-bottom: 16px;
}

.post-content pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}

.post-content a {
    color: var(--accent-mid);
    text-decoration: none;
}

.post-content a:hover {
    text-decoration: underline;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 16px 0;
}

.post-content blockquote {
    border-left: 3px solid var(--accent-from);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-muted);
}

.post-content ul, .post-content ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.post-content li {
    margin-bottom: 8px;
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 24px 0;
}

.post-tags {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.post-tags span {
    display: inline-block;
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-mid);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 14px;
    margin-right: 8px;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

/* 归档页面 */
.archive-page h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.archive-month {
    margin-bottom: 40px;
}

.archive-month h3 {
    font-size: 20px;
    color: var(--accent-mid);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-from);
}

.archive-list {
    list-style: none;
}

.archive-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.archive-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 16px;
    transition: color var(--transition);
}

.archive-list a:hover {
    color: var(--accent-mid);
}

.archive-date {
    color: var(--text-muted);
    font-size: 14px;
}

/* 关于页面 */
.about-page {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 40px;
}

.about-page h2 {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.about-page p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

/* 搜索页面 */
.search-page {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 40px;
}

.search-page h2 {
    font-size: 24px;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.search-info {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 14px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a, .pagination span {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.pagination a:hover {
    background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
    color: #ffffff;
    border-color: transparent;
}

.pagination .current {
    background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
    color: #ffffff;
    border-color: transparent;
}

/* 页脚 */
.footer {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 48px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
}

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

.footer-nav {
    display: flex;
    gap: 16px;
}

.footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-nav a:hover {
    color: var(--text-primary);
}

.footer-beian {
    margin-top: 12px;
    text-align: center;
    font-size: 14px;
}

.footer-beian a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-beian a:hover {
    color: var(--text-secondary);
}

.footer-divider {
    color: var(--text-muted);
    margin: 0 8px;
}

.footer-contact {
    margin-top: 6px;
    text-align: center;
}

.footer-contact a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition);
}

.footer-contact a:hover {
    color: var(--text-secondary);
}

/* 返回顶部按钮 */
#back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition);
    z-index: 999;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
    color: #ffffff;
    border-color: transparent;
}

/* 阅读进度条 */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
    z-index: 1001;
    width: 0%;
    transition: width 0.1s linear;
}

/* 响应式设计 - 平板 */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .header {
        padding: 12px 0;
    }

    .header-content {
        flex-wrap: wrap;
        position: relative;
    }

    .logo h1 {
        font-size: 1.2rem;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .header-nav-wrap {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 12px;
        padding-top: 16px;
        order: 3;
    }

    body.mobile-menu-open .header-nav-wrap {
        display: flex;
    }

    .nav {
        justify-content: center;
        flex-wrap: wrap;
        gap: 4px;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .search-box {
        width: 100%;
    }

    .search-box form {
        width: 100%;
    }

    .search-input {
        width: 100%;
        flex: 1;
    }

    .main {
        padding: 24px 0;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .post-card {
        padding: 20px;
    }

    .post-title {
        font-size: 18px;
    }

    .post-meta {
        font-size: 13px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .post-detail {
        padding: 24px 20px;
    }

    .post-detail-title {
        font-size: 24px;
        line-height: 1.4;
    }

    .post-detail-meta {
        font-size: 13px;
        flex-wrap: wrap;
        display: flex;
        gap: 8px;
    }

    .post-content {
        font-size: 15px;
    }

    .post-content pre {
        padding: 12px;
        font-size: 13px;
        border-radius: 6px;
    }

    .post-content h1 { font-size: 24px; }
    .post-content h2 { font-size: 20px; }
    .post-content h3 { font-size: 18px; }

    .sidebar-section {
        padding: 20px;
    }

    .sidebar-title {
        font-size: 16px;
    }

    .hero {
        padding: 48px 16px;
    }

    .hero h2 {
        font-size: clamp(2rem, 8vw, 2.8rem);
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-search {
        flex-direction: column;
        gap: 12px;
    }

    .hero-search input,
    .hero-search button {
        width: 100%;
    }

    .hero-search button {
        padding: 12px;
    }

    .pagination {
        gap: 4px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination a, .pagination span {
        padding: 8px 12px;
        font-size: 14px;
    }

    .footer {
        padding: 32px 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .footer-beian, .footer-contact {
        font-size: 12px;
    }

    .about-page, .search-page {
        padding: 24px 20px;
    }

    .about-page h2, .search-page h2 {
        font-size: 20px;
    }

    .archive-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .archive-date {
        font-size: 12px;
    }

    #back-to-top {
        right: 16px;
        bottom: 16px;
    }
}

/* 响应式设计 - 手机 */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    .post-card {
        padding: 16px;
    }

    .post-title {
        font-size: 16px;
    }

    .post-excerpt {
        font-size: 14px;
    }

    .post-detail {
        padding: 20px 16px;
    }

    .post-detail-title {
        font-size: 20px;
    }

    .post-detail-meta {
        font-size: 12px;
    }

    .post-content {
        font-size: 14px;
        line-height: 1.7;
    }

    .post-content pre {
        padding: 10px;
        font-size: 12px;
    }

    .post-content h1 { font-size: 20px; }
    .post-content h2 { font-size: 18px; }
    .post-content h3 { font-size: 16px; }

    .post-tags span {
        font-size: 12px;
        padding: 3px 10px;
    }

    .hero {
        padding: 32px 12px;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .sidebar-section {
        padding: 16px;
    }

    .stat-number {
        font-size: 24px;
    }

    .pagination a, .pagination span {
        padding: 6px 10px;
        font-size: 13px;
    }

    .footer-beian a, .footer-contact a {
        font-size: 11px;
    }

    .footer-divider {
        margin: 0 4px;
    }
}

/* Hero区域(首页) - 与主站"你好,我是屈霖"风格一致 */
.hero {
    text-align: center;
    padding: 80px 20px;
    background: transparent;
    color: var(--text-primary);
    margin-bottom: 40px;
}

.hero h2 {
    font-size: clamp(2.8rem, 6vw, 4.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--text-primary) 20%, var(--accent-from) 50%, var(--accent-to) 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.hero-search {
    display: flex;
    justify-content: center;
    gap: 8px;
    max-width: 500px;
    margin: 0 auto;
}

.hero-search input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 16px;
    background: var(--bg-card);
    color: var(--text-primary);
}

.hero-search input::placeholder {
    color: var(--text-muted);
}

.hero-search button {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition);
}

.hero-search button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
}
