/**
 * 个人中心页面样式
 */

/* Layout */
.profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    padding: 24px 0;
    min-height: calc(100vh - 200px);
}

@media (max-width: 768px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-card {
    background: var(--bg-card, #fff);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color, #e8e8e8);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1890ff 0%, #36cfc9 100%);
    color: #fff;
    font-size: 32px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #262626);
    margin: 0 0 4px;
}

.profile-role {
    font-size: 14px;
    color: var(--text-secondary, #8c8c8c);
    margin: 0 0 16px;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color, #e8e8e8);
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 600;
    color: #1890ff;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary, #8c8c8c);
}

/* Profile Navigation */
.profile-nav {
    background: var(--bg-card, #fff);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color, #e8e8e8);
}

.profile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-primary, #262626);
    text-decoration: none;
    transition: all 0.2s;
}

.profile-nav-item:hover {
    background: var(--bg-hover, #f5f5f5);
}

.profile-nav-item.active {
    background: rgba(24, 144, 255, 0.1);
    color: #1890ff;
}

.profile-nav-item .nav-icon {
    font-size: 18px;
}

/* Content */
.profile-content {
    min-width: 0;
}

.profile-section {
    background: var(--bg-card, #fff);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color, #e8e8e8);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color, #e8e8e8);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #262626);
    margin: 0;
}

/* Info Card */
.info-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light, #f0f0f0);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    width: 120px;
    font-size: 14px;
    color: var(--text-secondary, #8c8c8c);
}

.info-value {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary, #262626);
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-active,
.status-resolved {
    background: #f6ffed;
    color: #52c41a;
}

.status-pending {
    background: #fff7e6;
    color: #fa8c16;
}

.status-rejected,
.status-disabled {
    background: #fff2f0;
    color: #ff4d4f;
}

/* Requests List */
.requests-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.request-item {
    padding: 16px;
    border: 1px solid var(--border-color, #e8e8e8);
    border-radius: 8px;
    transition: all 0.2s;
}

.request-item:hover {
    border-color: #1890ff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.1);
}

.request-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.request-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary, #262626);
    margin: 0;
}

.request-desc {
    font-size: 14px;
    color: var(--text-secondary, #8c8c8c);
    margin: 0 0 12px;
    line-height: 1.5;
}

.request-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--text-tertiary, #bfbfbf);
}

.request-reply {
    color: #1890ff;
}

.request-reply-content {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-light, #fafafa);
    border-radius: 6px;
    font-size: 14px;
}

.request-reply-content strong {
    color: #1890ff;
    display: block;
    margin-bottom: 4px;
}

.request-reply-content p {
    margin: 0;
    color: var(--text-primary, #262626);
}

/* Security Card */
.security-card {
    max-width: 400px;
}

.security-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary, #262626);
    margin: 0 0 20px;
}

.security-form .form-group {
    margin-bottom: 16px;
}

.security-form .form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text-secondary, #8c8c8c);
}

.security-form .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.security-form .form-control:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
    outline: none;
}

.form-actions {
    margin-top: 24px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-text {
    font-size: 14px;
    color: var(--text-secondary, #8c8c8c);
    margin: 0 0 16px;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary, #8c8c8c);
}

/* Loading */
.loading-placeholder {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary, #8c8c8c);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color, #e8e8e8);
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 24px;
}

.modal-content {
    background: var(--bg-card, #fff);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color, #e8e8e8);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary, #8c8c8c);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary, #262626);
}

.modal-body {
    padding: 24px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-body .form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text-primary, #262626);
}

.modal-body .form-label.required::after {
    content: '*';
    color: #ff4d4f;
    margin-left: 4px;
}

.modal-body .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.modal-body .form-control:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
    outline: none;
}

.modal-body textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color, #e8e8e8);
}

/* Toast */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card, #fff);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
}

.toast-success {
    border-left: 4px solid #52c41a;
}

.toast-error {
    border-left: 4px solid #ff4d4f;
}

.toast.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #1890ff;
    color: #fff;
}

.btn-primary:hover {
    background: #40a9ff;
}

.btn-primary:disabled {
    background: #91caff;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-light, #f5f5f5);
    color: var(--text-primary, #262626);
}

.btn-secondary:hover {
    background: var(--bg-hover, #e8e8e8);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-loading {
    display: inline-flex;
    align-items: center;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 160px;
    background: var(--bg-card, #fff);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    display: none;
    z-index: 100;
}

.dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    text-align: left;
    background: none;
    border: none;
    font-size: 14px;
    color: var(--text-primary, #262626);
    cursor: pointer;
    text-decoration: none;
}

.dropdown-item:hover {
    background: var(--bg-hover, #f5f5f5);
}

.dropdown-item.active {
    color: #1890ff;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color, #e8e8e8);
    margin: 8px 0;
}

.admin-only {
    display: none;
}
