:root {
    --bg-color: #121214;
    --card-bg: #1e1e24;
    --accent-color: #ff9f43;
    --text-color: #f0f0f5;
    --border-color: #33333d;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 550px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 24px;
}

h1 {
    margin: 0;
    color: var(--accent-color);
}

.subtitle {
    color: #888;
    margin-top: 4px;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.card h2 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 16px;
    color: #bbb;
}

.file-upload label {
    display: block;
    padding: 16px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
}

.file-upload label:hover {
    border-color: var(--accent-color);
    background-color: rgba(255, 159, 67, 0.05);
}

#audio-input {
    display: none;
}

#audio-preview {
    width: 100%;
    margin-top: 12px;
}

.form-group {
    margin-bottom: 16px;
}

select {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    background-color: #2a2a35;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-size: 1rem;
}

button {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: none;
    background-color: var(--accent-color);
    color: #000;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
}

button:disabled {
    background-color: #444;
    color: #888;
    cursor: not-allowed;
}

button:not(:disabled):hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

#result-output {
    background-color: #0a0a0c;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    color: #00ff66;
    font-family: 'Consolas', monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

/* --- 共通レイアウト & カード設定 --- */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
    background: #e0e0e0;
    color: #555;
    margin-bottom: 16px;
}

.status-badge.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.result-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.placeholder-text {
    color: #888;
    font-style: italic;
    font-size: 0.95rem;
}

/* --- 汎用 UI Schema パーツ 1: メトリックカード --- */
.ui-metric-card {
    max-width: 100%;
    /* 親の container からはみ出さないようにする */
    box-sizing: border-box;
    /* 余白を含めたサイズ計算にする */
    background: #f8f9fa;
    border-left: 5px solid #ff9800;
    /* 動的カラー変更可能 */
    border-radius: 6px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ui-metric-card .label {
    font-size: 0.85rem;
    color: #666;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ui-metric-card .value {
    font-size: 1.6rem;
    font-weight: bold;
    color: #222;
    margin-top: 4px;
}

.ui-metric-card .unit {
    font-size: 0.9rem;
    color: #666;
    margin-left: 4px;
}

/* --- 汎用 UI Schema パーツ 2: ゲージメーター --- */
.ui-meter-bg {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    margin-top: 8px;
    overflow: hidden;
}

.ui-meter-fill {
    height: 100%;
    background: #ff9800;
    transition: width 0.3s ease;
}

/* --- 汎用 UI Schema パーツ 3: スペクトラムバーグラフ --- */
.ui-bars-container {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    background: #1e1e1e;
    padding: 10px;
    border-radius: 8px;
    margin-top: 8px;
}

.ui-bar {
    flex: 1;
    background: linear-gradient(to top, #ff9800, #f44336);
    border-radius: 2px 2px 0 0;
    transition: height 0.2s ease;
}

/* --- 汎用 UI Schema パーツ 4: キーバリューリスト --- */
.ui-kv-list {
    margin-top: 8px;
}

.ui-kv-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.ui-kv-row:last-child {
    border-bottom: none;
}

/* 折りたたみJSON */
.json-details {
    margin-top: 20px;
    font-size: 0.85rem;
    color: #666;
}

.json-details summary {
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 8px;
}

/* HTMLが直せない場合の強制中央寄せ */
body>* {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}