/* ==================== 云念AI 全局样式 ==================== */

* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== 页面切换动画 ==================== */
.page {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 底部导航 ==================== */
.nav-item {
    transition: color 0.2s;
}

.nav-item.active {
    color: #c45c3e;
}

.nav-item i {
    font-size: 20px;
}

.nav-item p {
    font-size: 12px;
    margin-top: 4px;
}

/* ==================== 创建角色步骤条 ==================== */
.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e8d5c0;
    color: #8b6b5a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.step-dot.active {
    background: #c45c3e;
    color: white;
    box-shadow: 0 2px 8px rgba(196, 92, 62, 0.3);
}

.step-line {
    flex: 1;
    height: 2px;
    background: #e8d5c0;
    margin: 0 8px;
}

/* ==================== 录音动画 ==================== */
.recording-pulse {
    animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(196, 92, 62, 0.4);
    }
    100% {
        box-shadow: 0 0 0 20px rgba(196, 92, 62, 0);
    }
}

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #e8d5c0;
    border-radius: 2px;
}

/* ==================== Toast ==================== */
#toast.show {
    opacity: 1;
}

/* ==================== 按钮点击效果 ==================== */
button:active {
    transform: scale(0.97);
}

/* ==================== 输入框聚焦 ==================== */
input:focus, textarea:focus, select:focus {
    outline: none;
}

/* ==================== 数字人说话动画 ==================== */
@keyframes speaking-bounce {
    0%, 100% {
        transform: scale(1) translateY(0);
    }
    25% {
        transform: scale(1.01) translateY(-2px);
    }
    50% {
        transform: scale(1.02) translateY(0);
    }
    75% {
        transform: scale(1.01) translateY(2px);
    }
}

.speaking {
    animation: speaking-bounce 0.6s ease-in-out infinite;
}

/* ==================== VIP卡片 ==================== */
.vip-card {
    transition: all 0.2s;
    cursor: pointer;
}

.vip-card:active {
    transform: scale(0.98);
}

.vip-card.selected {
    border-color: #c45c3e;
    background: linear-gradient(135deg, #fff5f0 0%, #ffe8dd 100%);
}

.vip-card .recommend-badge {
    position: absolute;
    top: -8px;
    right: 16px;
    background: linear-gradient(90deg, #c45c3e, #e88b6a);
    color: white;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 10px;
}

/* ==================== 消息列表项 ==================== */
.message-item {
    transition: background 0.2s;
}

.message-item.unread {
    background: #fff8f3;
}

.message-item .unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c45c3e;
}

/* ==================== 通讯录角色卡片 ==================== */
.role-card {
    transition: all 0.2s;
    cursor: pointer;
}

.role-card:active {
    transform: scale(0.98);
}

/* ==================== 安全区域适配 ==================== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .fixed.bottom-0 {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ==================== 加载动画 ==================== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e8d5c0;
    border-top-color: #c45c3e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
