@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700&display=swap');

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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333;
    --text-muted: #666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "header header"
        "sidebar main"
        "footer footer";
    min-height: 100vh;
    gap: 20px;
}

.header {
    grid-area: header;
    background: var(--card-bg);
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.site-title {
    font-size: 1.8rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.3);
    letter-spacing: 2px;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.site-title:hover {
    animation: gradient-shift 1s ease infinite;
    filter: brightness(1.2);
}

.search-box {
    position: relative;
}

.search-box input {
    width: 200px;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
    background: var(--bg-color);
}

.search-box input:focus {
    width: 280px;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    background: white;
}

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 100;
    opacity: 1;
    transition: opacity 0.5s ease, backdrop-filter 0.5s ease;
}

.search-overlay.hidden {
    opacity: 0;
    backdrop-filter: blur(0);
    pointer-events: none;
}

.search-box.active {
    position: relative;
    z-index: 101;
}

.search-box.active input {
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: scale(1.15);
}

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

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--secondary-color);
    background-color: rgba(52, 152, 219, 0.1);
}

.sidebar {
    grid-area: sidebar;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    height: fit-content;
}

.sidebar-title {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
}

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

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

.category-list a {
    text-decoration: none;
    color: var(--text-color);
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.category-list a:hover,
.category-list a.active {
    background-color: var(--secondary-color);
    color: white;
}

.main-content {
    grid-area: main;
}

.main-content.full-width {
    grid-column: 1 / -1;
}

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

.post-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.5s ease, filter 0.5s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    opacity: 0;
    filter: blur(10px);
    -webkit-filter: blur(10px);
}

.post-card.visible {
    opacity: 1;
    filter: blur(0);
    -webkit-filter: blur(0);
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.post-title {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

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

.post-locked {
    color: var(--accent-color);
    margin-left: 8px;
}

.read-more {
    display: inline-block;
    margin-top: 15px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: var(--primary-color);
}

.post-footer {
    margin-top: auto;
    padding-top: 15px;
    text-align: right;
}

.post-footer .post-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-results p {
    font-size: 1.1rem;
}

.post-detail {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.post-detail .post-title {
    font-size: 2rem;
    margin-bottom: 20px;
}

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

.post-header .post-title {
    margin-bottom: 0;
}

.btn-edit {
    padding: 8px 16px;
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-edit:hover {
    background: #2980b9;
}

.post-detail .post-content {
    line-height: 1.8;
    font-size: 1.05rem;
}

.post-detail .post-content h1,
.post-detail .post-content h2,
.post-detail .post-content h3 {
    margin: 25px 0 15px;
    color: var(--primary-color);
}

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

.post-detail .post-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
}

.post-detail .post-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.post-detail .post-content pre code {
    background: none;
    padding: 0;
}

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.post-nav-item {
    flex: 1;
    padding: 15px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.post-nav-item:hover:not(.disabled) {
    border-color: var(--secondary-color);
    background: rgba(52, 152, 219, 0.05);
}

.post-nav-item.disabled {
    opacity: 0;
    pointer-events: none;
}

.post-nav-prev {
    text-align: left;
}

.post-nav-next {
    text-align: right;
}

.post-nav-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.post-nav-title {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 250px;
}

.post-nav-prev .post-nav-title {
    margin-right: auto;
}

.post-nav-next .post-nav-title {
    margin-left: auto;
}

.footer {
    grid-area: footer;
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.error {
    color: var(--accent-color);
    text-align: center;
    padding: 40px;
}

.page-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.admin-panel {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.admin-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.page-header-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.page-header-row .admin-title {
    margin-bottom: 0;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
}

.btn-back:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.4);
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.tab-btn:hover {
    background: rgba(52, 152, 219, 0.1);
    color: var(--secondary-color);
}

.tab-btn.active {
    background: var(--secondary-color);
    color: white;
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

.tab-content.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.post-table-container {
    overflow-x: auto;
}

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

.post-table th,
.post-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.post-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--primary-color);
}

.post-table tr:hover {
    background: rgba(52, 152, 219, 0.05);
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.published {
    background: #d4edda;
    color: #155724;
}

.status-badge.draft {
    background: #fff3cd;
    color: #856404;
}

.slug-input-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slug-input-group input[type="text"] {
    flex: 1;
    margin: 0;
}

.auto-slug-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    margin: 0;
    padding: 0;
    height: 42px;
    line-height: 42px;
}

.auto-slug-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    vertical-align: middle;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-right: 5px;
    transition: all 0.3s ease;
}

.action-btn.edit {
    background: var(--secondary-color);
    color: white;
}

.action-btn.delete {
    background: var(--accent-color);
    color: white;
}

.action-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.post-form {
    max-width: 800px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--primary-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.checkbox-group {
    display: flex;
    gap: 20px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.category-form {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 8px;
}

.category-form h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.category-form form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.category-form input {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    flex: 1;
    min-width: 150px;
}

.category-form button {
    padding: 10px 20px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main"
            "footer";
    }

    .sidebar {
        display: none;
    }

    .header {
        flex-direction: column;
        gap: 15px;
    }

    .post-detail {
        padding: 20px;
    }

    .admin-tabs {
        flex-wrap: wrap;
    }
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-title {
    font-size: 2rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 8px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
}

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

.login-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--primary-color);
}

.login-form .form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.login-form .form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.captcha-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.captcha-group input {
    flex: 1;
}

.captcha-img {
    height: 42px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.login-error {
    background: #fee;
    color: #c00;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.lock-timer {
    background: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    text-align: center;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

/* ============================================
   现代化编辑器样式 - Modern Editor Styles
   ============================================ */

.editor-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: none;
    margin: 0;
    padding: 0;
    grid-template: none;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

.editor-container .main-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 16px 20px 20px;
}

.editor-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* 编辑器头部 - Editor Header */
.editor-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e8ecf1;
    gap: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.editor-title-input {
    flex: 1;
    font-size: 1.6rem;
    font-weight: 700;
    border: 2px solid transparent;
    outline: none;
    padding: 14px 20px;
    background: #e2e8f0;
    border-radius: 12px;
    color: #1a1a2e;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.editor-title-input::placeholder {
    color: #718096;
    font-weight: 500;
}

.editor-title-input:hover {
    background: #cbd5e0;
    border-color: #a0aec0;
}

.editor-title-input:focus {
    background: #ffffff;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.editor-category-select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    background: #ffffff;
    cursor: pointer;
    min-width: 140px;
    color: #4a5568;
    font-weight: 500;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.editor-category-select:hover {
    border-color: #667eea;
}

.editor-category-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.btn-save-draft {
    padding: 12px 24px;
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-save-draft:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-save-draft:active {
    transform: translateY(0);
}

.btn-publish {
    padding: 12px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
}

.btn-publish:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
    filter: brightness(1.05);
}

.btn-publish:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.35);
}

/* 编辑器工具栏 - Editor Toolbar */
.editor-toolbar {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #e8ecf1;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    gap: 2px;
    flex-wrap: wrap;
}

.toolbar-btn {
    padding: 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #4a5568;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    position: relative;
}

.toolbar-btn:hover {
    background: #edf2f7;
    border-color: #e2e8f0;
    color: #667eea;
    transform: translateY(-1px);
}

.toolbar-btn:active {
    transform: translateY(0);
    background: #e2e8f0;
}

.toolbar-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

/* 工具提示 - Tooltip */
.toolbar-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 6px 12px;
    background: #1a202c;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toolbar-btn::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border-width: 5px;
    border-style: solid;
    border-color: #1a202c transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1000;
}

.toolbar-btn:hover::after,
.toolbar-btn:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: linear-gradient(180deg, transparent 0%, #e2e8f0 50%, transparent 100%);
    margin: 0 10px;
}

/* 编辑器主体 - Editor Body */
.editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f8fafc;
}

.editor-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e8ecf1;
    background: #ffffff;
    transition: flex 0.3s ease;
}

.editor-pane:last-child {
    border-right: none;
}

.pane-header {
    padding: 12px 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e8ecf1;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pane-header::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
}

.editor-textarea {
    flex: 1;
    border: none;
    outline: none;
    padding: 24px;
    font-size: 0.95rem;
    line-height: 1.8;
    resize: none;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
    background: #fafbfc;
    color: #2d3748;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all;
    tab-size: 4;
}

.editor-textarea::placeholder {
    color: #a0aec0;
}

/* 自定义滚动条 - Custom Scrollbar */
.editor-textarea::-webkit-scrollbar,
.preview-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.editor-textarea::-webkit-scrollbar-track,
.preview-content::-webkit-scrollbar-track {
    background: transparent;
}

.editor-textarea::-webkit-scrollbar-thumb,
.preview-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.editor-textarea::-webkit-scrollbar-thumb:hover,
.preview-content::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 预览区域 - Preview Pane */
.preview-pane {
    background: #ffffff;
}

.preview-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    line-height: 1.8;
    color: #2d3748;
    font-size: 1rem;
}

.preview-content h1,
.preview-content h2,
.preview-content h3 {
    margin: 24px 0 16px;
    color: #1a202c;
    font-weight: 700;
    line-height: 1.3;
}

.preview-content h1 {
    font-size: 2rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
    margin-top: 0;
}

.preview-content h2 {
    font-size: 1.5rem;
    color: #2d3748;
}

.preview-content h3 {
    font-size: 1.25rem;
    color: #4a5568;
}

.preview-content p {
    margin-bottom: 16px;
    color: #4a5568;
}

.preview-content code {
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    color: #667eea;
    border: 1px solid #e2e8f0;
}

.preview-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 20px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.preview-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    border: none;
    font-size: 0.9rem;
    line-height: 1.6;
}

.preview-content blockquote {
    border-left: 4px solid #667eea;
    padding: 16px 20px;
    margin: 20px 0;
    color: #4a5568;
    background: linear-gradient(90deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 0 12px 12px 0;
    font-style: italic;
}

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

.preview-content li {
    margin-bottom: 8px;
    color: #4a5568;
}

.preview-content li::marker {
    color: #667eea;
}

.preview-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.preview-content th,
.preview-content td {
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    text-align: left;
}

.preview-content th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 600;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
}

.preview-content tr:nth-child(even) {
    background: #f8fafc;
}

.preview-content tr:hover {
    background: #f1f5f9;
}

.preview-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 16px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.preview-content del {
    color: #a0aec0;
    text-decoration: line-through;
}

.preview-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #e2e8f0 50%, transparent 100%);
    margin: 32px 0;
}

.preview-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.preview-content a:hover {
    border-bottom-color: #667eea;
}

/* 编辑器底部 - Editor Footer */
.editor-footer {
    padding: 20px 24px;
    border-top: 1px solid #e8ecf1;
    background: linear-gradient(180deg, #fafbfc 0%, #f8fafc 100%);
}

.excerpt-section {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.excerpt-section label {
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    padding-top: 12px;
    font-size: 0.9rem;
}

.excerpt-textarea {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    background: #ffffff;
    color: #4a5568;
    transition: all 0.2s ease;
    min-height: 80px;
    font-family: inherit;
    line-height: 1.6;
}

.excerpt-textarea::placeholder {
    color: #a0aec0;
}

.excerpt-textarea:hover {
    border-color: #cbd5e0;
}

.excerpt-textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.article-container {
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 280px;
    grid-template-areas:
        "header header"
        "main sidebar"
        "footer footer";
    gap: 20px;
}

.article-container .main-content {
    grid-area: main;
    width: 100%;
}

.article-sidebar {
    grid-area: sidebar;
}

.article-content {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.article-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid var(--border-color);
}

.article-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: nowrap;
}

.article-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    line-height: 1.4;
    margin: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-item svg {
    opacity: 0.6;
}

.article-body {
    padding: 30px;
    line-height: 1.8;
    font-size: 1.05rem;
}

.article-body h1,
.article-body h2,
.article-body h3 {
    margin: 25px 0 15px;
    color: var(--primary-color);
}

.article-body h1 {
    font-size: 1.6rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.article-body h2 {
    font-size: 1.4rem;
}

.article-body h3 {
    font-size: 1.2rem;
}

.article-body p {
    margin-bottom: 15px;
}

.article-body code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 0.9em;
}

.article-body pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all;
}

.article-body pre code {
    background: none;
    padding: 0;
    color: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all;
}

.article-body blockquote {
    border-left: 4px solid var(--secondary-color);
    padding: 15px 20px;
    margin: 20px 0;
    background: #f9f9f9;
    border-radius: 0 6px 6px 0;
    color: var(--text-muted);
}

.article-body ul,
.article-body ol {
    padding-left: 25px;
    margin-bottom: 15px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    display: block;
    overflow-x: auto;
}

.article-body th,
.article-body td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
}

.article-body thead {
    background: #f6f8fa;
}

.article-body th {
    font-weight: 600;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 15px 0;
}

.article-body del {
    color: var(--text-muted);
    text-decoration: line-through;
}

.article-body hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 25px 0;
}

.article-body a {
    color: var(--secondary-color);
    text-decoration: none;
}

.article-body a:hover {
    text-decoration: underline;
}

.article-actions {
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.btn-article-edit {
    padding: 10px 20px;
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-article-edit:hover {
    background: #2980b9;
}

.article-nav {
    display: flex;
    border-top: 1px solid var(--border-color);
}

.article-nav .nav-prev,
.article-nav .nav-next {
    flex: 1;
    padding: 20px 30px;
    text-decoration: none;
    transition: background 0.3s ease;
}

.article-nav .nav-prev {
    border-right: 1px solid var(--border-color);
}

.article-nav .nav-next {
    text-align: right;
}

.article-nav .nav-prev:hover,
.article-nav .nav-next:hover {
    background: #f9f9f9;
}

.article-nav .nav-prev.disabled,
.article-nav .nav-next.disabled {
    opacity: 0;
    pointer-events: none;
}

.article-nav .nav-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.article-nav .nav-title {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

.article-nav .nav-next .nav-title {
    margin-left: auto;
}

.sidebar-nav-row {
    display: flex;
    padding: 15px;
    gap: 10px;
}

.sidebar-nav-btn {
    flex: 1;
    padding: 12px;
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
    min-width: 0;
}

.sidebar-nav-btn:hover {
    background: #f6f8fa;
    border-color: var(--secondary-color);
}

.sidebar-nav-btn.disabled {
    opacity: 0;
    pointer-events: none;
}

.sidebar-nav-btn-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.sidebar-nav-btn-title {
    display: block;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-nav-prev .sidebar-nav-btn-title {
    text-align: left;
}

.sidebar-nav-next .sidebar-nav-btn-title {
    text-align: right;
}

.sidebar-nav-next .sidebar-nav-btn-label {
    text-align: right;
}

.article-sidebar {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: fit-content;
}

.sidebar-card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sidebar-card-header {
    padding: 15px;
    background: #f6f8fa;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary-color);
}

.toc-list {
    padding: 10px 0;
    max-height: 400px;
    overflow-y: auto;
}

.toc-empty {
    padding: 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

.toc-items {
    list-style: none;
}

.toc-item {
    margin: 0;
}

.toc-item a {
    display: block;
    padding: 8px 15px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.toc-item a:hover {
    background: #f6f8fa;
    color: var(--secondary-color);
}

.toc-item a.active {
    background: #e8f4fc;
    color: var(--secondary-color);
    border-left-color: var(--secondary-color);
}

.article-meta-info {
    padding: 15px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.meta-row:last-child {
    border-bottom: none;
}

.meta-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.meta-value {
    font-size: 0.9rem;
    color: var(--text-color);
}

@media (max-width: 1024px) {
    .article-container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main"
            "sidebar"
            "footer";
    }

    .article-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }

    .toc-list {
        max-height: 200px;
    }
}

@media (max-width: 768px) {
    .editor-container .main-content {
        padding: 12px;
    }
    
    .editor-wrapper {
        border-radius: 12px;
    }
    
    .editor-header {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        gap: 16px;
    }
    
    .editor-title-input {
        font-size: 1.3rem;
        padding: 12px 16px;
    }
    
    .editor-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .btn-save-draft,
    .btn-publish {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
    
    .editor-category-select {
        min-width: 100px;
        padding: 10px 14px;
    }
    
    .editor-toolbar {
        padding: 8px 10px;
        gap: 1px;
    }
    
    .toolbar-btn {
        padding: 6px;
        min-width: 32px;
        height: 32px;
    }
    
    .toolbar-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .toolbar-divider {
        height: 20px;
        margin: 0 6px;
    }
    
    .editor-body {
        flex-direction: column;
    }
    
    .editor-pane {
        border-right: none;
        border-bottom: 1px solid #e8ecf1;
        min-height: 250px;
    }
    
    .editor-pane:last-child {
        border-bottom: none;
    }
    
    .editor-textarea,
    .preview-content {
        padding: 16px;
    }
    
    .pane-header {
        padding: 10px 16px;
        font-size: 0.75rem;
    }
    
    .editor-footer {
        padding: 16px;
    }
    
    .excerpt-section {
        flex-direction: column;
        gap: 8px;
    }
    
    .excerpt-section label {
        padding-top: 0;
    }
    
    .excerpt-textarea {
        min-height: 60px;
    }
    
    .article-header {
        padding: 20px;
    }
    
    .article-body {
        padding: 20px;
    }
    
    .article-meta {
        gap: 15px;
    }
}

.toast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.toast-overlay.show {
    opacity: 1;
    visibility: visible;
}

.toast-box {
    background: white;
    border-radius: 16px;
    padding: 30px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.8) translateY(20px);
    transition: transform 0.3s ease;
}

.toast-overlay.show .toast-box {
    transform: scale(1) translateY(0);
}

.toast-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
}

.toast-icon.success {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.toast-icon.error {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.toast-icon.warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.toast-icon.info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.toast-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.toast-message {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.6;
}

.toast-btn {
    padding: 12px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.toast-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.toast-btn-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.toast-btn-cancel {
    background: #f0f0f0;
    color: var(--text-color);
}

.toast-btn-cancel:hover {
    background: #e0e0e0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10001;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification .toast-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
    margin: 0;
    flex-shrink: 0;
}

.toast-notification .toast-message {
    margin: 0;
    font-weight: 500;
}
