/* 管理后台样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: #001529;
    color: white;
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.admin-sidebar h2 {
    padding: 0 20px;
    margin-bottom: 30px;
    font-size: 20px;
}

.admin-sidebar nav a {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
    background: #1890ff;
    color: white;
}

/* 返回首页链接样式 */
.admin-sidebar nav a.home-link {
    color: #52c41a;
    font-weight: 500;
}

.admin-sidebar nav a.home-link:hover {
    background: #52c41a;
    color: white;
}

/* 导航分隔线 */
.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 10px 20px;
}

.admin-main {
    flex: 1;
    padding: 20px;
    background: #f8f9fa;
    margin-left: 250px;
    min-height: 100vh;
}

.admin-main h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
}

.admin-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 1200px;
    width: 100%;
}

/* 通用按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: #1890ff;
    color: white;
}

.btn-primary:hover {
    background: #40a9ff;
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;

/* 表单样式 - 强制更新 */
.form-row {
    display: flex !important;
    gap: 15px !important;
    align-items: end !important;
    margin-bottom: 20px !important;
    flex-wrap: nowrap !important;
}

.form-group {
    flex: 1 !important;
    min-width: 0 !important;
}

.form-group label {
    display: block !important;
    margin-bottom: 5px !important;
    font-weight: 500 !important;
    color: #333 !important;
    height: 20px !important;
    line-height: 20px !important;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    transition: border-color 0.3s !important;
    height: 38px !important;
    box-sizing: border-box !important;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none !important;
    border-color: #1890ff !important;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2) !important;
}
}

.btn-secondary:hover {
    background: #e6f7ff;
    border-color: #1890ff;
    color: #1890ff;
}

.btn-success {
    background: #52c41a;
    color: white;
}

.btn-success:hover {
    background: #73d13d;
}

.btn-warning {
    background: #faad14;
    color: white;
}

.btn-warning:hover {
    background: #ffc53d;
}

.btn-danger {
    background: #ff4d4f;
    color: white;
}

.btn-danger:hover {
    background: #ff7875;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 发布文章页面专用样式 */
.admin-content.post-form {
    max-width: 800px;
}

/* 页面头部样式 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e8e8e8;
}

.page-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    max-width: 800px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
}

.stat-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
}

/* 最新内容区域 */
.recent-section {
    margin-bottom: 30px;
    max-width: 800px;
}

.recent-section h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
}

.recent-posts {
    display: grid;
    gap: 12px;
}

.recent-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #1890ff;
}

.recent-item h4 {
    margin-bottom: 6px;
    color: #333;
}

/* 待审核评论样式 */
.pending-comments {
    display: grid;
    gap: 12px;
}

.comment-item {
    background: #fff7e6;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #faad14;
}

.comment-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.comment-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.comment-actions button:first-child {
    background: #52c41a;
    color: white;
}

.comment-actions button:last-child {
    background: #ff4d4f;
    color: white;
}

.recent-item p {
    color: #666;
    margin-bottom: 8px;
    line-height: 1.5;
}

.recent-time {
    font-size: 12px;
    color: #999;
}

/* 待审核评论 */
.pending-comments {
    display: grid;
    gap: 15px;
}

.comment-item {
    background: #fff7e6;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #faad14;
}

.comment-item strong {
    color: #1890ff;
    margin-bottom: 8px;
    display: block;
}

.comment-item p {
    margin-bottom: 15px;
    line-height: 1.5;
}

.comment-actions {
    display: flex;
    gap: 10px;
}

.comment-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.comment-actions button:first-child {
    background: #52c41a;
    color: white;
}

.comment-actions button:last-child {
    background: #ff4d4f;
    color: white;
}

/* 表单样式 */
.post-form {
    max-width: 800px;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* 富文本编辑器 */
.ql-editor {
    min-height: 200px;
    font-family: inherit;
}

.ql-toolbar {
    border-top: 1px solid #ccc;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    border-radius: 4px 4px 0 0;
}

.ql-container {
    border-bottom: 1px solid #ccc;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    border-radius: 0 0 4px 4px;
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 12px;
}

/* 发布文章页面样式 */
.post-form {
    max-width: 800px;
    width: 100%;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.form-actions .btn-primary {
    background: #1890ff;
    color: white;
}

.form-actions .btn-primary:hover {
    background: #40a9ff;
}

.form-actions .btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.form-actions .btn-secondary:hover {
    background: #e6f7ff;
    border-color: #1890ff;
    color: #1890ff;
}

/* 设置页面样式 */
.settings-section {
    background: white;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.settings-section h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 18px;
    border-bottom: 2px solid #1890ff;
    padding-bottom: 10px;
}

.settings-form {
    max-width: 600px;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.settings-form h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 18px;
    border-bottom: 2px solid #1890ff;
    padding-bottom: 10px;
}

.settings-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 25px;
}

.admin-content.admin-settings,
.admin-content.system-settings,
.admin-content.comment-management,
.admin-content.user-management {
    max-width: 800px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    border-bottom-color: #1890ff;
    color: #1890ff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.settings-form {
    max-width: 600px;
}

.settings-form h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-group input:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* 表单行内布局 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    margin-bottom: 0;
}

/* 复选框样式 */
.form-group label input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    vertical-align: middle;
}

.form-group label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 20px;
    }
}

/* Alert 消息样式 */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 25px;
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.alert-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

/* 评论管理样式 */
.comments-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.comment-item {
    border-bottom: 1px solid #f0f0f0;
    padding: 25px;
    transition: background-color 0.3s;
}

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

.comment-item:hover {
    background-color: #fafafa;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.comment-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.comment-meta strong {
    color: #333;
    font-size: 16px;
}

.comment-date {
    color: #666;
    font-size: 14px;
}

.comment-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    min-width: 60px;
}

.status-pending {
    background-color: #fff7e6;
    color: #d46b08;
    border: 1px solid #ffd591;
}

.status-approved {
    background-color: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.status-rejected {
    background-color: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.comment-content {
    margin: 15px 0;
    line-height: 1.6;
    color: #333;
}

.comment-content p {
    margin: 0;
}

.comment-post-info {
    margin-bottom: 15px;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #1890ff;
}

.comment-post-info small {
    color: #666;
    font-size: 13px;
}

.comment-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-success {
    background: #52c41a;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.btn-success:hover {
    background: #73d13d;
}

.btn-warning {
    background: #faad14;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.btn-warning:hover {
    background: #ffc53d;
}

.btn-danger {
    background: #ff4d4f;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.btn-danger:hover {
    background: #ff7875;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.empty-state p {
    margin: 0;
    font-size: 16px;
}

/* 文章管理表格样式 */
.posts-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.posts-table {
    width: 100%;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e8e8e8;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}

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

.table-row:hover {
    background: #f8f9fa;
}

.col-title h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 16px;
}

.post-excerpt {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

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

.status-published {
    background: #e6f7ff;
    color: #1890ff;
}

.status-draft {
    background: #fff7e6;
    color: #fa8c16;
}

.col-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.col-actions .btn {
    font-size: 12px;
    padding: 4px 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 16px;
}

/* 用户管理页面样式 */
.admin-content .create-user-section,
.admin-content .users-section {
    margin-bottom: 30px;
}

.admin-content {
    max-width: 800px;
}

.admin-content.user-management {
    max-width: 800px;
}

.create-user-section h3,
.users-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.user-form {
    max-width: 400px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.users-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.users-table th,
.users-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.users-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.btn-danger {
    background: #ff4d4f;
    color: white;
}

.btn-danger:hover {
    background: #ff7875;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.text-muted {
    color: #999;
    font-style: italic;
}

.no-users {
    text-align: center;
    color: #666;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* 图片历史版本样式 */
.image-history {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    background-color: #fafafa;
}

.history-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    transition: all 0.2s ease;
}

.history-item:hover {
    border-color: #1890ff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.2);
}

.history-info {
    margin-top: 8px;
    text-align: center;
}

.history-info p {
    margin: 0 0 5px 0;
    font-size: 12px;
    color: #666;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        position: relative;
        height: auto;
        order: 1;
    }
    
    .admin-main {
        margin-left: 0;
        order: 2;
    }
    
    .admin-content {
        margin: 10px;
        padding: 20px;
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* 确保在大屏幕上布局正常 */
@media (min-width: 769px) {
    .admin-sidebar {
        position: fixed;
        flex-shrink: 0;
    }
    
    .admin-main {
        margin-left: 250px;
    }
}
