:root { /* Color Palette */    --bg-base: #f0f2f5; --card-bg: rgba(255, 255, 255, 0.75); --card-border: rgba(255, 255, 255, 0.5); --card-shadow: 0 8px 32px rgba(31, 38, 135, 0.07); --primary: #4f46e5; --primary-hover: #4338ca; --primary-glow: rgba(79, 70, 229, 0.3); --secondary: #0ea5e9; --secondary-hover: #0284c7; --secondary-glow: rgba(14, 165, 233, 0.3); --warm: #f43f5e; --warm-hover: #e11d48; --warm-glow: rgba(244, 63, 94, 0.3); --text-main: #1e293b; --text-muted: #64748b; --text-light: #94a3b8; --input-bg: rgba(255, 255, 255, 0.9); --input-border: #cbd5e1; --input-focus: #4f46e5; /* Metrics & Typography */    --radius-sm: 8px; --radius-md: 16px; --radius-lg: 24px; --radius-round: 9999px; --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; --font-mono: 'JetBrains Mono', Consolas, monospace; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); background: var(--bg-base); background-image: radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.08) 0px, transparent 50%),                      radial-gradient(at 100% 0%, rgba(14, 165, 233, 0.08) 0px, transparent 50%),                      radial-gradient(at 100% 100%, rgba(244, 63, 94, 0.05) 0px, transparent 50%); background-attachment: fixed; color: var(--text-main); line-height: 1.6; min-height: 100vh; -webkit-font-smoothing: antialiased; letter-spacing: -0.01em; }
.glass-panel { background: var(--card-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--card-border); border-radius: var(--radius-md); box-shadow: var(--card-shadow); }
#header { position: sticky; top: 0; z-index: 100; background: rgba(255, 255, 255, 0.65); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid rgba(255, 255, 255, 0.3); }
.header-inner { max-width: 1040px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo h1 { font-size: 1.25rem; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -0.03em; }
.badge { font-size: 0.65rem; padding: 3px 8px; background: var(--primary); color: #fff; border-radius: var(--radius-round); font-weight: 700; box-shadow: 0 2px 10px var(--primary-glow); }
.nav-link { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; font-weight: 600; padding: 8px 16px; border-radius: var(--radius-round); transition: all 0.3s ease; background: rgba(255, 255, 255, 0.5); border: 1px solid transparent; }
.nav-link:hover { color: var(--primary); background: #fff; border-color: rgba(79, 70, 229, 0.2); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); }
#main { max-width: 1040px; margin: 0 auto; padding: 32px 24px 60px; display: flex; flex-direction: column; gap: 24px; }
.section { }
.section-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 16px; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ''; display: block; width: 4px; height: 14px; background: var(--primary); border-radius: 2px; }
.clickable { cursor: pointer; user-select: none; transition: color 0.2s; }
.clickable:hover { color: var(--primary); }
details.collapsible { background: var(--card-bg); backdrop-filter: blur(12px); border: 1px solid #fff; border-radius: var(--radius-md); padding: 16px 20px; box-shadow: var(--card-shadow); transition: all 0.3s ease; }
details.collapsible[open] { box-shadow: 0 12px 40px rgba(31, 38, 135, 0.1); }
details.collapsible > summary { list-style: none; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 0.95rem; color: var(--text-main); outline: none; }
details.collapsible > summary::before { content: '+'; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; background: rgba(0,0,0,0.05); border-radius: 50%; font-size: 1.1rem; font-weight: 400; color: var(--text-muted); transition: 0.3s; }
details.collapsible[open] > summary::before { content: '−'; background: var(--primary); color: #fff; }
details.collapsible > summary::-webkit-details-marker { display: none; }
.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.genre-card { background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.6); border-radius: var(--radius-md); padding: 16px 12px; cursor: pointer; text-align: center; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03); position: relative; overflow: hidden; }
.genre-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08); background: #fff; }
.genre-card.active { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 8px 20px var(--primary-glow); }
.genre-card-name { font-size: 0.9rem; font-weight: 700; color: var(--text-main); }
.genre-card.active .genre-card-name { color: var(--primary); }
.genre-card-detail { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.params-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; grid-template-columns: 1fr; }
.param-group { background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(255, 255, 255, 0.8); border-radius: var(--radius-sm); padding: 12px 16px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02); transition: background 0.2s; }
.param-group:hover { background: #fff; }
.param-group label { display: block; font-size: 0.7rem; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; letter-spacing: 0.5px; }
.param-row { display: flex; align-items: center; gap: 12px; }
.param-value { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600; color: var(--primary); min-width: 42px; text-align: right; background: rgba(79, 70, 229, 0.1); padding: 2px 6px; border-radius: 4px; }
.switch-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; cursor: pointer; border-radius: var(--radius-round); background: #e2e8f0; transition: 0.3s cubic-bezier(0.4, 0.0, 0.2, 1); box-shadow: inset 0 2px 4px rgba(0,0,0,0.05); }
.switch .slider::before { content: ''; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: 0.3s cubic-bezier(0.4, 0.0, 0.2, 1); box-shadow: 0 2px 5px rgba(0,0,0,0.15); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch-label { font-size: 0.85rem; font-weight: 500; color: var(--text-main); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; background: #e2e8f0; border-radius: var(--radius-round); outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.15); transition: border-width 0.1s; }
input[type="range"]::-webkit-slider-thumb:active { border-width: 5px; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
select { width: 100%; padding: 8px 12px; background: var(--input-bg); color: var(--text-main); border: 1px solid var(--input-border); border-radius: var(--radius-sm); font-family: var(--font-sans); font-size: 0.85rem; font-weight: 500; outline: none; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; transition: all 0.2s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); }
.action-buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 10px 0; flex-direction: column; width: 100%; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; font-family: var(--font-sans); font-size: 0.9rem; font-weight: 600; border: none; border-radius: var(--radius-round); cursor: pointer; transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1); letter-spacing: 0.3px; }
.btn-large { padding: 14px 32px; font-size: 1rem; width: 100%; justify-content: center; }
.btn-small { padding: 4px 10px; font-size: 0.75rem; }
.btn-primary { background: linear-gradient(135deg, var(--primary), #6366f1); color: #fff; box-shadow: 0 4px 15px var(--primary-glow); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px var(--primary-glow); }
.btn-accent { background: linear-gradient(135deg, var(--secondary), #38bdf8); color: #fff; box-shadow: 0 4px 15px var(--secondary-glow); }
.btn-accent:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px var(--secondary-glow); }
.btn-secondary { background: #fff; color: var(--text-main); border: 1px solid var(--input-border); box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.btn-secondary:hover:not(:disabled) { border-color: var(--text-light); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.06); }
.btn-warm { background: linear-gradient(135deg, var(--warm), #fb7185); color: #fff; box-shadow: 0 4px 15px var(--warm-glow); }
.btn-warm:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px var(--warm-glow); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; background: #e2e8f0; color: #94a3b8; border: none; }
.status-bar, .piano-roll-container, .code-output { background: var(--card-bg); backdrop-filter: blur(12px); border: 1px solid #fff; border-radius: var(--radius-md); box-shadow: var(--card-shadow); margin-bottom: 16px; overflow: hidden; }
.status-bar { padding: 12px 20px; position: relative; display: flex; justify-content: space-between; align-items: center; }
.status-text { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.status-text.active { color: var(--primary); font-weight: 600; }
.status-progress { position: absolute; bottom: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--primary), var(--secondary)); width: 0%; transition: width 0.3s ease; }
.stats-panel { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.stats-panel:empty { display: none; }
.stats-panel .stat { background: #fff; border: 1px solid rgba(0,0,0,0.05); border-radius: var(--radius-round); padding: 6px 14px; display: flex; gap: 8px; align-items: center; font-size: 0.75rem; box-shadow: 0 2px 6px rgba(0,0,0,0.02); }
.stat-label { color: var(--text-light); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.65rem; }
.stat-value { color: var(--primary); font-family: var(--font-mono); font-weight: 600; }
.piano-roll-container { background: #fff; padding: 4px; }
#pianoRollCanvas { width: 100%; height: 280px; display: block; border-radius: calc(var(--radius-md) - 4px); background: #fafafc; height: 200px; }
.play-info { text-align: center; font-size: 0.9rem; font-weight: 500; color: var(--text-muted); min-height: 22px; margin-top: 8px; }
.play-info.success { color: var(--secondary); }
.play-info.error { color: var(--warm); }
.code-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: rgba(0,0,0,0.02); border-bottom: 1px solid rgba(0,0,0,0.05); font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.code-output pre { margin: 0; padding: 16px; max-height: 300px; overflow: auto; background: #fafbfc; }
.code-output code { font-family: var(--font-mono); font-size: 0.8rem; color: #334155; line-height: 1.6; }
.volume-container { display: flex; align-items: center; gap: 16px; background: var(--card-bg); backdrop-filter: blur(16px); border: 1px solid #fff; border-radius: var(--radius-round); padding: 12px 24px; box-shadow: var(--card-shadow); max-width: 400px; margin: 0 auto; padding: 8px 16px; width: 100%; max-width: none; }
.volume-slider { flex: 1; }
.volume-icon { font-size: 0.9rem; font-weight: 700; color: var(--text-muted); cursor: pointer; user-select: none; transition: 0.2s; background: #f1f5f9; padding: 6px 12px; border-radius: var(--radius-round); }
.volume-icon:hover { background: #e2e8f0; color: var(--text-main); }
.volume-icon.muted { text-decoration: line-through; opacity: 0.5; }
.volume-value { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 600; color: var(--secondary); min-width: 44px; text-align: right; }
.shortcut-hint { text-align: center; margin-top: 16px; font-size: 0.75rem; color: var(--text-light); user-select: none; }
kbd { display: inline-block; padding: 2px 6px; background: #fff; border: 1px solid var(--input-border); border-radius: 4px; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; color: var(--text-muted); margin: 0 2px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
#footer { border-top: 1px solid rgba(0,0,0,0.05); background: transparent; padding-bottom: 24px; }
.footer-inner { max-width: 1040px; margin: 0 auto; padding: 20px 24px; display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; font-size: 0.8rem; color: var(--text-light); }
.footer-inner a { color: var(--primary); text-decoration: none; font-weight: 500; }
.footer-inner a:hover { text-decoration: underline; }
.toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%) translateY(40px); background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(8px); color: #fff; padding: 12px 24px; border-radius: var(--radius-round); font-size: 0.9rem; font-weight: 500; box-shadow: 0 10px 25px rgba(0,0,0,0.2); z-index: 9999; opacity: 0; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); pointer-events: none; }
.toast.visible { transform: translateX(-50%) translateY(0); opacity: 1; }
.composing-anim { animation: cPulse 1.2s ease-in-out infinite; }
@keyframes cPulse { 0%, 100% { box-shadow: 0 4px 15px var(--primary-glow); transform: scale(1); }
50% { box-shadow: 0 8px 30px rgba(79, 70, 229, 0.5); transform: scale(1.02); }
}


@media(max-width: 768px) { .header-inner, #main, .footer-inner { padding-left: 16px; padding-right: 16px; }
