/* UI组件样式 */

/* 模态窗口通用样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    padding: 30px;
    border-radius: 15px;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    border: 2px solid var(--primary-color);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(139, 69, 19, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    color: var(--gold);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    text-align: center;
    font-size: 24px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s;
    z-index: 10;
}

.close-btn:hover {
    color: var(--gold);
    transform: rotate(90deg);
}

/* 菜单模态框 */
.menu-modal {
    width: 350px;
}

.menu-item {
    display: block;
    width: 100%;
    padding: 15px 20px;
    margin-bottom: 10px;
    background: rgba(139, 69, 19, 0.2);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    text-align: left;
}

.menu-item:hover {
    background: rgba(139, 69, 19, 0.5);
    transform: translateX(5px);
    border-color: var(--gold);
}

.menu-item.close-menu {
    background: rgba(100, 100, 100, 0.2);
    border-color: #666;
    text-align: center;
    margin-top: 20px;
}

.menu-item.close-menu:hover {
    background: rgba(100, 100, 100, 0.4);
}

/* 线索簿模态框 */
.clue-modal {
    width: 900px;
    min-height: 500px;
}

#clue-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.category-tab {
    padding: 8px 16px;
    background: rgba(139, 69, 19, 0.2);
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.3s;
    font-size: 13px;
}

.category-tab:hover {
    background: rgba(139, 69, 19, 0.4);
}

.category-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--gold);
    border-color: var(--gold);
}

#clue-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.clue-item {
    background: rgba(40, 40, 40, 0.8);
    padding: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.clue-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--gold), transparent);
}

.clue-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
    border-color: var(--gold);
}

.clue-item h3 {
    color: var(--gold);
    margin-bottom: 10px;
    font-size: 16px;
}

.clue-item p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.clue-item .clue-category {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 3px 10px;
    background: rgba(139, 69, 19, 0.5);
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-light);
}

.clue-item.new::after {
    content: 'NEW';
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 2px 8px;
    background: var(--danger);
    border-radius: 3px;
    font-size: 10px;
    color: white;
    font-weight: bold;
}

.empty-clue {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: var(--text-muted);
}

/* 线索详情模态框 */
.detail-modal {
    width: 600px;
}

#clue-detail-content {
    margin-bottom: 25px;
}

#clue-detail-content h3 {
    color: var(--gold);
    font-size: 22px;
    margin-bottom: 15px;
}

#clue-detail-content .clue-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 2px solid var(--primary-color);
}

#clue-detail-content .clue-desc {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-light);
}

#clue-detail-content .clue-meta {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--primary-color);
    font-size: 14px;
    color: var(--text-muted);
}

#clue-notes {
    background: rgba(30, 30, 30, 0.8);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--primary-color);
}

#clue-notes h4 {
    color: var(--gold);
    margin-bottom: 15px;
}

#clue-note-input {
    width: 100%;
    height: 100px;
    padding: 15px;
    background: rgba(20, 20, 20, 0.9);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 14px;
    resize: vertical;
    margin-bottom: 15px;
}

#clue-note-input:focus {
    outline: none;
    border-color: var(--gold);
}

#save-note-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: 2px solid var(--gold-dark);
    border-radius: 5px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
}

#save-note-btn:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

/* 对话历史模态框 */
.history-modal {
    width: 700px;
    max-height: 80vh;
}

#history-list {
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    padding: 15px;
    margin-bottom: 15px;
    background: rgba(40, 40, 40, 0.6);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.history-item .history-speaker {
    color: var(--gold);
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
}

.history-item .history-text {
    color: var(--text-light);
    line-height: 1.6;
}

.history-item .history-time {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
}

.history-item.player {
    border-left-color: var(--accent-blue);
    background: rgba(135, 206, 235, 0.1);
}

/* 图片线索弹窗 */
.image-clue-modal {
    width: auto;
    max-width: 80vw;
    max-height: 85vh;
    padding: 20px;
}

.image-clue-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#clue-image {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    transition: opacity 0.3s ease-in-out;
}

.clue-description {
    color: var(--text-light);
    font-size: 16px;
    line-height: 1.8;
    text-align: center;
    padding: 15px 20px;
    background: rgba(40, 40, 40, 0.6);
    border-radius: 10px;
    border-left: 4px solid var(--gold);
    max-width: 600px;
}

.history-item.player .history-speaker {
    color: var(--accent-blue);
}

/* 关键问题模态框 */
.question-modal {
    width: 650px;
}

#question-content {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(30, 30, 30, 0.8);
    border-radius: 10px;
    border: 1px solid var(--primary-color);
}

#question-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

#question-options button {
    padding: 15px 20px;
    background: rgba(139, 69, 19, 0.2);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-size: 16px;
}

#question-options button:hover {
    background: rgba(139, 69, 19, 0.4);
    transform: translateX(5px);
}

#question-options button.selected {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--gold);
    color: var(--gold);
}

.submit-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 18px;
    font-weight: bold;
}

.submit-btn:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    box-shadow: 0 5px 20px rgba(139, 69, 19, 0.4);
}

/* 存档模态框 */
.save-modal {
    width: 700px;
}

#save-slots, #load-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.save-slot {
    background: rgba(40, 40, 40, 0.8);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.save-slot:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.2);
}

.save-slot.empty {
    border-style: dashed;
    opacity: 0.6;
}

.save-slot.empty:hover {
    opacity: 1;
}

.slot-preview {
    width: 100%;
    height: 100px;
    background: var(--bg-dark);
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
}

.slot-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slot-info h4 {
    color: var(--gold);
    margin-bottom: 5px;
    font-size: 14px;
}

.slot-info p {
    color: var(--text-muted);
    font-size: 12px;
}

.slot-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 25px;
    height: 25px;
    background: var(--danger);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
    font-size: 14px;
}

.save-slot:hover .slot-delete {
    opacity: 1;
}

/* 设置模态框 */
.settings-modal {
    width: 500px;
}

.settings-group {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(30, 30, 30, 0.8);
    border-radius: 10px;
}

.settings-group label {
    display: block;
    color: var(--text-light);
    margin-bottom: 10px;
    font-size: 16px;
}

.settings-group input[type="range"] {
    width: 100%;
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.settings-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--gold);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.settings-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.settings-group span {
    display: inline-block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 14px;
}

.settings-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

#save-settings {
    margin-top: 10px;
}

/* 工具提示 */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: var(--text-light);
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 13px;
    z-index: 1500;
    pointer-events: none;
    white-space: nowrap;
    border: 1px solid var(--primary-color);
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: var(--primary-color) transparent transparent;
}

/* 确认对话框 */
.confirm-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-dark);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid var(--primary-color);
    z-index: 2000;
    text-align: center;
    min-width: 350px;
}

.confirm-dialog h3 {
    color: var(--gold);
    margin-bottom: 20px;
}

.confirm-dialog p {
    color: var(--text-light);
    margin-bottom: 25px;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-btn {
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 15px;
}

.confirm-btn.yes {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: 2px solid var(--gold-dark);
    color: var(--text-light);
}

.confirm-btn.no {
    background: rgba(100, 100, 100, 0.3);
    border: 2px solid #666;
    color: var(--text-light);
}

.confirm-btn:hover {
    transform: translateY(-2px);
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--gold));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

.badge-new {
    background: var(--danger);
    color: white;
}

.badge-important {
    background: var(--gold);
    color: var(--bg-dark);
}

.badge-complete {
    background: var(--success);
    color: white;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .clue-modal {
        width: 100%;
    }
    
    #clue-list {
        grid-template-columns: 1fr;
    }
    
    #save-slots, #load-slots {
        grid-template-columns: 1fr;
    }
    
    .menu-modal {
        width: 90%;
    }
    
    .question-modal {
        width: 95%;
    }
}

/* ==================== 谜题系统样式 ==================== */

/* 谜题全屏覆盖层 */
#puzzle-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 900;
    display: flex;
    flex-direction: column;
}

#puzzle-overlay.hidden {
    display: none;
}

#puzzle-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.4) blur(2px);
    z-index: -1;
}

#puzzle-container {
    display: flex;
    flex: 1;
    padding: 60px 20px 20px 20px;
    gap: 20px;
    overflow: hidden;
}

/* 左侧谜题列表 */
#puzzle-sidebar {
    width: 280px;
    background: rgba(20, 20, 30, 0.9);
    border-radius: 15px;
    border: 2px solid var(--primary-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

#puzzle-sidebar h3 {
    color: var(--gold);
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--primary-color);
}

#puzzle-list {
    flex: 1;
    overflow-y: auto;
}

.puzzle-item {
    background: rgba(40, 40, 60, 0.8);
    border: 1px solid rgba(139, 115, 85, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.puzzle-item:hover {
    background: rgba(60, 60, 80, 0.9);
    border-color: var(--gold);
    transform: translateX(5px);
}

.puzzle-item.active {
    background: rgba(139, 115, 85, 0.3);
    border-color: var(--gold);
}

.puzzle-item.solved {
    border-color: var(--success);
}

.puzzle-item.solved::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--success);
    font-size: 18px;
    font-weight: bold;
}

.puzzle-item-title {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.4;
}

.puzzle-item.solved .puzzle-item-title {
    color: var(--success);
}

/* 右侧谜题内容区 */
#puzzle-content {
    flex: 1;
    background: rgba(20, 20, 30, 0.85);
    border-radius: 15px;
    border: 2px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#puzzle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: rgba(139, 115, 85, 0.2);
    border-bottom: 1px solid var(--primary-color);
}

#puzzle-title {
    color: var(--gold);
    font-size: 22px;
    margin: 0;
    text-shadow: 0 0 10px rgba(218, 165, 32, 0.3);
}

.puzzle-close {
    background: rgba(100, 100, 100, 0.3);
    border: 1px solid #666;
    color: var(--text-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.puzzle-close:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* 问题显示区 */
#puzzle-questions-area {
    padding: 20px 25px;
    border-bottom: 1px solid var(--primary-color);
    background: rgba(40, 40, 60, 0.3);
}

#puzzle-questions-area h3 {
    color: var(--gold);
    font-size: 16px;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(139, 115, 85, 0.3);
}

#puzzle-questions-list {
    max-height: 150px;
    overflow-y: auto;
}

.puzzle-question-item {
    background: rgba(30, 30, 40, 0.6);
    border: 1px solid rgba(139, 115, 85, 0.2);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 8px;
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.4;
}

.puzzle-question-item .question-number {
    color: var(--gold);
    font-weight: bold;
    margin-right: 8px;
}

/* 线索工作区 */
#puzzle-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
}

#clue-cards-area {
    flex: 1;
    background: rgba(30, 30, 40, 0.5);
    border: 2px dashed rgba(139, 115, 85, 0.4);
    border-radius: 15px;
    position: relative;
    overflow: auto;
    min-height: 300px;
}

#clue-cards-area.drag-over {
    border-color: var(--gold);
    background: rgba(139, 115, 85, 0.1);
}

/* 线索卡片 */
.clue-card {
    position: absolute;
    width: 200px;
    background: linear-gradient(135deg, #f5f0e6 0%, #e8e0d0 100%);
    border-radius: 8px;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.4), 0 0 1px rgba(0, 0, 0, 0.3);
    cursor: move;
    user-select: none;
    transition: box-shadow 0.2s, transform 0.1s;
    z-index: 1;
}

.clue-card:hover {
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.clue-card.dragging {
    opacity: 0.8;
    transform: rotate(3deg) scale(1.05);
    z-index: 100;
}

.clue-card.selected {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.clue-card.used {
    filter: grayscale(0.7);
    opacity: 0.6;
}

.clue-card.final-answer {
    outline: 3px solid var(--success);
    outline-offset: 2px;
    filter: none;
    opacity: 1;
}

.clue-card-header {
    background: linear-gradient(135deg, #8b7355 0%, #6b5344 100%);
    color: #f5f0e6;
    padding: 8px 12px;
    border-radius: 8px 8px 0 0;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clue-card-remove {
    background: none;
    border: none;
    color: #f5f0e6;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.clue-card-remove:hover {
    opacity: 1;
}

.clue-card-body {
    padding: 12px;
    color: #3a3a3a;
    font-size: 12px;
    line-height: 1.5;
}

.clue-card-image {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 5px;
    margin-bottom: 8px;
    cursor: pointer;
}

.clue-card-image:hover {
    opacity: 0.9;
}

/* 操作按钮区 */
#puzzle-actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    justify-content: center;
}

.puzzle-action-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: 2px solid var(--gold-dark);
    color: var(--text-light);
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.puzzle-action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 115, 85, 0.4);
}

.puzzle-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== 答题系统样式 ==================== */

/* 答题全屏覆盖层 */
#quiz-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 900;
    display: flex;
    flex-direction: column;
}

#quiz-overlay.hidden {
    display: none;
}

#quiz-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.4) blur(2px);
    z-index: -1;
}

#quiz-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 60px 20px 20px 20px;
    overflow: hidden;
}

#quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: rgba(139, 115, 85, 0.2);
    border-bottom: 1px solid var(--primary-color);
    border-radius: 15px 15px 0 0;
    margin-bottom: 0;
}

#quiz-title {
    color: var(--gold);
    font-size: 22px;
    margin: 0;
    text-shadow: 0 0 10px rgba(218, 165, 32, 0.3);
}

#quiz-body {
    display: flex;
    flex: 1;
    gap: 20px;
    background: rgba(20, 20, 30, 0.85);
    border-radius: 0 0 15px 15px;
    border: 2px solid var(--primary-color);
    border-top: none;
    padding: 20px;
    overflow: hidden;
}

/* 左侧题目列表 */
#quiz-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: rgba(20, 20, 30, 0.9);
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    padding: 15px;
    overflow-y: auto;
}

#quiz-sidebar h3 {
    color: var(--gold);
    font-size: 16px;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--primary-color);
}

#quiz-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-item {
    padding: 12px 15px;
    background: rgba(139, 69, 19, 0.2);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.quiz-item:hover {
    background: rgba(139, 69, 19, 0.4);
}

.quiz-item.active {
    border-color: var(--accent-color);
    background: rgba(139, 69, 19, 0.5);
}

.quiz-item.completed {
    border-color: #27ae60;
}

.quiz-item.completed .quiz-item-title {
    color: #27ae60;
}

.quiz-item.completed .quiz-check {
    color: #27ae60;
    margin-right: 5px;
}

.quiz-item-title {
    color: var(--text-light);
    font-size: 14px;
    white-space: nowrap;
}

/* 中间答题区域 */
#quiz-main {
    flex: 1;
    display: flex;
    gap: 20px;
    overflow: hidden;
}

/* 关键词池 */
#quiz-keywords-panel {
    width: 280px;
    flex-shrink: 0;
    background: rgba(20, 20, 30, 0.9);
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    padding: 15px;
    display: flex;
    flex-direction: column;
}

#quiz-keywords-panel h4 {
    color: var(--gold);
    font-size: 14px;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--primary-color);
}

#keyword-pool {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
}

.keyword-pool-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 30px;
    font-size: 14px;
    line-height: 1.8;
}

.keyword-chip {
    padding: 6px 12px;
    border-radius: 15px;
    color: white;
    font-size: 13px;
    cursor: grab;
    transition: all 0.2s;
    user-select: none;
}

.keyword-chip:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.keyword-chip.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* 问题区域 */
#quiz-questions-panel {
    flex: 1;
    background: rgba(20, 20, 30, 0.9);
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#question-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
}

.quiz-question {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(139, 69, 19, 0.3);
    position: relative;
    transition: all 0.3s;
}

.quiz-question:last-child {
    border-bottom: none;
}

/* 问题状态：正确 */
.quiz-question.question-correct {
    background: rgba(39, 174, 96, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-left: -15px;
    margin-right: -15px;
    padding-left: 15px;
    padding-right: 15px;
}

.quiz-question.question-correct::before {
    content: '✓';
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 20px;
    color: #27ae60;
    font-weight: bold;
}

.quiz-question.question-correct .quiz-question-title {
    color: #27ae60;
}

/* 问题状态：错误 */
.quiz-question.question-wrong {
    background: rgba(231, 76, 60, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-left: -15px;
    margin-right: -15px;
    padding-left: 15px;
    padding-right: 15px;
}

.quiz-question.question-wrong::before {
    content: '✗';
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 20px;
    color: #e74c3c;
    font-weight: bold;
}

.quiz-question.question-wrong .quiz-question-title {
    color: #e74c3c;
}

.quiz-question-title {
    color: var(--text-light);
    font-size: 16px;
    margin-bottom: 15px;
    line-height: 1.6;
}

.quiz-answer-area {
    color: var(--text-light);
    font-size: 16px;
    line-height: 2.2;
}

.answer-prefix {
    color: var(--text-muted);
}

.answer-text {
    color: var(--text-light);
}

.answer-slot {
    display: inline-block;
    min-width: 2em;
    padding: 0 6px;
    margin: 0 2px;
    border-radius: 4px;
    text-align: center;
    vertical-align: baseline;
    line-height: inherit;
    transition: all 0.2s;
}

.answer-slot.empty {
    background: rgba(100, 100, 100, 0.4);
    border-bottom: 2px dashed rgba(200, 200, 200, 0.6);
    border-top: none;
    border-left: none;
    border-right: none;
    color: transparent;
    min-width: 2em;
}

.answer-slot.empty::before {
    content: '　　';
    line-height: inherit;
}

.answer-slot.filled {
    color: white;
    cursor: pointer;
    border: none;
    border-bottom: 2px solid transparent;
}

.answer-slot.filled:hover {
    filter: brightness(1.2);
}

.answer-slot.drag-over {
    border-color: var(--accent-color) !important;
    background: rgba(212, 175, 55, 0.3) !important;
}

.answer-slot.wrong {
    animation: shake 0.5s;
    border-color: #e74c3c !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 答题操作按钮 */
#quiz-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(139, 69, 19, 0.3);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
}

/* 提交按钮提示文字 */
.submit-hint {
    font-size: 12px;
    color: #888;
    max-width: 300px;
    line-height: 1.4;
    text-align: right;
}

.quiz-action-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.quiz-action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 115, 85, 0.4);
}

.quiz-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 底部对话框 */
#quiz-dialogue-panel {
    padding: 15px 20px;
    background: rgba(10, 10, 20, 0.95);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    margin-top: 15px;
}

#quiz-dialogue-text {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

/* 答题Toast */
.quiz-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 40px;
    border-radius: 12px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.quiz-toast.show {
    opacity: 1;
    visibility: visible;
}

.quiz-toast.success {
    background: rgba(39, 174, 96, 0.95);
    border: 2px solid #27ae60;
}

.quiz-toast.error {
    background: rgba(231, 76, 60, 0.95);
    border: 2px solid #e74c3c;
}

.quiz-toast.info {
    background: rgba(52, 152, 219, 0.95);
    border: 2px solid #3498db;
}

#quiz-toast-text {
    color: white;
    font-size: 18px;
    text-align: center;
}

/* 谜题Toast提示 - 居中弹出 */
.puzzle-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 30, 0.95);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 20px 40px;
    z-index: 10000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.puzzle-toast.show {
    opacity: 1;
    visibility: visible;
}

#puzzle-toast-text {
    color: var(--text-light);
    font-size: 18px;
    text-align: center;
    line-height: 1.6;
}

/* 线索选择弹窗 */
.clue-select-modal {
    width: 750px;
    max-height: 80vh;
}

#clue-select-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

#clue-select-categories .category-tab {
    padding: 6px 12px;
    font-size: 12px;
}

#clue-select-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    max-height: 55vh;
    overflow-y: auto;
    padding: 10px;
}

.clue-select-hint {
    background: rgba(218, 165, 32, 0.1);
    border: 1px solid rgba(218, 165, 32, 0.3);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.clue-select-hint .hint-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.clue-select-hint .hint-text {
    flex: 1;
}

.clue-select-hint .hint-text strong {
    color: var(--gold);
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.clue-select-hint .hint-text p {
    color: var(--text-light);
    font-size: 12px;
    margin: 0;
    line-height: 1.4;
}

.clue-select-item {
    background: rgba(40, 40, 60, 0.9);
    border: 2px solid rgba(139, 115, 85, 0.3);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.clue-select-item:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
}

.clue-select-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.clue-select-item.already-added {
    border-color: var(--success);
    opacity: 0.6;
}

.clue-select-item.valid-clue {
    border-color: var(--gold);
    background: rgba(218, 165, 32, 0.1);
    box-shadow: 0 0 15px rgba(218, 165, 32, 0.2);
}

.clue-select-item.valid-clue:hover {
    background: rgba(218, 165, 32, 0.15);
    box-shadow: 0 0 20px rgba(218, 165, 32, 0.3);
    transform: translateY(-3px);
}

.clue-select-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}

.valid-clue-icon {
    color: var(--gold);
    font-size: 14px;
    margin-left: 5px;
    animation: sparkle 2s infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.clue-select-item-name {
    color: var(--text-light);
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
}

.clue-select-item-category {
    color: var(--text-muted);
    font-size: 12px;
}

.clue-select-item-desc {
    color: var(--text-light);
    font-size: 12px;
    line-height: 1.4;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(139, 115, 85, 0.2);
    max-height: 60px;
    overflow-y: auto;
}

.clue-select-item-image {
    width: 100%;
    height: 80px;
    object-fit: contain;
    border-radius: 5px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.3);
}

/* 组合成功动画 */
@keyframes combineSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 0 30px var(--gold); }
    100% { transform: scale(1); }
}

.clue-card.combine-success {
    animation: combineSuccess 0.5s ease;
}

/* 谜题解决动画 */
@keyframes puzzleSolved {
    0% { opacity: 0; transform: scale(0.8); }
    50% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.puzzle-solved-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: puzzleSolved 0.5s ease;
}

.puzzle-solved-content {
    text-align: center;
    color: var(--success);
}

.puzzle-solved-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px var(--success);
}

.puzzle-solved-content p {
    font-size: 20px;
    color: var(--text-light);
}

