/* ========================================
   哈基蜂 - 零号大坝
   竖屏冒险游戏样式
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=ZCOOL+KuaiLe&family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
    --bg-primary: #0a0e14;
    --bg-secondary: #141b24;
    --bg-tertiary: #1e2832;
    --accent-primary: #f0b429;
    --accent-secondary: #ff6b35;
    --accent-danger: #e63946;
    --accent-success: #06d6a0;
    --text-primary: #e8e8e8;
    --text-secondary: #8a9199;
    --text-muted: #5a6370;
    --rarity-red: #ff2d55;
    --rarity-gold: #ffd700;
    --rarity-purple: #af52de;
    --rarity-blue: #007aff;
    --rarity-green: #34c759;
    --rarity-white: #c7c7cc;
    --scene-height: 45vh;
    --interaction-height: 55vh;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#game-container {
    width: 100%;
    height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
    background: linear-gradient(180deg, #0d1117 0%, #161b22 100%);
}

#scene-area {
    height: var(--scene-height);
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid var(--accent-primary);
    box-shadow: 0 4px 20px rgba(240, 180, 41, 0.2);
}

#scene-background {
    width: 100%;
    height: 100%;
    position: relative;
    background: linear-gradient(180deg, #1a1f2e 0%, #0f1419 100%);
}

#scene-layers { position: absolute; width: 100%; height: 100%; overflow: hidden; }

.parallax-layer { position: absolute; width: 200%; height: 100%; background-repeat: repeat-x; }

.layer-far {
    background: linear-gradient(0deg, transparent 60%, #2d3748 60%, #2d3748 65%, transparent 65%),
                linear-gradient(0deg, transparent 50%, #374151 50%, #374151 52%, transparent 52%);
    opacity: 0.3;
    animation: scroll-slow 60s linear infinite;
}

.layer-mid {
    background:
        radial-gradient(ellipse 80px 120px at 10% 80%, #3d4f5f 0%, transparent 70%),
        radial-gradient(ellipse 60px 100px at 30% 75%, #4a5568 0%, transparent 70%),
        radial-gradient(ellipse 100px 140px at 50% 85%, #2d3748 0%, transparent 70%),
        radial-gradient(ellipse 70px 90px at 70% 78%, #3d4f5f 0%, transparent 70%),
        radial-gradient(ellipse 90px 110px at 90% 82%, #4a5568 0%, transparent 70%);
    opacity: 0.5;
    animation: scroll-medium 40s linear infinite;
}

.layer-near { background: linear-gradient(0deg, #1a202c 0%, #1a202c 15%, transparent 15%); opacity: 0.8; }

@keyframes scroll-slow { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes scroll-medium { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

#location-name {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'ZCOOL KuaiLe', cursive;
    font-size: 1.4rem;
    color: var(--accent-primary);
    text-shadow: 0 0 10px rgba(240, 180, 41, 0.5), 0 2px 4px rgba(0,0,0,0.8);
    padding: 8px 20px;
    background: rgba(0,0,0,0.5);
    border-radius: 20px;
    border: 1px solid var(--accent-primary);
    z-index: 10;
}

#scene-content { position: absolute; bottom: 20%; left: 0; right: 0; height: 50%; display: flex; align-items: flex-end; padding: 0 20px; }
#characters-container { width: 100%; height: 100%; position: relative; display: flex; align-items: flex-end; }
.character { display: flex; flex-direction: column; align-items: center; transition: transform var(--transition-slow); }
#player-character { position: absolute; left: 10%; bottom: 0; z-index: 5; }
.character-name { font-size: 0.75rem; color: var(--text-primary); background: rgba(0,0,0,0.7); padding: 2px 8px; border-radius: 10px; margin-top: 5px; white-space: nowrap; }

.haji-bee { width: 60px; height: 80px; position: relative; animation: float 2s ease-in-out infinite; }
.bee-body { position: relative; width: 100%; height: 100%; }

.bee-head {
    position: absolute;
    top: 10px; left: 50%;
    transform: translateX(-50%);
    width: 35px; height: 30px;
    background: linear-gradient(135deg, #ffd93d 0%, #f0b429 100%);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.antenna { position: absolute; width: 3px; height: 15px; background: #333; border-radius: 3px; top: -12px; }
.antenna.left { left: 8px; transform: rotate(-20deg); }
.antenna.right { right: 8px; transform: rotate(20deg); }
.antenna::after { content: ''; position: absolute; top: -5px; left: -2px; width: 7px; height: 7px; background: #333; border-radius: 50%; }

.eye { position: absolute; width: 10px; height: 12px; background: #1a1a2e; border-radius: 50%; top: 8px; animation: blink 3s infinite; }
.eye.left { left: 6px; }
.eye.right { right: 6px; }
.eye::after { content: ''; position: absolute; width: 4px; height: 4px; background: white; border-radius: 50%; top: 2px; left: 2px; }

.bee-abdomen {
    position: absolute;
    top: 35px; left: 50%;
    transform: translateX(-50%);
    width: 40px; height: 45px;
    background: linear-gradient(180deg, #ffd93d 0%, #f0b429 100%);
    border-radius: 50% 50% 45% 45%;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.stripe { width: 100%; height: 8px; background: #1a1a2e; margin-top: 8px; }
.stripe:first-child { margin-top: 5px; }

.bee-wing { position: absolute; width: 25px; height: 35px; background: rgba(200, 220, 255, 0.4); border-radius: 50%; top: 25px; border: 1px solid rgba(255,255,255,0.3); animation: wing-flap 0.1s ease-in-out infinite alternate; }
.bee-wing.left { left: -5px; transform-origin: right center; animation-delay: 0s; }
.bee-wing.right { right: -5px; transform-origin: left center; animation-delay: 0.05s; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes wing-flap { 0% { transform: scaleX(1) rotate(-10deg); } 100% { transform: scaleX(0.8) rotate(10deg); } }
@keyframes blink { 0%, 90%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }

#player-character.moving { animation: move-right 0.8s ease-out forwards, float 2s ease-in-out infinite; }
@keyframes move-right { 0% { left: 10%; } 100% { left: 80%; } }

#npc-container { position: absolute; right: 15%; bottom: 0; display: flex; gap: 20px; }
.npc-character { display: flex; flex-direction: column; align-items: center; animation: appear 0.5s ease-out; }
@keyframes appear { 0% { opacity: 0; transform: scale(0.5); } 100% { opacity: 1; transform: scale(1); } }

.enemy-sprite { width: 50px; height: 65px; position: relative; }
.enemy-body { width: 100%; height: 100%; background: linear-gradient(180deg, #4a5568 0%, #2d3748 100%); border-radius: 10px 10px 5px 5px; position: relative; }
.enemy-body::before { content: ''; position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 30px; height: 25px; background: #1a202c; border-radius: 50%; }
.enemy-body::after { content: ''; position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 20px; height: 4px; background: #e63946; box-shadow: 0 0 10px #e63946; }

#event-visual { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.danger-flash { animation: danger-pulse 0.5s ease-out; }
@keyframes danger-pulse { 0%, 100% { background: transparent; } 50% { background: rgba(230, 57, 70, 0.3); } }
.success-flash { animation: success-pulse 0.5s ease-out; }
@keyframes success-pulse { 0%, 100% { background: transparent; } 50% { background: rgba(6, 214, 160, 0.3); } }

#hud { position: absolute; top: 0; left: 0; right: 0; padding: 10px 15px; display: flex; justify-content: space-between; background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%); z-index: 15; }
.hud-left, .hud-right { display: flex; gap: 15px; }
.hud-item { display: flex; align-items: center; gap: 5px; font-size: 0.85rem; background: rgba(0,0,0,0.5); padding: 5px 10px; border-radius: 15px; border: 1px solid rgba(255,255,255,0.1); }
.hud-icon { font-size: 1rem; }
#inventory-btn { cursor: pointer; transition: all var(--transition-fast); }
#inventory-btn:hover { background: rgba(240, 180, 41, 0.2); border-color: var(--accent-primary); }

#interaction-area { height: var(--interaction-height); display: flex; flex-direction: column; background: linear-gradient(180deg, #0d1117 0%, #161b22 50%, #1a1f26 100%); padding: 15px; }

#event-panel { flex: 1; background: linear-gradient(135deg, rgba(30,40,50,0.9) 0%, rgba(20,27,36,0.9) 100%); border-radius: 15px; padding: 20px; margin-bottom: 15px; border: 1px solid rgba(240,180,41,0.2); box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 4px 20px rgba(0,0,0,0.3); overflow-y: auto; }

#event-title { font-family: 'ZCOOL KuaiLe', cursive; font-size: 1.3rem; color: var(--accent-primary); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
#event-title::before { content: ''; display: inline-block; width: 4px; height: 20px; background: var(--accent-primary); border-radius: 2px; }
#event-description { font-size: 0.95rem; line-height: 1.7; color: var(--text-secondary); }

#action-panel { flex-shrink: 0; }
#action-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.action-btn { background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 15px 12px; color: var(--text-primary); font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: all var(--transition-fast); display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.action-btn:hover { background: linear-gradient(135deg, #3d4f5f 0%, #2d3748 100%); border-color: var(--accent-primary); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(240,180,41,0.2); }
.action-btn:active { transform: translateY(0); }
.action-btn.primary { background: linear-gradient(135deg, var(--accent-primary) 0%, #d4a012 100%); color: #1a1a2e; font-weight: 700; grid-column: span 2; }
.action-btn.primary:hover { box-shadow: 0 4px 20px rgba(240,180,41,0.4); }
.action-btn.danger { background: linear-gradient(135deg, #c53030 0%, #9b2c2c 100%); border-color: var(--accent-danger); }
.action-btn.danger:hover { box-shadow: 0 4px 15px rgba(230,57,70,0.3); }
.action-btn-text { font-size: 0.85rem; }

#navigation-panel { background: linear-gradient(135deg, rgba(30,40,50,0.95) 0%, rgba(20,27,36,0.95) 100%); border-radius: 15px; padding: 15px; border: 1px solid rgba(240,180,41,0.3); }
#navigation-panel.hidden { display: none; }
.nav-title { font-family: 'ZCOOL KuaiLe', cursive; font-size: 1.1rem; color: var(--accent-primary); margin-bottom: 12px; text-align: center; }
#nav-buttons { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; }
.nav-btn { background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 12px 15px; color: var(--text-primary); font-size: 0.9rem; cursor: pointer; transition: all var(--transition-fast); display: flex; justify-content: space-between; align-items: center; }
.nav-btn:hover { background: linear-gradient(135deg, #3d4f5f 0%, #2d3748 100%); border-color: var(--accent-primary); }
.nav-distance { font-size: 0.75rem; color: var(--text-muted); background: rgba(0,0,0,0.3); padding: 2px 8px; border-radius: 10px; }
.nav-btn.extraction { border-color: var(--accent-success); background: linear-gradient(135deg, rgba(6,214,160,0.2) 0%, rgba(6,214,160,0.1) 100%); }
.nav-btn.extraction:hover { box-shadow: 0 0 15px rgba(6,214,160,0.3); }

#start-screen, #end-screen { position: absolute; inset: 0; background: linear-gradient(180deg, #0a0e14 0%, #141b24 50%, #0a0e14 100%); display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 100; padding: 40px 20px; }
#start-screen.hidden, #end-screen.hidden { display: none; }
.title-container { text-align: center; margin-bottom: 40px; }
.game-title { font-family: 'ZCOOL KuaiLe', cursive; font-size: 3rem; color: var(--accent-primary); text-shadow: 0 0 30px rgba(240,180,41,0.5), 0 4px 8px rgba(0,0,0,0.8); letter-spacing: 5px; animation: title-glow 2s ease-in-out infinite alternate; }
@keyframes title-glow { 0% { text-shadow: 0 0 20px rgba(240,180,41,0.3), 0 4px 8px rgba(0,0,0,0.8); } 100% { text-shadow: 0 0 40px rgba(240,180,41,0.6), 0 4px 8px rgba(0,0,0,0.8); } }
.game-subtitle { font-size: 1.2rem; color: var(--text-secondary); margin-top: 10px; letter-spacing: 3px; }
.start-content { text-align: center; max-width: 320px; }
.story-intro { font-size: 0.95rem; line-height: 1.8; color: var(--text-secondary); margin-bottom: 40px; }
.main-btn { background: linear-gradient(135deg, var(--accent-primary) 0%, #d4a012 100%); border: none; border-radius: 30px; padding: 18px 50px; color: #1a1a2e; font-family: 'ZCOOL KuaiLe', cursive; font-size: 1.3rem; cursor: pointer; transition: all var(--transition-normal); box-shadow: 0 4px 20px rgba(240,180,41,0.4); }
.main-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(240,180,41,0.6); }
.main-btn:active { transform: translateY(0); }

.end-content { text-align: center; }
#end-title { font-family: 'ZCOOL KuaiLe', cursive; font-size: 2.2rem; margin-bottom: 30px; }
#end-title.victory { color: var(--accent-success); text-shadow: 0 0 30px rgba(6,214,160,0.5); }
#end-title.defeat { color: var(--accent-danger); text-shadow: 0 0 30px rgba(230,57,70,0.5); }
#end-stats { background: rgba(30,40,50,0.8); border-radius: 15px; padding: 20px 30px; margin-bottom: 30px; text-align: left; }
.stat-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 0.95rem; }
.stat-item:last-child { border-bottom: none; }
.stat-label { color: var(--text-secondary); }
.stat-value { color: var(--accent-primary); font-weight: 600; }

.modal { position: absolute; inset: 0; background: rgba(0,0,0,0.85); display: flex; justify-content: center; align-items: center; z-index: 50; padding: 20px; animation: fade-in 0.2s ease-out; }
.modal.hidden { display: none; }
@keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } }
.modal-content { background: linear-gradient(135deg, #1e2832 0%, #141b24 100%); border-radius: 20px; width: 100%; max-width: 400px; max-height: 80vh; overflow: hidden; border: 1px solid rgba(240,180,41,0.3); box-shadow: 0 10px 40px rgba(0,0,0,0.5); animation: slide-up 0.3s ease-out; }
@keyframes slide-up { 0% { transform: translateY(20px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.modal-header h3 { font-family: 'ZCOOL KuaiLe', cursive; font-size: 1.2rem; color: var(--accent-primary); }
.close-btn { background: none; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; padding: 5px; line-height: 1; transition: color var(--transition-fast); }
.close-btn:hover { color: var(--text-primary); }

#inventory-list { padding: 15px; max-height: 60vh; overflow-y: auto; }
.inventory-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: rgba(0,0,0,0.3); border-radius: 10px; margin-bottom: 8px; border-left: 4px solid; }
.inventory-item.rarity-red { border-color: var(--rarity-red); }
.inventory-item.rarity-gold { border-color: var(--rarity-gold); }
.inventory-item.rarity-purple { border-color: var(--rarity-purple); }
.inventory-item.rarity-blue { border-color: var(--rarity-blue); }
.inventory-item.rarity-green { border-color: var(--rarity-green); }
.inventory-item.rarity-white { border-color: var(--rarity-white); }
.item-icon { font-size: 1.5rem; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.05); border-radius: 8px; }
.item-info { flex: 1; }
.item-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.item-rarity { font-size: 0.75rem; color: var(--text-muted); }
.empty-inventory { text-align: center; color: var(--text-muted); padding: 40px 20px; }

.map-modal-content { max-width: 450px; }
#map-display { padding: 20px; min-height: 300px; position: relative; }
.map-node { position: absolute; width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%); border: 2px solid rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 0.65rem; text-align: center; padding: 5px; cursor: pointer; transition: all var(--transition-fast); }
.map-node:hover { border-color: var(--accent-primary); transform: scale(1.1); }
.map-node.current { border-color: var(--accent-primary); background: linear-gradient(135deg, rgba(240,180,41,0.3) 0%, rgba(240,180,41,0.1) 100%); box-shadow: 0 0 15px rgba(240,180,41,0.5); }
.map-node.extraction { border-color: var(--accent-success); background: linear-gradient(135deg, rgba(6,214,160,0.3) 0%, rgba(6,214,160,0.1) 100%); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: rgba(240,180,41,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(240,180,41,0.5); }

@media (max-height: 700px) {
    :root { --scene-height: 40vh; --interaction-height: 60vh; }
    .game-title { font-size: 2.5rem; }
    #event-panel { padding: 15px; }
}

@media (min-width: 481px) {
    #game-container { border-left: 1px solid rgba(240,180,41,0.2); border-right: 1px solid rgba(240,180,41,0.2); }
}
