/* 用户设置模态框样式 */
.user-setting-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(1px);
}

/* 遮罩层 - 覆盖整个页面 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99998;
}

.user-setting-modal-content {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    min-height: 40vh;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    position: relative;
    z-index: 99999;
}

/* 头部 */
.user-setting-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: #ffffff;
}

.user-setting-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.user-setting-modal-close {
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #6b7280;
    transition: all 0.2s ease;
    padding: 0;
}

.user-setting-modal-close:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

/* 主体内容 */
.user-setting-modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    background: #ffffff;
}

/* 左侧导航 */
.setting-sidebar {
    width: 200px;
    border-right: 1px solid #e5e7eb;
    padding: 16px 0;
    overflow-y: auto;
    flex-shrink: 0;
    background: #ffffff;
    position: relative;
    min-height: 100%;
}

.setting-nav-item {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #6b7280;
    font-size: 14px;
    transition: all 0.3s;
}

.setting-nav-item:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.setting-nav-item.active {
    background-color: #f3f4f6;
    color: #1f2937;
    font-weight: 500;
}

.setting-nav-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

/* 右侧内容区 */
.setting-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    min-height: 0;
    background: #ffffff;
}

.setting-content-panel {
    display: none;
}

.setting-content-panel.active {
    display: block;
}

.setting-section {
    max-width: 100%;
}

.panel-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

/* 头像部分 */
.avatar-section {
    margin-bottom: 24px;
    text-align: center;
}
.user-setting-modal-vipType{
    font-size: 14px;
    margin-top: 10px;
}

.avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar-preview:hover .avatar-overlay {
    opacity: 1;
}

.avatar-letter {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 28px;
    font-weight: 600;
    text-transform: uppercase;
    user-select: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
}

.avatar-upload-icon {
    width: 20px;
    height: 20px;
    margin-bottom: 4px;
}

.avatar-upload-text {
    font-size: 12px;
    font-weight: 500;
}

/* 头像上传loading样式 */
.avatar-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
}

.avatar-loading.hidden {
    display: none;
}

.avatar-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: avatar-spin 1s linear infinite;
    margin-bottom: 4px;
}

.avatar-loading-text {
    font-size: 10px;
    color: #ffffff;
    font-weight: 500;
}

@keyframes avatar-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 表单部分 */
.form-section {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #1f2937;
    font-size: 14px;
    font-weight: 500;
}

.form-input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 14px;
    color: #1f2937;
    background: #ffffff;
    transition: all 0.3s;
}

.form-input:focus {
    border-color: #000;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

/* 错误状态样式 */
.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.form-input.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.form-error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.form-input-count {
    position: absolute;
    right: 8px;
    bottom: 8px;
    font-size: 12px;
    color: #86909c;
}

/* 外观设置 */
.appearance-section {
    padding: 16px 0;
}

.section-title {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    margin: 0 0 20px 0;
}

.theme-options {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.theme-option {
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
}

.theme-option-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.theme-card {
    position: relative;
}

.theme-preview {
    width: 120px;
    height: 90px;
    border-radius: 8px;
    border: 2px solid transparent;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-option.active .theme-preview {
    border-color: #e6e6e6;
    box-shadow: 0 0 0 1px #e6e6e6, 0 4px 12px rgba(64, 128, 255, 0.2);
}

.theme-check-mark {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    background: #4080ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.theme-option.active .theme-check-mark {
    opacity: 1;
    transform: scale(1);
}

.theme-name {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    margin-top: 4px;
}

.light-theme {
    background: #ffffff;
}

.dark-theme {
    background: #1d2129;
}

.theme-preview-header {
    height: 25%;
    background: #f2f3f5;
    position: relative;
}

.dark-theme .theme-preview-header {
    background: #2e3440;
}

.theme-preview-content {
    height: 75%;
    display: flex;
}

.theme-preview-sidebar {
    width: 35%;
    background: #f7f8fa;
    position: relative;
}

.dark-theme .theme-preview-sidebar {
    background: #3b4252;
}

.theme-preview-main {
    width: 65%;
    background: #ffffff;
    position: relative;
}

.dark-theme .theme-preview-main {
    background: #2e3440;
}

/* 添加一些装饰性元素让缩略图更生动 */
.theme-preview-header::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: #d0d7de;
    border-radius: 50%;
}

.theme-preview-header::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: #d0d7de;
    border-radius: 50%;
}

.dark-theme .theme-preview-header::before,
.dark-theme .theme-preview-header::after {
    background: #4c566a;
}

.theme-preview-sidebar::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 6px;
    right: 6px;
    height: 2px;
    background: #e1e8ed;
    border-radius: 1px;
}

.dark-theme .theme-preview-sidebar::before {
    background: #4c566a;
}

.theme-preview-main::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 6px;
    right: 6px;
    height: 2px;
    background: #e1e8ed;
    border-radius: 1px;
}

.dark-theme .theme-preview-main::before {
    background: #4c566a;
}

.theme-preview-main::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 6px;
    right: 20px;
    height: 1px;
    background: #f0f0f0;
}

.dark-theme .theme-preview-main::after {
    background: #434c5e;
}

/* 底部操作区 */
.user-setting-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: end;
    align-items: center;
    background: #ffffff;
}

.footer-actions {
    display: flex;
    gap: 12px;
}

.btn-cancel, .btn-save {
    padding: 8px 24px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel {
    background: #f3f4f6;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.btn-save {
    background: #3b82f6;
    color: white;
    border: none;
}

.btn-cancel:hover {
    background: #e5e7eb;
}

.btn-save:hover {
    background: #2563eb;
}

/* 动画效果 */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.user-setting-modal-content {
    animation: modalSlideIn 0.2s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .user-setting-modal-content {
        width: 95%;
        height: 90vh;
        max-height: none;
    }
    
    .user-setting-modal-body {
        flex-direction: column;
    }
    
    .setting-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding: 8px 0;
        display: flex;
        overflow-x: auto;
    }
    
    .setting-nav-item {
        white-space: nowrap;
        min-width: 100px;
        justify-content: center;
        border-bottom: none;
        border-right: 1px solid rgba(229, 231, 235, 0.5);
    }
    
    .setting-content-panel {
        padding: 16px;
    }
    
    .theme-options {
        flex-direction: row;
        gap: 16px;
        justify-content: center;
    }
    
    .theme-preview {
        width: 100px;
        height: 75px;
    }
    
    .theme-check-mark {
        width: 18px;
        height: 18px;
        bottom: 4px;
        right: 4px;
    }
    
    .theme-name {
        font-size: 12px;
    }
}

/* 暗色主题覆盖样式 */
[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .user-setting-modal-content {
    background: #1f2937;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-color: #374151;
}

[data-theme="dark"] .user-setting-modal-header {
    background: #1f2937;
    border-bottom-color: #374151;
}

[data-theme="dark"] .user-setting-modal-title {
    color: #f9fafb;
}

[data-theme="dark"] .user-setting-modal-close {
    color: #9ca3af;
}

[data-theme="dark"] .user-setting-modal-close:hover {
    background-color: #374151;
    color: #f9fafb;
}

[data-theme="dark"] .user-setting-modal-body {
    background: #1f2937;
}

[data-theme="dark"] .setting-sidebar {
    background: #1f2937;
    border-right-color: #374151;
}

[data-theme="dark"] .setting-nav-item {
    color: #9ca3af;
}

[data-theme="dark"] .setting-nav-item:hover {
    background-color: #374151;
    color: #f9fafb;
}

[data-theme="dark"] .setting-nav-item.active {
    background-color: #374151;
    color: #f9fafb;
}

[data-theme="dark"] .setting-content {
    background: #1f2937;
}

[data-theme="dark"] .panel-title {
    color: #f9fafb;
}

[data-theme="dark"] .form-label {
    color: #f9fafb;
}

[data-theme="dark"] .form-input {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

[data-theme="dark"] .form-input:focus {
    border-color: #e6e6e6;
    box-shadow: 0 0 0 2px rgba(230, 230, 230, 0.2);
}

[data-theme="dark"] .section-title {
    color: #f9fafb;
}

[data-theme="dark"] .theme-name {
    color: #f9fafb;
}

[data-theme="dark"] .avatar-overlay {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .avatar-loading {
    background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .user-setting-modal-footer {
    background: #1f2937;
    border-top-color: #374151;
}

[data-theme="dark"] .btn-cancel {
    background: #374151;
    color: #f9fafb;
    border-color: #4b5563;
}

[data-theme="dark"] .btn-cancel:hover {
    background: #4b5563;
}

/* 移动端暗色主题 */
@media (max-width: 768px) {
    [data-theme="dark"] .setting-sidebar {
        border-bottom-color: #374151;
    }
    
    [data-theme="dark"] .setting-nav-item {
        border-right-color: rgba(75, 85, 99, 0.5);
    }
} 