/* 伊丁天堂 AI 助手 - 导航栏按钮 + iframe 悬浮窗 */
.header .nav-icons {
    align-items: center;
}

.ai-assistant-fab {
    position: relative;
    flex-shrink: 0;
    align-self: center;
    height: 28px;
    margin: 0;
    padding: 0 10px 0 8px;
    border: none;
    border-radius: 999px;
    background: #fff;
    color: #5a5a5a;
    font-size: 12px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.ai-assistant-fab-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    display: block;
    object-fit: contain;
}

.ai-assistant-fab-text {
    white-space: nowrap;
    color: #5a5a5a;
    font-weight: 700;
}

.ai-assistant-fab:hover {
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.26), 0 2px 6px rgba(0, 0, 0, 0.14);
    transform: scale(1.03);
}

.ai-assistant-fab.is-open {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 215, 0, 0.45);
}

.ai-assistant-window {
    position: fixed;
    left: auto;
    top: auto;
    z-index: 1300;
    width: min(400px, calc(100vw - 40px));
    min-height: 240px;
    height: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, left 0.28s ease, top 0.28s ease;
}

.ai-assistant-window.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.ai-assistant-panel {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(210, 105, 30, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 215, 0, 0.12);
    background: #1a1412;
}

.ai-assistant-drag-handle {
    flex-shrink: 0;
    position: relative;
    z-index: 5;
    height: 40px;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-assistant-drag-handle.is-dragging {
    cursor: grabbing;
}

.ai-assistant-drag-grip {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: rgba(218, 165, 32, 0.45);
}

.ai-assistant-window.is-dragging {
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

.ai-assistant-close {
    position: absolute;
    top: 50%;
    right: 8px;
    z-index: 6;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    transition: color 0.2s ease, transform 0.2s ease;
}

.ai-assistant-close:hover {
    color: #fff;
    transform: translateY(-50%) scale(1.08);
}

.ai-assistant-body {
    position: relative;
    flex: 1;
    min-height: 0;
    width: 100%;
    background: #221a18;
}

.ai-assistant-body iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #221a18;
}

.ai-assistant-loading {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: rgba(26, 20, 18, 0.85);
}

.ai-assistant-body.is-loading .ai-assistant-loading {
    opacity: 1;
}

@media (max-width: 640px) {
    .ai-assistant-fab {
        height: 26px;
        padding: 0 8px 0 7px;
        font-size: 11px;
        gap: 4px;
    }

    .ai-assistant-fab-icon {
        width: 14px;
        height: 14px;
    }

    .ai-assistant-window {
        width: calc(100vw - 24px);
    }

    .ai-assistant-panel {
        border-radius: 14px;
    }
}
