/* ==================== 我的文章页面 - 新中式风格 ==================== */

/* 页面容器 */
.user-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    min-height: calc(100vh - 200px);
}

/* ==================== 侧边栏 ==================== */
.user-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.user-menu {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.25s ease;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.menu-item:last-child {
    margin-bottom: 0;
}

.menu-item:hover {
    background: var(--secondary-light);
    color: var(--primary-color);
    transform: translateX(4px);
}

.menu-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: 0 4px 12px rgba(43, 95, 117, 0.3);
}

.menu-item .icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* ==================== 内容区域 ==================== */
.user-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 页面标题 */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

.content-header h1 {
    font-size: 1.75rem;
    color: var(--primary-color);
    font-weight: 600;
    letter-spacing: 0.1rem;
    position: relative;
}

.content-header h1::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--gold-color));
    border-radius: 2px;
}

/* 新建文章按钮 */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(43, 95, 117, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(43, 95, 117, 0.35);
}

.btn-primary span {
    font-size: 1.25rem;
    font-weight: 300;
}

/* ==================== 统计卡片 ==================== */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--gold-color));
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.5rem;
    font-family: var(--font-sans);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    letter-spacing: 0.05rem;
}

/* ==================== 筛选标签 ==================== */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--secondary-light);
    border-radius: var(--radius-full);
    width: fit-content;
}

.tab-btn {
    padding: 0.5rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: var(--font-family);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    font-weight: 500;
}

/* ==================== 文章列表 ==================== */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.article-item {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 1.25rem;
    padding: 1.25rem;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.article-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-light);
}

.article-cover {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.article-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.published {
    background: #E8F5E9;
    color: #2E7D32;
}

.status-badge.draft {
    background: #FFF3E0;
    color: #E65100;
}

.status-badge.pending {
    background: #E3F2FD;
    color: #1565C0;
}

.status-badge.rejected {
    background: #FFEBEE;
    color: #C62828;
}

.article-summary {
    font-size: 0.875rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.6;
}

.article-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
}

.btn-edit,
.btn-secondary,
.btn-delete {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: var(--font-family);
    min-width: 80px;
}

.btn-edit {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.btn-edit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(43, 95, 117, 0.3);
}

.btn-secondary {
    background: var(--secondary-light);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    color: var(--primary-color);
    border-color: var(--primary-light);
}

.btn-delete {
    background: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.btn-delete:hover {
    background: var(--accent-color);
    color: white;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-color);
    color: var(--text-light);
    font-size: 1rem;
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 0;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
    font-size: 0.9rem;
    min-width: 40px;
}

.page-btn:hover:not(:disabled) {
    background: var(--secondary-light);
    color: var(--primary-color);
    border-color: var(--primary-light);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-color: var(--primary-color);
}

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

/* ==================== 模态框 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.modal-content.modal-large {
    max-width: 700px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, var(--secondary-light), white);
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-light);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--secondary-light);
    color: var(--accent-color);
}

.modal form {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: var(--font-family);
    background: white;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(43, 95, 117, 0.1);
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.form-actions .btn-secondary,
.form-actions .btn-primary {
    padding: 0.75rem 1.5rem;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .user-container {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .user-sidebar {
        position: static;
        order: 2;
    }

    .user-menu {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .menu-item {
        margin-bottom: 0;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .article-item {
        grid-template-columns: 100px 1fr;
    }

    .article-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: flex-end;
        padding-top: 1rem;
        border-top: 1px solid var(--border-light);
    }
}

@media (max-width: 768px) {
    .user-container {
        padding: 1rem;
        gap: 1rem;
    }

    .content-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .content-header h1 {
        font-size: 1.5rem;
    }

    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .filter-tabs {
        width: 100%;
        overflow-x: auto;
    }

    .tab-btn {
        flex-shrink: 0;
    }

    .article-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .article-cover {
        width: 100%;
        height: 160px;
    }

    .article-actions {
        flex-direction: row;
        gap: 0.5rem;
    }

    .btn-edit,
    .btn-secondary,
    .btn-delete {
        flex: 1;
        padding: 0.625rem;
    }

    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }

    .modal form {
        padding: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn-secondary,
    .form-actions .btn-primary {
        width: 100%;
    }
}

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

    .stat-value {
        font-size: 1.5rem;
    }

    .article-title {
        font-size: 1rem;
    }

    .article-meta {
        font-size: 0.8rem;
        gap: 0.5rem;
    }
}
