/* style.css - 冒险岛单机版飞侠篇 样式表 */

:root {
    --bg-dark: #0f1016;
    --panel-bg: rgba(20, 22, 33, 0.75);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-pixel: 'Press Start 2P', monospace;
    
    /* 颜色系统 */
    --color-hp: #ff4757;
    --color-hp-glow: rgba(255, 71, 87, 0.4);
    --color-mp: #2ed573;
    --color-mp-glow: rgba(46, 213, 115, 0.4);
    --color-exp: #eccc68;
    --color-exp-glow: rgba(236, 204, 104, 0.4);
    --color-gold: #ffa502;
    --color-ap: #3742fa;
    --color-sp: #ffa502;
    
    /* 按钮颜色 */
    --btn-primary: #1e90ff;
    --btn-primary-hover: #3742fa;
    --btn-danger: #ff4757;
    --btn-danger-hover: #ff6b81;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-drag: none;
}

body {
    background-color: var(--bg-dark);
    font-family: var(--font-primary);
    color: #f1f2f6;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* 模糊背景 */
    background: radial-gradient(circle at center, #1b2030 0%, #0d0f14 100%);
}

#game-wrapper {
    position: relative;
    width: 1024px;
    height: 656px; /* 576px 游戏画布 + 80px 底部功能栏 */
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    background-color: #000;
}

#game-container {
    width: 100%;
    height: 576px; /* 固定游戏画布高度 */
}

/* 顶部状态栏 (HUD Top) */
.hud-top {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: none; /* 让鼠标事件穿透，除非点击按钮 */
}

.map-info {
    background: rgba(15, 17, 26, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid var(--panel-border);
    padding: 8px 16px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.map-icon {
    font-size: 16px;
}

#map-name {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    color: #eccc68;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.top-buttons {
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.hud-btn {
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.glass-btn {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.danger-btn:hover {
    background: rgba(255, 71, 87, 0.3);
    border-color: rgba(255, 71, 87, 0.5);
}

/* 底部 HUD 栏 */
.hud-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, rgba(10, 11, 16, 0.95), rgba(15, 17, 26, 0.85));
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 10;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.hud-player-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 160px;
}

.level-badge {
    background: linear-gradient(135deg, #f1c40f, #e67e22);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.4);
    border-radius: 8px;
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 44px;
}

.lvl-label {
    font-size: 8px;
    text-transform: uppercase;
    opacity: 0.8;
    font-weight: 800;
}

#player-level {
    font-family: var(--font-pixel);
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.player-name {
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.5px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* 进度条组 */
.hud-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    max-width: 320px;
    margin: 0 20px;
}

.bar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bar-label {
    font-family: var(--font-pixel);
    font-size: 9px;
    width: 28px;
    color: rgba(255, 255, 255, 0.6);
    text-align: right;
}

.progress-bar-container {
    height: 14px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 7px;
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

.progress-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.1s ease;
    position: relative;
}

.hp-fill {
    background: linear-gradient(to right, #ff4757, #ff6b81);
    box-shadow: 0 0 8px var(--color-hp-glow);
}

.mp-fill {
    background: linear-gradient(to right, #1e90ff, #3742fa);
    box-shadow: 0 0 8px rgba(30, 144, 255, 0.4);
}

.exp-fill {
    background: linear-gradient(to right, #ffa502, #ff7f50);
    box-shadow: 0 0 8px var(--color-exp-glow);
}

.bar-text {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 9px;
    font-weight: 800;
    line-height: 12px;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8), -1px -1px 1px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

/* 右侧操作和快捷槽 */
.hud-actions-slots {
    display: flex;
    align-items: center;
    gap: 16px;
}

.quick-slots {
    display: flex;
    gap: 6px;
}

.slot-item {
    position: relative;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.05);
    transition: all 0.1s ease;
}

.slot-item:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.key-cap {
    position: absolute;
    top: -6px;
    left: -4px;
    background: #2f3542;
    border: 1px solid #747d8c;
    border-radius: 3px;
    color: #f1f2f6;
    font-size: 8px;
    font-weight: 800;
    padding: 1px 3px;
    min-width: 14px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    font-family: var(--font-primary);
}

.slot-icon {
    font-size: 16px;
    margin-bottom: 2px;
}

.slot-label {
    font-size: 8px;
    opacity: 0.6;
    font-weight: 600;
}

.slot-count {
    position: absolute;
    bottom: 2px;
    right: 3px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 8px;
    font-family: var(--font-pixel);
    padding: 1px 3px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.2);
}

.cooldown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    height: 0%; /* 动态控制高度 */
    transition: height 0.1s linear;
    pointer-events: none;
}

/* 菜单按钮 */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.menu-btn {
    border: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 4px 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.1s ease;
    width: 68px;
}

.menu-btn:hover {
    background: var(--btn-primary);
    border-color: rgba(255,255,255,0.2);
}

/* 玻璃模态面板 (Game Panels) */
.glass-panel {
    position: absolute;
    background: var(--panel-bg);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: var(--panel-glow);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    pointer-events: auto;
}

.game-panel {
    width: 320px;
    height: 400px;
    top: 40px;
    transform: scale(1);
    opacity: 1;
}

.game-panel.hidden {
    transform: scale(0.95);
    opacity: 0;
    pointer-events: none;
}

#panel-stats { left: 40px; }
#panel-inventory { left: 380px; }
#panel-skills { left: 660px; }

.panel-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
}

.close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.1s ease;
}

.close-btn:hover {
    color: #fff;
}

.panel-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px 18px;
}

/* 隐藏滚动条 */
.panel-content::-webkit-scrollbar {
    width: 6px;
}
.panel-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* 属性面板明细 */
.stat-summary {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.stat-avatar {
    font-size: 28px;
    background: rgba(255, 255, 255, 0.05);
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05);
}

.stat-basic h4 {
    font-size: 14px;
    font-weight: 800;
}

.stat-basic .subtitle {
    font-size: 10px;
    opacity: 0.6;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.stat-row span {
    color: rgba(255, 255, 255, 0.7);
}

.stat-row strong {
    font-family: var(--font-primary);
    font-weight: 800;
}

.meso-color {
    color: var(--color-gold);
    font-weight: bold;
}

.ap-color {
    color: #ff9f43;
    font-weight: bold;
}

hr {
    border: none;
    border-bottom: 1px solid var(--panel-border);
    margin: 10px 0;
}

.stat-alloc div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-stat-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.1s ease;
}

.add-stat-btn:hover {
    background: var(--btn-primary);
    border-color: #fff;
    transform: scale(1.1);
}

.highlight-row {
    background: rgba(255, 159, 67, 0.1);
    padding: 8px;
    border-radius: 6px;
    border: 1px dashed rgba(255, 159, 67, 0.3);
}

/* 背包面板选项卡 */
.panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--panel-border);
    padding: 0 18px;
    background: rgba(0,0,0,0.15);
}

.tab-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 10px 16px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn.active {
    color: #fff;
    border-bottom-color: var(--btn-primary);
}

.tab-btn:hover {
    color: #fff;
}

.inventory-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.equipped-view h4, .bag-view h4 {
    font-size: 11px;
    opacity: 0.5;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.equip-grid {
    display: flex;
    gap: 12px;
}

.equip-slot {
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.equip-slot:hover {
    border-color: var(--btn-primary);
    background: rgba(30, 144, 255, 0.1);
}

.equip-slot.equipped::after {
    content: "E";
    position: absolute;
    bottom: -3px;
    right: -3px;
    background: #2ed573;
    color: #fff;
    font-size: 7px;
    font-weight: bold;
    padding: 1px 3px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.2);
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.grid-item {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    cursor: pointer;
    position: relative;
    transition: all 0.1s ease;
}

.grid-item:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
}

.grid-item .item-qty {
    position: absolute;
    bottom: 2px;
    right: 3px;
    color: #fff;
    font-size: 8px;
    font-family: var(--font-pixel);
    background: rgba(0,0,0,0.6);
    padding: 1px 2px;
    border-radius: 2px;
}

.hidden {
    display: none !important;
}

/* 技能面板列表 */
.skill-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skill-item {
    display: flex;
    gap: 14px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.skill-item:hover {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
}

.skill-icon {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    flex-shrink: 0;
}

.skill-info {
    flex-grow: 1;
}

.skill-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.skill-name {
    font-size: 13px;
    font-weight: 800;
}

.skill-lvl {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.skill-desc {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
    margin-bottom: 6px;
}

.skill-upgrade-row {
    display: flex;
    justify-content: flex-end;
}

.btn-upgrade-skill {
    background: rgba(30, 144, 255, 0.2);
    border: 1px solid rgba(30, 144, 255, 0.4);
    color: #70a1ff;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-upgrade-skill:hover {
    background: var(--btn-primary);
    color: #fff;
    border-color: #fff;
}

.skill-footer {
    border-top: 1px solid var(--panel-border);
    margin-top: 14px;
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.sp-color {
    color: #ffa502;
    font-weight: bold;
}

/* 欢迎和说明遮罩层 */
.glass-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 16, 0.6);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.welcome-card {
    width: 500px;
    height: auto;
    padding: 24px 30px;
    text-align: center;
    border-radius: 20px;
    transform: scale(1);
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}

.welcome-card h2 {
    font-size: 20px;
    font-weight: 800;
    color: #ffa502;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.welcome-intro {
    font-size: 12px;
    line-height: 1.6;
    color: rgba(255,255,255,0.8);
    margin-bottom: 18px;
}

.welcome-controls {
    text-align: left;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 20px;
}

.welcome-controls h4 {
    font-size: 12px;
    margin-bottom: 8px;
    color: #ffa502;
}

.welcome-controls ul {
    list-style: none;
    font-size: 11px;
    line-height: 1.6;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
}

.welcome-controls li strong {
    color: #fff;
}

.play-now-btn {
    background: linear-gradient(135deg, #ffa502, #ff7f50);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 800;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 127, 80, 0.4);
    transition: all 0.2s ease;
}

.play-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 127, 80, 0.6);
}

/* 物品提示窗 (Tooltips) */
.item-tooltip {
    position: fixed;
    background: rgba(10, 11, 16, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 8px 12px;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    max-width: 200px;
}

.item-tooltip h4 {
    font-size: 12px;
    font-weight: bold;
    color: #ffa502;
    margin-bottom: 4px;
}

.item-tooltip p {
    font-size: 9px;
    color: #fff;
    opacity: 0.8;
    line-height: 1.4;
}

.item-tooltip .tool-stat {
    color: #2ed573;
    font-weight: bold;
    margin-top: 4px;
    font-size: 10px;
}

/* 漂浮通知 Toast */
#toast-container {
    position: absolute;
    top: 68px;
    left: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 1000;
    pointer-events: none;
}

.toast {
    background: rgba(30, 200, 100, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    animation: slideIn 0.2s ease-out, fadeOut 0.3s ease-in 2.5s forwards;
}

.toast.toast-danger {
    background: rgba(220, 50, 50, 0.85);
}

.toast.toast-info {
    background: rgba(30, 150, 250, 0.85);
}

@keyframes slideIn {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}
