/* 日式卡通风格A-RPG游戏样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'SimHei', sans-serif;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 70%, #90EE90 100%);
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ui-panel {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid #FF69B4;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(255, 105, 180, 0.3);
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* 主菜单样式 */
#main-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    min-width: 300px;
}

#main-menu h1 {
    color: #FF69B4;
    font-size: 48px;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(255, 105, 180, 0.5);
    font-weight: bold;
}

#main-menu button {
    display: block;
    width: 200px;
    margin: 15px auto;
    padding: 12px 24px;
    font-size: 18px;
    background: linear-gradient(135deg, #FF69B4 0%, #FFB6C1 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
}

#main-menu button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 105, 180, 0.6);
}

/* 游戏内UI */
#game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 20px;
}

#player-stats {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 25px;
    border-radius: 15px;
    border: 2px solid #FF69B4;
    display: flex;
    gap: 20px;
    font-size: 16px;
    color: #333;
}

#player-stats span {
    font-weight: bold;
}

#minimap {
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #FF69B4;
    border-radius: 50%;
}

/* 对话框 */
#dialog-box {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid #FF69B4;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

#dialog-portrait {
    width: 120px;
    height: 150px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #FFB6C1 0%, #FF69B4 100%);
    border-radius: 15px;
    border: 2px solid #FF69B4;
    overflow: hidden;
}

#dialog-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#dialog-name {
    font-size: 20px;
    font-weight: bold;
    color: #FF69B4;
    text-shadow: 1px 1px 2px rgba(255, 105, 180, 0.3);
}

#dialog-text {
    flex: 1;
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    min-height: 60px;
}

#dialog-next {
    padding: 10px 20px;
    background: linear-gradient(135deg, #FF69B4 0%, #FFB6C1 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

#dialog-next:hover {
    transform: scale(1.05);
}

/* 脚本编辑器 */
#script-editor {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    overflow: hidden;
}

#script-editor h2 {
    color: #FF69B4;
    margin-bottom: 20px;
    text-align: center;
    font-size: 32px;
}

#editor-container {
    display: flex;
    gap: 20px;
    height: calc(100% - 80px);
}

#npc-list {
    width: 300px;
    background: rgba(255, 182, 193, 0.3);
    border-radius: 15px;
    padding: 15px;
    overflow-y: auto;
}

#npc-list h3 {
    color: #FF69B4;
    margin-bottom: 15px;
}

#npc-list-items {
    list-style: none;
    margin-bottom: 15px;
}

#npc-list-items li {
    padding: 10px;
    margin: 5px 0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

#npc-list-items li:hover {
    border-color: #FF69B4;
    transform: translateX(5px);
}

#npc-list-items li.active {
    background: #FFB6C1;
    border-color: #FF69B4;
}

#btn-add-npc {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #FF69B4 0%, #FFB6C1 100%);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 16px;
}

#editor-form {
    flex: 1;
    background: rgba(255, 182, 193, 0.3);
    border-radius: 15px;
    padding: 20px;
    overflow-y: auto;
}

#editor-form h3 {
    color: #FF69B4;
    margin-bottom: 20px;
}

#npc-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#npc-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #333;
    font-weight: bold;
}

#npc-form input,
#npc-form select,
#npc-form textarea {
    padding: 10px;
    border: 2px solid #FFB6C1;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
}

#npc-form input:focus,
#npc-form select:focus,
#npc-form textarea:focus {
    outline: none;
    border-color: #FF69B4;
}

#npc-form textarea {
    resize: vertical;
    min-height: 80px;
}

#form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

#btn-save-npc,
#btn-delete-npc {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

#btn-save-npc {
    background: linear-gradient(135deg, #98FB98 0%, #90EE90 100%);
    color: #333;
}

#btn-delete-npc {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
    color: white;
}

#btn-save-npc:hover,
#btn-delete-npc:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#btn-close-editor {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #FF69B4 0%, #FFB6C1 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #main-menu h1 {
        font-size: 32px;
    }
    
    #editor-container {
        flex-direction: column;
    }
    
    #npc-list {
        width: 100%;
        height: 200px;
    }
    
    #dialog-box {
        flex-direction: column;
        width: 90%;
    }
    
    #hud {
        flex-direction: column;
        gap: 10px;
    }
}

/* 战斗界面 */
#combat-ui {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    background: rgba(255, 240, 245, 0.98);
    border: 4px solid #FF69B4;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(255, 105, 180, 0.5);
}

#combat-enemies {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    min-height: 150px;
}

.enemy-display {
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 15px;
    border: 2px solid #FFB6C1;
    min-width: 120px;
}

.enemy-sprite {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #DDA0DD 0%, #9370DB 100%);
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.enemy-hp {
    width: 100%;
    height: 10px;
    background: #eee;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 5px;
}

.enemy-hp-bar {
    height: 100%;
    background: linear-gradient(90deg, #FF6B6B 0%, #FF8E8E 100%);
    transition: width 0.3s ease;
}

#combat-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

#combat-actions button {
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#btn-attack {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
    color: white;
}

#btn-skill {
    background: linear-gradient(135deg, #4ECDC4 0%, #45B7AA 100%);
    color: white;
}

#btn-flee {
    background: linear-gradient(135deg, #FFE66D 0%, #FFD93D 100%);
    color: #333;
}

#combat-actions button:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

#combat-log {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid #FFB6C1;
    border-radius: 10px;
    padding: 15px;
    max-height: 150px;
    overflow-y: auto;
    font-size: 14px;
    color: #666;
}

#combat-log p {
    margin: 5px 0;
    padding: 5px;
    border-bottom: 1px dashed #FFB6C1;
}

/* 任务列表 */
#quest-list {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    background: rgba(255, 255, 255, 0.98);
    border: 4px solid #FF69B4;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(255, 105, 180, 0.5);
}

#quest-list h3 {
    color: #FF69B4;
    text-align: center;
    margin-bottom: 20px;
    font-size: 28px;
}

#quest-items {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

#quest-items li {
    background: linear-gradient(135deg, #FFF0F5 0%, #FFE4E9 100%);
    border: 2px solid #FFB6C1;
    border-radius: 15px;
    padding: 15px;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

#quest-items li:hover {
    transform: translateX(10px);
    border-color: #FF69B4;
}

.quest-name {
    font-weight: bold;
    color: #FF69B4;
    font-size: 18px;
    margin-bottom: 5px;
}

.quest-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.quest-progress {
    font-size: 12px;
    color: #999;
}

#btn-close-quests {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #FF69B4 0%, #FFB6C1 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#btn-close-quests:hover {
    transform: scale(1.05);
}

/* 响应式调整 */
@media (max-width: 768px) {
    #combat-ui {
        width: 90%;
        padding: 20px;
    }
    
    #combat-enemies {
        flex-wrap: wrap;
    }
    
    #quest-list {
        width: 90%;
    }
}
