/**
 * 对话界面样式
 * Galgame风格
 */

/* 主容器 */
.dialogue-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10002; /* 确保在modal-overlay (10001) 之上 */
    pointer-events: all;
}

.dialogue-container.hidden {
    display: none !important;
    pointer-events: none !important;
}

/* 背景（地图背景+半透明遮罩） */
.dialogue-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    pointer-events: none;
    /* TODO: 添加地图背景 */
    /* background-image: url(...); */
    /* background-size: cover; */
    /* background-position: center; */
}

/* 立绘容器 */
.dialogue-portraits {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 立绘 */
.portrait {
    position: absolute;
    bottom: 200px;
    width: 400px;
    height: 600px;
    transition: all 0.3s ease;
    pointer-events: none;
}

.portrait.hidden {
    opacity: 0;
    transform: translateY(20px);
}

.portrait-left {
    left: 50px;
}

.portrait-right {
    right: 50px;
}

.portrait img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.portrait-name {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 16px;
    white-space: nowrap;
}

/* 对话框 */
.dialogue-box {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 1000px;
    background: rgba(20, 20, 30, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 20px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    pointer-events: all;
}

/* 说话者信息 */
.speaker-info {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #fff;
}

.speaker-info.player {
    color: #7cb9e8;
}

.speaker-info.npc {
    color: #e87c7c;
}

/* 对话文本 */
.dialogue-text {
    font-size: 20px;
    line-height: 1.8;
    color: #fff;
    min-height: 80px;
    cursor: pointer;
    user-select: none;
}

/* 点击提示 */
.click-hint {
    text-align: center;
    color: #888;
    font-size: 14px;
    font-style: italic;
    margin-top: 10px;
    animation: pulse 1.5s ease-in-out infinite;
}

.click-hint.hidden {
    display: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* 选项容器（对话框上方左侧，纵向排布） */
.dialogue-options {
    position: absolute;
    bottom: 180px;
    left: 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: all;
    z-index: 10;
}

.dialogue-options.hidden {
    display: none;
}

/* 选项按钮 */
.dialogue-option-btn {
    background: rgba(30, 30, 40, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    color: #fff;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
    text-align: left;
}

.dialogue-option-btn:hover,
.dialogue-option-btn.highlighted {
    background: rgba(60, 60, 90, 0.95);
    border-color: rgba(255, 200, 100, 0.9);
    transform: translateX(5px);
    box-shadow: 0 0 15px rgba(255, 200, 100, 0.3);
}

.dialogue-option-btn:active {
    transform: translateX(3px);
}

/* 跳过按钮 */
.dialogue-skip-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    color: #fff;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: all;
}

.dialogue-skip-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.6);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .portrait {
        width: 250px;
        height: 400px;
    }

    .portrait-left {
        left: 20px;
    }

    .portrait-right {
        right: 20px;
    }

    .dialogue-box {
        width: 90%;
        bottom: 20px;
        padding: 15px 20px;
    }

    .dialogue-text {
        font-size: 16px;
    }

    .dialogue-options {
        bottom: 160px;
        left: 20px;
    }

    .dialogue-option-btn {
        min-width: 150px;
        font-size: 14px;
        padding: 10px 18px;
    }
}
