/* 全局样式 - 白色+灰色主题，简洁大方 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #95a5a6;
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --bg-gray: #e9ecef;
    --text-color: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --border-color: #dee2e6;
    --hover-color: #34495e;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --link-color: #3498db;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

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

/* 头部导航 */
.header {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(222, 226, 230, 0.5);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s;
}

.header:hover {
    background-color: rgba(255, 255, 255, 0.85);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo a:hover {
    color: var(--hover-color);
}

.logo-img {
    height: 40px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.logo-text {
    display: inline-block;
}

.logo-slogan {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary-color);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    position: relative;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0;
    display: block;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* 导览下拉菜单 */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 350px;
    max-width: 450px;
    max-height: 600px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.nav-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-loading {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.dropdown-content {
    padding: 1rem;
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.dropdown-more {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

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

.dropdown-posts {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dropdown-post-item {
    margin-bottom: 0.25rem;
}

.dropdown-post-item:last-child {
    margin-bottom: 0;
}

.dropdown-post-link {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.dropdown-post-link:hover {
    background-color: var(--bg-light);
}

.dropdown-post-title {
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

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

/* 导览下拉菜单分页 */
.dropdown-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

.dropdown-pagination-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dropdown-page-btn {
    padding: 0.4rem 0.6rem;
    background-color: var(--bg-light);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    min-width: 32px;
}

.dropdown-page-btn:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.dropdown-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dropdown-page-info {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0 0.5rem;
}

/* 导航栏中的发表按钮 */
.nav-publish-btn {
    background-color: var(--primary-color);
    color: white !important;
    padding: 0.5rem 1rem !important;
    border-radius: 4px;
    transition: all 0.3s;
}

.nav-publish-btn:hover {
    background-color: var(--hover-color);
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 搜索触发按钮 */
.search-trigger {
    padding: 0;
    border: none;
    border-radius: 4px;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 放大镜圆形部分 */
.search-trigger::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    transition: border-color 0.3s;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 放大镜手柄部分 */
.search-trigger::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 2px;
    background-color: var(--text-muted);
    transform: rotate(45deg);
    transform-origin: left center;
    top: calc(50% + 6px);
    left: calc(50% + 6px);
    transition: background-color 0.3s;
}

.search-trigger:hover::before {
    border-color: var(--text-color);
}

.search-trigger:hover::after {
    background-color: var(--text-color);
}

/* 搜索框样式 */
.search-form {
    display: none;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.search-form.active {
    display: flex;
}

.search-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    width: 200px;
    transition: border-color 0.3s, width 0.3s;
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    width: 250px;
    background-color: var(--bg-color);
}

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

.search-button {
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    transition: border-color 0.3s;
}

.search-button::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 2px;
    background-color: var(--text-muted);
    transform: rotate(45deg);
    transform-origin: left center;
    top: 18px;
    left: 14px;
    transition: background-color 0.3s;
}

.search-button:hover {
    background-color: var(--bg-color);
    border-color: var(--border-color);
}

.search-button:hover::before {
    border-color: var(--text-color);
}

.search-button:hover::after {
    background-color: var(--text-color);
}

.search-button:active {
    background-color: var(--bg-gray);
}

/* 搜索关闭按钮 */
.search-close {
    padding: 0;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
    border-radius: 4px;
}

.search-close:hover {
    color: var(--text-color);
    background-color: var(--bg-light);
}

.search-close:active {
    background-color: var(--bg-gray);
}

/* 移动端导航链接颜色 */
@media (max-width: 768px) {
    .nav-menu a {
        color: var(--text-muted);
    }
    
    .nav-menu a:hover {
        color: var(--primary-color);
    }
}

/* 主内容区 */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Flash 消息 */
.flash-messages {
    margin-bottom: 1.5rem;
}

.flash-message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.flash-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Hero 区域 */
.hero-section {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 3rem;
}

.blog-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.blog-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    font-weight: 300;
}

/* 文章列表 */
.posts-container {
    margin-top: 2rem;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.post-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.post-header {
    margin-bottom: 1rem;
}

.post-title {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
}

.post-title a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.post-title a:hover {
    color: var(--hover-color);
}

.post-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.post-excerpt {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.read-more {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

.post-actions {
    display: flex;
    gap: 0.75rem;
}

/* 按钮样式 */
.btn-primary,
.btn-edit,
.btn-delete,
.btn-back,
.btn-cancel {
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--hover-color);
}

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

.btn-edit:hover {
    background-color: #7f8c8d;
}

.btn-delete {
    background-color: var(--text-muted);
    color: white;
}

.btn-delete:hover {
    background-color: var(--text-light);
}

.btn-back {
    background-color: var(--bg-gray);
    color: var(--text-color);
}

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

.btn-cancel {
    background-color: var(--bg-gray);
    color: var(--text-color);
}

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

/* 文章详情页 */
.post-detail {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
}

.post-detail-header {
    margin-bottom: 0.5rem;
    padding-bottom: 1rem;
}

.post-detail-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.post-detail-meta {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    align-items: center;
    overflow-x: auto;
}

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

.post-keywords {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: var(--bg-light);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.keywords-label {
    font-weight: 500;
    color: var(--text-color);
    margin-right: 0.5rem;
}

.keyword-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    margin: 0.25rem 0.25rem 0.25rem 0;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.keyword-tag:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    text-decoration: none;
}

.tag-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.tag-header .page-title {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.tag-description {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.tag-info {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.post-detail-content {
    white-space: pre-wrap;
    line-height: 1.9;
    font-size: 1.2rem;
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

/* 富文本编辑器内容样式 */
.post-detail-content h1,
.post-detail-content h2,
.post-detail-content h3 {
    color: var(--primary-color);
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}


.post-detail-content h1 {
    font-size: 2rem;
}

.post-detail-content h2 {
    font-size: 1.5rem;
}

.post-detail-content h3 {
    font-size: 1.25rem;
}

.post-detail-content p {
    margin: 0;
    padding: 0;
}

.post-detail-content p:first-child {
    margin-top: 0;
}

.post-detail-content p:last-child {
    margin-bottom: 0;
}

.post-detail-content ul,
.post-detail-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.post-detail-content li {
    margin-bottom: 0.5rem;
}

.post-detail-content a {
    color: var(--link-color);
    text-decoration: none;
}

.post-detail-content a:hover {
    text-decoration: underline;
}

.post-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1rem 0;
}

.post-detail-content video {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1rem 0;
}

/* 上标和下标样式 */
.post-detail-content sup,
.post-detail-content sub {
    font-size: 0.75em;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

.post-detail-content sup {
    top: -0.5em;
}

.post-detail-content sub {
    bottom: -0.25em;
}

.post-detail-content blockquote {
    border-left: 4px solid var(--border-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-light);
    font-style: italic;
}

.post-detail-content code {
    background-color: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.post-detail-content pre {
    background-color: #e8e8e8;
    padding: 0.2rem 1rem;
    border-radius: 4px;
    overflow-x: auto;
    
   
}

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

/* Quill 编辑器样式 */
.ql-container {
    font-family: inherit;
    font-size: 1rem;
}

.ql-editor {
    min-height: 400px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
    padding: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 确保编辑器内容样式与页面显示一致 */
.ql-editor h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.ql-editor h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.ql-editor h3 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.ql-editor p {
    margin-bottom: 1rem;
}

.ql-editor ul,
.ql-editor ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.ql-editor li {
    margin-bottom: 0.5rem;
}

.ql-editor a {
    color: var(--link-color);
    text-decoration: none;
}

.ql-editor a:hover {
    text-decoration: underline;
}

.ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1rem 0;
}

.ql-editor video {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1rem 0;
}

/* 上标和下标样式 */
.ql-editor sup,
.ql-editor sub {
    font-size: 0.75em;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

.ql-editor sup {
    top: -0.5em;
}

.ql-editor sub {
    bottom: -0.25em;
}

.ql-editor blockquote {
    border-left: 4px solid var(--border-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-light);
    font-style: italic;
}

.ql-editor code {
    background-color: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.ql-editor pre {
    background-color: var(--bg-light);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

.ql-editor pre.ql-syntax {
    background-color: #e8e8e8;
    color: #333;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    border: 1px solid #ccc;
}

.ql-editor pre code {
    background-color: transparent;
    padding: 0;
    font-size: 0.9em;
    line-height: 1.5;
    color: #333;
}

/* 代码块容器（带行号和复制按钮） */
.code-block-wrapper {
    position: relative;
    margin: 1rem 0;
    border-radius: 4px;
    overflow: hidden;
    background-color: #e8e8e8;
    border: 1px solid #ccc;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #d3d3d3;
    border-bottom: 1px solid #ccc;
    color: #333;
    font-size: 0.85rem;
}

.code-block-copy-btn {
    background-color: #fff;
    border: 1px solid #999;
    color: #333;
    padding: 0.25rem 0.75rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.code-block-copy-btn:hover {
    background-color: #999;
    color: #fff;
}

.code-block-copy-btn:active {
    transform: scale(0.98);
}

.code-block-copy-btn.copied {
    background-color: #4caf50;
    border-color: #4caf50;
    color: #fff;
}

.code-block-body {
    position: relative;
    overflow-x: auto;
    display: block;
}

.code-block-lines {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    padding: 1rem 0.5rem 1rem 1rem;
    background-color: #d3d3d3;
    color: #666;
    text-align: right;
    user-select: none;
    pointer-events: none;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    border-right: 1px solid #bbb;
    white-space: pre;
    box-sizing: border-box;
    margin: 0;
    min-width: 3rem; /* 确保行号区域有足够宽度 */
}

.code-block-content-wrapper {
    padding: 1rem 1rem 1rem 3rem;
    overflow-x: auto;
    box-sizing: border-box;
    margin: 0;
}

.code-block-content {
    margin-top: 0;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    background: none;
    border: none;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    white-space: pre;
    box-sizing: border-box;
    display: block;
}

/* 确保行号和代码内容完全对齐 */
.code-block-lines,
.code-block-content {
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace !important;
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    white-space: pre !important;
}

/* 确保第一行对齐 */
.code-block-lines {
    padding-top: 1rem;
}

.code-block-content-wrapper {
    padding-top: 1rem;
}

/* 编辑器中的代码块样式（浅色主题，确保可见） */
.ql-editor .code-block-wrapper,
#editor-container .code-block-wrapper,
.code-block-in-editor {
    background-color: #e8e8e8;
    border: 1px solid #ccc;
}

/* 编辑器中的代码块不显示头部 */
.code-block-in-editor .code-block-header {
    display: none;
}

/* 编辑器中的代码块内容可编辑 */
.code-block-in-editor .code-block-content {
    background: transparent !important;
    color: #333 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    outline: none;
    display: block !important;
    visibility: visible !important;
}

.ql-editor .code-block-header,
#editor-container .code-block-header {
    background-color: #d3d3d3;
    border-bottom: 1px solid #ccc;
    color: #333;
}

.ql-editor .code-block-copy-btn,
#editor-container .code-block-copy-btn {
    border: 1px solid #999;
    color: #333;
    background-color: #fff;
}

.ql-editor .code-block-copy-btn:hover,
#editor-container .code-block-copy-btn:hover {
    background-color: #999;
    color: #fff;
}

.ql-editor .code-block-content,
#editor-container .code-block-content {
    color: #333;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre;
}

.ql-editor .code-block-lines,
#editor-container .code-block-lines {
    background-color: #d3d3d3;
    color: #666;
    border-right: 1px solid #bbb;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre;
}

/* 显示页面的代码块样式（深色主题） */
.post-detail-content .code-block-wrapper {
    margin: 1rem 0;
}

.ql-toolbar {
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    background-color: var(--bg-light);
    padding: 0.5rem;
}

/* 工具栏按钮样式优化 */
.ql-toolbar .ql-formats {
    margin-right: 0.5rem;
}

.ql-toolbar button,
.ql-toolbar .ql-picker-label {
    padding: 0.25rem 0.5rem;
}

.ql-container {
    border-bottom: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 4px 4px;
    background-color: var(--bg-color);
}

.ql-editor.ql-blank::before {
    color: var(--text-muted);
    font-style: normal;
}

/* 相关推荐独立区域 */
.related-posts-section {
    margin-top: 1rem;
    margin-bottom: 2rem;
    width: 100%;
    clear: both;
}

.related-posts {
    margin: 0;
    padding: 1.5rem;
    background-color: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.related-posts-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin: -1.5rem -1.5rem 1rem -1.5rem;
    padding: 1rem 1.5rem;
    background-color: var(--bg-light);
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.related-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-post-item {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.related-post-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.related-post-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s;
}

.related-post-link:hover {
    color: var(--primary-color);
}

.related-post-title {
    flex: 1;
    font-weight: 500;
}

.related-post-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 1rem;
}

.related-posts-loading {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.related-posts-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-style: italic;
}

/* 文件上传按钮样式 */
.ql-upload {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.2rem;
    line-height: 1;
    vertical-align: middle;
    transition: opacity 0.3s;
}

.ql-upload:hover {
    opacity: 0.7;
}

/* 编辑器中的图片和链接可点击删除 */
.ql-editor img,
.ql-editor a {
    cursor: pointer;
    transition: opacity 0.3s;
}

.ql-editor img:hover,
.ql-editor a:hover {
    opacity: 0.8;
}

/* 编辑页面布局 */
.edit-page-wrapper {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

/* 附件侧边栏 */
.attachments-sidebar {
    width: 280px;
    min-width: 280px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.attachments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.attachments-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.attachments-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.attachments-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 0;
    font-size: 0.9rem;
}

/* 附件项 */
.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: move;
    transition: all 0.3s;
    position: relative;
}

.attachment-item:hover {
    background-color: var(--bg-gray);
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.attachment-item.dragging {
    opacity: 0.5;
    border-color: var(--primary-color);
}

.attachment-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
    border-radius: 4px;
    overflow: hidden;
}

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

.attachment-icon {
    font-size: 1.5rem;
}

.attachment-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.attachment-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.attachment-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.attachment-size,
.attachment-type {
    padding: 0.15rem 0.4rem;
    background-color: var(--bg-color);
    border-radius: 3px;
}

.attachment-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-attachment-delete {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.3s;
    opacity: 0.6;
}

.btn-attachment-delete:hover {
    opacity: 1;
    background-color: rgba(220, 53, 69, 0.1);
}

/* 主编辑区域 */
.edit-page-wrapper .form-container {
    flex: 1;
    min-width: 0;
}

/* 拖拽目标区域高亮 */
.ql-editor.drag-over {
    background-color: rgba(0, 123, 255, 0.05);
    border: 2px dashed var(--primary-color);
}

/* 分享按钮（左侧对齐，仅图标） */
.post-share-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: none;
    margin-top: 1rem;
}

.post-detail-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    padding-bottom: 0rem;
    border-top: 1px solid var(--border-color);
    border-bottom: none;
    margin-top: 0;
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 1rem;
}

/* 文章导航（上一篇/下一篇） */
.post-navigation {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.btn-nav {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 1rem;
    background-color: var(--bg-gray);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.btn-nav:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-nav.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--bg-light);
    color: var(--text-muted);
}

.btn-nav.disabled:hover {
    background-color: var(--bg-light);
    color: var(--text-muted);
    transform: none;
    box-shadow: none;
}

.btn-prev {
    text-align: left;
}

.btn-next {
    text-align: right;
}

.post-actions-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 分享按钮通用样式（仅图标） */
.btn-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background-color: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-share svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: fill 0.3s;
}

.btn-share img.share-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.6);
    transition: all 0.3s;
}

/* 微信分享按钮 - 默认灰色，悬浮时变绿色 */
.btn-share-wechat:hover {
    color: #07c160;
    border-color: #07c160;
    background-color: rgba(7, 193, 96, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(7, 193, 96, 0.2);
}

.btn-share-wechat:hover svg {
    fill: #07c160;
}

/* 微博分享按钮 - 默认灰色，悬浮时变红色 */
.btn-share-weibo:hover {
    color: #e6af1688;
    background-color: rgba(230, 22, 45, 0.1);
    transform: translateY(-2px);
}

.btn-share-weibo:hover svg {
    fill: #e6af1688;
}

.btn-share-weibo:hover img.share-icon {
    filter: grayscale(0%) opacity(1);
}

/* 微信分享弹窗 */
.wechat-share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

.wechat-share-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
}

.wechat-share-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--bg-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.wechat-share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.wechat-share-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.wechat-share-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.wechat-share-modal-close:hover {
    color: var(--text-color);
}

.wechat-share-modal-body {
    padding: 2rem 1.5rem;
    text-align: center;
}

.wechat-share-tip {
    margin: 0 0 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.wechat-share-qrcode {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: white;
    border-radius: 8px;
    display: inline-block;
}

.wechat-share-qrcode img {
    width: 200px;
    height: 200px;
    display: block;
    max-width: 100%;
    height: auto;
}

.wechat-share-title {
    margin: 1.5rem 0 0 0;
    padding: 1rem;
    background-color: var(--bg-light);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.6;
    word-break: break-word;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
}

/* 表单样式 */
.form-container {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

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

.post-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-control {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
    padding: 1.5rem;
}

.page-link {
    padding: 0.5rem 1rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s;
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
}

.empty-state a {
    color: var(--link-color);
    text-decoration: none;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* 搜索页面 */
.search-container {
    max-width: 900px;
    margin: 0 auto;
}

.search-info {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--bg-light);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.search-info p {
    margin: 0.5rem 0;
    color: var(--text-color);
}

.search-info strong {
    color: var(--primary-color);
}

/* 搜索页面 */
.search-container {
    max-width: 900px;
    margin: 0 auto;
}

.search-info {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--bg-light);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.search-info p {
    margin: 0.5rem 0;
    color: var(--text-color);
}

.search-info strong {
    color: var(--primary-color);
}

/* 关于页面 */
.about-container {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 3rem;
    box-shadow: var(--shadow);
    max-width: 700px;
    margin: 0 auto;
}

.page-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: left;
}

.about-content {
    line-height: 1.8;
    color: var(--text-color);
}

.about-content h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.about-content p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* 页脚 */
.footer {
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright {
    margin: 0;
    text-align: left;
}

/* 版权声明中的超链接样式，与普通文字保持一致 */
.footer-copyright a {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
}

.footer-copyright a:hover,
.footer-copyright a:active,
.footer-copyright a:focus,
.footer-copyright a:visited {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
}

.footer-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.footer-link {
    color: var(--bg-color);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    transition: all 0.2s;
    background-color: transparent;
}

.footer-link:active {
    background-color: var(--bg-gray);
}

.footer-link:hover {
    color: var(--text-muted);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .navbar {
        flex-direction: row;
        gap: 0.75rem;
        align-items: center;
        flex-wrap: wrap;
    }
    
    .logo {
        flex-shrink: 0;
        min-width: 0;
    }
    
    .nav-right {
        flex: 1;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        justify-content: flex-end;
        min-width: 0;
    }
    
    .search-trigger {
        flex-shrink: 0;
    }
    
    .nav-menu {
        display: flex;
        flex-direction: row;
        gap: 0.75rem;
        margin: 0;
        padding: 0;
        list-style: none;
        flex-shrink: 0;
    }
    
    .nav-menu li {
        margin: 0;
    }
    
    .nav-menu a {
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
        white-space: nowrap;
    }
    
    .nav-publish-btn {
        font-size: 0.85rem !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    .search-form {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background-color: var(--bg-color);
        padding: 0.75rem;
        border: 1px solid var(--border-color);
        border-top: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        z-index: 100;
        display: none;
    }
    
    .search-form.active {
        display: flex;
    }
    
    .search-input {
        flex: 1;
        width: 100%;
    }
    
    .search-input:focus {
        width: 100%;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-dropdown-menu {
        min-width: 280px;
        max-width: 320px;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
    }
    
    .nav-dropdown-menu.active {
        transform: translateX(-50%) translateY(0);
    }
    
    .blog-title {
        font-size: 2rem;
    }
    
    .post-card,
    .post-detail,
    .form-container {
        padding: 1.5rem;
    }
    
    .post-detail-title {
        font-size: 1.8rem;
    }
    
    .post-detail-meta {
        flex-wrap: nowrap;
        gap: 1rem;
        font-size: 0.85rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .meta-item {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .post-footer,
    .post-detail-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .post-navigation {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-nav {
        width: 100%;
        text-align: center;
    }
    
    .btn-prev,
    .btn-next {
        text-align: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button,
    .form-actions a {
        width: 100%;
        text-align: center;
    }
    
    .logo a {
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
    }
    
    .logo-img {
        height: 30px;
        flex-shrink: 0;
    }
    
    .logo-slogan {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .footer-copyright {
        text-align: left;
    }
    
    .footer-links {
        width: 100%;
        justify-content: flex-start;
    }
}

/* 管理页面样式 */
.admin-container {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 0 auto;
}

.admin-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.admin-section {
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-section:last-child {
    border-bottom: none;
}

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

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.current-logo {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: var(--bg-light);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.current-logo p {
    margin-bottom: 0.75rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.logo-preview {
    max-width: 200px;
    max-height: 100px;
    height: auto;
    width: auto;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    background-color: var(--bg-color);
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-footer {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.form-footer p {
    color: var(--text-light);
    margin: 0;
}

.form-footer a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span {
    color: var(--text-color);
    font-weight: 500;
}

.config-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--bg-light);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.info-label {
    font-weight: 500;
    color: var(--text-color);
    margin-right: 1rem;
    min-width: 120px;
}

.info-value {
    color: var(--text-light);
    word-break: break-all;
}

/* 表单复选框组 */
.form-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    color: var(--text-color);
    font-size: 0.95rem;
}

.checkbox-label:hover span {
    color: var(--primary-color);
}

/* 状态标签 */
.status-badges {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-pinned {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.status-public {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}

.status-private {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #dc3545;
}

/* 编辑页面布局 */
.edit-page-wrapper {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    max-width: none; /* 移除最大宽度限制，允许附件列表超出 */
    margin: 0 auto;
    width: 100%;
}

.edit-page-wrapper .form-container {
    flex: 0 0 800px; /* 固定宽度，保持原页面大小 */
    max-width: 800px;
    min-width: 0;
    margin: 0;
}

/* 附件侧边栏 */
.attachments-sidebar {
    width: 280px;
    min-width: 280px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    flex-shrink: 0; /* 不允许收缩 */
}

.attachments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.attachments-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.attachments-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.attachments-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 0;
    font-size: 0.9rem;
}

/* 附件项 */
.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: move;
    transition: all 0.3s;
    position: relative;
}

.attachment-item:hover {
    background-color: var(--bg-gray);
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.attachment-item.dragging {
    opacity: 0.5;
    border-color: var(--primary-color);
}

.attachment-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
    border-radius: 4px;
    overflow: hidden;
    font-size: 1.5rem;
}

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

.attachment-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.attachment-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.attachment-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.attachment-size,
.attachment-type {
    padding: 0.15rem 0.4rem;
    background-color: var(--bg-color);
    border-radius: 3px;
}

.attachment-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-attachment-delete {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.3s;
    opacity: 0.6;
}

.btn-attachment-delete:hover {
    opacity: 1;
    background-color: rgba(220, 53, 69, 0.1);
}

/* 拖拽目标区域高亮 */
.ql-editor.drag-over {
    background-color: rgba(0, 123, 255, 0.05);
    border: 2px dashed var(--primary-color);
}

/* 响应式设计：小屏幕时侧边栏移到下方 */
@media (max-width: 1200px) {
    .edit-page-wrapper {
        flex-direction: column;
    }
    
    .edit-page-wrapper .form-container {
        flex: 1;
        max-width: 100%;
    }
    
    .attachments-sidebar {
        width: 100%;
        position: static;
        max-height: none;
    }
}

