/* ===== 个人主页样式 ===== */
.main-content {
    margin-top: 2rem;
}

.profile-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: center;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--accent);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.profile-bio {
    color: var(--secondary);
    margin-bottom: 1rem;
    max-width: 600px;
}

.profile-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--secondary);
}

.profile-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s var(--ease);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: #4ab86c;
}

.btn-outline {
    background: transparent;
    border: var(--border);
    color: var(--secondary);
}

.btn-outline:hover {
    background: rgba(45,45,45,0.05);
    color: var(--primary);
}

/* ===== 文章管理选项卡 ===== */
.tabs {
    display: flex;
    border-bottom: var(--border);
    margin-bottom: 2rem;
}

.tab {
    padding: 1rem 1.5rem;
    cursor: pointer;
    position: relative;
    color: var(--secondary);
    transition: all 0.3s var(--ease);
}

.tab.active {
    color: var(--primary);
    font-weight: 500;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
}

.tab-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.draft-badge {
    background: rgba(255, 149, 0, 0.1);
    color: var(--draft);
}
.pending-badge {
    background: rgba(0, 122, 255, 0.1);
    color: var(--pending);
}
.published-badge {
    background: rgba(91, 203, 125, 0.1);
    color: var(--published);
}
.reject-badge {
    background: rgba(255, 59, 48, 0.1);
    color: var(--reject);
}

/* ===== 文章列表样式 ===== */
.articles-container {
    display: none;
}

.articles-container.active {
    display: block;
}

.article-item {
    display: flex;
    padding: 1.5rem;
    border: var(--border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    transition: all 0.3s var(--ease);
}

.article-item:hover {
    border-color: var(--accent);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.article-thumb {
    width: 120px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 1.5rem;
    flex-shrink: 0;
}

.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    flex: 1;
}

.article-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.article-excerpt {
    color: var(--secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.article-meta {
    display: flex;
    gap: 1rem;
    color: var(--secondary);
    font-size: 0.85rem;
}

.article-status {
    padding: 0.1rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    /*padding: 0.3rem 0.8rem;*/
    /*border-radius: 2rem;*/
    /*font-size: 0.8rem;*/
}

.status-draft {
    background: rgba(255, 149, 0, 0.1);
    color: var(--draft);
}
.status-pending {
    background: rgba(0, 122, 255, 0.1);
    color: var(--pending);
}
.status-published {
    background: rgba(91, 203, 125, 0.1);
    color: var(--published);
}
.status-reject {
    background: rgba(255, 59, 48, 0.1);
    color: var(--reject);
}
.admin-notes {
    margin-top: 0.5rem;
    color: var(--reject);
    font-size: 0.85rem;
}

.article-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.action-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s var(--ease);
}

.edit-btn {
    background: rgba(45,45,45,0.05);
    color: var(--primary);
}

.edit-btn:hover {
    background: rgba(45,45,45,0.1);
}

.delete-btn {
    background: rgba(255, 59, 48, 0.1);
    color: #FF3B30;
}

.delete-btn:hover {
    background: rgba(255, 59, 48, 0.2);
}

.publish-btn {
    background: rgba(91, 203, 125, 0.1);
    color: var(--published);
}

.publish-btn:hover {
    background: rgba(91, 203, 125, 0.2);
}

/* ===== 空状态样式 ===== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}


/* 加载指示器 */
.loader-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    height: 60px;
    margin-bottom: 20px;
}
.loader {
    width: 20px;
    height: 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.end-message {
    text-align: center;
    padding: 30px;
    color: #7f8c8d;
    font-style: italic;
}


/* ===== 弹窗样式 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--ease);
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal {
    background: var(--bg);
    border-radius: 12px;
    padding: 2.5rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(20px);
    transition: transform 0.3s var(--ease);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-overlay.active .modal {
    transform: translateY(0);
}
.modal-header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title {
    font-size: 1.5rem;
}
.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary);
    padding: 0.5rem;
}
.close-btn:hover {
    color: var(--primary);
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s var(--ease);
}
.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(91, 203, 125, 0.2);
}
.form-textarea {
    min-height: 100px;
    resize: vertical;
}
.form-input.error {
    border-color: #FF3B30;
}
.modal-error-message {
    color: #FF3B30;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}
.modal-error-message.show {
    display: block;
}
.avatar-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}
.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 3px solid var(--accent);
}
.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar-actions {
    display: flex;
    gap: 1rem;
}
.file-input {
    display: none;
}
.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}


/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    .profile-stats {
        justify-content: center;
    }
    .profile-actions {
        justify-content: center;
    }
    .tabs {
        overflow-x: auto;
        white-space: nowrap;
    }
    .article-item {
        flex-direction: column;
    }
    .article-thumb {
        width: 100%;
        height: 160px;
        margin-right: 0;
        margin-bottom: 1rem;
    }

    /* 模态框 */
    .modal {
        padding: 1.5rem;
    }

    .modal-actions {
        flex-direction: column;
    }
}

