/* ====== MC 皮肤魔法屋 — 可爱主题 v3 ====== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --pink: #f8a5c2; --pink2: #f78fb3; --pink3: #fbc2d5; --pink4: #fde8ef;
    --mint: #7ecba1; --mint2: #a8e6cf;
    --purple: #b8a9e8; --purple2: #d5cdf2;
    --bg: #fef9fb; --card: rgba(255,255,255,0.75);
    --card2: rgba(253,245,248,0.8); --border: rgba(240,220,228,0.6);
    --text: #4a3548; --text2: #8b7282;
    --shadow: 0 4px 20px rgba(240,180,200,0.2);
    --shadow-lg: 0 12px 40px rgba(240,180,200,0.25);
    --radius: 20px; --radius-sm: 14px; --radius-xs: 10px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text); min-height: 100vh; line-height: 1.6;
    position: relative;
    background: #fef5f8;
}
body::before {
    content: ''; position: fixed; inset: -5%;
    background: url('../bj/bj1.png') center/cover no-repeat;
    z-index: -2; animation: bgDrift 40s ease-in-out infinite alternate;
}
@keyframes bgDrift { 0% { transform: scale(1.05) translate(0, 0); } 50% { transform: scale(1.1) translate(-1%, 1%); } 100% { transform: scale(1.05) translate(1%, -0.5%); } }

/* ====== 背景装饰 ====== */
.bg-dots {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image: radial-gradient(circle, rgba(248,165,194,0.15) 1px, transparent 1px), radial-gradient(circle, rgba(184,169,232,0.1) 1.5px, transparent 1.5px);
    background-size: 28px 28px, 42px 42px; background-position: 0 0, 14px 14px;
}
.bg-dots::before {
    content: ''; position: fixed; width: 300px; height: 300px; border-radius: 50%;
    background: radial-gradient(circle, rgba(248,165,194,0.1), transparent 70%);
    top: -80px; right: -80px; animation: bgFloat 8s ease-in-out infinite;
}
.bg-dots::after {
    content: ''; position: fixed; width: 250px; height: 250px; border-radius: 50%;
    background: radial-gradient(circle, rgba(184,169,232,0.1), transparent 70%);
    bottom: -60px; left: -60px; animation: bgFloat 10s ease-in-out infinite reverse;
}
@keyframes bgFloat { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,-20px) scale(1.1); } }

/* 浮动粒子 */
.bg-sparkles { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.sparkle {
    position: absolute; width: 4px; height: 4px; border-radius: 50%;
    background: var(--pink2); animation: sparkleFloat 6s ease-in-out infinite;
    opacity: 0;
}
@keyframes sparkleFloat {
    0% { opacity: 0; transform: translateY(100vh) scale(0); }
    10% { opacity: 0.7; }
    90% { opacity: 0.7; }
    100% { opacity: 0; transform: translateY(-10vh) scale(1.5); }
}

/* ====== Layout ====== */
.app { position: relative; z-index: 1; max-width: 1260px; margin: 0 auto; padding: 20px 20px 60px; }
.app-header { text-align: center; padding: 28px 0 20px; animation: fadeSlideIn 0.6s ease; }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.logo { font-size: 3rem; font-weight: 800; color: var(--pink2); letter-spacing: 1px; }
.header-top { display: flex; align-items: center; justify-content: center; position: relative; }
.header-top .btn-login, .header-top .user-info { position: absolute; right: 0; }
.btn-login {
    padding: 8px 20px; border: 1px solid var(--pink3); border-radius: 20px;
    background: var(--card); color: var(--pink2); cursor: pointer;
    font-size: 0.85rem; font-weight: 600; font-family: inherit;
    backdrop-filter: blur(10px); transition: all 0.2s;
}
.btn-login:hover { background: var(--pink4); }
.user-info { display: flex; align-items: center; gap: 10px; }
.user-email { font-size: 0.85rem; color: var(--text2); }
.btn-logout {
    padding: 6px 14px; border: 1px solid var(--border); border-radius: 20px;
    background: transparent; color: var(--text2); cursor: pointer;
    font-size: 0.8rem; font-family: inherit; transition: all 0.2s;
}
.btn-logout:hover { background: var(--pink4); color: var(--text); }
.login-body { padding: 20px; }
.login-field { margin-bottom: 14px; }
.login-field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.email-input-row { display: flex; align-items: center; gap: 0; }
.login-input {
    flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
    background: var(--card2); color: var(--text); font-size: 0.9rem; font-family: inherit; outline: none;
}
.login-input:focus { border-color: var(--pink3); }
.email-suffix {
    padding: 10px 14px; background: var(--border); border-radius: 0 8px 8px 0;
    font-size: 0.9rem; color: var(--text2); white-space: nowrap; font-weight: 600;
    margin-left: -1px; border: 1px solid var(--border); border-left: 0;
}
.code-row { display: flex; gap: 8px; }
.code-row .login-input { flex: 1; }
.btn-send-code {
    padding: 10px 16px; border: 1px solid var(--pink3); border-radius: 8px;
    background: var(--pink4); color: var(--pink2); cursor: pointer;
    font-size: 0.82rem; font-weight: 600; font-family: inherit; white-space: nowrap;
    transition: all 0.2s;
}
.btn-send-code:hover { background: var(--pink3); }
.btn-send-code:disabled { opacity: 0.5; cursor: not-allowed; }
.code-hint { font-size: 0.72rem; color: var(--text2); margin-top: 4px; display: block; }
.login-note { font-size: 0.72rem; color: var(--text2); margin-top: 12px; text-align: center; }
.nav { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.nav-item {
    padding: 8px 22px; border-radius: 30px; font-size: 0.85rem; font-weight: 600;
    text-decoration: none; color: var(--text2); background: var(--card);
    border: 1px solid var(--border); transition: all 0.25s; cursor: pointer;
    backdrop-filter: blur(10px); font-family: inherit;
}
.nav-item:hover { border-color: var(--pink); color: var(--pink2); transform: translateY(-1px); }
.nav-item.active { background: linear-gradient(135deg, var(--pink2), var(--purple)); color: #fff; border-color: transparent; box-shadow: 0 4px 15px rgba(248,143,179,0.3); }

.layout { display: flex; gap: 20px; align-items: flex-start; margin-top: 8px; }
.sidebar { flex: 0 0 340px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 20px; animation: fadeSlideIn 0.8s ease 0.1s both; }
.preview-area { flex: 1; animation: fadeSlideIn 0.8s ease 0.2s both; }
#panelConvert:not(.hidden) { animation: fadeSlideIn 0.5s ease; }

/* ====== Card — 毛玻璃 ====== */
.card {
    background: rgba(255,255,255,0.85); border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow);
    overflow: hidden; backdrop-filter: blur(12px);
    transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-head {
    display: flex; align-items: center; gap: 6px; padding: 16px 18px 0;
    font-size: 0.9rem; font-weight: 700; color: var(--text);
}
.card-icon { font-size: 1.1rem; }

/* ====== Upload ====== */
.upload-card { padding-bottom: 18px; }
.upload-zone {
    margin: 12px 14px 0; border: 2px dashed var(--border); border-radius: var(--radius-sm);
    min-height: 180px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s; overflow: hidden;
    animation: uploadPulse 3s ease-in-out infinite;
}
@keyframes uploadPulse {
    0%,100% { border-color: var(--border); }
    50% { border-color: var(--pink3); }
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--pink); background: var(--pink4); }
.upload-placeholder { text-align: center; padding: 24px; color: var(--text2); }
.upload-emoji { font-size: 2.5rem; margin-bottom: 8px; }
.upload-placeholder p { font-size: 0.9rem; font-weight: 600; }
.upload-placeholder span { font-size: 0.75rem; }
.upload-preview { position: relative; width: 100%; }
.upload-preview img { width: 100%; max-height: 220px; object-fit: contain; display: block; }
.btn-xs {
    position: absolute; top: 8px; right: 8px; padding: 4px 12px;
    border-radius: 20px; font-size: 0.75rem; cursor: pointer;
    border: 1px solid rgba(0,0,0,0.1); background: rgba(255,255,255,0.9); color: var(--text2);
    transition: all 0.2s; font-family: inherit;
}
.btn-xs:hover { background: #fff; }

/* ====== Resolution ====== */
.reso-group { display: flex; gap: 8px; padding: 12px 18px 18px; }
.reso-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 12px 8px; border: 2px solid var(--border); border-radius: var(--radius-sm);
    background: transparent; cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.reso-btn:hover { border-color: var(--pink3); transform: translateY(-1px); }
.reso-btn.active { border-color: var(--pink2); background: var(--pink4); animation: resoGlow 2s ease-in-out infinite; }
@keyframes resoGlow {
    0%,100% { box-shadow: 0 0 0 rgba(248,143,179,0); }
    50% { box-shadow: 0 0 12px rgba(248,143,179,0.25); }
}
.reso-num { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.reso-tag { font-size: 0.7rem; color: var(--text2); }

/* ====== Generate Button ====== */
.btn-generate {
    width: 100%; padding: 15px; border: none; border-radius: var(--radius);
    font-size: 1rem; font-weight: 700; cursor: pointer; font-family: inherit;
    background: linear-gradient(135deg, var(--pink2), var(--purple));
    color: #fff; box-shadow: 0 4px 16px rgba(248,165,194,0.4);
    transition: all 0.25s; position: relative; overflow: hidden;
}
.btn-generate:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(248,165,194,0.5); }
.btn-generate:not(:disabled) { animation: glowPulse 2.5s ease-in-out infinite; }
@keyframes glowPulse {
    0%,100% { box-shadow: 0 4px 16px rgba(248,165,194,0.4); }
    50% { box-shadow: 0 4px 24px rgba(200,150,230,0.55); }
}
.btn-generate:disabled { opacity: 0.75; cursor: not-allowed; transform: none; animation: none; }
.btn-generate:disabled:hover { box-shadow: 0 4px 16px rgba(248,165,194,0.4); }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: dotBounce 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBounce { 0%,80%,100% { transform: translateY(0); } 40% { transform: translateY(-6px); } }

/* ====== Preview Area ====== */
.preview-card { display: flex; flex-direction: column; }
.preview-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.preview-title { display: flex; align-items: center; gap: 6px; font-size: 0.95rem; font-weight: 700; }
.preview-badge {
    display: flex; align-items: center; gap: 6px; padding: 5px 14px;
    border-radius: 20px; font-size: 0.75rem; font-weight: 600;
    background: var(--pink4); color: var(--pink2);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pink3); }
.dot.running { background: var(--pink2); animation: pulse 1s infinite; }
.dot.success { background: var(--mint); }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(1.3); } }

.preview-empty {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 60px 20px; color: var(--text2); gap: 8px;
}
.empty-img { font-size: 3.5rem; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.preview-empty p { font-size: 0.9rem; font-weight: 600; }
.preview-empty span { font-size: 0.78rem; }

.preview-body { display: flex; flex-direction: column; gap: 14px; padding: 14px; }

/* ====== 3D Viewer ====== */
.viewer-wrap {
    border-radius: var(--radius-sm); overflow: hidden;
    background: linear-gradient(180deg, #fef5f8 0%, #fdf0f4 50%, #fce8ef 100%);
    border: 1px solid var(--border); position: relative;
}
.viewer-wrap canvas { display: block; width: 100%; height: 400px; cursor: grab; }
.viewer-wrap canvas:active { cursor: grabbing; }
.viewer-toolbar {
    display: flex; align-items: center; gap: 4px; padding: 8px 10px;
    background: rgba(255,255,255,0.85); border-top: 1px solid var(--border);
    flex-wrap: wrap; justify-content: space-between;
}
.tool-group { display: flex; gap: 2px; }
.tool-btn {
    padding: 5px 10px; border: 1px solid transparent; border-radius: 20px;
    background: transparent; color: var(--text2); cursor: pointer;
    font-size: 0.78rem; font-family: inherit; transition: all 0.15s;
}
.tool-btn:hover { background: var(--pink4); color: var(--text); transform: translateY(-1px); }
.tool-btn.active { background: var(--pink4); color: var(--pink2); border-color: var(--pink3); font-weight: 600; box-shadow: 0 2px 8px rgba(248,165,194,0.2); }

/* ====== Preview Footer ====== */
.preview-footer { display: flex; gap: 14px; align-items: flex-start; }
.texture-card { flex: 0 0 auto; }
.texture-head { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.3px; }
.texture-size { font-weight: 400; font-size: 0.7rem; color: var(--pink2); }
.texture-wrap {
    background: #fef5f8; border: 1px solid var(--border); border-radius: var(--radius-xs);
    padding: 8px; display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
}
.texture-wrap img {
    image-rendering: pixelated; display: block; cursor: pointer;
}
.texture-wrap .texture-64 { width: 128px; height: auto; }
.texture-wrap .texture-128 { width: 192px; height: auto; }
.texture-hint { font-size: 0.65rem; color: var(--pink3); margin-top: 4px; display: block; text-align: center; }
.texture-hint span { cursor: pointer; text-decoration: underline; }

.action-group { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.btn-pink, .btn-purple {
    width: 100%; padding: 12px 20px; border: none; border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 700; cursor: pointer; font-family: inherit;
    transition: all 0.2s; color: #fff;
}
.btn-pink { background: linear-gradient(135deg, var(--pink2), var(--pink)); box-shadow: 0 4px 14px rgba(248,165,194,0.35); }
.btn-pink:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 6px 20px rgba(248,165,194,0.45); transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1); }
.btn-purple { background: linear-gradient(135deg, var(--purple), #cbb8f0); box-shadow: 0 4px 14px rgba(184,169,232,0.35); }
.btn-purple:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 6px 20px rgba(184,169,232,0.45); transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1); }

/* ====== History ====== */
.history-card { margin-top: 14px; }
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; padding: 12px 18px 18px; }
.history-item {
    border-radius: var(--radius-xs); overflow: hidden; border: 2px solid var(--border);
    cursor: pointer; transition: all 0.2s; background: var(--card2); aspect-ratio: 1;
}
.history-item {
    animation: cardIn 0.4s ease both;
}
@keyframes cardIn {
    from { opacity: 0; transform: scale(0.9) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.history-item:hover { border-color: var(--pink2); transform: translateY(-3px) scale(1.03); box-shadow: var(--shadow); }
.history-item img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
.history-empty { text-align: center; padding: 20px; color: var(--text2); font-size: 0.8rem; }

/* Texture lightbox */
.texture-lightbox {
    position: fixed; inset: 0; z-index: 2000; background: rgba(40,20,35,0.92);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    cursor: pointer; backdrop-filter: blur(8px);
}
.texture-lightbox img { image-rendering: pixelated; max-width: 90vw; max-height: 80vh; border-radius: var(--radius-xs); box-shadow: 0 0 0 2px rgba(255,255,255,0.15); }
.texture-lightbox p { color: rgba(255,255,255,0.5); font-size: 0.8rem; }

/* ====== Modal ====== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(74,53,72,0.45); backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
    background: rgba(255,255,255,0.9); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); max-width: 95vw; max-height: 90vh;
    overflow: hidden; backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.5);
    animation: popIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
.modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 20px; border-bottom: 1px solid var(--border);
    font-size: 1rem; font-weight: 700; background: rgba(255,255,255,0.5);
    flex-wrap: wrap;
}
.editor-mode-switch { display: flex; gap: 4px; }
.mode-btn {
    padding: 5px 14px; border: 1px solid var(--border); border-radius: 20px;
    background: transparent; color: var(--text2); cursor: pointer;
    font-size: 0.8rem; font-family: inherit; transition: all 0.2s;
}
.mode-btn:hover { border-color: var(--pink3); color: var(--text); }
.mode-btn.active { background: var(--pink2); color: #fff; border-color: var(--pink2); }
.modal-close {
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
    background: rgba(255,255,255,0.6); cursor: pointer; font-size: 1rem; color: var(--text2);
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.modal-close:hover { background: var(--pink4); border-color: var(--pink3); transform: rotate(90deg); }

/* Editor */
/* ====== Convert Result ====== */
.result-card {
    background: var(--card); border-radius: var(--radius-sm); border: 1px solid var(--border);
    padding: 14px; text-align: center; backdrop-filter: blur(8px);
}
.result-card h3 { font-size: 0.8rem; font-weight: 600; color: var(--text2); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.3px; }
.result-img-box {
    background: #fef5f8; border: 1px solid var(--border); border-radius: var(--radius-xs);
    padding: 10px; display: flex; align-items: center; justify-content: center;
    min-height: 100px;
}
.result-img-box img { max-width: 100%; max-height: 180px; }
.result-img-box.pixelated img { image-rendering: pixelated; }
.img-info { font-size: 0.72rem; color: var(--text2); margin-top: 6px; }

.editor-box { width: 95vw; max-width: 1400px; }
.editor-body { display: flex; height: 78vh; min-height: 600px; }
.editor-canvas-area { flex: 1; display: flex; flex-direction: column; background: #f5f0f5; min-width: 0; }
.editor-grid-wrap { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 0; }
.editor-grid-wrap canvas { image-rendering: pixelated; max-width: 100%; max-height: 100%; box-shadow: 0 0 0 1px var(--border); cursor: crosshair; display: block; }
.editor-3d-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(180deg, #fef5f8 0%, #fdf0f4 50%, #fce8ef 100%); position: relative; }
.editor-3d-wrap canvas { display: block; max-width: 100%; max-height: 100%; cursor: grab; }
.editor-3d-wrap.paint-mode canvas { cursor: crosshair; }
.editor-3d-toolbar { position: absolute; bottom: 10px; display: flex; gap: 4px; align-items: center; background: rgba(255,255,255,0.85); border-radius: 20px; padding: 4px 8px; backdrop-filter: blur(8px); border: 1px solid var(--border); }
.toolbar-sep { width: 1px; height: 18px; background: var(--border); margin: 0 2px; }
.editor-hint { text-align: center; padding: 6px; font-size: 0.7rem; color: var(--text2); }
.editor-status-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border-top: 1px solid var(--border); background: var(--card2); }
.editor-status { font-size: 0.72rem; color: var(--text2); }
.editor-sidebar { flex: 0 0 200px; padding: 12px; display: flex; flex-direction: column; gap: 8px; border-left: 1px solid var(--border); overflow: hidden; background: var(--card2); }
.editor-section { display: flex; flex-direction: column; gap: 4px; }
.editor-section label { font-size: 0.75rem; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.3px; }
.editor-section input[type="color"] { width: 100%; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-xs); cursor: pointer; padding: 2px; }
.editor-section input[type="range"] { width: 100%; accent-color: var(--pink2); }
.recent-colors { display: flex; gap: 4px; flex-wrap: wrap; }
.recent-color { width: 24px; height: 24px; border-radius: 4px; border: 1px solid var(--border); cursor: pointer; transition: transform 0.1s; }
.recent-color:hover { transform: scale(1.2); }

.color-shades { display: flex; gap: 6px; margin-top: 6px; }
.shade-swatch {
    flex: 1; height: 28px; border-radius: 4px; border: 2px solid transparent;
    cursor: pointer; transition: all 0.15s;
}
.shade-swatch:hover { transform: scale(1.08); }
.shade-swatch.active { border-color: var(--text); box-shadow: 0 0 0 2px rgba(255,255,255,0.5); }
.tool-row { display: flex; gap: 4px; }
.tool-row .tool-btn { flex: 1; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.tool-grid .tool-btn { justify-content: flex-start; padding: 6px 8px; font-size: 0.75rem; white-space: nowrap; }
.full { width: 100%; }
.btn-outline { font-family: inherit; }
.dpad { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dpad-row { display: flex; gap: 2px; }
.dpad-btn {
    width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--card2); cursor: pointer; font-size: 1rem; color: var(--text);
    display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.dpad-btn:hover { background: var(--pink4); border-color: var(--pink3); }
.sel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 6px; }
.sel-actions .tool-btn { text-align: center; justify-content: center; }
#editorSelectionPanel { animation: fadeSlideIn 0.3s ease; }
.brush-custom { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.brush-x { font-size: 0.85rem; font-weight: 700; color: var(--text2); }
.brush-num {
    width: 56px; padding: 5px 6px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--card2); color: var(--text); font-size: 0.8rem; font-family: inherit; outline: none; text-align: center;
}
.brush-num:focus { border-color: var(--pink3); }
.brush-custom-btns { display: flex; gap: 4px; margin-top: 4px; }
.brush-custom-btns .tool-btn { flex: 1; text-align: center; justify-content: center; }
.editor-zoom { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.editor-zoom .mode-btn { font-size: 0.85rem; }

/* ====== Utils ====== */
.hidden { display: none !important; }

/* ====== Responsive ====== */
@media (max-width: 900px) {
    .layout { flex-direction: column; }
    .sidebar { flex: none; width: 100%; position: static; }
    .viewer-wrap canvas { height: 300px; }
    .preview-footer { flex-direction: column; }
    .editor-body { flex-direction: column; height: auto; }
    .editor-sidebar { flex: none; flex-direction: row; flex-wrap: wrap; border-left: none; border-top: 1px solid var(--border); }
    .editor-box { width: 100%; }
}
@media (max-width: 480px) {
    .logo { font-size: 1.5rem; }
    .app { padding: 12px 8px; }
}
