/* ============================================================
   辉月工具箱 · 工具页统一样式
   所有工具页复用官网主题变量（--red / --gold / --bg / --card）
   ============================================================ */

[v-cloak] { display: none; }

.ic { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ic svg { display: block; }

/* ---------- 工具页主体 ---------- */
.tool-page {
    padding-top: 78px;
    min-height: 100vh;
    background:
        radial-gradient(circle at 16% 12%, rgba(191, 140, 61, 0.08), transparent 30%),
        radial-gradient(circle at 90% 36%, rgba(163, 22, 32, 0.06), transparent 29%),
        var(--bg);
    color: var(--fg);
}

.tool-page__head {
    padding: 36px 24px 8px;
    text-align: center;
}
.tool-page__title {
    margin: 0;
    font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
    font-size: clamp(26px, 4vw, 40px);
    color: var(--fg);
}
.tool-page__subtitle {
    margin: 10px 0 0;
    color: var(--fg-soft);
    font-size: 15px;
}

/* ---------- 工具导航（顶栏下拉） ---------- */
.tool-nav {
    position: relative;
    justify-self: center;
}
.tool-nav__trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    color: var(--fg-soft);
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}
.tool-nav__trigger:hover { border-color: var(--red); color: var(--red); }
.tool-nav__trigger .ic { color: var(--red); }
.tool-nav__chevron { transition: transform 0.2s; color: var(--fg-faint); }
.tool-nav.open .tool-nav__chevron { transform: rotate(180deg); }

.tool-nav__menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    min-width: 240px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: 0.2s;
    z-index: 1100;
}
.tool-nav.open .tool-nav__menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.tool-nav__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--fg-soft);
    font-size: 14px;
    transition: 0.15s;
}
.tool-nav__item .ic { color: var(--red); }
.tool-nav__item:hover { background: var(--red-soft); color: var(--red); }
.tool-nav__item.is-active { background: var(--red-soft); color: var(--red); font-weight: 650; }

/* ---------- 通用容器 / 卡片 ---------- */
.tool-container {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.tool-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 40%),
        var(--card);
    box-shadow: var(--shadow);
    padding: 22px;
}

.panel-section {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    padding: 14px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
    font-size: 15px;
    color: var(--fg);
}
.section-title .ic { color: var(--red); }

/* ---------- 标题块 / 返回 ---------- */
.title-block { text-align: center; margin-bottom: 22px; }
.title-block h1 {
    margin: 0 0 8px;
    font-family: "Songti SC", serif;
    font-size: clamp(24px, 3.5vw, 34px);
    color: var(--fg);
}
.title-block p { margin: 0; color: var(--fg-soft); font-size: 15px; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--fg-soft);
    font-size: 13px;
    transition: 0.2s;
}
.back-link:hover { border-color: var(--red); color: var(--red); }
.back-link .ic { color: var(--fg-faint); }

/* ---------- 上传区 ---------- */
.upload-area,
.drop-zone {
    border: 2px dashed var(--line-strong);
    border-radius: 14px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    background: var(--red-soft);
}
.upload-area:hover,
.upload-area.dragover,
.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--red);
    background: rgba(163, 22, 32, 0.12);
}
.upload-area .ic,
.drop-zone-icon .ic { color: var(--red); opacity: 0.55; }
.upload-area h3 { margin: 10px 0 6px; font-family: "Songti SC", serif; font-size: 17px; color: var(--fg); }
.upload-icon,
.drop-zone-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto;
    border-radius: 14px;
    color: var(--red);
    background: rgba(163, 22, 32, 0.1);
}
.options-box {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-soft);
    margin: 14px 0;
}
.upload-area p, .drop-zone-text { margin: 0; color: var(--fg-faint); font-size: 13px; }
.upload-area p.sub, .drop-zone-hint { font-size: 12px; margin-top: 3px; }
.file-input { display: none; }
.file-name { margin-top: 6px; font-size: 13px; color: var(--red); font-weight: 600; word-break: break-all; }

/* ---------- 文件信息 ---------- */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg-soft);
    margin-top: 16px;
}
.file-info-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-icon {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 12px;
    color: var(--red);
    background: var(--red-soft);
    flex-shrink: 0;
}
.file-icon .ic { color: var(--red); }
.file-meta { min-width: 0; }
.file-meta .name { font-size: 14px; font-weight: 650; color: var(--fg); word-break: break-all; }
.file-meta .size { font-size: 12px; color: var(--fg-faint); margin-top: 2px; }
.remove-btn {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--fg-faint);
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
}
.remove-btn:hover { border-color: var(--red); color: var(--red); }

/* ---------- 通用卡片（vox2script 等） ---------- */
.card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    padding: 18px;
    margin-bottom: 16px;
}
.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 650;
    font-size: 15px;
    color: var(--fg);
    margin-bottom: 12px;
}
.card-title .ic { color: var(--red); }
.file-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.file-info-row .fname { font-size: 14px; font-weight: 650; color: var(--fg); word-break: break-all; }
.file-info-row .fsize { font-size: 12px; color: var(--fg-faint); margin-top: 2px; }
.form-hint { font-size: 12px; color: var(--fg-faint); margin-top: 5px; }

/* ---------- 表单控件 ---------- */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 650; color: var(--fg); margin-bottom: 6px; }
.form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    color: var(--fg);
    font-size: 14px;
    font-family: inherit;
}
.form-input:focus { outline: none; border-color: var(--red); }
.form-hint { font-size: 12px; color: var(--fg-faint); margin-top: 4px; }

input[type="range"] { width: 100%; accent-color: var(--red); }
input[type="number"] {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    color: var(--fg);
    font-size: 14px;
    font-family: inherit;
}
input[type="number"]:focus { outline: none; border-color: var(--red); }

.checkbox-label,
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--fg-soft);
    cursor: pointer;
}
.checkbox-label input[type="checkbox"],
.checkbox-row input[type="checkbox"] { accent-color: var(--red); width: 16px; height: 16px; }

.radio-group {
    display: flex;
    gap: 4px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 3px;
}
.radio-group input { display: none; }
.radio-group label {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    border-radius: 7px;
    cursor: pointer;
    color: var(--fg-soft);
    transition: 0.2s;
}
.radio-group input:checked + label { background: var(--red); color: #fff8ea; }

.range-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--fg-faint); }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}
.btn .ic { flex: 0 0 auto; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    color: #fff8ea;
    background: linear-gradient(145deg, var(--red-bright), var(--red-deep));
    box-shadow: 0 10px 24px rgba(111, 14, 21, 0.2);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(111, 14, 21, 0.3); }
.btn-secondary {
    color: var(--fg-soft);
    background: var(--card);
    border: 1px solid var(--line-strong);
}
.btn-secondary:hover { border-color: var(--red); color: var(--red); }
.btn-outline {
    color: var(--red);
    background: transparent;
    border: 2px solid var(--red);
}
.btn-outline:hover { background: var(--red-soft); }
.btn-accent { color: #fff8ea; background: var(--gold); }
.btn-accent:hover { background: var(--gold-soft); }
.btn-green { color: #fff; background: #3f8f4f; }
.btn-green:hover { background: #357a42; }
.btn-gray { color: var(--fg-soft); background: var(--bg-soft); border: 1px solid var(--line); }
.btn-gray:hover { border-color: var(--red); color: var(--red); }
.btn-sm {
    width: auto;
    padding: 7px 14px;
    border: none;
    border-radius: 9px;
    background: var(--red);
    color: #fff8ea;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}
.btn-sm:hover { background: var(--red-bright); }
.btn-row, .btn-group, .action-row { display: flex; gap: 10px; }
.btn-row .btn, .action-row .btn { flex: 1; }
.btn-row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.btn-row-head h3 { margin: 0; font-family: "Songti SC", serif; font-size: 16px; color: var(--fg); }

/* 次要小按钮（模型转体素侧栏） */
button.secondary {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: transparent;
    color: var(--fg-soft);
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}
button.secondary:hover { border-color: var(--red); color: var(--red); }

/* ---------- 进度 ---------- */
.progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--fg-soft);
}
.progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
}
.progress-bar, .progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold), var(--red-bright));
    transition: width 0.3s;
}
.progress-text { text-align: center; font-size: 12px; color: var(--fg-soft); margin-top: 6px; }

/* ---------- 结果 / 统计 ---------- */
.result-box {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    background: var(--bg-soft);
    margin-top: 18px;
}
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 14px 0; }
.stats-grid--4 { grid-template-columns: repeat(4, 1fr); }
.stat-cell, .stat-item {
    padding: 16px;
    text-align: center;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--card);
}
.stat-value { font-family: Georgia, serif; font-size: 24px; font-weight: 700; color: var(--red); }
.stat-label { font-size: 12px; color: var(--fg-soft); margin-top: 4px; }
.stats-info {
    display: flex;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--line);
    font-size: 12px;
    color: var(--fg-soft);
    margin-bottom: 14px;
}

/* ---------- 文件列表 ---------- */
.file-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    transition: 0.2s;
}
.file-item:hover { background: var(--red-soft); }
.file-item .ficon { color: var(--red); }
.file-item .fname { font-size: 13px; font-weight: 600; color: var(--fg); }
.file-item .ftype { font-size: 11px; color: var(--fg-faint); margin-top: 2px; }

/* ---------- 模式切换 / 标签页 ---------- */
.mode-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 16px;
}
.mode-tab {
    flex: 1;
    padding: 9px 12px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--fg-soft);
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}
.mode-tab.active { background: var(--red); color: #fff8ea; }

.tab-buttons { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; background: var(--bg-soft); border-radius: 10px; margin-bottom: 12px; }
.script-tabs { margin-bottom: 12px; }
.output-section.inactive { opacity: 0.55; }
.tab-btn {
    padding: 7px 14px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--fg-soft);
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
    font-family: inherit;
}
.tab-btn.active { background: var(--red); color: #fff8ea; }

/* ---------- 文本输入 ---------- */
.input-label { display: block; font-weight: 600; color: var(--fg); margin-bottom: 8px; font-size: 14px; }
.text-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    color: var(--fg);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}
.text-input:focus { outline: none; border-color: var(--red); }
.input-meta { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--fg-faint); }

/* ---------- 音色网格 ---------- */
.voice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.voice-card {
    position: relative;
    border: 2px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: 0.2s;
    background: var(--card);
}
.voice-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.voice-card.selected { border-color: var(--red); background: var(--red-soft); }
.voice-check {
    position: absolute;
    top: 8px; right: 8px;
    width: 20px; height: 20px;
    background: var(--red);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.voice-card.selected .voice-check { display: flex; }
.voice-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.voice-head .ic { font-size: 18px; color: var(--red); }
.voice-head .name { font-weight: 650; color: var(--fg); font-size: 14px; }
.voice-desc { font-size: 12px; color: var(--fg-faint); }
.voice-tag {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 8px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    color: var(--fg-soft);
    font-size: 11px;
    border-radius: 999px;
}

/* ---------- 高级设置 ---------- */
.adv-box {
    padding: 14px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 16px;
}
.adv-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.adv-head span { font-weight: 650; color: var(--fg); font-size: 14px; }
.adv-toggle {
    background: none; border: none;
    color: var(--red); font-size: 13px;
    cursor: pointer; font-family: inherit;
}
.adv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.adv-item label { display: block; font-size: 13px; color: var(--fg-soft); margin-bottom: 6px; }
.range-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--fg-faint); }
.range-meta .val { color: var(--red); font-weight: 600; }

/* ---------- 音频 ---------- */
.audio-player {
    background: linear-gradient(135deg, var(--bg-soft), var(--card));
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
}
.audio-player audio { width: 100%; }
.audio-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--fg-faint); margin-bottom: 12px; }

/* ---------- 批量结果 ---------- */
.batch-list { display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow-y: auto; }
.batch-summary {
    display: flex;
    gap: 14px;
    font-size: 13px;
    color: var(--fg-soft);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.batch-summary .ok { color: #3f8f4f; }
.batch-summary .fail { color: var(--red); }
.batch-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
}
.batch-item.error { border-color: var(--red); background: var(--red-soft); }
.batch-info { flex: 1; min-width: 0; }
.batch-idx { font-size: 13px; color: var(--fg-soft); margin-bottom: 4px; }
.batch-text { font-size: 13px; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-err { color: var(--red); font-size: 12px; }
.batch-actions { display: flex; gap: 6px; flex-shrink: 0; }
.mini-btn {
    padding: 5px 12px;
    border: none;
    border-radius: 7px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}
.mini-btn.play { background: var(--red-soft); color: var(--red); }
.mini-btn.download { background: rgba(63, 143, 79, 0.14); color: #3f8f4f; }

/* ---------- 预览 ---------- */
.preview-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.result-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.result-label h3 { margin: 0; font-family: "Songti SC", serif; font-size: 16px; color: var(--fg); }
.result-label span { font-size: 12px; color: var(--fg-faint); }
.pct { font-size: 12px; color: var(--fg-faint); }
.preview-label h3 { margin: 0; font-family: "Songti SC", serif; font-size: 16px; color: var(--fg); }
.preview-label span { font-size: 12px; color: var(--fg-faint); }
.preview-box {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}
.preview-box img { max-width: 100%; max-height: 320px; object-fit: contain; }

.scale-label { display: block; font-size: 13px; font-weight: 650; color: var(--fg); margin-bottom: 8px; }
.scale-row { display: flex; gap: 8px; }
.scale-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    color: var(--fg-soft);
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}
.scale-btn.active { border-color: var(--red); background: var(--red-soft); color: var(--red); }

/* ---------- 功能说明 ---------- */
.feature-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.feature-cell {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
}
.feature-cell .ic { color: var(--red); margin-bottom: 8px; }
.feature-cell h3 { margin: 0 0 4px; font-size: 15px; color: var(--fg); }
.feature-cell p { margin: 0; font-size: 12px; color: var(--fg-soft); }

/* ---------- 代码输出 / 提示 ---------- */
.code-output {
    background: #14100e;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    color: #e8d9c4;
    white-space: pre-wrap;
    word-break: break-all;
}
.tip-box {
    background: var(--red-soft);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 14px;
    margin-top: 14px;
}
.tip-box h4 { margin: 0 0 8px; font-size: 13px; color: var(--red); }
.tip-box p { margin: 0; font-size: 13px; color: var(--fg-soft); line-height: 1.6; }

/* ---------- 状态点 ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot.ok { background: #3f8f4f; }
.dot.warn { background: var(--gold); }
.dot.err { background: var(--red); }
.dot.none { background: var(--fg-faint); }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 9999;
    padding: 12px 24px;
    border-radius: 999px;
    background: var(--fg);
    color: var(--bg-soft);
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #3f8f4f; color: #fff; }
.toast.error { background: #c0392b; color: #fff; }

/* ---------- 动画 ---------- */
.fade-enter-active { animation: hy-fade-in 0.45s ease-in; }
@keyframes hy-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- 3D 画布 ---------- */
#previewCanvas {
    width: 100%;
    height: 280px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: block;
}
.preview-wrap { position: relative; }
.preview-hint {
    position: absolute;
    bottom: 12px;
    right: 14px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
}

.footer-note { text-align: center; margin-top: 24px; color: var(--fg-faint); font-size: 12px; }

/* ---------- 模型转体素 · 左右分栏 ---------- */
.tool-split {
    position: fixed;
    top: 78px;
    left: 0; right: 0; bottom: 0;
    display: grid;
    grid-template-columns: 320px 1fr;
    overflow: hidden;
    background: var(--bg-soft);
}
.tool-split__sidebar {
    overflow-y: auto;
    background: var(--bg);
    border-right: 1px solid var(--line);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.tool-split__sidebar::-webkit-scrollbar { display: none; }
.tool-split__stage { position: relative; background: #0a0f18; }
.tool-split__stage canvas { display: block; }

.file-drop-zone, .texture-drop-zone {
    display: block;
    border: 2px dashed var(--line-strong);
    border-radius: 12px;
    padding: 16px 10px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    background: var(--red-soft);
    font-size: 13px;
    color: var(--fg-soft);
    margin: 6px 0;
}
.file-drop-zone:hover, .file-drop-zone.dragover,
.texture-drop-zone:hover, .texture-drop-zone.dragover {
    border-color: var(--red);
    background: rgba(163, 22, 32, 0.12);
}
.texture-drop-zone { background: var(--card); }
.file-drop-zone p, .texture-drop-zone p { margin: 0; }
.file-drop-zone .sub, .texture-drop-zone .sub { font-size: 11px; color: var(--fg-faint); margin-top: 3px; }
.file-status, .texture-status { font-size: 12px; color: var(--fg-faint); margin-top: 4px; word-break: break-all; }
.file-status.success, .texture-status.success { color: #3f8f4f; }
.file-status.error, .texture-status.error { color: var(--red); }
.hidden-input { position: absolute; opacity: 0; width: 0.1px; height: 0.1px; overflow: hidden; }

.param-row { margin-bottom: 10px; }
.param-row label { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--fg); margin-bottom: 6px; }
.value-display { padding: 2px 9px; border-radius: 999px; color: #fff8ea; background: var(--red); font-size: 11px; font-weight: 700; }

.progress-container { text-align: center; padding: 4px 0; }
.progress-container progress { width: 100%; height: 8px; border-radius: 4px; overflow: hidden; accent-color: var(--red); }

.custom-select-wrap { position: relative; margin: 6px 0; }
.custom-select-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    cursor: pointer;
    font-size: 12px;
    color: var(--fg-soft);
    transition: 0.2s;
}
.custom-select-btn:hover { border-color: var(--red); }
.color-swatch { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); flex-shrink: 0; }
.btn-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select-options {
    display: none;
    position: absolute;
    z-index: 100;
    top: 100%;
    left: 0; right: 0;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-soft);
    box-shadow: var(--shadow);
}
.custom-select-options.active { display: block; }
.custom-select-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    cursor: pointer;
    font-size: 11px;
    color: var(--fg-soft);
    transition: 0.15s;
}
.custom-select-option:hover { background: var(--red-soft); color: var(--red); }

.replace-row { margin-top: 8px; }
.replace-status { font-size: 11px; color: var(--fg-faint); margin-top: 4px; }
.flip-options { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.batch-input { width: 70px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--fg); font-size: 12px; text-align: center; }

button.export-btn { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--fg-soft); font-size: 13px; cursor: pointer; transition: 0.2s; font-family: inherit; }
button.export-btn:hover { border-color: var(--red); color: var(--red); }
button.lua-export { color: var(--red); border-color: var(--red); }

/* ---------- 像素画 · 分栏 ---------- */
.pixel-layout {
    display: flex;
    gap: 16px;
    padding: 16px;
    min-height: calc(100vh - 78px);
}
.pixel-controls {
    width: 320px;
    flex-shrink: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}
.pixel-controls h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-family: "Songti SC", serif; font-size: 16px; color: var(--red); }
.control-group { display: flex; flex-direction: column; gap: 6px; }
.control-group label { font-size: 13px; font-weight: 650; color: var(--fg); }
.control-group .hint { font-size: 12px; color: var(--fg-faint); }
.number-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    color: var(--fg);
    font-size: 14px;
    font-family: inherit;
}
.pixel-preview { flex: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pixel-preview-row { display: flex; gap: 16px; flex: 1; min-height: 0; }
.preview-card {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.preview-card .card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    font-weight: 650;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--fg);
    flex-shrink: 0;
}
.preview-card .card-header .ic { color: var(--red); }
.preview-card .card-header .size-info { font-size: 12px; color: var(--fg-faint); font-weight: 400; }
.canvas-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    min-height: 0;
    overflow: hidden;
    background: var(--bg-soft);
}
.canvas-wrap canvas { max-width: 100%; max-height: 100%; object-fit: contain; image-rendering: pixelated; }
.status-bar {
    background: var(--card);
    border-top: 1px solid var(--line);
    padding: 10px 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--fg-soft);
}
.color-pick-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-soft); }
.color-pick-row input[type="color"] { width: 32px; height: 26px; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; background: transparent; }
.color-pick-row.disabled { opacity: 0.4; pointer-events: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .pixel-layout { flex-direction: column; }
    .pixel-controls { width: 100%; max-height: none; }
    .pixel-preview-row { flex-direction: column; }
}
@media (max-width: 820px) {
    .tool-split { top: 70px; grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .tool-split__sidebar { max-height: 45vh; border-right: 0; border-bottom: 1px solid var(--line); }
    .voice-grid { grid-template-columns: repeat(2, 1fr); }
    .adv-grid { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: 1fr; }
    .stats-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
    .btn-row, .action-row { flex-direction: column; }
    .stats-grid { grid-template-columns: 1fr; }
}
