/* ============================================
   喜雀集团官网 - AI数字人客服组件样式
   设计风格：深蓝金配色 · 科技感 · 玻璃拟态
   依赖：style.css 中的 CSS 变量
   ============================================ */

/* ---------- 数字人客服专用变量 ---------- */
:root {
    --dh-z-index: 9999;
    --dh-btn-size: 64px;
    --dh-panel-width: 380px;
    --dh-panel-height: 560px;
    --dh-avatar-height: 180px;
    --dh-radius: 20px;
    --dh-radius-sm: 12px;
    --dh-spacing: 16px;
    --dh-gold-glow: 0 0 20px rgba(212, 175, 55, 0.4);
    --dh-gold-glow-strong: 0 0 30px rgba(212, 175, 55, 0.6);
}

/* ---------- 容器：右下角悬浮定位 ---------- */
.digital-human {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: var(--dh-z-index);
    font-family: var(--font-main);
}

/* ============================================
   1. 悬浮按钮（收起状态）
   ============================================ */
.dh-fab {
    position: relative;
    width: var(--dh-btn-size);
    height: var(--dh-btn-size);
    border-radius: 50%;
    cursor: pointer;
    transition: transform var(--transition-normal),
                box-shadow var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 按钮主体 - 圆形头像 */
.dh-fab__avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--gradient-dark);
    border: 2px solid var(--color-accent);
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.dh-fab__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 呼吸光晕动画 */
.dh-fab::before,
.dh-fab::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* 第一层光晕 */
.dh-fab::before {
    background: radial-gradient(circle, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
    animation: dh-breath 3s ease-in-out infinite;
}

/* 第二层光晕 - 延迟播放 */
.dh-fab::after {
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, transparent 60%);
    animation: dh-breath 3s ease-in-out infinite 1.5s;
}

/* 呼吸动画关键帧 */
@keyframes dh-breath {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 1;
    }
}

/* 悬停效果 */
.dh-fab:hover {
    transform: scale(1.08);
}

.dh-fab:hover::before {
    animation-duration: 2s;
}

/* "AI客服"文字标签 */
.dh-fab__label {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-secondary);
    color: var(--color-accent);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid var(--color-accent);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast),
                transform var(--transition-fast),
                visibility var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.dh-fab__label::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: var(--color-secondary);
    border-right: 1px solid var(--color-accent);
    border-top: 1px solid var(--color-accent);
}

.dh-fab:hover .dh-fab__label {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(-4px);
}

/* 未读消息红点 */
.dh-fab__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: linear-gradient(135deg, #ff4757, #ff6b7a);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    border: 2px solid var(--color-primary);
    animation: dh-bounce 1.5s ease-in-out infinite;
}

@keyframes dh-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ============================================
   2. 展开对话框面板
   ============================================ */
.dh-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 16px);
    width: var(--dh-panel-width);
    height: var(--dh-panel-height);
    background: linear-gradient(180deg,
                rgba(17, 24, 39, 0.95) 0%,
                rgba(10, 14, 26, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--dh-radius);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: var(--shadow-lg),
                0 0 60px rgba(212, 175, 55, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* 初始状态：隐藏 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: opacity var(--transition-normal),
                transform var(--transition-normal),
                visibility var(--transition-normal);
}

/* 展开状态 */
.digital-human.is-open .dh-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* 收起时隐藏悬浮按钮 */
.digital-human.is-open .dh-fab {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: opacity var(--transition-fast),
                transform var(--transition-fast),
                visibility var(--transition-fast);
}

/* 面板顶部装饰线 */
.dh-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-gold);
    opacity: 0.6;
}

/* ============================================
   3. 数字人头像区域（对话框顶部）
   ============================================ */
.dh-avatar-section {
    position: relative;
    height: var(--dh-avatar-height);
    overflow: hidden;
    background: linear-gradient(180deg,
                rgba(212, 175, 55, 0.08) 0%,
                transparent 100%);
    flex-shrink: 0;
}

/* 头像图片容器 */
.dh-avatar-section__image {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.dh-avatar-section__image img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: bottom center;
    transition: opacity 0.3s ease;
}

/* 状态图片切换 - 默认idle显示主图 */
.dh-avatar-section__image img.dh-avatar--idle { opacity: 1; }
.dh-avatar-section__image img.dh-avatar--speaking,
.dh-avatar-section__image img.dh-avatar--thinking,
.dh-avatar-section__image img.dh-avatar--smile {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
}

/* 说话状态 */
.digital-human.speaking .dh-avatar-section__image img.dh-avatar--idle { opacity: 0; }
.digital-human.speaking .dh-avatar-section__image img.dh-avatar--speaking { opacity: 1; }

/* 思考状态 */
.digital-human.thinking .dh-avatar-section__image img.dh-avatar--idle { opacity: 0; }
.digital-human.thinking .dh-avatar-section__image img.dh-avatar--thinking { opacity: 1; }

/* 微笑状态 */
.digital-human.smile .dh-avatar-section__image img.dh-avatar--idle { opacity: 0; }
.digital-human.smile .dh-avatar-section__image img.dh-avatar--smile { opacity: 1; }

/* 微浮动效果（idle状态） */
.digital-human.idle .dh-avatar-section__image {
    animation: dh-float 4s ease-in-out infinite;
}

@keyframes dh-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* 说话时的微动效 - 轻微上下起伏 */
.digital-human.speaking .dh-avatar-section__image {
    animation: dh-speak-bob 0.4s ease-in-out infinite;
}

@keyframes dh-speak-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* 思考时的轻微旋转 */
.digital-human.thinking .dh-avatar-section__image {
    animation: dh-think-sway 2s ease-in-out infinite;
}

@keyframes dh-think-sway {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(1deg); }
    75% { transform: rotate(-1deg); }
}

/* 顶部状态栏 - 数字人名片 */
.dh-avatar-section__info {
    position: absolute;
    top: var(--dh-spacing);
    left: var(--dh-spacing);
    right: var(--dh-spacing);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 5;
}

.dh-avatar-section__name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dh-avatar-section__name-text {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.dh-avatar-section__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    padding: 3px 10px;
    border-radius: 12px;
}

.dh-avatar-section__status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: dh-status-pulse 2s ease-in-out infinite;
}

@keyframes dh-status-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* 关闭/最小化按钮组 */
.dh-avatar-section__controls {
    display: flex;
    gap: 8px;
}

.dh-control-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast),
                color var(--transition-fast),
                transform var(--transition-fast);
    border: none;
    font-size: 0.875rem;
}

.dh-control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-text-primary);
    transform: scale(1.05);
}

.dh-control-btn--close:hover {
    background: rgba(255, 71, 87, 0.2);
    color: #ff6b7a;
}

/* ============================================
   4. 快捷问题按钮区
   ============================================ */
.dh-quick-questions {
    padding: 12px var(--dh-spacing);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.dh-quick-btn {
    padding: 6px 14px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 16px;
    font-size: 0.8125rem;
    color: var(--color-accent-light);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.dh-quick-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--color-accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}

.dh-quick-btn:active {
    transform: translateY(0);
}

/* ============================================
   5. 对话消息区
   ============================================ */
.dh-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--dh-spacing);
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

/* 滚动条美化 */
.dh-messages::-webkit-scrollbar {
    width: 5px;
}

.dh-messages::-webkit-scrollbar-track {
    background: transparent;
}

.dh-messages::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.2);
    border-radius: 3px;
}

.dh-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.4);
}

/* 消息气泡基础样式 */
.dh-message {
    display: flex;
    max-width: 80%;
    animation: dh-message-in 0.3s ease-out;
}

@keyframes dh-message-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AI消息 - 靠左白色气泡 */
.dh-message--ai {
    align-self: flex-start;
    flex-direction: row;
}

.dh-message--ai .dh-message__bubble {
    background: var(--color-glass-hover);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    border-radius: 4px var(--dh-radius-sm) var(--dh-radius-sm) var(--dh-radius-sm);
    padding: 10px 14px;
    font-size: 0.875rem;
    line-height: 1.6;
    position: relative;
}

/* AI消息小头像 */
.dh-message--ai .dh-message__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-gold);
    margin-right: 8px;
    flex-shrink: 0;
    overflow: hidden;
    margin-top: 2px;
}

.dh-message--ai .dh-message__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 用户消息 - 靠右金色气泡 */
.dh-message--user {
    align-self: flex-end;
    flex-direction: row;
}

.dh-message--user .dh-message__bubble {
    background: linear-gradient(135deg,
                rgba(212, 175, 55, 0.25) 0%,
                rgba(212, 175, 55, 0.15) 100%);
    color: var(--color-accent-light);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: var(--dh-radius-sm) 4px var(--dh-radius-sm) var(--dh-radius-sm);
    padding: 10px 14px;
    font-size: 0.875rem;
    line-height: 1.6;
    position: relative;
}

/* 消息时间戳 */
.dh-message__time {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    margin-top: 4px;
    text-align: right;
}

.dh-message--ai .dh-message__time {
    text-align: left;
    margin-left: 36px;
}

/* ============================================
   6. 打字指示器（三点跳动动画）
   ============================================ */
.dh-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
}

.dh-typing__dot {
    width: 6px;
    height: 6px;
    background: var(--color-accent);
    border-radius: 50%;
    animation: dh-typing-bounce 1.4s ease-in-out infinite;
}

.dh-typing__dot:nth-child(1) { animation-delay: 0s; }
.dh-typing__dot:nth-child(2) { animation-delay: 0.2s; }
.dh-typing__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dh-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* AI消息中的打字指示器容器 */
.dh-message--ai .dh-typing {
    padding: 10px 14px;
}

/* ============================================
   7. 输入框区域
   ============================================ */
.dh-input-area {
    padding: var(--dh-spacing);
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
}

.dh-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: var(--color-glass);
    border: 1px solid var(--color-border);
    border-radius: var(--dh-radius-sm);
    padding: 8px;
    transition: border-color var(--transition-fast),
                box-shadow var(--transition-fast);
}

.dh-input-wrapper:focus-within {
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* 文本输入框 */
.dh-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    resize: none;
    max-height: 80px;
    min-height: 24px;
    line-height: 1.5;
    padding: 4px 6px;
}

.dh-input::placeholder {
    color: var(--color-text-muted);
}

/* 输入框按钮组 */
.dh-input-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* 功能按钮（语音等） */
.dh-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    font-size: 1rem;
}

.dh-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-accent-light);
}

/* 语音录制激活状态 */
.dh-action-btn--voice.is-recording {
    background: rgba(255, 71, 87, 0.2);
    color: #ff6b7a;
    animation: dh-record-pulse 1s ease-in-out infinite;
}

@keyframes dh-record-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 71, 87, 0);
    }
}

/* 发送按钮 */
.dh-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-gold);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    font-size: 0.9375rem;
    font-weight: bold;
}

.dh-send-btn:hover {
    transform: scale(1.08);
    box-shadow: var(--dh-gold-glow);
}

.dh-send-btn:active {
    transform: scale(0.95);
}

.dh-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================
   8. 语音录制状态指示
   ============================================ */
.dh-voice-recording {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: var(--dh-radius-sm);
    margin-bottom: 10px;
    animation: dh-voice-fade-in 0.3s ease-out;
}

.dh-voice-recording.is-active {
    display: flex;
}

@keyframes dh-voice-fade-in {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 录音波形动画 */
.dh-voice-recording__waves {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 24px;
}

.dh-voice-recording__wave {
    width: 3px;
    background: #ff6b7a;
    border-radius: 2px;
    animation: dh-wave 1s ease-in-out infinite;
}

.dh-voice-recording__wave:nth-child(1) { animation-delay: 0s; height: 8px; }
.dh-voice-recording__wave:nth-child(2) { animation-delay: 0.1s; height: 16px; }
.dh-voice-recording__wave:nth-child(3) { animation-delay: 0.2s; height: 20px; }
.dh-voice-recording__wave:nth-child(4) { animation-delay: 0.3s; height: 14px; }
.dh-voice-recording__wave:nth-child(5) { animation-delay: 0.4s; height: 10px; }

@keyframes dh-wave {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1.2); }
}

/* 录音时间 */
.dh-voice-recording__time {
    font-size: 0.875rem;
    color: #ff6b7a;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* 录音状态文字 */
.dh-voice-recording__text {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

/* 取消录音按钮 */
.dh-voice-recording__cancel {
    padding: 4px 12px;
    background: rgba(255, 71, 87, 0.2);
    border: 1px solid rgba(255, 71, 87, 0.4);
    border-radius: 14px;
    color: #ff6b7a;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dh-voice-recording__cancel:hover {
    background: rgba(255, 71, 87, 0.3);
}

/* ============================================
   9. 欢迎消息 / 系统消息
   ============================================ */
.dh-message--system {
    align-self: center;
    max-width: 100%;
}

.dh-message--system .dh-message__bubble {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-align: center;
    padding: 4px 0;
}

/* 欢迎卡片 */
.dh-welcome-card {
    background: linear-gradient(135deg,
                rgba(212, 175, 55, 0.1) 0%,
                rgba(212, 175, 55, 0.03) 100%);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--dh-radius-sm);
    padding: 14px;
    margin-bottom: 4px;
}

.dh-welcome-card__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-accent-light);
    margin-bottom: 6px;
}

.dh-welcome-card__desc {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* ============================================
   10. 表情状态指示器
   ============================================ */
.dh-expression-indicator {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    z-index: 5;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.digital-human.speaking .dh-expression-indicator--speaking,
.digital-human.thinking .dh-expression-indicator--thinking {
    opacity: 1;
}

.dh-expression-indicator__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dh-expression-indicator--speaking .dh-expression-indicator__dot {
    background: #10b981;
    animation: dh-status-pulse 1.5s ease-in-out infinite;
}

.dh-expression-indicator--thinking .dh-expression-indicator__dot {
    background: var(--color-accent);
    animation: dh-spin 1s linear infinite;
}

@keyframes dh-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   11. 响应式设计 - 移动端适配
   ============================================ */

/* 平板设备 */
@media (max-width: 768px) {
    :root {
        --dh-panel-width: 340px;
        --dh-panel-height: 500px;
        --dh-btn-size: 56px;
    }

    .digital-human {
        right: 20px;
        bottom: 20px;
    }

    .dh-fab__label {
        display: none;
    }
}

/* 手机设备 */
@media (max-width: 480px) {
    :root {
        --dh-btn-size: 52px;
    }

    .digital-human {
        right: 16px;
        bottom: 16px;
    }

    /* 移动端对话框全屏宽度 */
    .dh-panel {
        position: fixed;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 85vh;
        border-radius: var(--dh-radius) var(--dh-radius) 0 0;
        transform-origin: bottom center;
    }

    .digital-human.is-open .dh-panel {
        transform: translateY(0) scale(1);
    }

    .dh-avatar-section {
        --dh-avatar-height: 160px;
        height: var(--dh-avatar-height);
    }

    .dh-messages {
        padding: 12px;
        gap: 12px;
    }

    .dh-message {
        max-width: 85%;
    }

    .dh-input-area {
        padding: 12px;
        /* 适配移动端底部安全区域 */
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .dh-quick-questions {
        padding: 10px 12px;
        gap: 6px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .dh-quick-questions::-webkit-scrollbar {
        display: none;
    }

    .dh-quick-btn {
        flex-shrink: 0;
        font-size: 0.75rem;
        padding: 5px 12px;
    }
}

/* 极小屏幕 */
@media (max-width: 360px) {
    :root {
        --dh-btn-size: 48px;
    }

    .dh-avatar-section {
        --dh-avatar-height: 140px;
    }
}

/* ============================================
   12. 无障碍与减少动画偏好
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .dh-fab::before,
    .dh-fab::after,
    .dh-fab__badge,
    .dh-avatar-section__status::before,
    .dh-typing__dot,
    .dh-action-btn--voice.is-recording,
    .dh-voice-recording__wave,
    .digital-human.idle .dh-avatar-section__image,
    .digital-human.speaking .dh-avatar-section__image,
    .digital-human.thinking .dh-avatar-section__image {
        animation: none;
    }

    .dh-panel,
    .dh-fab,
    .dh-message,
    .dh-voice-recording {
        transition: none;
    }
}

/* ============================================
   13. 深色模式支持（默认即为深色，预留浅色模式接口）
   ============================================ */
@media (prefers-color-scheme: light) {
    /* 预留浅色模式样式扩展位置 */
}

/* ============================================
   14. 工具类与辅助类
   ============================================ */

/* 隐藏元素（带动画） */
.dh-hidden {
    display: none !important;
}

/* 文字渐变金色 */
.dh-text-gold {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 玻璃拟态卡片 */
.dh-glass-card {
    background: var(--color-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
    border-radius: var(--dh-radius-sm);
}

/* 金色描边按钮 */
.dh-btn-gold {
    background: var(--gradient-gold);
    color: var(--color-primary);
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dh-btn-gold:hover {
    transform: translateY(-1px);
    box-shadow: var(--dh-gold-glow);
}

/* 最小化状态 - 仅保留头部 */
.digital-human.is-minimized .dh-panel {
    height: 60px;
}

.digital-human.is-minimized .dh-avatar-section,
.digital-human.is-minimized .dh-quick-questions,
.digital-human.is-minimized .dh-messages,
.digital-human.is-minimized .dh-input-area {
    display: none;
}

.digital-human.is-minimized .dh-panel::before {
    display: none;
}

/* 最小化时显示的标题栏 */
.dh-minimized-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--dh-spacing);
    height: 60px;
    background: linear-gradient(90deg,
                rgba(212, 175, 55, 0.1) 0%,
                transparent 100%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.digital-human.is-minimized .dh-minimized-bar {
    display: flex;
}

.dh-minimized-bar__left {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.dh-minimized-bar__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--color-accent);
}

.dh-minimized-bar__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dh-minimized-bar__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.dh-minimized-bar__subtitle {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

/* ============================================
   15. 加载与错误状态
   ============================================ */

/* 骨架屏加载动画 */
.dh-skeleton {
    background: linear-gradient(90deg,
                rgba(255, 255, 255, 0.03) 25%,
                rgba(255, 255, 255, 0.08) 50%,
                rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: dh-skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes dh-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 错误消息样式 */
.dh-message--error .dh-message__bubble {
    background: rgba(255, 71, 87, 0.1);
    border-color: rgba(255, 71, 87, 0.3);
    color: #ff6b7a;
}

/* ============================================
   附录：状态类速查
   ============================================
   .digital-human.idle       - 默认/空闲状态
   .digital-human.speaking   - 说话状态
   .digital-human.thinking   - 思考状态
   .digital-human.smile      - 微笑状态
   .digital-human.is-open    - 对话框展开
   .digital-human.is-minimized - 对话框最小化
   ============================================ */
