/**
 * AI数字人核心样式
 */

/* ==================== 重置 & 基础 ==================== */
.wpai-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1E293B;
    line-height: 1.6;
    background: #F8FAFC;
    min-height: 100vh;
}

.wpai-container * {
    box-sizing: border-box;
}

/* ==================== 头部 ==================== */
.wpai-header {
    background: white;
    border-bottom: 1px solid #E2E8F0;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
}

.wpai-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    height: 64px;
}

.wpai-header-left {
    display: flex;
    align-items: center;
}

.wpai-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #1E293B;
    font-weight: 700;
    font-size: 20px;
}

.wpai-logo:hover {
    color: #1E293B;
}

.wpai-logo-icon {
    display: flex;
    align-items: center;
}

.wpai-logo-text {
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wpai-nav {
    display: flex;
    align-items: center;
}

.wpai-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}

.wpai-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: #64748B;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.wpai-nav-link svg {
    width: 18px;
    height: 18px;
}

.wpai-nav-link:hover {
    color: #1E293B;
    background: #F1F5F9;
}

.wpai-nav-link.active {
    color: #8B5CF6;
    background: rgba(139, 92, 246, 0.1);
}

.wpai-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ==================== 用户信息 ==================== */
.wpai-user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.wpai-user-power {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    background: #F1F5F9;
    border-radius: 20px;
    font-size: 14px;
}

.wpai-power-icon {
    font-size: 16px;
}

.wpai-power-value {
    font-weight: 700;
    color: #1E293B;
}

.wpai-power-label {
    color: #94A3B8;
    font-size: 12px;
}

.wpai-user-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.wpai-user-dropdown:hover {
    background: #F1F5F9;
}

.wpai-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.wpai-user-name {
    font-size: 14px;
    font-weight: 500;
    color: #1E293B;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wpai-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
    min-width: 180px;
    padding: 8px 0;
    list-style: none;
    margin: 0;
}

.wpai-user-dropdown.open .wpai-dropdown-menu {
    display: block;
}

.wpai-dropdown-menu li {
    margin: 0;
}

.wpai-dropdown-menu a {
    display: block;
    padding: 8px 20px;
    color: #1E293B;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.wpai-dropdown-menu a:hover {
    background: #F1F5F9;
    color: #8B5CF6;
}

.wpai-dropdown-menu hr {
    margin: 4px 12px;
    border: none;
    border-top: 1px solid #E2E8F0;
}

/* ==================== 按钮 ==================== */
.wpai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.wpai-btn-primary {
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
    color: white;
}

.wpai-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
    color: white;
}

.wpai-btn-outline {
    background: transparent;
    color: #1E293B;
    border: 2px solid #E2E8F0;
}

.wpai-btn-outline:hover {
    border-color: #8B5CF6;
    color: #8B5CF6;
}

.wpai-btn-block {
    width: 100%;
    justify-content: center;
}

.wpai-btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.wpai-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ==================== 移动端菜单 ==================== */
.wpai-mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.wpai-mobile-menu-toggle span {
    width: 24px;
    height: 2.5px;
    background: #1E293B;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.wpai-mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.wpai-mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.wpai-mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.wpai-mobile-nav {
    display: none;
    background: white;
    padding: 16px 24px;
    border-top: 1px solid #E2E8F0;
}

.wpai-mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wpai-mobile-nav-list li {
    margin: 0;
}

.wpai-mobile-nav-list a {
    display: block;
    padding: 12px 0;
    color: #1E293B;
    text-decoration: none;
    border-bottom: 1px solid #F1F5F9;
    font-weight: 500;
}

.wpai-mobile-nav-list a:last-child {
    border-bottom: none;
}

/* ==================== 模态框 ==================== */
.wpai-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.wpai-modal {
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 440px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.3s ease;
}

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

.wpai-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #94A3B8;
    cursor: pointer;
    line-height: 1;
}

.wpai-modal-close:hover {
    color: #1E293B;
}

.wpai-auth-tabs {
    display: flex;
    gap: 0;
    margin: 0 0 24px;
    border-radius: 12px;
    background: #F1F5F9;
    padding: 4px;
}

.wpai-auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #94A3B8;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wpai-auth-tab.active {
    background: white;
    color: #1E293B;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.wpai-auth-form {
    display: none;
}

.wpai-auth-form.active {
    display: block;
}

.wpai-form-group {
    margin-bottom: 16px;
}

.wpai-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1E293B;
    margin-bottom: 4px;
}

.wpai-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.wpai-form-group input:focus {
    outline: none;
    border-color: #8B5CF6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.wpai-input-group {
    display: flex;
    gap: 8px;
}

.wpai-input-group input {
    flex: 1;
}

.wpai-input-group .wpai-btn {
    flex-shrink: 0;
}

.wpai-auth-extra {
    text-align: center;
    margin-top: 16px;
}

.wpai-auth-extra a {
    color: #8B5CF6;
    text-decoration: none;
    font-size: 14px;
}

.wpai-auth-extra a:hover {
    text-decoration: underline;
}

/* ==================== 底部 ==================== */
.wpai-footer {
    background: white;
    border-top: 1px solid #E2E8F0;
    padding: 24px;
    margin-top: 40px;
}

.wpai-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.wpai-footer-copyright {
    color: #94A3B8;
    font-size: 14px;
}

.wpai-footer-links {
    display: flex;
    gap: 24px;
}

.wpai-footer-links a {
    color: #94A3B8;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.wpai-footer-links a:hover {
    color: #8B5CF6;
}

/* ==================== 响应式 ==================== */
@media (max-width: 1024px) {
    .wpai-nav {
        display: none;
    }
    .wpai-mobile-menu-toggle {
        display: flex;
    }
    .wpai-mobile-nav {
        display: none;
    }
}

@media (max-width: 640px) {
    .wpai-header {
        padding: 0 16px;
    }
    .wpai-header-inner {
        height: 56px;
    }
    .wpai-logo-text {
        font-size: 16px;
    }
    .wpai-user-power {
        display: none;
    }
    .wpai-user-name {
        max-width: 60px;
        font-size: 13px;
    }
    .wpai-modal {
        padding: 24px;
    }
    .wpai-footer-inner {
        flex-direction: column;
        text-align: center;
    }
    .wpai-footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ==================== Toast ==================== */
.wpai-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: #1E293B;
    color: white;
    border-radius: 12px;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: toastSlide 0.4s ease;
}

.wpai-toast-success {
    background: #22C55E;
}

.wpai-toast-error {
    background: #EF4444;
}

.wpai-toast-warning {
    background: #F59E0B;
}

@keyframes toastSlide {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}