/* 个人中心页面 */
.profile-section {
    max-width: 800px;
    margin: 0 auto;
    height: 100%;
    padding: 20px;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.profile-user-info {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-secondary);
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gray);
    overflow: hidden;
    margin-right: 20px;
}

.profile-info h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}

.profile-info p {
    color: var(--text-secondary);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--gray);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.stat-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.stat-icon svg {
    width: 40px;
    height: 40px;
    fill: var(--primary);
}

.stat-action {
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.stat-action .arrow-icon {
    width: 16px;
    height: 16px;
    fill: var(--primary);
    transition: transform 0.3s ease;
}

.points-recharge:hover, .points-record:hover {
    background: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(var(--primary-rgb), 0.15);
}

.points-recharge:hover .stat-action, .points-record:hover .stat-action {
    color: var(--background);
}

.points-recharge:hover .stat-icon svg, .points-record:hover .stat-icon svg {
    fill: var(--background);
}

.points-record:hover .arrow-icon {
    fill: var(--background);
    transform: translateX(3px);
}

.profile-settings {
    background: var(--gray);
    border-radius: 15px;
    padding: 30px;
}

.settings-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-label {
    font-weight: 500;
}

.toggle-switch {
    width: 50px;
    height: 26px;
    background: var(--border-color);
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-switch::after {
    content: '';
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-switch.active::after {
    left: 26px;
}

/* 退出登录按钮样式改进 */
#logout-btn {
    background: linear-gradient(45deg, #FF5252, #FF8080);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    width: auto;
    margin-top: 10px;
    box-shadow: 0 4px 8px rgba(255, 82, 82, 0.2);
    float: right; /* 添加浮动使按钮靠右 */
    margin-left: auto; /* 添加左边距自动确保靠右 */
}

#logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 82, 82, 0.3);
}

/* 换绑手机号按钮样式 */
.change-phone-btn {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(var(--primary-rgb), 0.2);
}

.change-phone-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(var(--primary-rgb), 0.3);
}

/* 视频清晰度选择器 */
.quality-selector {
    display: flex;
    background: var(--border-color);
    border-radius: 30px;
    overflow: hidden;
}

.quality-option {
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.quality-option:hover {
    background: var(--primary-light);
    color: white;
}

.quality-option.active {
    background: var(--primary);
    color: white;
}

/* 手机号更换模态框 */
.phone-change-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 1000;
}

.phone-change-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 450px;
    background: var(--background);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.2rem;
    margin: 0;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

.modal-footer button {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: var(--gray);
    color: var(--text);
}

.confirm-btn {
    background: var(--primary);
    color: white;
}

.cancel-btn:hover {
    background: var(--border-color);
}

.confirm-btn:hover {
    background: var(--secondary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .profile-stats {
        grid-template-columns: 1fr;
    }
    
    .profile-section {
        padding: 15px;
    }
    
    .profile-settings {
        padding: 20px;
    }
}

/* 表单相关样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.input-with-prefix {
    display: flex;
    align-items: center;
    width: 100%;
}

.input-prefix {
    background: var(--gray);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 8px 0 0 8px;
    padding: 10px 15px;
    color: var(--text-secondary);
}

.input-with-prefix .form-input {
    border-radius: 0 8px 8px 0;
    flex: 1;
}

.form-input {
    width: 100%;
    background: var(--gray);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    color: var(--text);
    font-size: 1rem;
}

.verification-code-container {
    display: flex;
    gap: 10px;
}

.verification-code-container .form-input {
    flex: 1;
}

.verification-code-btn {
    background: var(--primary);
    border: none;
    border-radius: 8px;
    padding: 0 15px;
    color: white;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.verification-code-btn:hover {
    background: var(--secondary);
}

.verification-code-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
}

/* API KEY管理按钮样式 */
.api-key-btn {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(var(--primary-rgb), 0.2);
}

.api-key-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(var(--primary-rgb), 0.3);
}

/* API KEY管理模态框 */
.api-key-modal, .create-api-key-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 1000;
}

.api-key-modal.active, .create-api-key-modal.active {
    display: block;
}

.api-key-modal .modal-content {
    width: 90%;
    max-width: 600px;
}

/* API KEY列表样式 */
.api-key-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.api-key-item {
    background: var(--gray);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
}

.api-key-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.api-key-item.expired {
    border-left-color: #ff9800;
    opacity: 0.8;
}

.api-key-item.inactive {
    border-left-color: #f44336;
    opacity: 0.6;
}

/* 过期警告样式 */
.expiry-warning {
    background: #fff3cd;
    color: #856404;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 0.9rem;
    border: 1px solid #ffeaa7;
}

[data-theme="dark"] .expiry-warning {
    background: #3d2914;
    color: #ffeaa7;
    border-color: #5d4e37;
}

.api-key-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.api-key-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
}

.api-key-status {
    display: flex;
    gap: 10px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-active {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-expired {
    background: #ffeaa7;
    color: #d68910;
}

.status-inactive {
    background: #ffebee;
    color: #c62828;
}

.api-key-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.api-key-value {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.api-key-masked {
    font-family: monospace;
    background: var(--background);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    flex: 1;
    font-size: 0.9rem;
}

.api-key-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.edit-btn {
    background: var(--primary);
    color: white;
}

.delete-btn {
    background: #ff5252;
    color: white;
}

.toggle-btn {
    background: var(--secondary);
    color: white;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.copy-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--secondary);
}

.copy-btn.copied {
    background: #4caf50;
}

/* 创建API KEY按钮 */
.create-api-key-btn {
    width: 100%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(var(--primary-rgb), 0.2);
}

.create-api-key-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(var(--primary-rgb), 0.3);
}

/* API KEY显示区域 */
.api-key-display {
    background: var(--gray);
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
}

.api-key-display label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}

.api-key-warning {
    font-size: 0.8rem;
    color: #ff5722;
    margin-top: 10px;
    font-style: italic;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.empty-state-subtext {
    font-size: 0.9rem;
}

/* 加载状态样式 */
.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.loading-state::after {
    content: '...';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* 错误状态样式 */
.error-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.error-text {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #ff5722;
}

.error-subtext {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.retry-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: var(--secondary);
    transform: translateY(-1px);
}

/* API KEY响应式设计 */
@media (max-width: 768px) {
    .api-key-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .api-key-actions {
        justify-content: flex-start;
    }
    
    .api-key-value {
        flex-direction: column;
        align-items: stretch;
    }
    
    .copy-btn {
        align-self: flex-start;
    }
}
