/* ========================================
   Magazine Editorial Theme
   杂志编辑风 — 克制但有态度
   ======================================== */

/* Design Tokens */
:root {
    /* Typography */
    --font-display: 'Fraunces', 'Georgia', serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Fluid Type Scale */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
    --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --text-lg: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-xl: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
    --text-2xl: clamp(2rem, 1.5rem + 2.5vw, 3rem);
    --text-3xl: clamp(2.5rem, 1.8rem + 3.5vw, 4rem);
    
    /* Spacing Scale */
    --space-xs: clamp(0.25rem, 0.2rem + 0.25vw, 0.5rem);
    --space-sm: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
    --space-md: clamp(1rem, 0.8rem + 1vw, 1.5rem);
    --space-lg: clamp(1.5rem, 1.2rem + 1.5vw, 2.5rem);
    --space-xl: clamp(2rem, 1.5rem + 2.5vw, 4rem);
    --space-2xl: clamp(3rem, 2rem + 5vw, 6rem);
    
    /* Colors - Light Theme (Warm Editorial) */
    --bg-primary: oklch(98% 0.005 80);
    --bg-secondary: oklch(96% 0.008 80);
    --bg-tertiary: oklch(92% 0.012 80);
    --bg-elevated: oklch(100% 0 0);
    
    --text-primary: oklch(20% 0.02 60);
    --text-secondary: oklch(45% 0.02 60);
    --text-tertiary: oklch(60% 0.015 60);
    --text-inverse: oklch(98% 0.005 80);
    
    --accent: oklch(55% 0.18 25);
    --accent-hover: oklch(48% 0.2 25);
    --accent-subtle: oklch(92% 0.04 25);
    
    --border: oklch(88% 0.01 80);
    --border-strong: oklch(75% 0.02 80);
    
    --success: oklch(60% 0.15 145);
    --warning: oklch(75% 0.15 85);
    --error: oklch(60% 0.2 25);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px oklch(0% 0 0 / 0.04);
    --shadow-md: 0 4px 12px oklch(0% 0 0 / 0.06);
    --shadow-lg: 0 12px 32px oklch(0% 0 0 / 0.08);
    
    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;
    
    /* Layout */
    --max-width: 1200px;
    --content-width: 680px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: oklch(15% 0.01 260);
    --bg-secondary: oklch(20% 0.015 260);
    --bg-tertiary: oklch(25% 0.02 260);
    --bg-elevated: oklch(22% 0.015 260);
    
    --text-primary: oklch(92% 0.01 80);
    --text-secondary: oklch(75% 0.015 80);
    --text-tertiary: oklch(55% 0.01 80);
    --text-inverse: oklch(15% 0.01 260);
    
    --accent: oklch(70% 0.15 25);
    --accent-hover: oklch(78% 0.17 25);
    --accent-subtle: oklch(25% 0.04 25);
    
    --border: oklch(30% 0.015 260);
    --border-strong: oklch(45% 0.02 260);
    
    --shadow-sm: 0 1px 2px oklch(0% 0 0 / 0.2);
    --shadow-md: 0 4px 12px oklch(0% 0 0 / 0.3);
    --shadow-lg: 0 12px 32px oklch(0% 0 0 / 0.4);
}

/* ========================================
   Base Styles
   ======================================== */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--duration-slow) var(--ease-out),
                color var(--duration-slow) var(--ease-out);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p {
    margin-bottom: var(--space-md);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
    color: var(--accent-hover);
}

/* Selection */
::selection {
    background: var(--accent);
    color: var(--text-inverse);
}

/* ========================================
   Navigation
   ======================================== */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .navbar {
    background: oklch(15% 0.01 260 / 0.95);
}

[data-theme="light"] .navbar {
    background: oklch(98% 0.005 80 / 0.95);
}

.nav-brand a {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.03em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-links a {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
    padding: var(--space-xs) 0;
    transition: color var(--duration-fast) var(--ease-out);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1.5px;
    background: var(--accent);
    transition: all var(--duration-normal) var(--ease-out);
    transform: translateX(-50%);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Active nav link */
.nav-links a[aria-current="page"] {
    color: var(--text-primary);
}

.nav-links a[aria-current="page"]::after {
    width: 100%;
}

/* Theme Toggle */
#theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

#theme-toggle:hover {
    background: var(--bg-tertiary);
    transform: scale(1.05);
}

#theme-icon {
    font-size: 14px;
    line-height: 1;
}

/* ========================================
   Layout
   ======================================== */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
    min-height: calc(100vh - 200px);
}

/* ========================================
   Hero Section
   ======================================== */

.hero {
    text-align: center;
    padding: var(--space-2xl) 0;
    margin-bottom: var(--space-xl);
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-size: var(--text-3xl);
    font-weight: 400;
    letter-spacing: -0.04em;
    margin-bottom: var(--space-sm);
}

.hero p {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    font-weight: 300;
}

/* ========================================
   Post List
   ======================================== */

.post-list {
    display: grid;
    gap: var(--space-lg);
}

.post-card {
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border);
    transition: transform var(--duration-normal) var(--ease-out);
}

.post-card:last-child {
    border-bottom: none;
}

.post-card h2 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-sm);
}

.post-card h2 a {
    color: var(--text-primary);
    text-decoration: none;
    background-image: linear-gradient(var(--accent), var(--accent));
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    transition: background-size var(--duration-normal) var(--ease-out);
}

.post-card h2 a:hover {
    background-size: 100% 2px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.post-meta span:not(:last-child)::after {
    content: '·';
    margin-left: var(--space-sm);
}

.post-summary {
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: var(--content-width);
}

.post-cover {
    position: relative;
    width: 100%;
    padding-bottom: 42.55%; /* 100 / 2.35 = 42.55% for 2.35:1 aspect ratio */
    margin-bottom: var(--space-md);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
}

.post-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--duration-slow) var(--ease-out);
}

.post-card:hover .post-cover img {
    transform: scale(1.02);
}

/* ========================================
   News List (Homepage)
   ======================================== */

.news-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.news-item {
    display: flex;
    gap: var(--space-lg);
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border);
    transition: background-color var(--duration-fast) var(--ease-out);
}

.news-item:last-child {
    border-bottom: none;
}

.news-thumbnail {
    flex-shrink: 0;
    width: 200px;
    height: 85px; /* 200 / 2.35 = 85.1 for 2.35:1 aspect ratio */
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-secondary);
}

.news-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--duration-normal) var(--ease-out);
}

.news-item:hover .news-thumbnail img {
    transform: scale(1.05);
}

.news-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.news-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 0 0 var(--space-xs) 0;
    line-height: 1.4;
}

.news-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

.news-title a:hover {
    color: var(--accent);
}

.news-summary {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.6;
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    flex-wrap: wrap;
}

.news-meta span:not(:last-child)::after {
    content: '·';
    margin-left: var(--space-sm);
}

.news-tags {
    display: inline-flex;
    gap: var(--space-xs);
    margin-left: auto;
}

.news-tags .tag {
    font-size: var(--text-xs);
    padding: 2px 8px;
    margin: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .news-item {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .news-thumbnail {
        position: relative;
        width: 100%;
        height: 0;
        padding-bottom: 42.55%; /* 2.35:1 ratio */
    }
    
    .news-thumbnail img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    
    .news-title {
        font-size: var(--text-md);
    }
    
    .news-tags {
        margin-left: 0;
        margin-top: var(--space-xs);
    }
}

/* ========================================
   Tags
   ======================================== */

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-md);
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 100px;
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
}

.tag:hover {
    background: var(--accent-subtle);
    border-color: var(--accent);
    color: var(--accent);
}

.tags-cloud {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

.tags-cloud h3 {
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

/* ========================================
   Post Detail
   ======================================== */

.post-detail {
    max-width: var(--content-width);
    margin: 0 auto;
}

.post-header {
    margin-bottom: var(--space-xl);
    text-align: center;
}

.post-header h1 {
    font-size: var(--text-2xl);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

.post-header .post-meta {
    justify-content: center;
}

.post-header .tags {
    justify-content: center;
}

.post-detail .post-cover {
    position: relative;
    width: 100%;
    padding-bottom: 42.55%; /* 2.35:1 aspect ratio */
    margin: var(--space-xl) 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
}

.post-detail .post-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    font-size: var(--text-base);
    line-height: 1.8;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
}

.post-content h2 { font-size: var(--text-xl); }
.post-content h3 { font-size: var(--text-lg); }
.post-content h4 { font-size: var(--text-base); font-weight: 600; }

.post-content p {
    margin-bottom: var(--space-md);
}

.post-content a {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.post-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-secondary);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.post-content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    overflow-x: auto;
    margin: var(--space-lg) 0;
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: var(--text-sm);
    line-height: 1.6;
}

.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: var(--space-md);
    margin: var(--space-lg) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: var(--space-lg) 0;
}

.post-content ul,
.post-content ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
}

.post-content li {
    margin-bottom: var(--space-xs);
}

/* ========================================
   Related Posts
   ======================================== */

.related-posts {
    margin-top: var(--space-2xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

.related-posts h3 {
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.related-posts ul {
    list-style: none;
    padding: 0;
}

.related-posts li {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
}

.related-posts li:last-child {
    border-bottom: none;
}

.related-posts a {
    color: var(--text-primary);
    text-decoration: none;
}

.related-posts a:hover {
    color: var(--accent);
}

/* ========================================
   Comments
   ======================================== */

.comments-section {
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border);
}

.comments-section h3 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-lg);
}

.comment-form {
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.comment {
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
}

.comment:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-date {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

.comment-content {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ========================================
   Forms
   ======================================== */

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: flex;
    gap: var(--space-md);
}

.form-row .form-group {
    flex: 1;
}

.form-row .flex-2 {
    flex: 2;
}

.radio-group {
    display: flex;
    gap: var(--space-md);
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-weight: normal;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    width: auto;
    margin: 0;
}

.form-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

/* Upload Dropzone */
.upload-dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    padding: var(--space-md);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.upload-dropzone:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
    color: var(--accent);
}

.cover-preview {
    position: relative;
    margin-top: var(--space-sm);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.cover-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

.cover-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease-out);
}

.cover-remove:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-inverse);
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
}

.btn:hover {
    background: var(--accent-hover);
    color: var(--text-inverse);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success);
}

.btn-danger {
    background: var(--error);
}

.btn-warning {
    background: var(--warning);
    color: var(--text-primary);
}

.btn-small {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
}

.btn-primary {
    background: var(--accent);
}

/* AI Buttons */
.btn-ai {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-subtle);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-ai:hover {
    background: var(--accent);
    color: var(--text-inverse);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-ai:disabled,
.btn-ai.loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-ai .ai-icon {
    font-weight: 700;
    font-size: 0.7em;
    padding: 1px 4px;
    background: var(--accent);
    color: var(--text-inverse);
    border-radius: var(--radius-sm);
    line-height: 1.2;
}

.btn-ai:hover .ai-icon {
    background: var(--text-inverse);
    color: var(--accent);
}

.btn-ai.btn-small {
    padding: 4px var(--space-sm);
}

[data-theme="dark"] .btn-ai {
    background: oklch(25% 0.04 25 / 0.5);
    border-color: var(--accent);
}

[data-theme="dark"] .btn-ai:hover {
    background: var(--accent);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-ai .ai-icon {
    background: var(--accent);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-ai:hover .ai-icon {
    background: var(--text-primary);
    color: var(--accent);
}

.summary-input-row {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
}

.summary-input-row textarea {
    flex: 1;
}

.cover-image-input-row {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.cover-image-input-row input {
    flex: 1;
}

.editor-toolbar-extra {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

@keyframes ai-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-ai.loading .ai-icon {
    animation: ai-spin 1s linear infinite;
}

/* ========================================
   Search
   ======================================== */

.search-container {
    max-width: var(--content-width);
    margin: 0 auto;
}

.search-container h1 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-lg);
}

.search-form {
    margin-bottom: var(--space-xl);
}

.search-input {
    display: flex;
    gap: var(--space-sm);
}

.search-input input {
    flex: 1;
    font-size: var(--text-lg);
    padding: var(--space-md);
}

.search-results p {
    color: var(--text-tertiary);
    margin-bottom: var(--space-lg);
}

.search-score {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-sm);
}

/* ========================================
   Flash Messages
   ======================================== */

.flash-messages {
    margin-bottom: var(--space-lg);
}

.alert {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    font-size: var(--text-sm);
    animation: slideIn var(--duration-normal) var(--ease-out);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: oklch(92% 0.08 145 / 0.3);
    color: oklch(35% 0.12 145);
    border: 1px solid oklch(75% 0.12 145);
}

.alert-error {
    background: oklch(92% 0.08 25 / 0.3);
    color: oklch(40% 0.15 25);
    border: 1px solid oklch(75% 0.12 25);
}

.alert-warning {
    background: oklch(92% 0.1 85 / 0.3);
    color: oklch(45% 0.12 85);
    border: 1px solid oklch(80% 0.12 85);
}

.alert-info {
    background: oklch(92% 0.05 220 / 0.3);
    color: oklch(40% 0.1 220);
    border: 1px solid oklch(75% 0.08 220);
}

[data-theme="dark"] .alert-success {
    background: oklch(25% 0.06 145 / 0.3);
    color: oklch(75% 0.1 145);
}

[data-theme="dark"] .alert-error {
    background: oklch(25% 0.06 25 / 0.3);
    color: oklch(75% 0.1 25);
}

[data-theme="dark"] .alert-warning {
    background: oklch(30% 0.08 85 / 0.3);
    color: oklch(80% 0.1 85);
}

[data-theme="dark"] .alert-info {
    background: oklch(25% 0.04 220 / 0.3);
    color: oklch(75% 0.08 220);
}

/* ========================================
   Pagination
   ======================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
}

.pagination span {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* ========================================
   Admin
   ======================================== */

.admin-dashboard h1,
.admin-posts h1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
}

.stat-card h3 {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
}

.stat-number {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 500;
    color: var(--text-primary);
}

.admin-sections {
    display: grid;
    gap: var(--space-xl);
}

.admin-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.admin-section h2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--text-lg);
    margin-bottom: var(--space-md);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.admin-table th {
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    font-weight: 500;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: var(--text-xs);
    font-weight: 500;
    background: var(--bg-tertiary);
    border-radius: 100px;
}

.badge-success {
    background: oklch(85% 0.12 145 / 0.3);
    color: oklch(40% 0.15 145);
}

[data-theme="dark"] .badge-success {
    background: oklch(30% 0.08 145 / 0.4);
    color: oklch(75% 0.12 145);
}

/* 草稿状态标签 */
.badge-draft {
    background: oklch(90% 0.01 80);
    color: oklch(50% 0.02 80);
}

[data-theme="dark"] .badge-draft {
    background: oklch(25% 0.01 80);
    color: oklch(70% 0.01 80);
}

/* 文章列表表格优化 */
.admin-table {
    table-layout: fixed;
}

.admin-table .col-checkbox {
    width: 40px;
    text-align: center;
}

.admin-table .col-title {
    width: 40%;
}

.admin-table .col-author {
    width: 80px;
}

.admin-table .col-status {
    width: 120px;
    text-align: center;
}

.status-badges {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.status-badges .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 100px;
    white-space: nowrap;
    min-width: 60px;
}

.badge-wechat {
    background: oklch(85% 0.08 145 / 0.3);
    color: oklch(35% 0.12 145);
}

[data-theme="dark"] .badge-wechat {
    background: oklch(30% 0.05 145 / 0.4);
    color: oklch(75% 0.08 145);
}

.admin-table .col-time {
    width: 100px;
    white-space: nowrap;
}

.admin-table .col-actions {
    width: 100px;
    text-align: center;
}

/* 标题单元格 */
.post-title-cell {
    max-width: 100%;
}

.post-title-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.action-buttons .btn-small {
    padding: 4px 8px;
    font-size: 14px;
    min-width: 32px;
}

.filter-bar {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.bulk-actions {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.form-select {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.pending-comments {
    display: grid;
    gap: var(--space-md);
}

.pending-comment {
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.pending-comment p {
    margin-bottom: var(--space-sm);
}

.comment-actions {
    display: flex;
    gap: var(--space-sm);
}

/* ========================================
   Auth
   ======================================== */

.auth-container {
    max-width: 400px;
    margin: var(--space-2xl) auto;
    padding: var(--space-xl);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.auth-container h2 {
    font-size: var(--text-xl);
    text-align: center;
    margin-bottom: var(--space-lg);
}

.auth-container .btn {
    width: 100%;
    margin-top: var(--space-md);
}

/* ========================================
   About Page
   ======================================== */

.about-page {
    max-width: var(--content-width);
    margin: 0 auto;
}

.about-page h1 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-lg);
}

.about-page h2 {
    font-size: var(--text-lg);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
}

.about-page ul {
    padding-left: var(--space-lg);
    margin-bottom: var(--space-md);
}

.about-page li {
    margin-bottom: var(--space-xs);
    color: var(--text-secondary);
}

/* ========================================
   Post Form Page
   ======================================== */

.post-form-page {
    max-width: 800px;
    margin: 0 auto;
}

.post-form-page h1 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-xl);
}

.post-form {
    padding: var(--space-xl);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

/* ========================================
   Footer
   ======================================== */

.footer {
    margin-top: var(--space-2xl);
    padding: var(--space-xl) var(--space-lg);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.footer p {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin: 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
}

.footer-links a {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--text-secondary);
}

/* ICP 备案号样式 - 精致元信息风格 */
.icp-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
    position: relative;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.icp-link::before {
    content: '◈';
    font-size: 0.75em;
    opacity: 0.6;
}

.icp-link:hover {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

/* 链接分隔符 */
.footer-links a:not(:last-child)::after {
    content: '·';
    margin-left: var(--space-sm);
    color: var(--border-strong);
    opacity: 0.5;
}

/* ========================================
   Share Section
   ======================================== */

.share-section {
    position: relative;
    margin-top: var(--space-xl);
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.share-buttons {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
}

.share-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.share-icon {
    font-size: 1em;
}

.share-weibo:hover {
    background: #e6162d;
    border-color: #e6162d;
    color: white;
}

.share-twitter:hover {
    background: #1da1f2;
    border-color: #1da1f2;
    color: white;
}

.qr-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: var(--space-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.qr-popup-inner {
    text-align: center;
}

.qr-popup-inner p {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-sm);
    margin-bottom: 0;
}

/* ========================================
   Code Highlight (Pygments)
   ======================================== */

.highlight {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: auto;
}

.highlight pre {
    margin: 0;
    padding: var(--space-md);
}

/* Light theme Pygments */
[data-theme="light"] .highlight .hll { background-color: #ffffcc }
[data-theme="light"] .highlight .c { color: #6a737d; font-style: italic }
[data-theme="light"] .highlight .k { color: #d73a49; font-weight: bold }
[data-theme="light"] .highlight .o { color: #d73a49 }
[data-theme="light"] .highlight .cm { color: #6a737d; font-style: italic }
[data-theme="light"] .highlight .cp { color: #d73a49; font-weight: bold }
[data-theme="light"] .highlight .c1 { color: #6a737d; font-style: italic }
[data-theme="light"] .highlight .cs { color: #6a737d; font-style: italic; font-weight: bold }
[data-theme="light"] .highlight .gd { color: #b31d28; background-color: #ffeef0 }
[data-theme="light"] .highlight .ge { font-style: italic }
[data-theme="light"] .highlight .gr { color: #b31d28 }
[data-theme="light"] .highlight .gh { color: #005cc5; font-weight: bold }
[data-theme="light"] .highlight .gi { color: #22863a; background-color: #f0fff4 }
[data-theme="light"] .highlight .go { color: #6a737d }
[data-theme="light"] .highlight .gp { color: #735c0f; font-weight: bold }
[data-theme="light"] .highlight .gs { font-weight: bold }
[data-theme="light"] .highlight .gu { color: #6f42c1; font-weight: bold }
[data-theme="light"] .highlight .gt { color: #b31d28 }
[data-theme="light"] .highlight .kc { color: #005cc5; font-weight: bold }
[data-theme="light"] .highlight .kd { color: #d73a49; font-weight: bold }
[data-theme="light"] .highlight .kn { color: #d73a49; font-weight: bold }
[data-theme="light"] .highlight .kp { color: #d73a49 }
[data-theme="light"] .highlight .kr { color: #d73a49; font-weight: bold }
[data-theme="light"] .highlight .kt { color: #6f42c1 }
[data-theme="light"] .highlight .m { color: #005cc5 }
[data-theme="light"] .highlight .s { color: #032f62 }
[data-theme="light"] .highlight .na { color: #005cc5 }
[data-theme="light"] .highlight .nb { color: #005cc5 }
[data-theme="light"] .highlight .nc { color: #6f42c1; font-weight: bold }
[data-theme="light"] .highlight .no { color: #005cc5 }
[data-theme="light"] .highlight .nd { color: #6f42c1 }
[data-theme="light"] .highlight .ni { color: #24292e }
[data-theme="light"] .highlight .ne { color: #d73a49; font-weight: bold }
[data-theme="light"] .highlight .nf { color: #6f42c1; font-weight: bold }
[data-theme="light"] .highlight .nl { color: #005cc5 }
[data-theme="light"] .highlight .nn { color: #005cc5 }
[data-theme="light"] .highlight .nt { color: #22863a }
[data-theme="light"] .highlight .nv { color: #e36209 }
[data-theme="light"] .highlight .ow { color: #d73a49; font-weight: bold }
[data-theme="light"] .highlight .w { color: #bbbbbb }
[data-theme="light"] .highlight .mb { color: #005cc5 }
[data-theme="light"] .highlight .mf { color: #005cc5 }
[data-theme="light"] .highlight .mh { color: #005cc5 }
[data-theme="light"] .highlight .mi { color: #005cc5 }
[data-theme="light"] .highlight .mo { color: #005cc5 }
[data-theme="light"] .highlight .sa { color: #032f62 }
[data-theme="light"] .highlight .sb { color: #032f62 }
[data-theme="light"] .highlight .sc { color: #032f62 }
[data-theme="light"] .highlight .dl { color: #032f62 }
[data-theme="light"] .highlight .sd { color: #032f62; font-style: italic }
[data-theme="light"] .highlight .s2 { color: #032f62 }
[data-theme="light"] .highlight .se { color: #032f62; font-weight: bold }
[data-theme="light"] .highlight .sh { color: #032f62 }
[data-theme="light"] .highlight .si { color: #032f62 }
[data-theme="light"] .highlight .sx { color: #032f62 }
[data-theme="light"] .highlight .sr { color: #032f62 }
[data-theme="light"] .highlight .s1 { color: #032f62 }
[data-theme="light"] .highlight .ss { color: #005cc5 }

/* Dark theme Pygments */
[data-theme="dark"] .highlight .hll { background-color: #3a3d41 }
[data-theme="dark"] .highlight .c { color: #8b949e; font-style: italic }
[data-theme="dark"] .highlight .k { color: #ff7b72; font-weight: bold }
[data-theme="dark"] .highlight .o { color: #ff7b72 }
[data-theme="dark"] .highlight .cm { color: #8b949e; font-style: italic }
[data-theme="dark"] .highlight .cp { color: #ff7b72; font-weight: bold }
[data-theme="dark"] .highlight .c1 { color: #8b949e; font-style: italic }
[data-theme="dark"] .highlight .cs { color: #8b949e; font-style: italic; font-weight: bold }
[data-theme="dark"] .highlight .gd { color: #ffa198; background-color: #490202 }
[data-theme="dark"] .highlight .ge { font-style: italic }
[data-theme="dark"] .highlight .gr { color: #ffa198 }
[data-theme="dark"] .highlight .gh { color: #79c0ff; font-weight: bold }
[data-theme="dark"] .highlight .gi { color: #56d364; background-color: #0f5323 }
[data-theme="dark"] .highlight .go { color: #8b949e }
[data-theme="dark"] .highlight .gp { color: #d29922; font-weight: bold }
[data-theme="dark"] .highlight .gs { font-weight: bold }
[data-theme="dark"] .highlight .gu { color: #bc8cff; font-weight: bold }
[data-theme="dark"] .highlight .gt { color: #ffa198 }
[data-theme="dark"] .highlight .kc { color: #79c0ff; font-weight: bold }
[data-theme="dark"] .highlight .kd { color: #ff7b72; font-weight: bold }
[data-theme="dark"] .highlight .kn { color: #ff7b72; font-weight: bold }
[data-theme="dark"] .highlight .kp { color: #ff7b72 }
[data-theme="dark"] .highlight .kr { color: #ff7b72; font-weight: bold }
[data-theme="dark"] .highlight .kt { color: #bc8cff }
[data-theme="dark"] .highlight .m { color: #79c0ff }
[data-theme="dark"] .highlight .s { color: #a5d6ff }
[data-theme="dark"] .highlight .na { color: #79c0ff }
[data-theme="dark"] .highlight .nb { color: #79c0ff }
[data-theme="dark"] .highlight .nc { color: #bc8cff; font-weight: bold }
[data-theme="dark"] .highlight .no { color: #79c0ff }
[data-theme="dark"] .highlight .nd { color: #bc8cff }
[data-theme="dark"] .highlight .ni { color: #c9d1d9 }
[data-theme="dark"] .highlight .ne { color: #ffa657; font-weight: bold }
[data-theme="dark"] .highlight .nf { color: #d2a8ff; font-weight: bold }
[data-theme="dark"] .highlight .nl { color: #79c0ff }
[data-theme="dark"] .highlight .nn { color: #79c0ff }
[data-theme="dark"] .highlight .nt { color: #7ee787 }
[data-theme="dark"] .highlight .nv { color: #ffa657 }
[data-theme="dark"] .highlight .ow { color: #ff7b72; font-weight: bold }
[data-theme="dark"] .highlight .w { color: #6e7681 }
[data-theme="dark"] .highlight .mb { color: #79c0ff }
[data-theme="dark"] .highlight .mf { color: #79c0ff }
[data-theme="dark"] .highlight .mh { color: #79c0ff }
[data-theme="dark"] .highlight .mi { color: #79c0ff }
[data-theme="dark"] .highlight .mo { color: #79c0ff }
[data-theme="dark"] .highlight .sa { color: #a5d6ff }
[data-theme="dark"] .highlight .sb { color: #a5d6ff }
[data-theme="dark"] .highlight .sc { color: #a5d6ff }
[data-theme="dark"] .highlight .dl { color: #a5d6ff }
[data-theme="dark"] .highlight .sd { color: #a5d6ff; font-style: italic }
[data-theme="dark"] .highlight .s2 { color: #a5d6ff }
[data-theme="dark"] .highlight .se { color: #79c0ff; font-weight: bold }
[data-theme="dark"] .highlight .sh { color: #a5d6ff }
[data-theme="dark"] .highlight .si { color: #a5d6ff }
[data-theme="dark"] .highlight .sx { color: #a5d6ff }
[data-theme="dark"] .highlight .sr { color: #a5d6ff }
[data-theme="dark"] .highlight .s1 { color: #a5d6ff }
[data-theme="dark"] .highlight .ss { color: #79c0ff }

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: var(--space-md);
        padding: var(--space-md);
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .container {
        padding: var(--space-lg) var(--space-md);
    }
    
    .hero {
        padding: var(--space-xl) 0;
    }
    
    .search-input {
        flex-direction: column;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        font-size: var(--text-xs);
    }
    
    .admin-table th,
    .admin-table td {
        padding: var(--space-xs);
    }
}

/* ========================================
   Cover Image Crop Modal
   ======================================== */

.cover-crop-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.cover-crop-modal.active {
    display: flex;
}

.cover-crop-modal-content {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.cover-crop-modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.cover-crop-modal-header h3 {
    margin: 0 0 var(--space-xs) 0;
    font-size: var(--text-lg);
}

.cover-crop-hint {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

.cover-crop-modal-body {
    padding: var(--space-lg);
    flex: 1;
    overflow: auto;
}

.cover-crop-container {
    max-height: 60vh;
    overflow: hidden;
}

.cover-crop-container img {
    display: block;
    max-width: 100%;
}

.cover-crop-modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

/* ========================================
   WeChat Push Button
   ======================================== */

.wechat-actions {
    margin-left: auto;
}

.btn-wechat {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-wechat:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-strong);
}

.btn-wechat.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-wechat.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-wechat.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-wechat:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-wechat .icon {
    font-size: 1.1em;
}

.btn-wechat .loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Toast Notifications
   ======================================== */

.toast {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-sm);
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--error);
}

.toast-info {
    border-left: 4px solid var(--accent);
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .navbar,
    .footer,
    .comments-section,
    .related-posts,
    #theme-toggle {
        display: none;
    }
    
    body {
        font-size: 12pt;
        color: black;
        background: white;
    }
    
    .post-detail {
        max-width: 100%;
    }
}

/* ========================================
   Quality Enhancements - 高品质细节优化
   ======================================== */

/* 1. 焦点状态优化 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* 2. 平滑滚动增强 */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* 3. 图片加载优化 */
img {
    content-visibility: auto;
}

/* 4. 按钮微交互增强 */
.btn:active {
    transform: translateY(1px);
}

/* 5. 标签云标签大小变化 */
.tag:nth-child(3n) { font-size: calc(var(--text-xs) * 1.05); }
.tag:nth-child(5n) { font-size: calc(var(--text-xs) * 0.95); }

/* 6. 文章内容首字下沉（可选装饰） */
.post-content > p:first-of-type::first-letter {
    font-family: var(--font-display);
    font-size: 3.5em;
    float: left;
    line-height: 0.8;
    margin-right: 0.1em;
    margin-top: 0.05em;
    color: var(--accent);
}

/* 7. 代码块标题栏 */
.post-content pre::before {
    content: 'CODE';
    display: block;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    letter-spacing: 0.1em;
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border);
}

/* 8. 打印样式优化 */
@media print {
    .navbar,
    .footer,
    .share-section,
    .comments-section,
    .related-posts {
        display: none;
    }
    
    .post-content {
        max-width: 100%;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* 9. 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 10. 高对比度模式适配 */
@media (prefers-contrast: high) {
    :root {
        --border: oklch(50% 0 0);
        --text-secondary: oklch(30% 0 0);
    }
}
