/* ============================================
   个人博客 - 前台样式
   支持暗色/浅色主题切换 + 响应式
   ============================================ */

/* CSS 变量 - 浅色主题 */
:root, [data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #eef1f5;
    --text-primary: #1f2328;
    --text-secondary: #57606a;
    --text-muted: #8b949e;
    --border-color: #d0d7de;
    --accent-color: #0969da;
    --accent-hover: #0860c4;
    --accent-light: #ddf4ff;
    --success-color: #1a7f37;
    --warning-color: #9a6700;
    --danger-color: #cf222e;
    --code-bg: #f6f8fa;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-sm: 4px;
}

/* 暗色主题 */
[data-theme="dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --border-color: #30363d;
    --accent-color: #2f81f7;
    --accent-hover: #4493f8;
    --accent-light: #388bfd26;
    --success-color: #3fb950;
    --warning-color: #d29922;
    --danger-color: #f85149;
    --code-bg: #161b22;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 15px;
    transition: background 0.3s, color 0.3s;
}

a { color: var(--accent-color); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== 头部 ===== */
.site-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 20px;
}
.site-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}
.site-logo img { height: 36px; vertical-align: middle; }
.site-nav { display: flex; gap: 4px; flex: 1; justify-content: center; flex-wrap: wrap; }
.nav-link {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.2s;
}
.nav-link:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.search-form { display: flex; gap: 4px; }
.search-form input {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    width: 160px;
}
.search-form button {
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent-color);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
}
.theme-toggle, .nav-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-primary);
}
.nav-toggle { display: none; }

/* ===== 主体布局 ===== */
.site-main { padding: 24px 0; }
.content-wrapper { display: flex; gap: 24px; align-items: flex-start; }
.content-area { flex: 1; min-width: 0; }
.sidebar { width: 300px; flex-shrink: 0; position: sticky; top: 88px; }

/* ===== 文章卡片 ===== */
.post-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.post-card:hover { box-shadow: var(--shadow-md); }
.post-cover img { width: 100%; height: 240px; object-fit: cover; display: block; }
.post-body { padding: 20px 24px; }
.post-title { font-size: 22px; margin-bottom: 10px; line-height: 1.4; }
.post-title a { color: var(--text-primary); }
.post-title a:hover { color: var(--accent-color); }
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.post-summary { color: var(--text-secondary); margin-bottom: 14px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tag {
    display: inline-block;
    padding: 2px 10px;
    background: var(--accent-light);
    color: var(--accent-color);
    border-radius: 20px;
    font-size: 12px;
}
.tag-large { font-size: 16px; padding: 4px 14px; }
.read-more {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
}

/* ===== 文章详情 ===== */
.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.breadcrumb .current { color: var(--text-secondary); }
.post-detail {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 20px;
}
.post-detail .post-title { font-size: 28px; margin-bottom: 16px; }
.post-cover-large img { width: 100%; border-radius: var(--radius); margin-bottom: 20px; }
.post-content { font-size: 16px; line-height: 1.85; }
.post-content h1, .post-content h2, .post-content h3, .post-content h4 {
    margin: 24px 0 12px;
    line-height: 1.4;
}
.post-content h2 { font-size: 22px; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }
.post-content h3 { font-size: 18px; }
.post-content p { margin-bottom: 16px; }
.post-content ul, .post-content ol { margin: 0 0 16px 24px; }
.post-content li { margin-bottom: 6px; }
.post-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding: 8px 16px;
    margin: 16px 0;
    background: var(--bg-secondary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}
.post-content pre {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0;
}
.post-content code {
    font-family: "SF Mono", "Fira Code", Consolas, monospace;
    font-size: 14px;
}
.post-content :not(pre) > code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.post-content img { max-width: 100%; border-radius: var(--radius-sm); }
.post-content hr { border: none; border-top: 1px solid var(--border-color); margin: 24px 0; }
.post-content table { border-collapse: collapse; width: 100%; margin: 16px 0; }
.post-content th, .post-content td { border: 1px solid var(--border-color); padding: 8px 12px; text-align: left; }
.post-content th { background: var(--bg-secondary); }

/* 上一篇/下一篇 */
.post-nav {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}
.post-nav-prev, .post-nav-next {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.2s;
}
.post-nav-prev:hover, .post-nav-next:hover { border-color: var(--accent-color); }
.post-nav-next { text-align: right; align-items: flex-end; }
.post-nav .nav-label { font-size: 12px; color: var(--text-muted); }
.post-nav .nav-title { font-size: 14px; color: var(--text-primary); font-weight: 500; }
.post-nav .disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 评论区 ===== */
.comments-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
}
.comments-title { font-size: 18px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.comment-form { margin-bottom: 24px; }
.form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.form-group { flex: 1; margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
}
.form-group textarea { resize: vertical; }
.reply-notice {
    background: var(--accent-light);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.reply-notice button {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 13px;
}
.btn {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    text-align: center;
}
.btn:hover { border-color: var(--accent-color); color: var(--accent-color); }
.btn-primary { background: var(--accent-color); color: #fff; border-color: var(--accent-color); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-block { display: block; width: 100%; margin-bottom: 8px; }

.comment-list { margin-top: 20px; }
.comment-item { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border-color); }
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.comment-author { font-weight: 600; font-size: 14px; }
.comment-date { font-size: 12px; color: var(--text-muted); }
.comment-reply-btn {
    font-size: 12px;
    color: var(--accent-color);
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
}
.comment-content { font-size: 14px; color: var(--text-secondary); word-break: break-word; }
.comment-replies { margin-top: 12px; padding-left: 16px; border-left: 2px solid var(--border-color); }
.reply-item { padding: 10px 0; }
.empty-comments, .comments-closed {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
}
.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}
.badge-top { background: #fff3cd; color: #856404; }
.badge-admin { background: var(--accent-light); color: var(--accent-color); }

/* ===== 侧边栏 ===== */
.widget {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
}
.widget-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.widget-about { text-align: center; }
.widget-about .avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    margin: 0 auto 10px;
    overflow: hidden;
}
.widget-about .avatar img { width: 100%; height: 100%; object-fit: cover; }
.widget-about .nickname { font-weight: 600; margin-bottom: 4px; }
.widget-about .bio { font-size: 13px; color: var(--text-muted); }
.widget-list { list-style: none; }
.widget-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 13px;
    gap: 8px;
}
.widget-list li:last-child { border-bottom: none; }
.widget-list li a {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}
.widget-list li a:hover { color: var(--accent-color); }
.widget-date, .widget-views, .widget-count { color: var(--text-muted); font-size: 12px; flex-shrink: 0; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud a {
    color: var(--text-secondary);
    transition: color 0.2s;
}
.tag-cloud a:hover { color: var(--accent-color); }

/* ===== 页面头部 ===== */
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 24px; margin-bottom: 8px; }
.page-desc { color: var(--text-secondary); margin-bottom: 4px; }
.page-count { color: var(--text-muted); font-size: 13px; }
.search-form-large { display: flex; gap: 8px; margin: 16px 0; }
.search-form-large input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
}
.search-form-large button {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent-color);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}
mark { background: #fff3cd; color: #856404; padding: 0 2px; border-radius: 2px; }
[data-theme="dark"] mark { background: #663c00; color: #ffd33d; }

/* ===== 归档 ===== */
.archive-timeline { }
.archive-year-block { margin-bottom: 28px; }
.archive-month {
    font-size: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.archive-month a { color: var(--text-primary); }
.archive-count { font-size: 13px; color: var(--text-muted); }
.archive-list { list-style: none; }
.archive-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}
.archive-list li:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.archive-list li:last-child { border-radius: 0 0 var(--radius) var(--radius); border-bottom: none; }
.archive-date { color: var(--text-muted); font-size: 13px; flex-shrink: 0; width: 60px; }
.archive-list li a { flex: 1; color: var(--text-primary); }
.archive-list li a:hover { color: var(--accent-color); }
.archive-views { color: var(--text-muted); font-size: 12px; flex-shrink: 0; }
.archive-month-header { margin-bottom: 16px; }
.archive-month-header .btn-back { display: inline-block; margin-bottom: 8px; font-size: 13px; }
.archive-list-large li { padding: 12px 16px; }

/* ===== 独立页面 ===== */
.page-detail {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
}
.page-title { font-size: 26px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.page-content { font-size: 15px; line-height: 1.8; }
.friend-links { margin-top: 24px; }
.friend-links h2 { font-size: 18px; margin-bottom: 16px; }
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    transition: border-color 0.2s;
}
.link-card:hover { border-color: var(--accent-color); }
.link-card img, .link-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--accent-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}
.link-info { display: flex; flex-direction: column; min-width: 0; }
.link-info strong { font-size: 14px; color: var(--text-primary); }
.link-info span { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.page-link {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    transition: all 0.2s;
}
.page-link:hover { border-color: var(--accent-color); color: var(--accent-color); }
.page-link.active { background: var(--accent-color); color: #fff; border-color: var(--accent-color); }
.page-ellipsis { padding: 6px 4px; color: var(--text-muted); }

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-muted);
}
.empty-state h2 { font-size: 32px; margin-bottom: 8px; color: var(--text-secondary); }

/* ===== 页脚 ===== */
.site-footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    margin-top: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.footer-inner p { margin-bottom: 4px; }

/* ===== 返回顶部 ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
    z-index: 99;
}
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--accent-hover); transform: translateY(-2px); }

/* ===== 响应式 ===== */
@media (max-width: 960px) {
    .content-wrapper { flex-direction: column; }
    .sidebar { width: 100%; position: static; }
    .site-nav { display: none; }
    .site-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
        padding: 12px 20px;
        box-shadow: var(--shadow-md);
    }
    .nav-toggle { display: block; }
    .search-form input { width: 120px; }
}

@media (max-width: 640px) {
    .container { padding: 0 12px; }
    .header-inner { height: 56px; gap: 8px; }
    .site-logo { font-size: 17px; }
    .search-form { display: none; }
    .post-body { padding: 16px; }
    .post-title { font-size: 18px; }
    .post-detail { padding: 20px 16px; }
    .post-detail .post-title { font-size: 22px; }
    .post-meta { gap: 10px; font-size: 12px; }
    .form-row { flex-direction: column; gap: 0; }
    .post-nav { flex-direction: column; }
    .post-nav-next { text-align: left; align-items: flex-start; }
    .comments-section { padding: 16px; }
    .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }
    .page-detail { padding: 20px 16px; }
    .links-grid { grid-template-columns: 1fr; }
}

/* ============================================
   v2.0 新增样式
   ============================================ */

/* 认证页面 */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 20px;
}
.auth-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
}
.auth-header {
    text-align: center;
    margin-bottom: 24px;
}
.auth-icon {
    font-size: 40px;
    color: var(--accent-color);
    margin-bottom: 12px;
}
.auth-header h1 {
    font-size: 22px;
    margin-bottom: 4px;
}
.auth-header p {
    color: var(--text-muted);
    font-size: 13px;
}
.auth-form .form-group { margin-bottom: 14px; }
.auth-form label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.auth-form input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
}
.auth-form input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(9,105,218,0.1);
}
.btn-lg { padding: 12px 24px; font-size: 15px; }
.auth-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
}
.input-with-btn {
    display: flex;
    gap: 8px;
}
.input-with-btn input { flex: 1; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    white-space: nowrap;
}
.btn-outline:disabled { opacity: 0.5; cursor: not-allowed; }

/* 用户菜单 */
.header-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.header-icon:hover {
    background: var(--bg-tertiary);
    color: var(--accent-color);
}
.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger-color);
    color: #fff;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: 600;
}
.user-menu-wrapper { position: relative; }
.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    color: var(--text-primary);
    transition: background 0.2s;
}
.user-menu-trigger:hover { background: var(--bg-tertiary); }
.user-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
}
.user-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.user-name-sm { font-size: 13px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    min-width: 220px;
    z-index: 200;
    display: none;
    overflow: hidden;
}
.user-menu-wrapper:hover .user-dropdown,
.user-dropdown.show { display: block; }
.user-dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}
.user-dropdown-header strong { display: block; font-size: 14px; }
.user-uid { font-size: 11px; color: var(--text-muted); display: block; margin: 2px 0; }
.user-group-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}
.group-super_admin { background: #fef3c7; color: #92400e; }
.group-admin { background: #dbeafe; color: #1e40af; }
.group-member { background: #d1fae5; color: #065f46; }
.group-guest { background: #f3f4f6; color: #4b5563; }
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    transition: all 0.2s;
}
.user-dropdown a:hover { background: var(--bg-tertiary); color: var(--accent-color); }
.user-dropdown .text-danger { color: var(--danger-color); }
.user-dropdown .text-danger:hover { background: #fef2f2; }
.dropdown-divider { height: 1px; background: var(--border-color); margin: 4px 0; }
.badge-dot {
    background: var(--danger-color);
    color: #fff;
    font-size: 10px;
    padding: 0 5px;
    border-radius: 8px;
    margin-left: auto;
}

/* 公告弹窗 */
.announcement-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.3s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.announcement-modal-content {
    background: var(--bg-primary);
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.announcement-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
}
.announcement-modal-header h3 { font-size: 18px; flex: 1; min-width: 200px; }
.announcement-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 4px;
}
.announcement-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.announcement-type-tag {
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.type-normal { background: #e0e7ff; color: #3730a3; }
.type-important { background: #fef3c7; color: #92400e; }
.type-urgent { background: #fee2e2; color: #991b1b; }
.announcement-icon-normal { color: #6366f1; }
.announcement-icon-important { color: #f59e0b; }
.announcement-icon-urgent { color: #ef4444; }
.announcement-modal-body { padding: 20px 24px; font-size: 14px; line-height: 1.7; }
.announcement-modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.announcement-time { font-size: 12px; color: var(--text-muted); }

/* 用户中心 */
.user-center-header {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
}
.user-center-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}
.user-center-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-center-info { flex: 1; }
.user-center-info h1 { font-size: 22px; margin-bottom: 6px; }
.user-center-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.user-center-stats { display: flex; gap: 20px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.user-center-stats span { display: flex; align-items: center; gap: 4px; }
.user-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px;
    overflow-x: auto;
}
.user-tab {
    padding: 8px 16px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.2s;
}
.user-tab:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.user-tab.active { background: var(--accent-color); color: #fff; }
.user-tab-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}
.my-posts-list, .my-comments-list { display: flex; flex-direction: column; gap: 12px; }
.my-post-item, .my-comment-item {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s;
}
.my-post-item:hover, .my-comment-item:hover { border-color: var(--accent-color); }
.my-post-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.my-post-title a { color: var(--text-primary); }
.my-post-title a:hover { color: var(--accent-color); }
.my-post-meta, .my-comment-meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.my-post-meta span, .my-comment-meta span { display: flex; align-items: center; gap: 4px; }
.my-comment-content { font-size: 14px; color: var(--text-secondary); margin-bottom: 6px; }
.reject-reason { margin-top: 8px; padding: 8px 12px; background: #fef2f2; border-radius: 6px; font-size: 12px; color: #991b1b; }

/* 站内信列表 */
.notification-list { display: flex; flex-direction: column; gap: 1px; background: var(--border-color); border-radius: 10px; overflow: hidden; }
.notification-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: var(--bg-primary);
    transition: background 0.2s;
}
.notification-item.unread { background: var(--accent-light); }
.notification-item:hover { background: var(--bg-tertiary); }
.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}
.notification-icon.type-system { background: #e0e7ff; color: #4338ca; }
.notification-icon.type-post_rejected { background: #fee2e2; color: #dc2626; }
.notification-icon.type-post_deleted { background: #fef3c7; color: #d97706; }
.notification-icon.type-comment_replied { background: #d1fae5; color: #059669; }
.notification-icon.type-announcement { background: #fce7f3; color: #db2777; }
.notification-icon.type-admin { background: #fef3c7; color: #d97706; }
.notification-body { flex: 1; min-width: 0; }
.notification-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-color); flex-shrink: 0; }
.notification-content { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.notification-meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); align-items: center; }
.notification-mark-read { color: var(--accent-color); font-size: 11px; }
.badge-urgent, .badge-important, .badge-normal { padding: 1px 8px; border-radius: 10px; font-size: 11px; }
.badge-urgent { background: #fee2e2; color: #991b1b; }
.badge-important { background: #fef3c7; color: #92400e; }
.badge-normal { background: #e0e7ff; color: #3730a3; }
.badge-major { background: #fee2e2; color: #991b1b; }
.badge-minor { background: #dbeafe; color: #1e40af; }
.badge-patch { background: #d1fae5; color: #065f46; }
.badge-secondary { background: #f3f4f6; color: #4b5563; }
.nav-section {
    padding: 12px 20px 6px;
    font-size: 11px;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.text-danger { color: var(--danger-color) !important; }
