/* WPS Office 官网 - 后台管理样式 */

/* ===== 登录页 ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    color: #e21e2d;
    font-size: 1.8rem;
    font-weight: 700;
}

.login-logo p {
    color: #666;
    font-size: 0.9rem;
    margin-top: 5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #e21e2d;
    box-shadow: 0 0 0 3px rgba(226, 30, 45, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: #e21e2d;
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: #c41826;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: #fff;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ===== 管理后台布局 ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #1a1a2e;
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
    font-size: 1.3rem;
    color: #e21e2d;
}

.sidebar-header p {
    font-size: 0.85rem;
    opacity: 0.6;
    margin-top: 5px;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    transition: all 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-nav a.active {
    border-left: 3px solid #e21e2d;
    padding-left: 17px;
}

.sidebar-nav svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    background: #f5f5f5;
}

.content-header {
    background: #fff;
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.content-body {
    padding: 30px;
}

.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.blue {
    background: #e3f2fd;
    color: #1976d2;
}

.stat-icon.green {
    background: #e8f5e9;
    color: #388e3c;
}

.stat-icon.orange {
    background: #fff3e0;
    color: #f57c00;
}

.stat-icon.red {
    background: #ffebee;
    color: #d32f2f;
}

.stat-icon svg {
    width: 30px;
    height: 30px;
}

.stat-info h4 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
}

.stat-info p {
    font-size: 0.9rem;
    color: #666;
}

/* ===== 文章表格 ===== */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.data-table td {
    font-size: 0.9rem;
    color: #666;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.table-cover {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions .btn {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* ===== 富文本编辑器 ===== */
.editor-container {
    margin-bottom: 25px;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.toolbar-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.toolbar-btn.active {
    background: #e21e2d;
    color: #fff;
    border-color: #e21e2d;
}

.toolbar-separator {
    width: 1px;
    height: 36px;
    background: #ddd;
    margin: 0 5px;
}

.editor-textarea {
    width: 100%;
    min-height: 350px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
}

.editor-textarea:focus {
    outline: none;
    border-color: #e21e2d;
}

/* 图片上传区域 */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #e21e2d;
    background: rgba(226, 30, 45, 0.02);
}

.upload-area svg {
    width: 50px;
    height: 50px;
    color: #999;
    margin-bottom: 10px;
}

.upload-area p {
    color: #666;
    font-size: 0.9rem;
}

.upload-area .upload-btn {
    color: #e21e2d;
    font-weight: 500;
}

.upload-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.upload-preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}

/* ===== 友链管理 ===== */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.link-item .link-info {
    flex: 1;
}

.link-item .link-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 3px;
}

.link-item .link-url {
    font-size: 0.85rem;
    color: #666;
}

.link-item .link-actions {
    display: flex;
    gap: 8px;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 1000;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content-body {
        padding: 20px 15px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    
    .card-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

/* ===== 辅助 ===== */
.flex {
    display: flex;
}

.flex-1 {
    flex: 1;
}

.gap-2 {
    gap: 10px;
}

.gap-3 {
    gap: 15px;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.text-muted {
    color: #666;
}

.text-small {
    font-size: 0.85rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #666;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #e21e2d;
    color: #fff;
    border-color: #e21e2d;
}

.pagination .active {
    background: #e21e2d;
    color: #fff;
    border-color: #e21e2d;
}
