/* admin.css — 管理员后台 极简浅色主题 */

/* ===== 全局 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto,
                 "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
    background: #f8f9fa;
    color: #212529;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: url('../img/blog_home_background.jpg') center/cover no-repeat fixed;
    filter: blur(8px) brightness(0.95);
    transform: scale(1.05);
}

.login-page-body {
    position: relative;
    z-index: 1;
}

/* ===== 登录页 ===== */
.login-page-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 0;
    position: relative;
    background: url('../img/blog_home_background.jpg') center/130% no-repeat fixed;
}

.login-page-body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.15);
    z-index: 0;
}

.login-page-body > * {
    position: relative;
    z-index: 1;
}

.back-home {
    font-size: 14px;
    color: #868e96;
    text-decoration: none;
    transition: color 0.2s;
    padding: 4px 0;
}

.back-home:hover {
    color: #228be6;
}

/* ===== 加载动画 ===== */
#loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#loading-overlay .loader-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.8);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    animation: loaderSpin 8s ease-in-out infinite;
}

@keyframes loaderSpin {
    0%   { transform: rotate(0deg); }
    25%  { transform: rotate(-720deg); }
    50%  { transform: rotate(-720deg); }
    75%  { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

.loader-progress {
    width: 200px;
    height: 4px;
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    background: var(--accent, #228be6);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

.loader-text {
    font-size: 13px;
    color: #868e96;
}
/* ===== 登录表单 ===== */
.login-container {
    max-width: 420px;
    margin: 80px auto;
    padding: 36px;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

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

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

.login-container h1 {
    text-align: center;
    margin-bottom: 24px;
    color: #212529;
    font-size: 1.3rem;
    font-weight: 600;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: #495057;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255,255,255,0.55);
    color: #212529;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #228be6;
    box-shadow: 0 0 0 3px rgba(34,139,230,0.1);
}

.btn {
    width: 100%;
    padding: 12px;
    background: #228be6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #1c7ed6;
}

.error-message {
    padding: 10px 14px;
    background: #fff5f5;
    color: #c92a2a;
    border: 1px solid #ffc9c9;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

/* ===== 后台头部 ===== */
.admin-header {
    background: rgba(255,255,255,0.55);
    border-bottom: 1px solid #e9ecef;
    color: #212529;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header h1 {
    font-size: 18px;
    font-weight: 600;
}

.admin-header .user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #495057;
}

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

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

/* ===== 内容区 ===== */
.admin-content {
    max-width: 1200px;
    width: 95%;
    margin: 24px auto;
    padding: 0 0 40px;
}

/* ===== 卡片 ===== */
.card {
    background: rgba(255,255,255,0.55);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.card h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
    color: #212529;
}

.card p {
    color: #495057;
    margin-bottom: 16px;
}

/* ===== 仪表盘统计 ===== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-item {
    background: rgba(255,255,255,0.55);
    border: 1px solid #e9ecef;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    transition: box-shadow 0.2s;
}

.stat-item:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.stat-item i {
    font-size: 28px;
    color: #228be6;
    margin-bottom: 8px;
    display: block;
}

.stat-item .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 4px;
}

.stat-item .stat-label {
    color: #868e96;
    font-size: 13px;
}

/* ===== 分类列表 ===== */
.category-list {
    margin: 16px 0;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    background: rgba(255,255,255,0.55);
}

.category-item:last-child {
    border-bottom: none;
}

.category-item:nth-child(even) {
    background: #f8f9fa;
}

.category-info {
    flex: 1;
}

.category-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
    color: #212529;
}

.category-meta {
    font-size: 12px;
    color: #868e96;
}

.category-actions a {
    margin-left: 8px;
    padding: 4px 10px;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    transition: opacity 0.2s;
}

.category-actions a:hover {
    opacity: 0.85;
}

.edit-category {
    background: #228be6;
    color: #fff;
}

.delete-category {
    background: #e03131;
    color: #fff;
}

.edit-mode-title {
    display: inline-block;
    background: #e7f5ff;
    color: #228be6;
    padding: 6px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 14px;
}

.disabled-hint {
    color: #e03131;
    margin-left: 8px;
    font-size: 13px;
}

/* ===== 提示框 ===== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 9999;
    font-size: 14px;
}

.toast.show {
    opacity: 1;
}

.toast-success {
    background: #2b8a3e;
}

.toast-error {
    background: #e03131;
}

.toast-info {
    background: #228be6;
}

/* ===== 表单 ===== */
.form-item .required {
    color: #e03131;
    margin-left: 4px;
}

.form-hint {
    color: #868e96;
    display: block;
    margin-top: 8px;
    font-size: 13px;
}

#md_content {
    width: 100%;
    min-height: 500px;
    padding: 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-family: "SF Mono", "Fira Code", Consolas, monospace;
    font-size: 14px;
    line-height: 1.8;
    resize: vertical;
    background: rgba(255,255,255,0.55);
    color: #212529;
}

#md_content:focus {
    outline: none;
    border-color: #228be6;
    box-shadow: 0 0 0 3px rgba(34,139,230,0.1);
}

/* ===== 文章列表 ===== */
.article-list {
    margin-top: 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    max-height: 560px;
    overflow-y: auto;
}

.article-item {
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.55);
}

.article-item:last-child {
    border-bottom: none;
}

.article-info {
    flex: 1;
}

.article-info .article-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #212529;
}

.article-info .article-meta {
    font-size: 12px;
    color: #868e96;
}

.article-actions a {
    text-decoration: none;
    margin-left: 10px;
    font-size: 13px;
}

.article-actions .edit-article {
    color: #228be6;
}

.article-actions .delete-article {
    color: #e03131;
}

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

/* ===== 折叠面板 ===== */
.collapse-panel {
    margin: 16px 0;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.collapse-header {
    padding: 14px 20px;
    background: rgba(255,255,255,0.55);
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: #212529;
    transition: background 0.15s;
}

.collapse-header:hover {
    background: #f8f9fa;
}

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

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

.collapse-body {
    padding: 20px;
    display: none;
    background: rgba(255,255,255,0.55);
}

.collapse-body .form-item {
    margin-bottom: 16px;
}

/* ===== 评论区 ===== */
.comment-list {
    margin-top: 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    max-height: 560px;
    overflow-y: auto;
}

.comment-list .comment-item {
    padding: 14px 16px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: rgba(255,255,255,0.55);
}

.comment-list .comment-item:last-child {
    border-bottom: none;
}

.comment-list .comment-item:hover {
    background: #f8f9fa;
}

.comment-list .comment-info {
    flex: 1;
}

.comment-list .comment-username {
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
}

.comment-list .comment-content {
    color: #495057;
    line-height: 1.5;
    margin-bottom: 8px;
    word-break: break-all;
}

.comment-list .comment-meta {
    font-size: 12px;
    color: #868e96;
}

.comment-list .comment-actions {
    margin-left: 16px;
    display: flex;
    gap: 6px;
}

.comment-list .comment-actions a {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.comment-list .comment-actions a:hover {
    opacity: 0.85;
}

.approve-comment {
    background: #2b8a3e;
    color: #fff;
}

.reject-comment {
    background: #f08c00;
    color: #fff;
}

.delete-comment {
    background: #e03131;
    color: #fff;
}

.comment-pagination {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 4px;
}

.comment-pagination a {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-decoration: none;
    color: #495057;
    background: rgba(255,255,255,0.55);
    font-size: 14px;
    transition: background 0.15s;
}

.comment-pagination a:hover {
    background: #f1f3f5;
}

.comment-pagination a.active {
    background: #228be6;
    color: #fff;
    border-color: #228be6;
}

.batch-actions {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.batch-btn {
    padding: 6px 14px;
    background: #e03131;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.batch-btn:hover {
    background: #c92a2a;
}

.check-all-comments {
    margin-right: 10px;
    color: #212529;
    font-size: 14px;
}

.comment-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 8px;
}

.status-approved {
    background: #f0fdf4;
    color: #2b8a3e;
    border: 1px solid #b2f2bb;
}

.status-pending {
    background: #fff9db;
    color: #e67700;
    border: 1px solid #ffd43b;
}

/* ===== 评论筛选 ===== */
.comment-filter {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 14px;
    color: #868e96;
}

.filter-select, .filter-input {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    background: rgba(255,255,255,0.55);
    color: #212529;
}

.filter-input {
    width: 200px;
}

.filter-btn {
    padding: 8px 16px;
    background: #228be6;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.filter-btn:hover {
    background: #1c7ed6;
}

.reset-btn {
    padding: 8px 16px;
    background: #adb5bd;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.reset-btn:hover {
    background: #868e96;
}

/* ===== 标签选择 ===== */
.tags-select {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.tag-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    background: rgba(255,255,255,0.55);
    color: #212529;
    font-size: 13px;
    transition: background 0.15s;
}

.tag-checkbox:hover {
    background: #f1f3f5;
}

.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: #228be6;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }

    .admin-header {
        flex-direction: column;
        gap: 8px;
        padding: 12px 16px;
        text-align: center;
    }

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

    .admin-content {
        margin: 16px auto;
        padding: 0 12px;
    }

    .card {
        padding: 16px;
    }

    .collapse-header {
        font-size: 14px;
        padding: 10px 14px;
    }

    .collapse-body {
        padding: 14px;
    }

    #md_content {
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .stat-item {
        padding: 16px;
    }

    .category-actions a {
        display: inline-block;
        margin: 4px 0 0;
        width: 100%;
        text-align: center;
    }

    .category-item, .article-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-actions {
        margin-top: 8px;
        width: 100%;
    }
}
