/* css/admin.css - 管理员后台基础样式文件 */
/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", sans-serif;
}

body {
    background-color: #0f172a;
    color: #f8fafc;
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== 登录容器样式 ========== */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background: #1e293b;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #f8fafc;
    font-size: 24px;
}

.login-container .logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-container .logo i {
    font-size: 48px;
    color: #3b82f6;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #e2e8f0;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #334155;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s;
    background: #0f172a;
    color: #f8fafc;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.btn {
    width: 100%;
    padding: 12px;
    background-color: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #2563eb;
}

.error-message {
    padding: 10px;
    background-color: #0f172a;
    color: #ef4444;
    border: 1px solid #ef4444;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

/* ========== 后台主界面样式 ========== */
.admin-header {
    background-color: #1e293b;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.admin-header h1 {
    font-size: 20px;
}

.admin-header .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-header .logout-btn {
    color: #fff;
    text-decoration: none;
    padding: 6px 12px;
    background-color: #ef4444;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.admin-header .logout-btn:hover {
    background-color: #dc2626;
}

/* 合并后的 admin-content 样式（保留原有+新增的关键属性） */
.admin-content {
    max-width: 1200px;
    width: 95%;
    margin: 30px auto;
    padding: 20px 0 0 20px;
    overflow: visible !important;
}

/* 合并后的 card 样式（保留原有+新增的关键属性） */
.card {
    background: #1e293b;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    padding: 20px;
    margin-bottom: 20px;
    display: block !important;
}

.card h2 {
    font-size: 18px;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #334155;
    color: #f8fafc; /* 优先保留新增的颜色值，更适配整体风格 */
}

.card p {
    color: #e2e8f0;
    margin-bottom: 15px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    background: #0f172a;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.stat-item i {
    font-size: 32px;
    color: #3b82f6;
    margin-bottom: 10px;
    display: block;
}

.stat-item .stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #f8fafc;
    margin-bottom: 5px;
}

.stat-item .stat-label {
    color: #94a3b8;
    font-size: 14px;
}

/* ========== 分类列表样式补充 ========== */
.category-list {
    margin: 20px 0;
    border: 1px solid #334155;
    border-radius: 8px;
    overflow: hidden;
}
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #334155;
    background: #0f172a;
}
.category-item:last-child {
    border-bottom: none;
}
.category-item:nth-child(even) {
    background-color: #1e293b;
}
.category-info {
    flex: 1;
}
.category-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    color: #f8fafc;
}
.category-meta {
    font-size: 12px;
    color: #94a3b8;
}
.category-actions a {
    margin-left: 10px;
    padding: 4px 8px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
}
.edit-category {
    background-color: #3b82f6;
    color: white;
}
.delete-category {
    background-color: #ef4444;
    color: white;
}
.edit-mode-title {
    display: inline-block;
    background-color: #1e293b;
    color: #3b82f6;
    padding: 6px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-weight: 600;
}
.disabled-hint {
    color: #ef4444;
    margin-left: 10px;
    font-size: 14px;
}

/* ========== 提示框样式 ========== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 4px;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 9999;
}
.toast.show {
    opacity: 1;
}
.toast-success {
    background-color: #10b981;
}
.toast-error {
    background-color: #ef4444;
}
.toast-info {
    background-color: #3b82f6;
}

/* ========== 编辑功能专属样式 ========== */
.form-item .required {
    color: #ef4444;
    margin-left: 4px;
}
.form-hint {
    color: #94a3b8;
    display: block;
    margin-top: 8px;
    font-size: 13px;
}
.disabled-hint {
    color: #ef4444;
    margin-top: 8px;
    font-size: 13px;
    display: block;
}
/* Markdown编辑框样式优化 */
#md_content {
    width: 100%;
    min-height: 500px;
    padding: 15px;
    border: 1px solid #334155;
    border-radius: 4px;
    font-family: Consolas, "Microsoft Yahei", monospace;
    font-size: 14px;
    line-height: 1.8;
    resize: vertical;
    background: #0f172a;
    color: #f8fafc;
    caret-color: #3b82f6;
}
#md_content:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* ========== 文章列表样式 ========== */
.article-list {
    margin-top: 20px;
    border: 1px solid #334155;
    border-radius: 4px;
}
.article-item {
    padding: 10px 15px;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
}
.article-item:last-child {
    border-bottom: none;
}
.article-info {
    flex: 1;
}
.article-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #f8fafc;
}
.article-meta {
    font-size: 12px;
    color: #94a3b8;
}
.article-actions a {
    text-decoration: none;
    margin-left: 10px;
}
.article-actions .edit-article {
    color: #3b82f6;
}
.article-actions .delete-article {
    color: #ef4444;
}
.article-actions a:hover {
    text-decoration: underline;
}

/* ========== 折叠面板核心样式 ========== */
.collapse-panel {
    margin: 15px 0;
    border: 1px solid #334155;
    border-radius: 8px;
    overflow: hidden;
}

.collapse-header {
    padding: 12px 20px;
    background-color: #1e293b;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    color: #f8fafc;
}

.collapse-header:hover {
    background-color: #334155;
}

.collapse-header i {
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.collapse-header .icon-rotate {
    transform: rotate(180deg);
}

.collapse-body {
    padding: 20px;
    display: none;
    background: #0f172a;
}

/* 折叠面板内样式优化 */
.collapse-body .form-item {
    margin-bottom: 15px;
}

.collapse-body .upload-section {
    margin-bottom: 0 !important;
}

/* ========== 评论/系统设置卡片专属样式 ========== */
.card .setting-content {
    padding: 15px;
    color: #e2e8f0;
    line-height: 1.8;
}
.card .setting-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #334155;
}
.card .setting-item:last-child {
    border-bottom: none;
}
.card .setting-label {
    font-weight: 600;
    color: #f8fafc;
    margin-right: 10px;
}

/* ========== 折叠面板通用样式 ========== */
.collapse-panel {
    margin-bottom: 15px;
    border: 1px solid #334155;
    border-radius: 4px;
}
.collapse-header {
    padding: 12px 15px;
    background-color: #1e293b;
    border-bottom: 1px solid #334155;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #f8fafc;
}
.collapse-header i {
    transition: transform 0.3s ease;
    color: #94a3b8;
}
.collapse-header.active i {
    transform: rotate(180deg);
}
.collapse-body {
    padding: 15px;
    display: none;
    background: #0f172a;
}
.collapse-body.show {
    display: block;
}

/* ========== 评论管理样式 ========== */
.comment-list {
    margin-top: 15px;
    border: 1px solid #334155;
    border-radius: 4px;
    overflow: hidden;
}
.comment-item {
    padding: 12px 15px;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: #0f172a;
}
.comment-item:last-child {
    border-bottom: none;
}
.comment-item:hover {
    background-color: #1e293b;
}
.comment-info {
    flex: 1;
}
.comment-username {
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 5px;
}
.comment-content {
    color: #e2e8f0;
    line-height: 1.5;
    margin-bottom: 8px;
    word-break: break-all;
}
.comment-meta {
    font-size: 12px;
    color: #94a3b8;
}
.comment-actions {
    margin-left: 15px;
    display: flex;
    gap: 8px;
}
.comment-actions a {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}
.approve-comment {
    background-color: #10b981;
    color: white;
}
.reject-comment {
    background-color: #f59e0b;
    color: white;
}
.delete-comment {
    background-color: #ef4444;
    color: white;
}
.comment-pagination {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 5px;
}
.comment-pagination a {
    padding: 5px 10px;
    border: 1px solid #334155;
    border-radius: 3px;
    text-decoration: none;
    color: #f8fafc;
    background: #0f172a;
}
.comment-pagination a.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}
.batch-actions {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.batch-btn {
    padding: 6px 12px;
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.batch-btn:hover {
    background-color: #dc2626;
}
.check-all-comments {
    margin-right: 10px;
    color: #f8fafc;
}
.comment-status {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 8px;
}
.status-approved {
    background-color: #0f172a;
    color: #10b981;
    border: 1px solid #10b981;
}
.status-pending {
    background-color: #0f172a;
    color: #f59e0b;
    border: 1px solid #f59e0b;
}

/* ========== 评论筛选样式 ========== */
.comment-filter {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.filter-label {
    font-size: 14px;
    color: #94a3b8;
}
.filter-select {
    padding: 6px 10px;
    border: 1px solid #334155;
    border-radius: 4px;
    font-size: 14px;
    background: #0f172a;
    color: #f8fafc;
}
.filter-input {
    padding: 6px 10px;
    border: 1px solid #334155;
    border-radius: 4px;
    font-size: 14px;
    width: 200px;
    background: #0f172a;
    color: #f8fafc;
}
.filter-btn {
    padding: 6px 12px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.filter-btn:hover {
    background-color: #2563eb;
}
.reset-btn {
    padding: 6px 12px;
    background-color: #64748b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.reset-btn:hover {
    background-color: #475569;
}

/* ========== 标签选择样式 ========== */
.tags-select {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.tag-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid #334155;
    border-radius: 15px;
    background-color: #0f172a;
    color: #f8fafc;
}
.tag-checkbox:hover {
    background-color: #1e293b;
}
.tag-checkbox input[type="checkbox"] {
    margin: 0;
}
.tag-checkbox label {
    margin: 0;
    cursor: pointer;
}
.tag-checkbox input[type="checkbox"]:checked + label {
    font-weight: 600;
    color: #3b82f6;
}

/* ========== 响应式适配 ========== */
@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    .admin-header {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        text-align: center;
    }
    .admin-header h1 {
        font-size: 18px;
    }
    .admin-content {
        margin: 20px auto;
        padding: 0 15px;
    }
    .card {
        padding: 15px;
    }
    .collapse-header {
        font-size: 14px;
        padding: 10px 15px;
    }
    .collapse-body {
        padding: 15px;
    }
    #md_content {
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    .stat-item {
        padding: 15px;
    }
    .category-actions a {
        display: inline-block;
        margin: 5px 0 0 0;
        width: 100%;
        text-align: center;
    }
    .category-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .article-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .article-actions {
        margin-top: 10px;
        width: 100%;
    }
}