:root {
    --bg: #0d0d0d;
    --surface: #181818;
    --surface2: #222222;
    --accent: #c8a96e;
    --accent-dark: #a88a4e;
    --text: #f0ece4;
    --text-muted: #777;
    --border: #2a2a2a;
    --radius: 12px;
    --radius-sm: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; min-height: 100vh; line-height: 1.5; }
header { display: flex; align-items: center; gap: 1.5rem; padding: 0.875rem 2rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: rgba(13,13,13,0.92); backdrop-filter: blur(12px); z-index: 100; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.1rem; font-weight: 700; flex-shrink: 0; }
.logo-icon { color: var(--accent); font-size: 1.4rem; }
nav { display: flex; gap: 0.25rem; flex: 1; }
.nav-btn { background: none; border: none; color: var(--text-muted); padding: 0.4rem 0.875rem; border-radius: 6px; cursor: pointer; font-size: 0.875rem; font-family: inherit; transition: color 0.15s, background 0.15s; }
.nav-btn:hover, .nav-btn.active { color: var(--text); background: var(--surface2); }
.sync-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 0.4rem 0.875rem; border-radius: 6px; cursor: pointer; font-size: 0.8rem; font-family: inherit; transition: all 0.15s; white-space: nowrap; flex-shrink: 0; }
.sync-btn:hover { border-color: var(--accent); color: var(--accent); }
.sync-btn:disabled { opacity: 0.4; cursor: default; }
main { max-width: 1200px; margin: 0 auto; padding: 2.5rem 2rem; }
.tab { display: none; }
.tab.active { display: block; }
.mood-section { max-width: 640px; margin: 0 auto 3rem; text-align: center; }
.mood-label { font-size: 1.5rem; font-weight: 300; margin-bottom: 1.25rem; }
textarea { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 0.95rem; padding: 1rem 1.25rem; resize: none; font-family: inherit; line-height: 1.6; transition: border-color 0.2s; display: block; margin-bottom: 1rem; }
textarea:focus { outline: none; border-color: var(--accent); }
textarea::placeholder { color: var(--text-muted); }
#recommendBtn { background: var(--accent); color: #111; border: none; padding: 0.75rem 2.5rem; border-radius: 50px; font-size: 0.95rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: background 0.15s, transform 0.15s; }
#recommendBtn:hover { background: var(--accent-dark); transform: translateY(-1px); }
#recommendBtn:disabled { opacity: 0.45; cursor: default; transform: none; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.results-grid.hidden { display: none; }
.album-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; }
.album-card:hover { transform: translateY(-3px); box-shadow: 0 16px 48px rgba(0,0,0,0.6); }
.album-card.listened { opacity: 0.38; pointer-events: none; }
.album-cover-wrap { position: relative; aspect-ratio: 1; background: var(--surface2); overflow: hidden; }
.album-cover { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.album-card:hover .album-cover { transform: scale(1.03); }
.album-cover-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3.5rem; color: #333; }
.album-info { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.album-artist { font-size: 0.72rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }
.album-title { font-size: 0.95rem; font-weight: 600; line-height: 1.3; }
.album-meta { font-size: 0.75rem; color: var(--text-muted); }
.album-reason { font-size: 0.8rem; color: #999; line-height: 1.5; font-style: italic; margin-top: 0.5rem; flex: 1; }
.listen-btn { margin-top: 0.875rem; width: 100%; background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 0.55rem 0; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.8rem; font-family: inherit; transition: all 0.15s; }
.listen-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(200,169,110,0.06); }
.loading-wrap { grid-column: 1 / -1; text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.spinner { width: 36px; height: 36px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.empty-state.hidden { display: none; }
.empty-icon { display: block; font-size: 3rem; color: #2a2a2a; margin-bottom: 1rem; }
.section-header { margin-bottom: 1.5rem; }
.section-header h2 { font-size: 1.25rem; font-weight: 500; }
.section-sub { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.25rem; }
.history-list { display: flex; flex-direction: column; gap: 0.625rem; max-width: 580px; }
.history-item { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem 1rem; }
.history-cover { width: 46px; height: 46px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.history-cover-placeholder { width: 46px; height: 46px; border-radius: 6px; background: var(--surface2); display: flex; align-items: center; justify-content: center; color: #333; font-size: 1.25rem; flex-shrink: 0; }
.history-info { flex: 1; min-width: 0; }
.history-title { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-artist { font-size: 0.78rem; color: var(--text-muted); }
.history-date { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.history-empty { color: var(--text-muted); font-size: 0.9rem; padding: 2rem 0; }
.toast { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(8px); background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 0.7rem 1.5rem; border-radius: 50px; font-size: 0.875rem; z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
@media (max-width: 600px) { header { padding: 0.75rem 1rem; gap: 0.75rem; } main { padding: 1.5rem 1rem; } .logo-text { display: none; } .results-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; } .mood-label { font-size: 1.2rem; } }
