:root {
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #555;
    --text-muted: #888;
    --accent: #d32f2f;
    --accent-hover: #b71c1c;
    --border: #e0e0e0;
    --tag-bg: #fff3f3;
    --tag-text: #c62828;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-serif: 'Georgia', 'Noto Serif SC', 'STSong', 'Songti SC', 'SimSun', 'KaiTi', serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 导航栏 */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}
.navbar.scrolled {
    box-shadow: var(--shadow-md);
}
.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
}
.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
}
.nav-logo .logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}
.nav-links {
    display: flex;
    list-style: none;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 20px;
    transition: all var(--transition);
    white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
    background: #f5f5f5;
    color: var(--accent);
}
.nav-links a.active {
    background: var(--tag-bg);
    color: var(--tag-text);
    font-weight: 600;
}
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}
.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}
.mobile-menu-btn.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-btn.open span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}
.mobile-menu-btn.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* 主布局 */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px 40px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    flex: 1;
    width: 100%;
}

/* 文章主体 */
.article-main {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 36px 40px 40px;
    overflow: hidden;
}
.article-category {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--tag-text);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    text-transform: uppercase;
}
.article-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.article-meta .author-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #d32f2f);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}
.article-meta .meta-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.article-meta .author-name {
    font-weight: 600;
    color: var(--text);
}
.article-meta .meta-detail {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.article-meta .meta-detail span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.share-btns {
    margin-left: auto;
    display: flex;
    gap: 8px;
}
.share-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    color: var(--text-secondary);
}
.share-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.share-btn.bookmark-btn.saved {
    background: #fff3e0;
    border-color: #ff9800;
    color: #e65100;
}

/* 文章内容 */
.article-content {
    font-family: var(--font-serif);
    font-size: 1.08rem;
    line-height: 1.9;
    color: #2c2c2c;
}
.article-content p {
    margin-bottom: 1.4em;
}
.article-content .dropcap::first-letter {
    float: left;
    font-size: 3.8em;
    font-weight: 700;
    line-height: 0.85;
    margin-right: 12px;
    margin-top: 2px;
    color: var(--accent);
    font-family: var(--font-serif);
}
.article-image-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #e8e8e8 0%, #d5d5d5 30%, #e0e0e0 60%, #c8c8c8 100%);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 24px 0;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
}
.article-image-placeholder:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-lg);
}
.article-image-placeholder .img-icon {
    font-size: 3.5rem;
    opacity: 0.6;
    margin-bottom: 8px;
}
.article-image-placeholder .img-caption {
    font-size: 0.85rem;
    color: #666;
    font-family: var(--font-sans);
    position: absolute;
    bottom: 12px;
    background: rgba(255, 255, 255, 0.85);
    padding: 4px 12px;
    border-radius: 12px;
}
.article-content blockquote {
    border-left: 4px solid var(--accent);
    margin: 20px 0;
    padding: 16px 20px;
    background: #fafafa;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: #444;
}
.article-content h3 {
    font-family: var(--font-sans);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 28px 0 12px;
    color: var(--text);
}
.highlight-box {
    background: #fffdf5;
    border: 1px solid #ffe082;
    border-radius: var(--radius);
    padding: 18px 22px;
    margin: 20px 0;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: #5d4037;
}
.highlight-box strong {
    color: #d32f2f;
}

/* 标签 */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.article-tag {
    display: inline-block;
    background: #f5f5f5;
    color: #555;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
    text-decoration: none;
}
.article-tag:hover {
    background: #e0e0e0;
    color: #222;
}

/* 评论区 */
.comments-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--border);
}
.comments-section h3 {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.comment-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}
.comment-form textarea {
    width: 100%;
    min-height: 90px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color var(--transition);
    background: #fafafa;
    color: var(--text);
}
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.08);
}
.comment-form .form-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.comment-form input {
    flex: 1;
    min-width: 140px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: border-color var(--transition);
    background: #fafafa;
    color: var(--text);
}
.comment-form input:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.08);
}
.btn-submit {
    align-self: flex-end;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
    white-space: nowrap;
}
.btn-submit:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-submit:active {
    transform: scale(0.97);
}
.comment-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.comment-item {
    background: #fafafa;
    border-radius: var(--radius);
    padding: 16px 18px;
    transition: all var(--transition);
    border: 1px solid transparent;
}
.comment-item:hover {
    border-color: #e0e0e0;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.comment-item .comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}
.comment-time {
    font-size: 0.78rem;
    color: #999;
    margin-left: auto;
}
.comment-body {
    font-size: 0.9rem;
    color: #444;
    line-height: 1.6;
    padding-left: 42px;
}
.no-comments {
    text-align: center;
    color: #aaa;
    padding: 30px;
    font-size: 0.95rem;
}

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.sidebar-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 22px 20px;
}
.sidebar-card h4 {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
}
.sidebar-news-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.sidebar-news-list li {
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 12px;
    cursor: pointer;
    transition: all var(--transition);
}
.sidebar-news-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.sidebar-news-list li:hover {
    color: var(--accent);
}
.sidebar-news-list .side-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text);
    transition: color var(--transition);
}
.sidebar-news-list li:hover .side-title {
    color: var(--accent);
}
.sidebar-news-list .side-meta {
    font-size: 0.75rem;
    color: #aaa;
    margin-top: 4px;
}
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag-cloud .cloud-tag {
    background: #f5f5f5;
    color: #555;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}
.tag-cloud .cloud-tag:hover {
    background: var(--tag-bg);
    color: var(--tag-text);
}

/* 页脚 */
.footer {
    background: #fff;
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 20px 24px;
    font-size: 0.82rem;
    color: #aaa;
    margin-top: auto;
}
.footer a {
    color: #888;
    text-decoration: none;
    transition: color var(--transition);
}
.footer a:hover {
    color: var(--accent);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    white-space: nowrap;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 响应式 */
@media (max-width: 900px) {
    .main-container {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 20px;
    }
    .article-main {
        padding: 24px 20px 28px;
        border-radius: var(--radius);
    }
    .article-title {
        font-size: 1.5rem;
    }
    .sidebar {
        gap: 16px;
    }
    .nav-links {
        display: none;
        position: absolute;
        top: 58px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 12px 20px;
        gap: 4px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
    }
    .nav-links.open {
        display: flex;
    }
    .nav-links a {
        padding: 10px 16px;
        border-radius: 8px;
        font-size: 0.95rem;
    }
    .mobile-menu-btn {
        display: flex;
    }
    .share-btns {
        margin-left: 0;
        margin-top: 8px;
    }
}
@media (max-width: 500px) {
    .article-title {
        font-size: 1.3rem;
    }
    .article-content {
        font-size: 0.98rem;
    }
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .share-btns {
        margin-left: 0;
    }
    .navbar-inner {
        padding: 0 14px;
    }
}