/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #f0f0f0;
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

/* 标题栏 */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(90deg, #2c003e 0%, #4a1e5d 100%);
    border-bottom: 3px solid #9d4edd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.game-header h1 {
    font-family: 'Noto Serif SC', serif;
    font-size: 2.2rem;
    background: linear-gradient(45deg, #ff9fe5, #9d4edd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-controls {
    display: flex;
    gap: 12px;
}

.header-controls button {
    background: rgba(157, 78, 221, 0.3);
    border: 1px solid #9d4edd;
    color: #f0f0f0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-controls button:hover {
    background: rgba(157, 78, 221, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(157, 78, 221, 0.4);
}

/* 主游戏区域 */
.game-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 左侧视觉区域 */
.visual-area {
    flex: 7;
    position: relative;
    overflow: hidden;
    background: #0c0c14;
}

.character-container {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 75%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 10;
}

.character {
    position: relative;
    height: 95%;
    margin: 0 20px;
    transition: all 0.5s ease;
    opacity: 0.9;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.character.active {
    opacity: 1;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
}

.character-image {
    max-height: 100%;
    max-width: 80%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
    border-radius: 10px;
    display: block;
}

.character-name {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44, 0, 62, 0.8);
    color: #ff9fe5;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 1.1rem;
    white-space: nowrap;
    border: 1px solid #9d4edd;
}

.scene-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 1s ease;
    z-index: 1;
}

/* 对话框 */
.dialogue-box {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(20, 10, 30, 0.95);
    border-top: 3px solid #9d4edd;
    padding: 20px;
    z-index: 100;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.speaker-name {
    color: #ff9fe5;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid rgba(157, 78, 221, 0.5);
}

.dialogue-text {
    font-size: 1.1rem;
    line-height: 1.8;
    min-height: 80px;
    margin-bottom: 15px;
}

.dream-text {
    font-style: italic;
    color: #8a9fff;
    border-left: 3px solid #8a9fff;
    padding-left: 15px;
    margin: 10px 0;
    background: rgba(138, 159, 255, 0.1);
    padding: 10px 15px;
    border-radius: 0 10px 10px 0;
}

.analysis-text {
    font-family: 'Courier Prime', monospace;
    color: #4dff88;
    background: rgba(0, 20, 10, 0.7);
    padding: 10px;
    border-radius: 5px;
    border-left: 3px solid #4dff88;
    margin: 10px 0;
}

.dialogue-controls {
    display: flex;
    justify-content: flex-end;
}

.continue-btn {
    background: linear-gradient(45deg, #9d4edd, #ff9fe5);
    border: none;
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(157, 78, 221, 0.5);
}

/* 右侧状态面板 */
.status-panel {
    flex: 3;
    background: rgba(15, 10, 25, 0.9);
    padding: 20px;
    overflow-y: auto;
    border-left: 2px solid #4a1e5d;
    min-width: 300px;
}

.status-card {
    background: rgba(30, 15, 45, 0.8);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(157, 78, 221, 0.3);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.status-card h3 {
    color: #ff9fe5;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-item {
    margin-bottom: 15px;
}

.status-item span {
    display: block;
    margin-bottom: 5px;
    color: #b8b8d0;
}

.status-bar {
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.status-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

#mentalHealthBar {
    background: linear-gradient(90deg, #ff4757, #ff9ff3);
    width: 100%;
}

#trustBar {
    background: linear-gradient(90deg, #2ed573, #7bed9f);
    width: 80%;
}

.status-value {
    position: absolute;
    right: 10px;
    top: 0;
    line-height: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

.status-value-large {
    font-size: 2rem;
    text-align: center;
    color: #ff9fe5;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 159, 229, 0.5);
}

/* 线索样式 */
.clues-container {
    max-height: 200px;
    overflow-y: auto;
}

.clue-item {
    background: rgba(40, 20, 60, 0.7);
    border-left: 3px solid #9d4edd;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 0 5px 5px 0;
    transition: all 0.3s ease;
}

.clue-item:hover {
    background: rgba(60, 30, 80, 0.9);
    transform: translateX(5px);
}

.clue-item.new {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { border-left-color: #9d4edd; }
    50% { border-left-color: #ff9fe5; }
    100% { border-left-color: #9d4edd; }
}

/* 物品栏 */
.inventory {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 2rem;
}

.inventory-item {
    width: 50px;
    height: 50px;
    background: rgba(50, 25, 75, 0.8);
    border: 2px solid #9d4edd;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ff9fe5;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.inventory-item.active {
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.7);
    border-color: #ff9fe5;
}

.inventory-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(157, 78, 221, 0.5);
}

.item-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-desc {
    background: rgba(40, 20, 60, 0.7);
    padding: 10px;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* 决策记录 */
.decision-log {
    max-height: 150px;
    overflow-y: auto;
}

.decision-entry {
    font-size: 0.9rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #b8b8d0;
}

.decision-entry:last-child {
    border-bottom: none;
}

.decision-date {
    color: #9d4edd;
    font-size: 0.8rem;
}

/* 选项区域 */
.choices-area {
    background: rgba(20, 10, 30, 0.95);
    padding: 20px;
    border-top: 3px solid #4a1e5d;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.choice-btn {
    background: linear-gradient(45deg, #2c003e, #4a1e5d);
    border: 2px solid #9d4edd;
    color: #f0f0f0;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.choice-btn:hover {
    background: linear-gradient(45deg, #4a1e5d, #6a2e8d);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(157, 78, 221, 0.4);
}

.choice-btn i {
    color: #ff9fe5;
}

/* 推理分析界面 */
.analysis-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.analysis-container {
    background: #0a0a14;
    width: 90%;
    max-width: 1000px;
    height: 80%;
    border: 3px solid #4dff88;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.analysis-header {
    background: linear-gradient(90deg, #003320, #005533);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #4dff88;
}

.analysis-header h2 {
    color: #4dff88;
    font-family: 'Courier Prime', monospace;
}

.close-analysis {
    background: transparent;
    border: none;
    color: #4dff88;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-analysis:hover {
    color: #ff9fe5;
    transform: rotate(90deg);
}

.analysis-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-family: 'Courier Prime', monospace;
    background: rgba(0, 20, 10, 0.5);
}

.hypothesis-box {
    background: rgba(0, 40, 20, 0.8);
    border: 1px solid #4dff88;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.hypothesis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.hypothesis-probability {
    background: #4dff88;
    color: #003320;
    padding: 3px 10px;
    border-radius: 15px;
    font-weight: bold;
}

.evidence-list {
    list-style-type: none;
}

.evidence-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(77, 255, 136, 0.3);
    display: flex;
    align-items: center;
}

.evidence-item::before {
    content: "▶";
    color: #4dff88;
    margin-right: 10px;
}

/* 模态窗口 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #9d4edd;
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 80%;
    overflow-y: auto;
}

.modal-content h2 {
    color: #ff9fe5;
    margin-bottom: 20px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-content {
    line-height: 1.8;
}

.help-content h3 {
    color: #ff9fe5;
    margin: 15px 0 10px;
}

.help-content ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.help-content li {
    margin-bottom: 8px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

.modal-buttons button {
    background: #9d4edd;
    border: none;
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.modal-buttons button:hover {
    background: #ff9fe5;
    transform: translateY(-2px);
}

/* 梦境特效 */
.dream-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 1s ease;
}

.dream-effect.active {
    opacity: 1;
    background: radial-gradient(circle at center, rgba(138, 159, 255, 0.1) 0%, transparent 70%);
    animation: dreamPulse 3s infinite alternate;
}

@keyframes dreamPulse {
    0% { opacity: 0.3; }
    100% { opacity: 0.7; }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .game-main {
        flex-direction: column;
    }
    
    .status-panel {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .visual-area {
        height: 60vh;
    }
}

@media (max-width: 768px) {
    .game-header h1 {
        font-size: 1.5rem;
    }
    
    .character-container {
        height: 60%;
    }
    
    .dialogue-text {
        font-size: 1rem;
    }
    
    .status-panel {
        grid-template-columns: 1fr;
    }
    
    .choices-area {
        grid-template-columns: 1fr;
        max-height: 300px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #9d4edd, #ff9fe5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #ff9fe5, #9d4edd);
}