*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ═══════ DEFAULT: 复古街机 ═══════ */
:root {
    --bg: #1a1147;
    --surface: #221658;
    --surface-dim: #2d1f6e;
    --border: rgba(0, 240, 255, 0.2);
    --border-light: rgba(0, 240, 255, 0.1);
    --text: #e0e0ff;
    --text-secondary: #a0a0d0;
    --text-muted: #6060a0;
    --accent: #00f0ff;
    --accent-hover: #00c8d4;
    --accent-light: rgba(0, 240, 255, 0.1);
    --accent-glow: rgba(0, 240, 255, 0.3);
    --success: #39ff14;
    --success-bg: rgba(57, 255, 20, 0.1);
    --error: #ff2d7b;
    --error-bg: rgba(255, 45, 123, 0.1);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --display-font: 'Press Start 2P', monospace;
    --body-font: 'Space Mono', 'IBM Plex Mono', monospace;
    --mono-font: 'Space Mono', 'IBM Plex Mono', monospace;
}

/* ═══════ 温暖工坊 ═══════ */
body[data-theme="workshop"] {
    --bg: #f5f0eb;
    --surface: #ffffff;
    --surface-dim: #ede8e2;
    --border: #e0d8cf;
    --border-light: #ece6de;
    --text: #1a1612;
    --text-secondary: #6b5e52;
    --text-muted: #9c8e80;
    --accent: #c2694a;
    --accent-hover: #a8583c;
    --accent-light: rgba(194, 105, 74, 0.08);
    --accent-glow: rgba(194, 105, 74, 0.15);
    --success: #3d8b5e;
    --success-bg: rgba(61, 139, 94, 0.08);
    --error: #c24a4a;
    --error-bg: rgba(194, 74, 74, 0.08);
    --display-font: 'Space Grotesk', sans-serif;
    --body-font: 'DM Sans', system-ui, sans-serif;
    --mono-font: 'IBM Plex Mono', monospace;
}
body[data-theme="workshop"] .header h1 { text-shadow: none; }
body[data-theme="workshop"] .header h1 em { text-shadow: none; }
body[data-theme="workshop"] .eyebrow { letter-spacing: 0.12em; }
body[data-theme="workshop"] .icon-box { border: 1px solid var(--border-light); box-shadow: none; border-radius: var(--radius); }
body[data-theme="workshop"] .card { overflow: visible; }
body[data-theme="workshop"] .card::after { display: none; }
body[data-theme="workshop"] .fetch-btn { text-transform: none; letter-spacing: normal; }
body[data-theme="workshop"] .preset.active, body[data-theme="workshop"] .fpill.active { box-shadow: none; }

/* ═══════ 紫色渐变 ═══════ */
body[data-theme="purple"] {
    --bg: #667eea;
    --surface: rgba(255,255,255,0.92);
    --surface-dim: rgba(255,255,255,0.6);
    --border: rgba(255,255,255,0.35);
    --border-light: rgba(255,255,255,0.2);
    --text: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --accent: #667eea;
    --accent-hover: #5a67d8;
    --accent-light: rgba(102, 126, 234, 0.1);
    --accent-glow: rgba(102, 126, 234, 0.2);
    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.1);
    --error: #dc2626;
    --error-bg: rgba(220, 38, 38, 0.1);
}
body[data-theme="purple"] { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
body[data-theme="purple"] .card { backdrop-filter: blur(12px); }
body[data-theme="purple"] .eyebrow { color: rgba(255,255,255,0.7); }
body[data-theme="purple"] .header h1 { color: white; }
body[data-theme="purple"] .header h1 em { color: #fbbf24; }
body[data-theme="purple"] .header-sub { color: rgba(255,255,255,0.8); }
body[data-theme="purple"] .foot { color: rgba(255,255,255,0.5); border-color: rgba(255,255,255,0.15); }
body[data-theme="purple"] .foot a { color: rgba(255,255,255,0.7); }
body[data-theme="purple"] .foot a:hover { color: white; }

/* ═══════ 暗夜霓虹 ═══════ */
body[data-theme="neon"] {
    --bg: #0c0c1d;
    --surface: #14142b;
    --surface-dim: #1a1a36;
    --border: rgba(139, 92, 246, 0.15);
    --border-light: rgba(139, 92, 246, 0.08);
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-light: rgba(139, 92, 246, 0.12);
    --accent-glow: rgba(139, 92, 246, 0.25);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.12);
}
body[data-theme="neon"] .icon-box {
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.2), 0 0 60px rgba(236, 72, 153, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* ═══════ 日式侘寂 ═══════ */
body[data-theme="wabisabi"] {
    --bg: #e8e0d4;
    --surface: #f2ede6;
    --surface-dim: #ddd5c8;
    --border: #c8bfb0;
    --border-light: #d8d0c4;
    --text: #2c2c2c;
    --text-secondary: #6a6258;
    --text-muted: #9a9088;
    --accent: #7d8a6e;
    --accent-hover: #6a775c;
    --accent-light: rgba(125, 138, 110, 0.1);
    --accent-glow: rgba(125, 138, 110, 0.15);
    --success: #7d8a6e;
    --success-bg: rgba(125, 138, 110, 0.1);
    --error: #b07060;
    --error-bg: rgba(176, 112, 96, 0.1);
    --display-font: 'Noto Serif SC', serif;
    --body-font: 'Noto Serif SC', 'DM Sans', serif;
}
body[data-theme="wabisabi"] .icon-box {
    border-radius: 4px;
    border: 1.5px solid var(--border);
    border-style: dashed;
}
body[data-theme="wabisabi"] .header h1 { letter-spacing: 0.02em; }
body[data-theme="wabisabi"] .card {
    border-radius: 4px;
    border: 1px solid var(--border);
}
body[data-theme="wabisabi"] .eyebrow { letter-spacing: 0.2em; font-size: 0.6rem; }

/* ═══════ 赛博终端 ═══════ */
body[data-theme="terminal"] {
    --bg: #0a0e14;
    --surface: #111820;
    --surface-dim: #1a2230;
    --border: #1e3a2a;
    --border-light: #162a20;
    --text: #c0d0d0;
    --text-secondary: #708888;
    --text-muted: #405858;
    --accent: #00ff9f;
    --accent-hover: #00cc7f;
    --accent-light: rgba(0, 255, 159, 0.08);
    --accent-glow: rgba(0, 255, 159, 0.2);
    --success: #00ff9f;
    --success-bg: rgba(0, 255, 159, 0.08);
    --error: #ffb000;
    --error-bg: rgba(255, 176, 0, 0.08);
    --display-font: 'JetBrains Mono', 'IBM Plex Mono', monospace;
    --body-font: 'JetBrains Mono', 'IBM Plex Mono', monospace;
    --mono-font: 'JetBrains Mono', 'IBM Plex Mono', monospace;
}
body[data-theme="terminal"] .card {
    border: 1px solid var(--accent);
    border-radius: 0;
    box-shadow: 0 0 20px rgba(0, 255, 159, 0.05);
}
body[data-theme="terminal"] .icon-box {
    border-radius: 0;
    border: 1px solid var(--accent);
    background: #0d1218;
}
body[data-theme="terminal"] .eyebrow { color: var(--accent); }
body[data-theme="terminal"] .header h1 { font-family: var(--mono-font); color: var(--accent); text-shadow: 0 0 10px rgba(0,255,159,0.3); }
body[data-theme="terminal"] .header h1 em { color: #ffb000; text-shadow: 0 0 10px rgba(255,176,0,0.3); }
body[data-theme="terminal"] .header-sub { color: var(--text-secondary); font-family: var(--mono-font); font-size: 0.75rem; }
body[data-theme="terminal"] .url-input { border-radius: 0; font-family: var(--mono-font); font-size: 0.82rem; }
body[data-theme="terminal"] .fetch-btn { border-radius: 0; text-transform: uppercase; letter-spacing: 0.1em; font-family: var(--mono-font); }
body[data-theme="terminal"] .preset, body[data-theme="terminal"] .fpill { border-radius: 0; font-family: var(--mono-font); }
body[data-theme="terminal"] .dl-btn { border-radius: 0; font-family: var(--mono-font); text-transform: uppercase; letter-spacing: 0.05em; }
body[data-theme="terminal"] .size-badge { border-radius: 0; }
body[data-theme="terminal"] .meta-pill { border-radius: 0; font-family: var(--mono-font); }
body[data-theme="terminal"] .toast { border-radius: 0; font-family: var(--mono-font); }
body[data-theme="terminal"] .section-label { font-family: var(--mono-font); }
body[data-theme="terminal"] .foot { font-family: var(--mono-font); font-size: 0.6rem; }
body[data-theme="terminal"] .format-block { border-color: var(--border); }

/* ═══════ 极光渐变 ═══════ */
body[data-theme="aurora"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-dim: #273548;
    --border: rgba(13, 148, 136, 0.2);
    --border-light: rgba(13, 148, 136, 0.1);
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #0d9488;
    --accent-hover: #0f766e;
    --accent-light: rgba(13, 148, 136, 0.1);
    --accent-glow: rgba(13, 148, 136, 0.25);
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.1);
    --error: #f87171;
    --error-bg: rgba(248, 113, 113, 0.1);
}
body[data-theme="aurora"] .header { position: relative; padding-bottom: 1.5rem; }
body[data-theme="aurora"] .header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, #0d9488, #34d399, #a78bfa, #0d9488);
    background-size: 200% 100%;
    animation: aurora-shift 4s ease-in-out infinite;
}
@keyframes aurora-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
body[data-theme="aurora"] .icon-box {
    box-shadow: 0 0 25px rgba(13, 148, 136, 0.15), 0 0 50px rgba(167, 139, 250, 0.08);
}
body[data-theme="aurora"] .header h1 em { color: #34d399; }
body[data-theme="aurora"] .eyebrow { color: #34d399; }

/* ═══════ 瑞士极简 ═══════ */
body[data-theme="swiss"] {
    --bg: #ffffff;
    --surface: #f8f8f8;
    --surface-dim: #f0f0f0;
    --border: #e0e0e0;
    --border-light: #eee;
    --text: #000000;
    --text-secondary: #555555;
    --text-muted: #999999;
    --accent: #e53935;
    --accent-hover: #c62828;
    --accent-light: rgba(229, 57, 53, 0.06);
    --accent-glow: rgba(229, 57, 53, 0.12);
    --success: #2e7d32;
    --success-bg: rgba(46, 125, 50, 0.06);
    --error: #e53935;
    --error-bg: rgba(229, 57, 53, 0.06);
    --display-font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --body-font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --mono-font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
body[data-theme="swiss"] .header h1 {
    font-family: var(--display-font);
    font-weight: 700;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}
body[data-theme="swiss"] .header h1 em { color: var(--accent); }
body[data-theme="swiss"] .eyebrow { font-family: var(--mono-font); font-weight: 700; letter-spacing: 0.15em; }
body[data-theme="swiss"] .card { border-radius: 0; border: 2px solid #000; }
body[data-theme="swiss"] .icon-box { border-radius: 0; border: 2px solid #000; }
body[data-theme="swiss"] .preset, body[data-theme="swiss"] .fpill { border-radius: 0; border-width: 2px; font-weight: 700; }
body[data-theme="swiss"] .preset.active, body[data-theme="swiss"] .fpill.active { border-color: var(--accent); }
body[data-theme="swiss"] .fetch-btn { border-radius: 0; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
body[data-theme="swiss"] .dl-btn { border-radius: 0; text-transform: uppercase; font-weight: 700; }
body[data-theme="swiss"] .size-badge { border-radius: 0; font-weight: 700; }
body[data-theme="swiss"] .url-input { border-radius: 0; border-width: 2px; }
body[data-theme="swiss"] .meta-pill { border-radius: 0; }
body[data-theme="swiss"] .toast { border-radius: 0; }
body[data-theme="swiss"] .size-block { border-top: 2px solid #000; padding-top: 1.25rem; }
body[data-theme="swiss"] .format-block { border-top: 2px solid #000; }
body[data-theme="swiss"] .preview { border-bottom: 2px solid #000; }
body[data-theme="swiss"] .foot { border-top: 2px solid #000; }
body[data-theme="swiss"] .section-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.15em; }

/* ═══════ BASE STYLES ═══════ */
body {
    background: var(--bg);
    font-family: var(--body-font);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
}

/* ═══════ Arcade-only base styles (default) ═══════ */
body:not([data-theme]) .header h1 { text-shadow: 0 0 20px rgba(0, 240, 255, 0.5); }
body:not([data-theme]) .header h1 em { color: #ff2d7b; text-shadow: 0 0 20px rgba(255, 45, 123, 0.5); }
body:not([data-theme]) .eyebrow { letter-spacing: 0.2em; }
body:not([data-theme]) .icon-box { border: 2px solid var(--accent); box-shadow: 0 0 15px rgba(0, 240, 255, 0.3), inset 0 0 15px rgba(0, 240, 255, 0.05); }
body:not([data-theme]) .card { position: relative; overflow: hidden; }
body:not([data-theme]) .card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.08) 2px, rgba(0,0,0,0.08) 4px);
    pointer-events: none;
    border-radius: var(--radius);
}
body:not([data-theme]) .fetch-btn { text-transform: uppercase; letter-spacing: 0.08em; }
body:not([data-theme]) .preset.active, body:not([data-theme]) .fpill.active { box-shadow: 0 0 10px rgba(0, 240, 255, 0.4); }

.page {
    max-width: 600px;
    margin: 0 auto;
    padding: 3rem 1.5rem 3rem;
}

/* ── Header ── */
.header {
    margin-bottom: 2.5rem;
    position: relative;
}

.brand-mark {
    width: 54px;
    height: 54px;
    margin-bottom: 14px;
    border-radius: 16px;
    display: block;
    box-shadow: 0 14px 34px rgba(0,0,0,0.18), 0 0 0 1px var(--border-light);
}

.eyebrow {
    font-family: var(--mono-font);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 8px;
}

.header h1 {
    font-family: var(--display-font);
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.05;
    color: var(--text);
    letter-spacing: -0.03em;
}

.header h1 em {
    font-style: normal;
    color: var(--accent);
}

.header-sub {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* ── Theme Switcher ── */
.theme-switcher {
    position: absolute;
    top: 0;
    right: 0;
}

.theme-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
}

.theme-btn:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.theme-dropdown {
    position: absolute;
    top: 44px;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px;
    width: 200px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    display: none;
    z-index: 100;
}

.theme-dropdown.open { display: block; }

.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 0.78rem;
    color: var(--text);
    transition: background 0.12s;
}

.theme-option:hover { background: var(--accent-light); }
.theme-option.active { background: var(--accent-light); font-weight: 600; }

.theme-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.theme-name { flex: 1; }

.theme-check {
    font-size: 0.7rem;
    color: var(--accent);
    opacity: 0;
}

.theme-option.active .theme-check { opacity: 1; }

/* ── Input ── */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
}

.url-input {
    flex: 1;
    padding: 0.85rem 1.1rem;
    font-size: 0.92rem;
    font-family: inherit;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.url-input::placeholder { color: var(--text-muted); }

.url-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.fetch-btn {
    padding: 0 1.6rem;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}

.fetch-btn:hover:not(:disabled) { background: var(--accent-hover); }
.fetch-btn:active:not(:disabled) { transform: scale(0.97); }
.fetch-btn:disabled { opacity: 0.45; cursor: wait; }

/* ── Card ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    animation: card-in 0.4s ease-out;
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Preview ── */
.preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.icon-box {
    background: var(--surface-dim);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    flex-shrink: 0;
    position: relative;
    width: 180px;
    height: 180px;
}

#faviconImg {
    object-fit: contain;
    display: block;
    border-radius: 6px;
    width: 100%;
    height: 100%;
}

.meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    width: fit-content;
    font-family: var(--mono-font);
}

.meta-pill.idle { background: var(--surface-dim); color: var(--text-muted); }
.meta-pill.ok { background: var(--success-bg); color: var(--success); }
.meta-pill.err { background: var(--error-bg); color: var(--error); }

.meta-line {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.meta-line strong {
    color: var(--text);
    font-family: var(--mono-font);
    font-weight: 600;
    font-size: 0.76rem;
}

.switch-btn {
    font-family: var(--mono-font);
    font-size: 0.66rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s;
    display: none;
    width: fit-content;
}

.switch-btn:hover { border-color: var(--accent); color: var(--accent); }
.switch-btn.visible { display: inline-flex; align-items: center; gap: 4px; }

/* ── Section Labels ── */
.section-label {
    font-family: var(--mono-font);
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* ── Size ── */
.size-block {
    margin-bottom: 1.5rem;
}

.size-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.size-badge {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--accent-light);
    color: var(--accent);
}

input[type="range"] {
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: var(--surface-dim);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 3px solid var(--surface);
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.presets {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.preset {
    font-family: var(--mono-font);
    font-size: 0.66rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s;
}

.preset:hover { border-color: var(--text-muted); color: var(--text); }

.preset.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ── Format ── */
.format-block {
    border-top: 1px solid var(--border-light);
    padding-top: 1.25rem;
}

.format-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.format-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.fpill {
    font-family: var(--mono-font);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s;
}

.fpill:hover { border-color: var(--text-muted); color: var(--text); }

.fpill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.dl-btn {
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    padding: 9px 22px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--success);
    color: white;
    cursor: pointer;
    transition: background 0.12s, transform 0.1s;
}

.dl-btn:hover:not(:disabled) { filter: brightness(0.85); }
.dl-btn:active:not(:disabled) { transform: scale(0.97); }
.dl-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Toast ── */
.toast-area { margin-top: 1rem; }

.toast {
    font-size: 0.78rem;
    padding: 8px 14px;
    border-radius: var(--radius-xs);
    animation: toast-in 0.2s ease-out;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast.ok { background: var(--success-bg); color: var(--success); }
.toast.err { background: var(--error-bg); color: var(--error); }

/* ── Spinner ── */
.spin {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 480px) {
    .page { padding: 2rem 1rem; }
    .brand-mark { width: 46px; height: 46px; margin-bottom: 12px; }
    .header h1 { font-size: 2rem; }
    .input-group { flex-direction: column; }
    .fetch-btn { padding: 0.75rem; text-align: center; }
    .preview { flex-direction: column; gap: 16px; }
    .format-row { flex-direction: column; align-items: stretch; }
    .dl-btn { text-align: center; }
    .theme-switcher { position: static; margin-top: 10px; display: flex; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}