/* TrMenu 配置生成器 - Minecraft像素风格样式 */
/* 使用 Google Blockly 实现积木编程界面 */

/* ==================== 基础变量 ==================== */
:root {
    --mc-green: #5D8C3E;
    --mc-dark-green: #3D5C28;
    --mc-brown: #8B4513;
    --mc-dark-brown: #5D3A1A;
    --mc-stone: #7F7F7F;
    --mc-dark-stone: #4A4A4A;
    --mc-dirt: #6B5344;
    --mc-grass: #7CBD6B;
    --mc-sky: #78A7FF;
    --mc-gold: #FFAA00;
    --mc-red: #FF5555;
    --mc-blue: #5555FF;
    --mc-aqua: #55FFFF;
    --mc-white: #FFFFFF;
    --mc-gray: #AAAAAA;
    --mc-dark: #1A1A1A;
    
    --slot-bg: #C6C6C6;
    --slot-border: #373737;
    --slot-highlight: #FFFFFF;
    --slot-shadow: #555555;
    
    --font-pixel: 'VT323', 'Microsoft YaHei', monospace;
}

/* ==================== 基础样式 ==================== */

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

body {
    font-family: var(--font-pixel);
    background: linear-gradient(180deg, var(--mc-sky) 0%, #4A7AB8 50%, var(--mc-grass) 50%, var(--mc-dirt) 100%);
    color: var(--mc-white);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    image-rendering: pixelated;
    min-height: 100vh;
}

/* 像素化背景纹理 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.03) 2px,
            rgba(0,0,0,0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.03) 2px,
            rgba(0,0,0,0.03) 4px
        );
    pointer-events: none;
    z-index: 0;
}

/* ==================== 背景粒子效果 ==================== */
.mc-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.mc-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    animation: mcFloat 15s infinite linear;
}

@keyframes mcFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(720deg);
        opacity: 0;
    }
}

/* ==================== 界面切换 ==================== */

.screen {
    display: none;
    width: 100vw;
    height: 100vh;
    position: relative;
    z-index: 10;
}

.screen.active {
    display: flex;
}

/* ==================== 新建项目界面 ==================== */

#new-project-screen {
    justify-content: center;
    align-items: center;
}

.new-project-container {
    background: linear-gradient(180deg, #3D3D3D 0%, #1A1A1A 100%);
    border: 4px solid #1A1A1A;
    padding: 30px 40px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 
        inset 2px 2px 0 #555,
        inset -2px -2px 0 #000,
        8px 8px 0 rgba(0,0,0,0.5);
    animation: fadeInDown 0.5s ease-out;
}

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

.new-project-container h1 {
    font-size: 32px;
    margin-bottom: 5px;
    color: var(--mc-gold);
    text-shadow: 3px 3px 0 #000;
    letter-spacing: 2px;
}

.new-project-container h2 {
    font-size: 18px;
    margin-bottom: 25px;
    color: var(--mc-aqua);
    text-shadow: 2px 2px 0 #000;
}

.sponsor-text {
    font-size: 14px;
    color: var(--mc-gray);
    text-shadow: 1px 1px 0 #000;
    margin-bottom: 20px;
}

.sponsor-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--mc-gold);
    text-decoration: none;
    padding: 3px 8px;
    border: 2px solid #333;
    background: rgba(0,0,0,0.3);
    transition: all 0.2s;
    margin-left: 5px;
}

.sponsor-link:hover {
    color: var(--mc-white);
    background: rgba(0,0,0,0.5);
    border-color: var(--mc-gold);
}

.sponsor-icon {
    height: 16px;
    width: auto;
    vertical-align: middle;
}

/* ==================== 下载提示 ==================== */
/* 已改为弹窗，此样式废弃 */

/* ==================== 复制/下载成功弹窗 ==================== */
.copy-modal {
    max-width: 380px;
    padding: 30px;
}

.copy-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(180deg, var(--mc-green) 0%, var(--mc-dark-green) 100%);
    border: 4px solid var(--mc-dark-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--mc-white);
    margin: 0 auto 15px;
    text-shadow: 2px 2px 0 #000;
    box-shadow: 
        inset 2px 2px 0 #8FC,
        inset -2px -2px 0 #2A4A1A;
}

.copy-modal h3 {
    font-size: 22px;
    font-weight: normal;
    color: var(--mc-gold);
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 10px;
}

.sponsor-message {
    color: var(--mc-gray);
    font-size: 15px;
    text-shadow: 1px 1px 0 #000;
    margin-bottom: 20px;
    line-height: 1.5;
}

.sponsor-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(180deg, #12B7F5 0%, #0A8CD0 100%);
    border: 3px solid #086B9E;
    color: var(--mc-white);
    padding: 12px 25px;
    font-size: 16px;
    text-decoration: none;
    text-shadow: 1px 1px 0 #000;
    box-shadow: 
        inset 1px 1px 0 rgba(255,255,255,0.3),
        inset -1px -1px 0 rgba(0,0,0,0.2),
        3px 3px 0 rgba(0,0,0,0.3);
    transition: all 0.2s;
}

.sponsor-btn:hover {
    background: linear-gradient(180deg, #2BC4F7 0%, #12B7F5 100%);
    transform: translateY(-2px);
}

.sponsor-icon-btn {
    height: 22px;
    width: auto;
}

/* ==================== 赞助弹窗推广 ==================== */
.sponsor-divider {
    display: flex;
    align-items: center;
    margin: 15px 0;
}

.sponsor-divider::before,
.sponsor-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #333;
}

.sponsor-divider span {
    padding: 0 15px;
    color: var(--mc-gray);
    font-size: 14px;
}

/* ==================== 条款弹窗推广 ==================== */
.terms-sponsor {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #333;
    text-align: center;
}

/* 返回主页链接 */
.back-link {
    display: inline-block;
    color: var(--mc-gray);
    text-decoration: none;
    margin-bottom: 15px;
    padding: 8px 16px;
    border: 2px solid #333;
    background: linear-gradient(180deg, #3A3A3A 0%, #2A2A2A 100%);
    box-shadow: inset 1px 1px 0 #555, inset -1px -1px 0 #111;
    transition: all 0.15s;
}

.back-link:hover {
    color: var(--mc-white);
    background: linear-gradient(180deg, #4A4A4A 0%, #3A3A3A 100%);
}

/* 顶部导航返回链接 */
.back-link-header {
    display: inline-block;
    color: var(--mc-gray);
    text-decoration: none;
    padding: 8px 14px;
    border: 2px solid #333;
    background: linear-gradient(180deg, #3A3A3A 0%, #2A2A2A 100%);
    box-shadow: inset 1px 1px 0 #555, inset -1px -1px 0 #111;
    transition: all 0.15s;
    margin-right: 10px;
}

.back-link-header:hover {
    color: var(--mc-white);
    background: linear-gradient(180deg, #4A4A4A 0%, #3A3A3A 100%);
}

.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    color: var(--mc-white);
    text-shadow: 1px 1px 0 #000;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 3px solid #1A1A1A;
    background: linear-gradient(180deg, #2A2A2A 0%, #1A1A1A 100%);
    color: var(--mc-white);
    font-size: 16px;
    font-family: var(--font-pixel);
    outline: none;
    box-shadow: 
        inset 2px 2px 0 #444,
        inset -2px -2px 0 #000;
    text-shadow: 1px 1px 0 #000;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--mc-gold);
    box-shadow: 
        inset 2px 2px 0 #444,
        inset -2px -2px 0 #000,
        0 0 10px rgba(255, 170, 0, 0.3);
}

.form-group input::placeholder {
    color: #666;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* ==================== 按钮样式 ==================== */

.btn-primary {
    background: linear-gradient(180deg, var(--mc-green) 0%, var(--mc-dark-green) 100%);
    color: var(--mc-white);
    border: 3px solid var(--mc-dark-green);
    padding: 12px 24px;
    font-size: 18px;
    font-family: var(--font-pixel);
    cursor: pointer;
    width: 100%;
    text-shadow: 2px 2px 0 #000;
    box-shadow: 
        inset 2px 2px 0 #8FC,
        inset -2px -2px 0 #2A4A1A,
        4px 4px 0 rgba(0,0,0,0.5);
    transition: all 0.15s;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #7CDD6B 0%, var(--mc-green) 100%);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: linear-gradient(180deg, #6B6B6B 0%, #4A4A4A 50%, #3A3A3A 100%);
    color: var(--mc-white);
    border: 3px solid #2A2A2A;
    padding: 8px 16px;
    font-size: 14px;
    font-family: var(--font-pixel);
    cursor: pointer;
    text-shadow: 2px 2px 0 #000;
    box-shadow: 
        inset 1px 1px 0 #888,
        inset -1px -1px 0 #333,
        3px 3px 0 rgba(0,0,0,0.5);
    transition: all 0.15s;
}

.btn-secondary:hover {
    background: linear-gradient(180deg, #8B8B8B 0%, #6A6A6A 50%, #5A5A5A 100%);
    transform: translateY(-1px);
}

/* 导入配置部分 */
.import-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 3px solid #333;
}

.import-hint {
    color: var(--mc-gray);
    font-size: 14px;
    margin-bottom: 12px;
    text-shadow: 1px 1px 0 #000;
}

.import-section .btn-secondary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 导入进度条覆盖层 */
.import-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.import-progress-modal {
    background: linear-gradient(180deg, #3D3D3D 0%, #1A1A1A 100%);
    padding: 30px 40px;
    border: 4px solid #1A1A1A;
    text-align: center;
    box-shadow: 
        inset 2px 2px 0 #555,
        inset -2px -2px 0 #000,
        8px 8px 0 rgba(0,0,0,0.5);
    min-width: 320px;
}

.progress-title {
    font-size: 20px;
    font-weight: normal;
    color: var(--mc-gold);
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 #000;
}

.progress-bar-container {
    width: 100%;
    height: 16px;
    background: #1A1A1A;
    border: 3px solid #333;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 2px 2px 0 #000;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(180deg, var(--mc-green) 0%, var(--mc-dark-green) 100%);
    transition: width 0.3s ease;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.2);
    width: 0%;
}

.progress-text {
    font-size: 14px;
    color: var(--mc-gray);
    text-shadow: 1px 1px 0 #000;
}

/* ==================== 编辑界面 ==================== */

#edit-screen {
    flex-direction: column;
    height: 100vh;
}

/* 顶部导航 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(180deg, #3D3D3D 0%, #2A2A2A 100%);
    border-bottom: 4px solid #1A1A1A;
    flex-shrink: 0;
    box-shadow: 
        inset 0 2px 0 #555,
        0 4px 0 rgba(0,0,0,0.3);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h2 {
    font-size: 22px;
    color: var(--mc-gold);
    text-shadow: 2px 2px 0 #000;
}

.header-right {
    display: flex;
    gap: 12px;
}

/* 主内容区 */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* ==================== 工具箱面板 ==================== */

.toolbox-panel {
    width: 220px;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(30,30,30,0.95) 0%, rgba(20,20,20,0.95) 100%);
    border-right: 4px solid #1A1A1A;
    overflow-y: auto;
    padding: 16px;
    position: relative;
    z-index: 10;
    box-shadow: inset -2px 0 0 #333;
}

.toolbox-panel h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--mc-gold);
    text-shadow: 2px 2px 0 #000;
}

.toolbox-category {
    margin-bottom: 8px;
}

.category-header {
    padding: 10px 12px;
    border: 3px solid #1A1A1A;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
    color: var(--mc-white);
    text-shadow: 2px 2px 0 #000;
    box-shadow: 
        inset 2px 2px 0 rgba(255,255,255,0.2),
        inset -2px -2px 0 rgba(0,0,0,0.3);
    transition: all 0.15s;
}

.category-header:hover {
    filter: brightness(1.1);
}

.category-content {
    padding: 8px 0;
    display: none;
}

.category-content.show {
    display: block !important;
}

/* 默认展开第一个分类 */
.toolbox-category:first-child .category-content {
    display: block;
}

.block-item {
    padding: 8px 12px;
    margin: 4px 0;
    background: linear-gradient(180deg, #3A3A3A 0%, #2A2A2A 100%);
    border: 2px solid #222;
    font-size: 13px;
    cursor: pointer;
    color: var(--mc-white);
    text-shadow: 1px 1px 0 #000;
    box-shadow: 
        inset 1px 1px 0 #555,
        inset -1px -1px 0 #111;
    transition: all 0.15s;
}

.block-item:hover {
    background: linear-gradient(180deg, #4A4A4A 0%, #3A3A3A 100%);
    border-color: var(--mc-gold);
    transform: translateX(4px);
}

/* ==================== 编辑内容区 ==================== */

.editor-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* 函数标签页 */
.function-tabs {
    background: linear-gradient(180deg, #2A2A2A 0%, #1A1A1A 100%);
    border-bottom: 3px solid #1A1A1A;
    flex-shrink: 0;
}

.tabs-header {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    gap: 8px;
}

.tabs-list {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
}

.function-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(180deg, #3A3A3A 0%, #2A2A2A 100%);
    border: 2px solid #222;
    cursor: pointer;
    font-size: 14px;
    color: var(--mc-white);
    text-shadow: 1px 1px 0 #000;
    box-shadow: 
        inset 1px 1px 0 #555,
        inset -1px -1px 0 #111;
    transition: all 0.15s;
    white-space: nowrap;
}

.function-tab:hover {
    background: linear-gradient(180deg, #4A4A4A 0%, #3A3A3A 100%);
}

.function-tab.active {
    background: linear-gradient(180deg, var(--mc-green) 0%, var(--mc-dark-green) 100%);
    border-color: var(--mc-dark-green);
    box-shadow: 
        inset 1px 1px 0 #8FC,
        inset -1px -1px 0 #2A4A1A;
}

.tab-close-btn {
    background: none;
    border: none;
    color: var(--mc-gray);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.tab-close-btn:hover {
    color: var(--mc-red);
}

/* 函数编辑器 */
.function-editors {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.workspace-container {
    flex: 1;
    min-height: 0;
    width: 100%;
    background: #fff;
    position: relative;
    overflow: hidden;
}

/* 格子编辑区 */
.grid-editor {
    background: linear-gradient(180deg, rgba(30,30,30,0.95) 0%, rgba(20,20,20,0.95) 100%);
    border-top: 4px solid #1A1A1A;
    padding: 16px;
    height: 150px;
    flex-shrink: 0;
    overflow: auto;
}

.grid-editor h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--mc-gold);
    text-shadow: 2px 2px 0 #000;
}

.grid-container {
    display: grid;
    gap: 4px;
    max-width: 100%;
    overflow-x: auto;
}

.grid-slot {
    width: 50px;
    height: 50px;
    background: var(--slot-bg);
    border: 3px solid var(--slot-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: 
        inset 2px 2px 0 var(--slot-highlight),
        inset -2px -2px 0 var(--slot-shadow);
    transition: all 0.15s;
}

.grid-slot:hover {
    transform: scale(1.05);
    box-shadow: 
        inset 2px 2px 0 var(--slot-highlight),
        inset -2px -2px 0 var(--slot-shadow),
        0 0 10px rgba(255, 170, 0, 0.5);
}

.grid-slot.selected {
    background: linear-gradient(180deg, var(--mc-green) 0%, var(--mc-dark-green) 100%);
    border-color: var(--mc-dark-green);
    box-shadow: 
        inset 2px 2px 0 #8FC,
        inset -2px -2px 0 #2A4A1A;
}

.grid-slot.swap-mode {
    border-color: var(--mc-gold);
}

.grid-slot.swap-source {
    background: linear-gradient(180deg, #FFAA00 0%, #CC8800 100%);
    border-color: #CC8800;
}

.slot-index {
    font-size: 10px;
    color: #333;
    position: absolute;
    top: 2px;
    left: 4px;
    text-shadow: none;
}

.slot-item {
    font-size: 11px;
    color: #333;
    text-align: center;
    word-break: break-all;
    text-shadow: none;
}

.slot-name {
    font-size: 9px;
    color: #555;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: none;
}

/* 格子物品显示样式 */
.grid-slot.has-item {
    background: linear-gradient(180deg, #7CBD6B 0%, #5D8C3E 100%);
    border-color: var(--mc-dark-green);
    box-shadow: 
        inset 2px 2px 0 #9EDB8B,
        inset -2px -2px 0 #3D5C28;
}

.slot-item-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 2px;
    overflow: hidden;
}

.slot-item-display .item-icon {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin-bottom: 2px;
}

.slot-item-display .slot-item-name {
    font-size: 8px;
    color: var(--mc-white);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
    text-shadow: 1px 1px 0 #000;
}

.slot-item-display .slot-material {
    font-size: 7px;
    color: rgba(255,255,255,0.7);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Minecraft材质图标样式 */
.material-icon {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* 常见材质图标 */
.material-icon.stone { background: linear-gradient(135deg, #7f7f7f, #5a5a5a); }
.material-icon.diamond { background: linear-gradient(135deg, #4aedd9, #2dbfb8); }
.material-icon.gold_ingot { background: linear-gradient(135deg, #ffd700, #b8860b); }
.material-icon.iron_ingot { background: linear-gradient(135deg, #dcdcdc, #a9a9a9); }
.material-icon.emerald { background: linear-gradient(135deg, #50c878, #2e8b57); }
.material-icon.redstone { background: linear-gradient(135deg, #ff4444, #cc0000); }
.material-icon.lapis_lazuli { background: linear-gradient(135deg, #1e90ff, #4169e1); }
.material-icon.nether_star { background: linear-gradient(135deg, #fff, #e0e0e0); }
.material-icon.blaze_rod { background: linear-gradient(135deg, #ffd700, #ff8c00); }
.material-icon.ender_pearl { background: linear-gradient(135deg, #00ff7f, #2e8b57); }
.material-icon.clock { background: linear-gradient(135deg, #ffd700, #daa520); }
.material-icon.compass { background: linear-gradient(135deg, #c0c0c0, #808080); }
.material-icon.player_head { background: linear-gradient(135deg, #d4a574, #8b6914); }
.material-icon.source-ia-air_icon { background: linear-gradient(135deg, #87ceeb, #4682b4); }

/* ==================== 属性面板 ==================== */

.properties-panel {
    width: 280px;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(30,30,30,0.95) 0%, rgba(20,20,20,0.95) 100%);
    border-left: 4px solid #1A1A1A;
    overflow-y: auto;
    padding: 16px;
    box-shadow: inset 2px 0 0 #333;
}

.properties-panel h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--mc-gold);
    text-shadow: 2px 2px 0 #000;
}

.panel-section {
    margin-bottom: 20px;
}

.panel-section h4 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--mc-aqua);
    text-shadow: 1px 1px 0 #000;
}

.event-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.event-btn {
    padding: 8px;
    background: linear-gradient(180deg, #3A3A3A 0%, #2A2A2A 100%);
    border: 2px solid #222;
    color: var(--mc-white);
    font-size: 12px;
    font-family: var(--font-pixel);
    cursor: pointer;
    text-shadow: 1px 1px 0 #000;
    box-shadow: 
        inset 1px 1px 0 #555,
        inset -1px -1px 0 #111;
    transition: all 0.15s;
}

.event-btn:hover {
    background: linear-gradient(180deg, #4A4A4A 0%, #3A3A3A 100%);
}

.event-btn.active {
    background: linear-gradient(180deg, var(--mc-green) 0%, var(--mc-dark-green) 100%);
    border-color: var(--mc-dark-green);
    box-shadow: 
        inset 1px 1px 0 #8FC,
        inset -1px -1px 0 #2A4A1A;
}

/* ==================== YAML预览 ==================== */

.footer {
    background: linear-gradient(180deg, #2A2A2A 0%, #1A1A1A 100%);
    border-top: 4px solid #1A1A1A;
    max-height: 200px;
    flex-shrink: 0;
}

.footer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: linear-gradient(180deg, #3A3A3A 0%, #2A2A2A 100%);
    border-bottom: 2px solid #222;
}

.footer-header h4 {
    font-size: 14px;
    color: var(--mc-gold);
    text-shadow: 1px 1px 0 #000;
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--mc-gray);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    transition: all 0.15s;
}

.toggle-btn:hover {
    color: var(--mc-white);
}

#yaml-preview {
    padding: 12px 16px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: var(--mc-aqua);
    background: #0A0A0A;
    overflow: auto;
    max-height: 150px;
    white-space: pre-wrap;
    word-break: break-all;
    text-shadow: 1px 1px 0 #000;
}

/* ==================== Blockly样式覆盖 ==================== */

.blocklyToolboxDiv {
    background: linear-gradient(180deg, #2A2A2A 0%, #1A1A1A 100%) !important;
}

.blocklyTreeRow {
    padding: 8px !important;
    margin: 2px 0 !important;
}

.blocklyTreeLabel {
    font-family: var(--font-pixel) !important;
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 1200px) {
    .toolbox-panel {
        width: 180px;
    }
    
    .properties-panel {
        width: 240px;
    }
}

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }
    
    .toolbox-panel {
        width: 100%;
        height: auto;
        max-height: 200px;
        flex-direction: row;
        overflow-x: auto;
    }
    
    .properties-panel {
        width: 100%;
        max-height: 200px;
    }
}

/* ==================== 滚动条样式 ==================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1A1A1A;
    border: 2px solid #333;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4A4A4A 0%, #3A3A3A 100%);
    border: 2px solid #333;
    box-shadow: inset 1px 1px 0 #666;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #5A5A5A 0%, #4A4A4A 100%);
}

::-webkit-scrollbar-corner {
    background: #1A1A1A;
}

/* ==================== 动画效果 ==================== */

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

.new-project-container {
    animation: fadeIn 0.5s ease-out;
}

/* ==================== 禁用文本选择 ==================== */

.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* ==================== 右键菜单样式 ==================== */

.block-context-menu {
    position: fixed;
    background: linear-gradient(180deg, #3D3D3D 0%, #1A1A1A 100%);
    border: 4px solid #1A1A1A;
    padding: 12px 16px;
    min-width: 200px;
    max-width: 300px;
    box-shadow: 
        inset 2px 2px 0 #555,
        inset -2px -2px 0 #000,
        8px 8px 0 rgba(0,0,0,0.5);
    z-index: 10000;
    font-size: 14px;
    color: var(--mc-white);
    animation: contextMenuFadeIn 0.2s ease-out;
}

@keyframes contextMenuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.block-context-menu .menu-title {
    font-weight: normal;
    color: var(--mc-gold);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #333;
    font-size: 16px;
    text-shadow: 2px 2px 0 #000;
}

.block-context-menu .menu-content {
    line-height: 1.6;
    color: var(--mc-gray);
    text-shadow: 1px 1px 0 #000;
}

.block-context-menu .menu-example {
    margin-top: 10px;
    padding: 8px;
    background: #0A0A0A;
    border: 2px solid #222;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    color: #7CFC00;
    word-break: break-all;
    text-shadow: 1px 1px 0 #000;
}

.block-context-menu .menu-close {
    margin-top: 10px;
    text-align: right;
}

.block-context-menu .menu-close button {
    background: linear-gradient(180deg, var(--mc-green) 0%, var(--mc-dark-green) 100%);
    border: 2px solid var(--mc-dark-green);
    color: var(--mc-white);
    padding: 4px 12px;
    cursor: pointer;
    font-size: 12px;
    font-family: var(--font-pixel);
    text-shadow: 1px 1px 0 #000;
    box-shadow: 
        inset 1px 1px 0 #8FC,
        inset -1px -1px 0 #2A4A1A;
    transition: all 0.15s;
}

.block-context-menu .menu-close button:hover {
    background: linear-gradient(180deg, #7CDD6B 0%, var(--mc-green) 100%);
}

/* ==================== QQ群按钮 ==================== */
.qq-group-btn-header {
    background: linear-gradient(180deg, #12B7F5 0%, #0A8CD0 100%);
    border: 3px solid #086B9E;
    color: white;
    padding: 8px 16px;
    font-family: var(--font-pixel);
    font-size: 16px;
    text-decoration: none;
    text-shadow: 1px 1px 0 #000;
    box-shadow: 
        inset 1px 1px 0 rgba(255,255,255,0.3),
        inset -1px -1px 0 rgba(0,0,0,0.2),
        3px 3px 0 rgba(0,0,0,0.3);
    transition: all 0.2s;
    margin-right: 10px;
}

.qq-group-btn-header:hover {
    background: linear-gradient(180deg, #2BC4F7 0%, #12B7F5 100%);
    transform: translateY(-2px);
}

.qq-group-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
    background: linear-gradient(180deg, #12B7F5 0%, #0A8CD0 100%);
    border: 3px solid #086B9E;
    color: white;
    padding: 8px 16px;
    font-family: var(--font-pixel);
    font-size: 16px;
    text-decoration: none;
    text-shadow: 1px 1px 0 #000;
    box-shadow: 
        inset 1px 1px 0 rgba(255,255,255,0.3),
        inset -1px -1px 0 rgba(0,0,0,0.2),
        3px 3px 0 rgba(0,0,0,0.3);
    transition: all 0.2s;
}

.qq-group-btn:hover {
    background: linear-gradient(180deg, #2BC4F7 0%, #12B7F5 100%);
    transform: translateY(-2px);
}

/* ==================== 弹窗样式 ==================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(180deg, #3D3D3D 0%, #1A1A1A 100%);
    border: 4px solid #1A1A1A;
    padding: 25px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 
        inset 2px 2px 0 #555,
        inset -2px -2px 0 #000,
        8px 8px 0 rgba(0,0,0,0.5);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--mc-gray);
    font-size: 28px;
    cursor: pointer;
}

.modal-close:hover { color: var(--mc-red); }

.modal-content h3 {
    font-size: 22px;
    font-weight: normal;
    color: var(--mc-gold);
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 15px;
}

.sponsor-modal { max-width: 350px; }

.sponsor-qr {
    width: 250px;
    height: auto;
    border: 3px solid #333;
    margin: 15px auto;
    display: block;
}

.sponsor-modal p {
    color: var(--mc-gray);
    font-size: 16px;
    text-shadow: 1px 1px 0 #000;
}

.terms-modal {
    max-width: 500px;
    text-align: left;
}

.terms-content {
    max-height: 300px;
    overflow-y: auto;
}

.terms-content p {
    color: var(--mc-gray);
    font-size: 15px;
    margin: 10px 0;
    text-shadow: 1px 1px 0 #000;
    line-height: 1.6;
}

/* ==================== 页脚链接 ==================== */
.footer-links-container {
    position: fixed;
    bottom: 15px;
    left: 15px;
    z-index: 100;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-links a {
    color: var(--mc-aqua);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 8px;
    background: rgba(0,0,0,0.5);
    border: 2px solid #333;
    transition: all 0.15s;
}

.footer-links a:hover {
    color: var(--mc-white);
    background: rgba(0,0,0,0.7);
}

.bilibili-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}
