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

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

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

.admin-header {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-header h1 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.admin-header nav {
    display: flex;
    gap: 15px;
}

.admin-header nav a {
    color: #3498db;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid #3498db;
    border-radius: 4px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-header nav a i {
    font-size: 14px;
}

.admin-header h1 i {
    margin-right: 10px;
    color: #3498db;
}

.admin-header nav a:hover {
    background: #3498db;
    color: #fff;
}

.admin-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 编辑器中的图片样式 */
#wangEditor-container img,
#editor img {
    max-width: 90%;
    height: auto;
    display: block;
    margin: 10px auto;
}

/* wangEditor 附件上传按钮样式 */
.attachment-btn-custom {
    border: none;
    background: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-btn-custom:hover {
    background-color: #f5f5f5;
    color: #333;
}

.attachment-btn-custom:active {
    background-color: #e0e0e0;
}

.attachment-btn-custom:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 编辑器中附件链接样式 */
#editor a.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background-color: #f0f7ff;
    border: 1px solid #b3d7ff;
    border-radius: 4px;
    color: #1976d2;
    text-decoration: none;
    transition: all 0.3s;
}

#editor a.attachment-link:hover {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

/* 编辑器容器本身也要限制宽度 */
#editor {
    max-width: 100%;
    overflow-x: auto;
}

.filter-bar {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.filter-bar form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-bar select,
.filter-bar button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.filter-bar select {
    min-width: 150px;
}

.filter-bar button {
    background: #3498db;
    color: #fff;
    border: none;
    cursor: pointer;
}

.filter-bar button:hover {
    background: #2980b9;
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

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

.article-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.article-table tr:hover {
    background: #f8f9fa;
}

.article-table a {
    color: #3498db;
    text-decoration: none;
    margin-right: 10px;
}

/* 操作按钮中的链接不受影响 */
.article-table .btn-action,
.article-table .btn-delete {
    color: #fff;
}

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

.btn-delete {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-delete:hover {
    background: #c0392b;
}

/* 操作按钮样式 */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.3s;
}

.btn-edit {
    background: #3498db;
    color: #fff;
}

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

/* 发布按钮样式 */
.btn-publish {
    background: #27ae60;
    color: #fff;
}

.btn-publish:hover {
    background: #229954;
}

/* 徽章样式 */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

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

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

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-purple {
    background: #e8d5f7;
    color: #6f42c1;
}

/* 备份进度条样式 */
.backup-progress {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #fff;
}

.progress-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 16px;
}

.progress-header i {
    font-size: 20px;
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00c6ff 0%, #0072ff 100%);
    transition: width 0.3s ease;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

#current-file {
    font-style: italic;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 表格响应式容器 */
.table-responsive {
    overflow-x: auto;
}

/* 空状态样式 */
.empty-state {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.pagination a:hover {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.pagination span {
    background: #f8f9fa;
}

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

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

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

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.btn-primary {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.btn-secondary {
    background: #95a5a6;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

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

/* 消息提示 */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

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

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

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    color: #fff;
}

.stat-card h3 {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card .value {
    font-size: 36px;
    font-weight: bold;
    color: #fff;
}

/* 登录信息卡片特殊样式 */
.stat-card h3 i {
    margin-right: 8px;
    font-size: 16px;
}

.stat-card .value small {
    display: block;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 5px;
}

/* 统计表格 */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

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

.stats-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.stats-table tr:hover {
    background: #f8f9fa;
}

/* 卡片容器 */
.card {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 18px;
}

/* 登录页面 */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

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

.login-container .btn-primary {
    width: 100%;
    justify-content: center;
}

/* 修改密码页面 */
.password-change-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.password-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    color: #fff;
}

.password-info i {
    font-size: 24px;
    margin-right: 10px;
}

.password-info p {
    display: inline-block;
    font-weight: bold;
    margin-bottom: 10px;
}

.password-info ul {
    list-style: none;
    padding-left: 30px;
}

.password-info ul li {
    margin-bottom: 8px;
    font-size: 14px;
}

.password-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* 快捷操作区域 */
.quick-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.quick-actions h2 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.action-buttons a {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.action-buttons .btn-primary {
    background: #3498db;
    color: #fff;
    border: none;
}

.action-buttons .btn-primary:hover {
    background: #2980b9;
}

.action-buttons .btn-secondary {
    background: #95a5a6;
    color: #fff;
    border: none;
}

.action-buttons .btn-secondary:hover {
    background: #7f8c8d;
}

/* 备份按钮禁用状态 */
.btn-backup-disabled {
    background: #95a5a6 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.btn-backup-disabled:hover {
    background: #95a5a6 !important;
}

/* 最新文章区域 */
.latest-articles {
    margin-bottom: 30px;
}

.latest-articles h2 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 15px;
}

/* 文件上传区域样式 */
.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.file-upload-area:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.file-upload-area.drag-over {
    border-color: #3498db;
    background-color: #e3f2fd;
    transform: scale(1.02);
}

.file-upload-area input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-info p {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #666;
}

.file-upload-info small {
    color: #999;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background-color: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 4px;
}

.file-name {
    font-size: 14px;
    color: #333;
    flex: 1;
}

.file-size {
    font-size: 12px;
    color: #666;
    margin: 0 10px;
}

.upload-status {
    font-size: 12px;
    font-weight: 500;
    min-width: 80px;
    text-align: right;
}

.file-item.uploading {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

.file-item.uploading .upload-status {
    color: #1976d2;
}

.file-item.uploaded {
    background-color: #e8f5e9;
    border-color: #4caf50;
}

.file-item.error {
    background-color: #ffebee;
    border-color: #f44336;
}

.file-item.error .upload-status {
    color: #d32f2f;
}

/* 封面图片预览样式 */
#coverPreview img {
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

#coverPreview img:hover {
    border-color: #3498db;
}

/* 富文本编辑器容器样式 */
.ql-editor {
    min-height: 300px;
}

/* 编辑器默认样式 - 兼容老文章格式 */
#editor p,
#editor div {
    line-height: 26pt;
    text-indent: 28pt;
    mso-line-height-rule: exactly;
    font-size: 14px;
    margin: 0;
    padding: 0;
}

/* 编辑器中的段落保持首行缩进 */
#editor .w-e-text-container p {
    line-height: 26pt;
    text-indent: 28pt;
    mso-line-height-rule: exactly;
}

/* wangEditor V5 样式优化 */
#toolbar-container {
    border: 1px solid #ccc;
    padding: 5px 0;
    margin-bottom: 5px;
}

#editor {
    border: 1px solid #ccc;
    background-color: #fff;
}

#editor p {
    line-height: 26pt;
    text-indent: 28pt;
    mso-line-height-rule: exactly;
    font-size: 14px;
    margin: 0;
    padding: 0;
}
