/* ===== CSS 变量 ===== */
:root {
    --mc-green: #5B8731;
    --mc-green-dark: #3D5C20;
    --mc-green-light: #7BA94A;
    --mc-grass: #7CB342;
    --mc-grass-light: #9CCC65;
    --mc-brown: #8B6B47;
    --mc-brown-dark: #5D4037;
    --mc-dirt: #6B4F2F;
    --mc-stone: #7E7E7E;
    --mc-stone-light: #9E9E9E;
    --mc-stone-dark: #5E5E5E;
    --mc-bg: #E8E8E8;
    --mc-bg-card: #FFFFFF;
    --mc-bg-darker: #D0D0D0;
    --mc-sky: #87CEEB;
    --mc-sky-light: #B3E0F2;
    --mc-diamond: #4DD0E1;
    --mc-gold: #FFAA00;
    --mc-redstone: #D43030;
    --mc-text: #2A2A2A;
    --mc-text-dim: #5A5A5A;
    --mc-border: #C0C0C0;
    --mc-border-light: #D8D8D8;
    --mc-shadow: rgba(0, 0, 0, 0.2);
    --pixel-font: 'Press Start 2P', monospace;
    --body-font: 'Noto Sans SC', sans-serif;
}

/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--body-font);
    color: var(--mc-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* MC 官方壁纸做背景 + 白色半透明遮罩保证可读性 */
    background-color: var(--mc-bg);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.88)),
        url('../assets/img/wallpaper_minecraft_bedrock_edition_1920x1080.png');
    background-size: cover, cover;
    background-position: center, center top;
    background-attachment: fixed, fixed;
    background-repeat: no-repeat, no-repeat;
}

/* body 伪元素：MC 像素噪点纹理叠加（明亮版） */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.3) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 8px 8px, 12px 12px;
}

/* 主内容区与导航栏置于噪点层之上 */
.navbar, .main-content, .footer {
    position: relative;
    z-index: 1;
}

/* ===== 导航栏（石头方块质感） ===== */
.navbar {
    background: linear-gradient(180deg, var(--mc-stone-light) 0%, var(--mc-stone) 100%);
    border-bottom: 4px solid var(--mc-green-dark);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 0 var(--mc-green-dark), 0 6px 12px rgba(0, 0, 0, 0.2);
    /* 石头方块纹理 */
    background-image:
        linear-gradient(180deg, var(--mc-stone-light) 0%, var(--mc-stone) 100%),
        repeating-linear-gradient(90deg, transparent 0, transparent 3px, rgba(255,255,255,0.15) 3px, rgba(255,255,255,0.15) 4px),
        repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(0,0,0,0.08) 3px, rgba(0,0,0,0.08) 4px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.nav-logo {
    font-size: 28px;
    filter: drop-shadow(2px 2px 0 var(--mc-green-dark));
}

.nav-title {
    font-family: var(--pixel-font);
    font-size: 14px;
    color: #fff;
    text-shadow: 2px 2px 0 var(--mc-green-dark), 3px 3px 0 rgba(0,0,0,0.3);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    font-family: var(--body-font);
    font-size: 14px;
    color: #fff;
    text-decoration: none;
    padding: 8px 14px;
    border: 2px solid transparent;
    border-radius: 0;
    transition: all 0.1s ease;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
    position: relative;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.nav-link.active {
    color: #fff;
    background: var(--mc-green);
    border-color: var(--mc-green-dark);
    box-shadow: inset 0 -3px 0 var(--mc-green-dark);
    text-shadow: 1px 1px 0 var(--mc-green-dark);
}

/* ===== 首页底部版权 ===== */
.site-footer {
    text-align: center;
    padding: 32px 16px 16px;
    margin-top: 40px;
    color: var(--mc-text-dim);
    font-size: 14px;
    border-top: 4px solid var(--mc-green-dark);
}
.site-footer .footer-brand,
.hero-subtitle .footer-brand {
    color: var(--mc-gold);
    font-weight: 700;
    font-size: 16px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3), 2px 2px 0 rgba(0,0,0,0.15);
    padding: 0;
}
.site-footer .footer-highlight,
.hero-subtitle .footer-highlight {
    color: var(--mc-gold);
    font-weight: 700;
    font-size: 16px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3), 2px 2px 0 rgba(0,0,0,0.15);
    padding: 0;
}

/* ===== 子页签（MIDI/MC函数切换） ===== */
.sub-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border: 3px solid var(--mc-stone-dark);
    background: var(--mc-stone-dark);
    box-shadow: 4px 4px 0 var(--mc-shadow);
}
.sub-tab {
    padding: 10px 22px;
    background: var(--mc-stone);
    border: none;
    border-right: 2px solid var(--mc-stone-dark);
    border-radius: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s ease;
    font-family: inherit;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2);
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}
.sub-tab:last-child {
    border-right: none;
}
.sub-tab:hover {
    background: var(--mc-stone-light);
    box-shadow: inset 0 -3px 0 var(--mc-green-dark);
}
.sub-tab.active {
    color: #fff;
    background: var(--mc-green);
    text-shadow: 1px 1px 0 var(--mc-green-dark);
    box-shadow: inset 0 -3px 0 var(--mc-green-dark);
}

/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ===== 页脚 ===== */
.footer {
    text-align: center;
    padding: 20px 16px 16px;
    color: var(--mc-text-dim);
    font-size: 12px;
    border-top: 6px solid;
    border-image: linear-gradient(90deg, var(--mc-green-dark) 0%, var(--mc-green) 20%, var(--mc-grass) 50%, var(--mc-green) 80%, var(--mc-green-dark) 100%) 1;
    margin-top: 32px;
    position: relative;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.05) 100%);
}

/* ===== 首页样式 ===== */
.hero {
    text-align: center;
    padding: 64px 20px 48px;
    position: relative;
    margin: 0 -24px 32px;
    padding-left: 24px;
    padding-right: 24px;
    /* MC 壁纸做 hero 背景 + 绿色半透明遮罩 */
    background-image:
        linear-gradient(rgba(91, 135, 49, 0.55), rgba(61, 92, 32, 0.75)),
        url('../assets/img/wallpaper_minecraft_bedrock_edition_2058x1440.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 6px 0 var(--mc-green-dark), 0 8px 20px rgba(0,0,0,0.3);
    border-bottom: 4px solid var(--mc-green-dark);
}

/* hero 顶部草地+泥土方块装饰条 */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    height: 12px;
    background:
        linear-gradient(180deg,
            var(--mc-grass-light) 0%,
            var(--mc-grass) 25%,
            var(--mc-green-dark) 33%,
            var(--mc-dirt) 34%,
            var(--mc-brown-dark) 100%);
    box-shadow: 0 4px 0 var(--mc-shadow), inset 0 -2px 0 rgba(0,0,0,0.3);
    image-rendering: pixelated;
}

.hero-title {
    font-family: var(--pixel-font);
    font-size: 40px;
    color: #fff;
    text-shadow:
        3px 3px 0 var(--mc-green-dark),
        6px 6px 0 rgba(0, 0, 0, 0.5),
        0 0 20px rgba(0, 0, 0, 0.4);
    margin-bottom: 16px;
    letter-spacing: 2px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.hero-subtitle {
    font-size: 15px;
    color: #fff;
    max-width: 600px;
    margin: 0 auto;
    line-height: 2;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5), 2px 2px 0 rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.hero-divider {
    margin: 28px auto;
    width: 300px;
    height: 10px;
    background:
        linear-gradient(90deg,
            transparent 0%,
            var(--mc-green-dark) 10%,
            var(--mc-green) 30%,
            var(--mc-grass-light) 50%,
            var(--mc-green) 70%,
            var(--mc-green-dark) 90%,
            transparent 100%);
    box-shadow: 0 3px 0 var(--mc-shadow), inset 0 -2px 0 rgba(0,0,0,0.3);
    image-rendering: pixelated;
    position: relative;
    z-index: 1;
}

/* ===== 工具卡片网格 ===== */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.tool-card {
    background: var(--mc-bg-card);
    border: 3px solid var(--mc-stone-dark);
    border-radius: 0;
    padding: 24px 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 4px 4px 0 var(--mc-shadow);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background:
        repeating-linear-gradient(90deg,
            var(--card-color, var(--mc-green)) 0px,
            var(--card-color, var(--mc-green)) 8px,
            rgba(0,0,0,0.15) 8px,
            rgba(0,0,0,0.15) 9px);
    box-shadow: 0 3px 0 var(--mc-shadow);
}

.tool-card:hover {
    transform: translate(-2px, -2px);
    border-color: var(--card-color, var(--mc-green));
    box-shadow: 6px 6px 0 var(--mc-shadow);
}

.tool-card:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--mc-shadow);
}

.tool-card-icon {
    font-size: 40px;
    margin-bottom: 14px;
    margin-top: 6px;
    display: block;
    filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.2));
}

.tool-card-title {
    font-family: var(--pixel-font);
    font-size: 12px;
    color: var(--mc-text);
    margin-bottom: 8px;
    line-height: 1.6;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

.tool-card-desc {
    font-size: 13px;
    color: var(--mc-text-dim);
    line-height: 1.6;
}

.tool-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 12px;
}

.tool-tag {
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(91, 135, 49, 0.15);
    color: var(--mc-green-dark);
    border-radius: 0;
    border: 1px solid var(--mc-green);
    font-weight: 600;
}

/* ===== 工具页面通用样式 ===== */
.tool-page {
    animation: fadeIn 0.3s ease;
}

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

.page-header {
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 4px solid var(--mc-stone-dark);
    position: relative;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 80px;
    height: 4px;
    background: var(--mc-green);
}

.page-title {
    font-family: var(--pixel-font);
    font-size: 18px;
    color: var(--mc-green-dark);
    text-shadow: 2px 2px 0 var(--mc-grass), 3px 3px 0 rgba(0,0,0,0.15);
    margin-bottom: 8px;
}

.page-desc {
    font-size: 14px;
    color: var(--mc-text-dim);
    line-height: 1.6;
}

/* ===== 上传区域 ===== */
.upload-zone {
    border: 3px dashed var(--mc-stone);
    border-radius: 0;
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--mc-bg-card);
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--mc-green);
    background: rgba(124, 179, 66, 0.1);
    border-style: solid;
    box-shadow: inset 0 0 0 2px var(--mc-green-dark), 0 0 12px rgba(124, 179, 66, 0.3);
}

.upload-zone-icon {
    font-size: 44px;
    margin-bottom: 10px;
    display: block;
    filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.2));
}

.upload-zone-text {
    font-size: 15px;
    color: var(--mc-text);
    margin-bottom: 6px;
    font-weight: 600;
}

.upload-zone-hint {
    font-size: 12px;
    color: var(--mc-text-dim);
}

.upload-zone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

/* 文件名显示 */
.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(124, 179, 66, 0.15);
    border: 2px solid var(--mc-green);
    border-radius: 0;
    padding: 10px 16px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--mc-green-dark);
    box-shadow: 2px 2px 0 var(--mc-shadow);
    font-weight: 600;
}

.file-info .file-remove {
    margin-left: auto;
    cursor: pointer;
    color: var(--mc-redstone);
    font-weight: bold;
    border: none;
    background: none;
    font-size: 16px;
}

/* ===== 参数面板 ===== */
.params-panel {
    background: var(--mc-bg-card);
    border: 3px solid var(--mc-stone-dark);
    border-radius: 0;
    padding: 22px;
    margin-top: 20px;
    box-shadow: 4px 4px 0 var(--mc-shadow);
}

.params-title {
    font-family: var(--pixel-font);
    font-size: 12px;
    color: var(--mc-gold);
    margin-bottom: 16px;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
    padding-bottom: 10px;
    border-bottom: 3px solid var(--mc-stone);
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.param-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.param-label {
    font-size: 13px;
    color: var(--mc-text-dim);
    font-weight: 600;
}

.param-input,
.param-select {
    background: var(--mc-bg);
    border: 2px solid var(--mc-stone);
    border-radius: 0;
    color: var(--mc-text);
    padding: 8px 12px;
    font-size: 14px;
    font-family: var(--body-font);
    transition: border-color 0.1s ease;
    box-shadow: inset 2px 2px 0 rgba(0,0,0,0.08);
}

.param-input:focus,
.param-select:focus {
    outline: none;
    border-color: var(--mc-green);
    background: #fff;
    box-shadow: inset 2px 2px 0 rgba(0,0,0,0.08), 0 0 0 2px rgba(124, 179, 66, 0.3);
}

.param-select {
    cursor: pointer;
}

.param-range-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.param-range-row input[type="range"] {
    flex: 1;
    accent-color: var(--mc-green);
}

.param-range-row .range-value {
    min-width: 50px;
    text-align: right;
    font-size: 13px;
    color: var(--mc-green-dark);
    font-weight: 600;
}

/* ===== 按钮（MC 像素 3D 凸起） ===== */
.btn {
    font-family: var(--body-font);
    font-size: 14px;
    font-weight: 700;
    padding: 12px 28px;
    border: 2px solid var(--mc-green-dark);
    border-radius: 0;
    cursor: pointer;
    transition: all 0.08s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.btn-primary {
    background: var(--mc-green);
    color: #fff;
    box-shadow: 0 4px 0 var(--mc-green-dark), inset 0 -2px 0 rgba(0,0,0,0.2);
}

.btn-primary:hover {
    background: var(--mc-grass);
    transform: translateY(-1px);
    box-shadow: 0 5px 0 var(--mc-green-dark), inset 0 -2px 0 rgba(0,0,0,0.2);
}

.btn-primary:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--mc-green-dark), inset 0 -2px 0 rgba(0,0,0,0.2);
}

.btn-primary:disabled {
    background: var(--mc-stone);
    box-shadow: 0 4px 0 var(--mc-stone-dark);
    border-color: var(--mc-stone-dark);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: var(--mc-stone);
    color: #fff;
    border-color: var(--mc-stone-dark);
    box-shadow: 0 4px 0 var(--mc-stone-dark), inset 0 -2px 0 rgba(0,0,0,0.2);
}

.btn-secondary:hover {
    background: var(--mc-stone-light);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 5px 0 var(--mc-stone-dark), inset 0 -2px 0 rgba(0,0,0,0.2);
}

.btn-secondary:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--mc-stone-dark), inset 0 -2px 0 rgba(0,0,0,0.2);
}

/* ===== 结果区域 ===== */
.result-area {
    margin-top: 24px;
    min-height: 60px;
}

.result-success {
    background: rgba(124, 179, 66, 0.12);
    border: 3px solid var(--mc-green);
    border-radius: 0;
    padding: 20px;
    text-align: center;
    box-shadow: 4px 4px 0 var(--mc-shadow), inset 0 -3px 0 rgba(0,0,0,0.1);
}

.result-error {
    background: rgba(212, 48, 48, 0.12);
    border: 3px solid var(--mc-redstone);
    border-radius: 0;
    padding: 20px;
    text-align: center;
    box-shadow: 4px 4px 0 var(--mc-shadow), inset 0 -3px 0 rgba(0,0,0,0.1);
}

.result-message {
    font-size: 15px;
    margin-bottom: 12px;
    font-weight: 600;
}

.result-success .result-message {
    color: var(--mc-green-dark);
    text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
}

.result-error .result-message {
    color: var(--mc-redstone);
    text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
}

.result-detail {
    font-size: 13px;
    color: var(--mc-text-dim);
    margin-top: 8px;
    word-break: break-all;
}

/* ===== Canvas 预览 ===== */
.canvas-preview {
    margin-top: 20px;
    text-align: center;
    background: var(--mc-bg-card);
    border: 3px solid var(--mc-stone-dark);
    border-radius: 0;
    padding: 20px;
    box-shadow: 4px 4px 0 var(--mc-shadow);
}

.canvas-preview canvas {
    max-width: 100%;
    border: 2px solid var(--mc-stone);
    border-radius: 0;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    box-shadow: inset 2px 2px 0 rgba(0,0,0,0.2);
}

.preview-label {
    font-size: 13px;
    color: var(--mc-text-dim);
    margin-bottom: 12px;
    font-weight: 600;
}

/* ===== 格式选择器 ===== */
.format-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.format-box {
    flex: 1;
    min-width: 200px;
}

.format-arrow {
    font-size: 24px;
    color: var(--mc-green);
    filter: drop-shadow(2px 2px 0 var(--mc-shadow));
}

/* ===== 表格样式 ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 13px;
    border: 3px solid var(--mc-stone-dark);
    box-shadow: 4px 4px 0 var(--mc-shadow);
    background: var(--mc-bg-card);
}

.data-table th {
    background: var(--mc-stone);
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 3px solid var(--mc-stone-dark);
    font-weight: 600;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--mc-border);
    color: var(--mc-text);
}

.data-table tr:hover td {
    background: rgba(124, 179, 66, 0.1);
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--mc-bg-card);
    border: 3px solid var(--mc-green);
    color: var(--mc-text);
    padding: 12px 24px;
    border-radius: 0;
    font-size: 14px;
    z-index: 1000;
    box-shadow: 4px 4px 0 var(--mc-shadow), inset 0 -2px 0 rgba(0,0,0,0.1);
    animation: toastSlide 0.3s ease;
    font-weight: 600;
}

.toast.error {
    border-color: var(--mc-redstone);
}

@keyframes toastSlide {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== 加载动画 ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--mc-stone);
    border-top-color: var(--mc-green);
    border-radius: 0;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding: 30px;
    color: var(--mc-text-dim);
    font-size: 14px;
}

/* ===== 动画生成器：输入模式子页签 ===== */
.anim-tabs {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    border: 3px solid var(--mc-stone-dark);
    background: var(--mc-stone-dark);
    box-shadow: 4px 4px 0 var(--mc-shadow);
}

.anim-tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 18px;
    background: var(--mc-stone);
    border: none;
    border-right: 2px solid var(--mc-stone-dark);
    border-radius: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s ease;
    font-family: inherit;
    text-align: center;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2);
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.anim-tab-btn:last-child {
    border-right: none;
}

.anim-tab-btn:hover {
    background: var(--mc-stone-light);
    box-shadow: inset 0 -3px 0 var(--mc-green-dark);
}

.anim-tab-btn.active {
    color: #fff;
    background: var(--mc-green);
    text-shadow: 1px 1px 0 var(--mc-green-dark);
    box-shadow: inset 0 -3px 0 var(--mc-green-dark);
}

/* ===== 动画生成器：徽章 / 帧列表 / 提示 ===== */
.anim-badge {
    display: inline-block;
    min-width: 24px;
    padding: 2px 10px;
    margin-left: 8px;
    background: var(--mc-gold);
    color: #fff;
    border-radius: 0;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
    box-shadow: 2px 2px 0 var(--mc-shadow);
}

.anim-frame-list {
    max-height: 320px;
    overflow-y: auto;
    background: var(--mc-bg-darker);
    border: 3px solid var(--mc-stone-dark);
    border-radius: 0;
    padding: 8px;
    box-shadow: inset 2px 2px 0 rgba(0,0,0,0.15);
}

.anim-frame-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: var(--mc-bg-card);
    border: 2px solid var(--mc-stone);
    border-radius: 0;
    transition: all 0.1s ease;
    box-shadow: 2px 2px 0 var(--mc-shadow);
}

.anim-frame-item:hover {
    border-color: var(--mc-green);
    background: rgba(124, 179, 66, 0.08);
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--mc-shadow);
}

.anim-frame-item .anim-frame-preview {
    flex: 1;
    min-width: 0;
    font-family: var(--body-font);
    font-size: 13px;
    color: var(--mc-text);
    white-space: pre-wrap;
    word-break: break-all;
}

.anim-frame-item .anim-frame-badge {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--mc-gold);
    padding: 4px 10px;
    background: rgba(255, 170, 0, 0.15);
    border: 2px solid var(--mc-gold);
    border-radius: 0;
    font-weight: 700;
    box-shadow: 1px 1px 0 var(--mc-shadow);
}

.anim-frame-item .anim-frame-remove {
    flex-shrink: 0;
    background: transparent;
    border: 2px solid var(--mc-redstone);
    color: var(--mc-redstone);
    padding: 4px 10px;
    border-radius: 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.1s ease;
    box-shadow: 2px 2px 0 var(--mc-shadow);
}

.anim-frame-item .anim-frame-remove:hover {
    background: var(--mc-redstone);
    color: #fff;
}

.anim-note {
    margin-top: 15px;
    padding: 12px 16px;
    background: rgba(77, 208, 225, 0.12);
    border-left: 4px solid var(--mc-diamond);
    border-radius: 0;
    font-size: 12px;
    color: var(--mc-text-dim);
    line-height: 1.7;
}

/* ===== 动画生成器：文件预览 ===== */
.anim-preview-wrap {
    background: var(--mc-bg-card);
    border: 3px solid var(--mc-stone-dark);
    border-radius: 0;
    padding: 16px;
    margin-top: 15px;
    box-shadow: 4px 4px 0 var(--mc-shadow);
}

.anim-preview-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--mc-stone);
}

.anim-preview-toolbar .layer-btn {
    width: 36px;
    height: 36px;
    background: var(--mc-stone);
    border: 2px solid var(--mc-stone-dark);
    color: #fff;
    border-radius: 0;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.1s ease;
    box-shadow: 2px 2px 0 var(--mc-shadow);
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.anim-preview-toolbar .layer-btn:hover:not(:disabled) {
    border-color: var(--mc-green);
    background: var(--mc-stone-light);
}

.anim-preview-toolbar .layer-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.anim-preview-toolbar .layer-info {
    font-size: 13px;
    color: var(--mc-text);
    padding: 6px 14px;
    background: rgba(124, 179, 66, 0.15);
    border: 2px solid var(--mc-green);
    border-radius: 0;
    font-weight: 600;
    box-shadow: 2px 2px 0 var(--mc-shadow);
}

.anim-preview-toolbar .layer-select {
    background: var(--mc-bg);
    border: 2px solid var(--mc-stone);
    color: var(--mc-text);
    padding: 6px 10px;
    border-radius: 0;
    font-size: 13px;
    max-width: 120px;
    box-shadow: inset 2px 2px 0 rgba(0,0,0,0.08);
}

.anim-preview-canvas-wrap {
    overflow: auto;
    max-height: 520px;
    background: var(--mc-bg-darker);
    border-radius: 0;
    padding: 8px;
    text-align: center;
    box-shadow: inset 2px 2px 0 rgba(0,0,0,0.15);
}

.anim-preview-canvas-wrap canvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: inline-block;
}

.anim-preview-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 3px solid var(--mc-stone);
    max-height: 100px;
    overflow-y: auto;
}

.anim-preview-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    background: var(--mc-bg-darker);
    border-radius: 0;
    font-size: 11px;
    color: var(--mc-text-dim);
    border: 1px solid var(--mc-stone);
}

.anim-preview-legend-item .legend-color {
    width: 12px;
    height: 12px;
    border-radius: 0;
    border: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: 1px 1px 0 rgba(0,0,0,0.2);
}

/* ===== 建筑预览器 ===== */
.pv-stats {
    padding: 10px 14px;
    background: var(--mc-bg-card);
    border: 2px solid var(--mc-stone);
    border-radius: 0;
    font-size: 13px;
    color: var(--mc-text);
    margin-bottom: 14px;
    font-family: var(--body-font);
    box-shadow: 2px 2px 0 var(--mc-shadow);
    font-weight: 600;
}

.pv-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.pv-controls .btn {
    padding: 8px 14px;
    font-size: 13px;
}

.pv-canvas-wrap {
    margin-top: 20px;
    background: var(--mc-bg-darker);
    border: 3px solid var(--mc-stone-dark);
    border-radius: 0;
    padding: 10px;
    overflow: auto;
    text-align: center;
    box-shadow: 4px 4px 0 var(--mc-shadow);
}

.pv-canvas-wrap canvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: inline-block;
    max-width: 100%;
    height: auto;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .navbar {
        flex-direction: row;
        height: 56px;
        padding: 0 10px;
        gap: 8px;
        align-items: center;
    }

    .nav-brand {
        flex-shrink: 0;
        gap: 8px;
    }

    .nav-logo {
        font-size: 22px;
    }

    .nav-title {
        font-size: 11px;
        letter-spacing: 0.5px;
    }

    /* 顶部导航链接：横向排列、可滑动、不换行 */
    .nav-links {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        flex: 1 1 auto;
        gap: 4px;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 4px;
        margin-bottom: -4px;
        white-space: nowrap;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-link {
        flex-shrink: 0;
        font-size: 13px;
        padding: 8px 12px;
        white-space: nowrap;
    }

    .hero-title {
        font-size: 20px;
    }

    .main-content {
        padding: 20px 12px;
    }

    .params-grid {
        grid-template-columns: 1fr;
    }

    .format-selector {
        flex-direction: column;
    }

    .format-arrow {
        transform: rotate(90deg);
    }
}
