/* =============================================
   MyBlog — NeutralPress 风格
   深色科技感 · 新粗野主义 · 极简中性
   ============================================= */

/* ---------- CSS 变量 ---------- */
:root {
    /* 深色主题（默认） */
    --bg-primary: #0d0d0d;
    --bg-secondary: #141414;
    --bg-card: #1a1a1a;
    --bg-elevated: #222222;
    --text-primary: #e5e5e5;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent: #2dd4bf;
    --accent-hover: #14b8a6;
    --accent-light: rgba(45, 212, 191, 0.12);
    --accent-glow: rgba(45, 212, 191, 0.25);
    --border: #2a2a2a;
    --border-hover: #3a3a3a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --radius: 4px;
    --radius-sm: 2px;
    --radius-md: 8px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* 底部导航高度 */
    --nav-height: 52px;
}

/* 浅色主题 */
[data-theme="light"] {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-elevated: #f5f5f5;
    --text-primary: #111111;
    --text-secondary: #555555;
    --text-muted: #999999;
    --accent: #0d9488;
    --accent-hover: #0f766e;
    --accent-light: rgba(13, 148, 136, 0.08);
    --accent-glow: rgba(13, 148, 136, 0.15);
    --border: #e0e0e0;
    --border-hover: #cccccc;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    padding-top: var(--nav-height);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
}

::selection {
    background: var(--accent);
    color: #000;
}

/* ---------- 布局 ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- 底部导航栏（NeutralPress 风格） ---------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    height: var(--nav-height);
}

[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.92);
}

:root .navbar {
    background: rgba(20, 20, 20, 0.92);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 0;
}

.navbar-brand {
    position: absolute;
    left: 24px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent) !important;
    letter-spacing: -0.3px;
    -webkit-text-fill-color: var(--accent);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.navbar-nav a {
    color: var(--text-muted);
    padding: 8px 16px;
    font-weight: 500;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
    transition: var(--transition);
    border-radius: 6px;
}

.navbar-nav a:hover {
    color: var(--text-primary);
    background: rgba(45, 212, 191, 0.08);
}

.navbar-nav a.active {
    color: #000;
    background: var(--accent);
    font-weight: 700;
}

.theme-toggle {
    position: absolute;
    right: 24px;
    background: rgba(45, 212, 191, 0.1);
    border: 1px solid var(--accent);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 20px;
    transition: var(--transition);
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
}

.theme-toggle::after {
    content: '主题';
    font-size: 0.75rem;
    font-weight: 500;
}

.theme-toggle:hover {
    background: var(--accent);
    color: #000;
}

/* ---------- NeutralPress 横幅 ---------- */
.np-banner {
    background: var(--accent);
    color: #000;
    padding: 10px 24px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 0;
}

/* ---------- Hero / 页面头部 ---------- */
.hero {
    padding: 80px 0 40px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.1;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.hero p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.8;
}

/* ---------- 主布局（双栏） ---------- */
.main-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 0;
    min-height: calc(100vh - var(--nav-height));
}

.main-content {
    min-width: 0;
    border-left: 1px solid var(--border);
}

/* ---------- 侧边栏（左固定信息栏） ---------- */
.sidebar {
    position: sticky;
    top: 0;
    height: calc(100vh - var(--nav-height));
    overflow-y: auto;
    padding: 0 24px 40px 0;
    display: flex;
    flex-direction: column;
}

.sidebar-widget {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}

.sidebar-widget:last-child {
    border-bottom: none;
}

.sidebar-widget h3 {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
    color: var(--text-muted);
}

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

.category-list li {
    margin-bottom: 2px;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
    border-left: 2px solid transparent;
}

.category-list a:hover {
    color: var(--accent);
    background: var(--accent-light);
    border-left-color: var(--accent);
}

.active-category {
    color: var(--accent) !important;
    background: var(--accent-light) !important;
    border-left-color: var(--accent) !important;
    font-weight: 600;
}

.category-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ---------- 搜索栏 ---------- */
.search-bar {
    margin: 28px 0 0;
    max-width: none;
}

.search-form {
    display: flex;
    gap: 0;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 0;
    font-size: 0.9rem;
    font-family: var(--font-sans);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: var(--transition);
}

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

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

.search-btn {
    padding: 10px 20px;
    background: var(--accent);
    color: #000;
    border: 1px solid var(--accent);
    border-radius: 0;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.search-btn:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* ---------- 筛选提示 ---------- */
.filter-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    margin-bottom: 0;
    font-size: 0.88rem;
    color: var(--accent);
    font-weight: 500;
}

.clear-filter {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.clear-filter:hover {
    color: var(--accent);
}

/* ---------- 文章卡片（NeutralPress 风格） ---------- */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.article-card {
    position: relative;
    padding: 28px 32px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
    overflow: hidden;
    background: var(--bg-primary);
}

.article-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--accent);
    opacity: 0;
    transition: var(--transition);
}

.article-card:hover {
    background: var(--bg-card);
}

.article-card:hover::before {
    opacity: 1;
}

/* 封面图作为背景 */
.article-cover {
    position: absolute;
    right: 0;
    top: 0;
    width: 45%;
    height: 100%;
    object-fit: cover;
    opacity: 0.15;
    transition: var(--transition);
    z-index: 0;
    mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.6) 40%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.6) 40%);
}

.article-card:hover .article-cover {
    opacity: 0.25;
}

.article-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    transition: var(--transition);
    position: relative;
    z-index: 1;
    letter-spacing: -0.3px;
}

.article-card:hover .article-card-title {
    color: var(--accent);
}

.article-card-title a {
    color: inherit;
}

.article-card-summary {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
    font-family: var(--font-mono);
}

.article-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.category-badge {
    display: inline-block;
    background: var(--accent);
    color: #000;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tag-badge {
    display: inline-block;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 500;
}

.article-tags {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 0;
    padding: 24px 0;
    border-top: 1px solid var(--border);
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: var(--transition);
}

.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.pagination .active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    font-weight: 700;
}

/* ---------- 文章详情页 ---------- */
.article-detail {
    background: var(--bg-primary);
    padding: 60px 48px;
    max-width: 820px;
    margin: 0 auto;
}

.article-detail-header {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.article-detail-header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.15;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.article-detail-meta {
    display: flex;
    gap: 24px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

/* Markdown 渲染 */
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
    margin-top: 2em;
    margin-bottom: 0.75em;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.article-body h1 { font-size: 1.8rem; }
.article-body h2 {
    font-size: 1.5rem;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.article-body h3 { font-size: 1.25rem; }

.article-body p {
    margin-bottom: 1.2em;
    line-height: 1.9;
    color: var(--text-secondary);
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.2em;
    padding-left: 2em;
}

.article-body li {
    margin-bottom: 0.4em;
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-body code {
    background: var(--accent-light);
    color: var(--accent);
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 0.88em;
}

.article-body pre {
    background: #0a0a0a;
    color: #cdd6f4;
    padding: 24px;
    overflow-x: auto;
    margin-bottom: 1.5em;
    border: 1px solid var(--border);
    font-family: var(--font-mono);
}

[data-theme="light"] .article-body pre {
    background: #1e1e2e;
    color: #cdd6f4;
}

.article-body pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: 0.88rem;
    line-height: 1.7;
}

.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 20px;
    margin-bottom: 1.2em;
    background: var(--accent-light);
    color: var(--text-secondary);
}

.article-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.article-body img {
    border: 1px solid var(--border);
    margin: 1em 0;
}

/* ---------- 底部 ---------- */
.footer {
    text-align: center;
    padding: 40px 0;
    margin-top: 48px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

.footer a {
    color: var(--accent);
}

.footer-links {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-light);
}

.footer-section-title {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    font-weight: 600;
}

/* ---------- 友链页面 ---------- */
.links-grid {
    display: grid;
    gap: 16px;
    margin-top: 32px;
}

.link-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    background: var(--bg-secondary);
}

.link-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.link-card-icon {
    font-size: 2rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.link-card-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.link-card-info p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.link-card-url {
    font-size: 0.75rem;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}

/* ---------- 关于页面 ---------- */
.about-page {
    padding: 48px;
    max-width: 720px;
    margin: 0 auto;
}

.about-page h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -1.5px;
    color: var(--text-primary);
}

.about-page p {
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 1em;
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    font-weight: 700;
    font-size: 0.88rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.02em;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #000;
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-danger {
    background: rgba(220, 38, 38, 0.15);
    color: #ef4444;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
}

/* ---------- 后台管理 ---------- */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.admin-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.admin-nav-item {
    padding: 10px 18px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: var(--transition);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.admin-nav-item:hover {
    color: var(--accent);
    background: var(--accent-light);
}

.admin-nav-item.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: rgba(45, 212, 191, 0.08);
}

/* 管理表格 */
.admin-table {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    overflow: hidden;
}

.admin-table table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 20px;
    text-align: left;
}

.admin-table th {
    background: var(--bg-secondary);
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-table td {
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

.admin-table tr:hover td {
    background: var(--accent-light);
}

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.status-published {
    background: rgba(45, 212, 191, 0.15);
    color: var(--accent);
}

.status-draft {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.actions {
    display: flex;
    gap: 8px;
}

/* ---------- 统计卡片 ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 28px 24px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ---------- 编辑器 ---------- */
.editor-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 32px;
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border);
    font-size: 0.93rem;
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 400px;
    font-family: var(--font-mono);
    line-height: 1.7;
    resize: vertical;
}

.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.editor-toolbar .left {
    display: flex;
    gap: 12px;
}

.editor-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.editor-split .editor-pane,
.editor-split .preview-pane {
    position: relative;
}

.editor-split .preview-pane {
    border-left: 1px solid var(--border);
}

.editor-split .pane-label {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    z-index: 1;
    background: var(--bg-primary);
    padding: 2px 8px;
}

.editor-split .editor-pane textarea {
    border: none;
    border-radius: 0;
}

.preview-content {
    min-height: 400px;
    padding: 20px 24px;
    background: var(--bg-card);
    overflow-y: auto;
    max-height: 600px;
}

.preview-content .placeholder-text {
    color: var(--text-muted);
    font-style: italic;
}

.editor-toolbar-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom: none;
}

.toolbar-divider {
    width: 1px;
    background: var(--border);
    margin: 2px 6px;
}

.toolbar-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-muted);
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.toolbar-btn:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

/* ---------- 封面图片上传 ---------- */
.cover-upload-area {
    margin-top: 4px;
}

.cover-preview {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 16 / 9;
    border: 1px dashed var(--border);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
}

.cover-preview.empty {
    cursor: pointer;
}

.cover-preview.empty:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.cover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 4px;
}

.cover-placeholder span { font-size: 2rem; }
.cover-placeholder p { font-weight: 500; font-size: 0.9rem; }
.cover-placeholder small { font-size: 0.78rem; }

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 20px;
}

/* ---------- 404 页面 ---------- */
.error-page {
    text-align: center;
    padding: 120px 20px;
}

.error-page h1 {
    font-size: 8rem;
    font-weight: 800;
    color: var(--accent);
    font-family: var(--font-mono);
    letter-spacing: -4px;
}

.error-page p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 16px 0 32px;
}

/* ---------- 登录页面 ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 48px 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--text-muted);
    margin-top: 8px;
    font-size: 0.9rem;
}

/* ---------- 验证码 ---------- */
.captcha-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.captcha-img {
    height: 45px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.captcha-img:hover {
    border-color: var(--accent);
}

/* ---------- 提示消息 ---------- */
.alert {
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    font-weight: 500;
    border-left: 3px solid;
}

.alert-error {
    background: rgba(220, 38, 38, 0.1);
    color: #ef4444;
    border-color: #ef4444;
}

.alert-success {
    background: rgba(45, 212, 191, 0.1);
    color: var(--accent);
    border-color: var(--accent);
}

/* ---------- 评论区 ---------- */
.comment-section {
    max-width: 800px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.comment-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.3px;
}

.comment-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 700;
    color: var(--accent);
}

.comment-time {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.comment-content {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.93rem;
}

.comment-form-wrapper {
    margin-top: 28px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

/* ---------- 标签输入组件 ---------- */
.tags-input-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
    padding: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
    transition: var(--transition);
}

.tag-item:hover {
    background: var(--accent);
    color: #000;
}

.tag-remove {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-left: 2px;
    opacity: 0.7;
    transition: var(--transition);
}

.tag-remove:hover {
    opacity: 1;
}

/* ---------- 管理卡片通用 ---------- */
.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 24px;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.admin-card-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.badge {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ---------- 动画 ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.4s ease forwards;
}

.article-card:nth-child(1) { animation-delay: 0.03s; }
.article-card:nth-child(2) { animation-delay: 0.06s; }
.article-card:nth-child(3) { animation-delay: 0.09s; }
.article-card:nth-child(4) { animation-delay: 0.12s; }
.article-card:nth-child(5) { animation-delay: 0.15s; }
.article-card:nth-child(6) { animation-delay: 0.18s; }

/* ---------- 归档页面 ---------- */
.archive-stats {
    display: flex;
    gap: 48px;
    padding: 28px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}

.archive-stats .stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.archive-stats .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    font-family: var(--font-mono);
}

.archive-stats .stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 时间轴 */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
}

.timeline-marker {
    position: absolute;
    left: -28px;
    top: 10px;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border: 2px solid var(--bg-primary);
    box-shadow: 0 0 0 1px var(--accent);
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 24px;
    transition: var(--transition);
}

.timeline-content:hover {
    border-color: var(--accent);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.timeline-date {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.timeline-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 8px;
    font-family: var(--font-mono);
}

.btn-expand {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 6px 16px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    transition: var(--transition);
    letter-spacing: 0.02em;
}

.btn-expand:hover {
    background: var(--accent);
    color: #000;
}

.timeline-articles {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.loading-placeholder {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* 归档文章项 */
.archive-article-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.archive-article-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 12px;
    transition: var(--transition);
    margin-bottom: 4px;
    border-left: 2px solid transparent;
}

.archive-article-item:hover {
    background: var(--accent-light);
    border-left-color: var(--accent);
}

.archive-article-date {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
    min-width: 45px;
}

.archive-article-title {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.archive-article-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.archive-tag {
    font-size: 0.72rem;
    padding: 1px 8px;
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

.no-articles, .error-message {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

/* ---------- 响应式布局 ---------- */
@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .main-content {
        border-left: none;
        border-top: 1px solid var(--border);
    }

    .sidebar {
        position: relative;
        height: auto;
        padding: 0;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .article-detail {
        padding: 32px 20px;
    }

    .article-detail-header h1 {
        font-size: 1.8rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .editor-split {
        grid-template-columns: 1fr;
    }

    .editor-split .preview-pane {
        border-left: none;
        border-top: 1px solid var(--border);
    }

    .navbar-brand {
        display: none;
    }

    .theme-toggle {
        position: relative;
        right: auto;
    }

    .archive-stats {
        gap: 24px;
    }

    .archive-stats .stat-number {
        font-size: 2rem;
    }

    .timeline {
        padding-left: 24px;
    }

    .timeline-marker {
        left: -22px;
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .archive-article-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

@media (max-width: 600px) {
    .navbar-nav {
        gap: 0;
    }

    .navbar-nav a {
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    .article-card {
        padding: 20px;
    }

    .about-page {
        padding: 32px 20px;
    }

    .admin-table {
        overflow-x: auto;
    }

    .admin-nav {
        overflow-x: auto;
    }
}

/* ========== Toast 通知 ========== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 420px;
    padding: 14px 20px;
    border-radius: 8px;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    animation: toastSlideIn 0.35s ease;
    position: relative;
    overflow: hidden;
}

.toast.toast-success {
    background: linear-gradient(135deg, #059669, #10b981);
}

.toast.toast-error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.toast.toast-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.toast.toast-info {
    background: linear-gradient(135deg, #0d9488, #2dd4bf);
}

.toast .toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast .toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 0 0 8px;
    flex-shrink: 0;
}

.toast .toast-close:hover {
    color: #fff;
}

.toast .toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255,255,255,0.4);
    animation: toastProgress var(--toast-duration, 3s) linear forwards;
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastFadeOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}