/* ============================================
   AI Vocal - Style
   ============================================ */

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-card: #1e2130;
    --bg-hover: #252836;
    --border: #2a2d3a;
    --border-light: #32364a;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a3b0;
    --text-muted: #6b6f80;
    --accent: #6366f1;
    --accent-hover: #5558e6;
    --accent-light: rgba(99,102,241,0.15);
    --accent-glow: rgba(99,102,241,0.3);
    --success: #10b981;
    --success-light: rgba(16,185,129,0.15);
    --warning: #f59e0b;
    --warning-light: rgba(245,158,11,0.15);
    --error: #ef4444;
    --error-light: rgba(239,68,68,0.15);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 12px rgba(0,0,0,0.4);
    --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { font-size:16px; scroll-behavior:smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary); color: var(--text-primary); line-height:1.6; min-height:100vh;
    -webkit-font-smoothing: antialiased;
}

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; z-index: 999;
    background: rgba(0,0,0,0.75); display: flex; align-items: center; justify-content: center;
}
.modal-box {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
    max-width: 520px; width: 90%; padding: 32px;
}
.modal-box h3 { font-size:1.2rem; margin-bottom:16px; }
.modal-box ol { padding-left:20px; color:var(--text-secondary); font-size:0.92rem; line-height:1.8; margin-bottom:20px; }
.modal-box li { margin-bottom:6px; }
.modal-btn {
    display:block; width:100%; padding:12px; border:none; border-radius:var(--radius);
    background:var(--accent); color:#fff; font-size:0.95rem; font-weight:600; cursor:pointer; transition:var(--transition);
}
.modal-btn:hover { background:var(--accent-hover); }

/* Navbar */
.navbar { position:sticky; top:0; z-index:100; background:rgba(15,17,23,0.85); backdrop-filter:blur(12px); border-bottom:1px solid var(--border); }
.nav-container { max-width:800px; margin:0 auto; padding:0 24px; height:56px; display:flex; align-items:center; justify-content:space-between; }
.nav-logo { font-weight:600; font-size:1.1rem; }
.nav-status { display:flex; align-items:center; gap:8px; font-size:0.85rem; color:var(--text-secondary); }
.status-dot { width:8px; height:8px; border-radius:50%; background:var(--text-muted); }
.status-dot.online { background:var(--success); box-shadow:0 0 8px var(--success); }
.status-dot.offline { background:var(--error); box-shadow:0 0 8px var(--error); }

/* Main */
.main-container { max-width:800px; margin:0 auto; padding:32px 24px 80px; }

.hero-section { text-align:center; padding:40px 0 32px; }
.hero-section h1 { font-size:2.2rem; font-weight:700; letter-spacing:-0.5px; background:linear-gradient(135deg, var(--accent),#8b5cf6,#ec4899); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.hero-subtitle { color:var(--text-secondary); font-size:1rem; }

/* Queue */
.queue-bar { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:16px 20px; margin-bottom:24px; }
.queue-info { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; font-size:0.9rem; }
.queue-label { color:var(--text-secondary); font-weight:500; }
.queue-value strong { color:var(--accent); }
.queue-indicator { height:6px; background:var(--bg-secondary); border-radius:3px; overflow:hidden; }
.queue-fill { height:100%; border-radius:3px; transition:width 0.4s; max-width:100%; }
.queue-fill { background:linear-gradient(90deg,var(--success),var(--accent)); }

/* Section */
.section-title { font-size:1.15rem; font-weight:600; margin-bottom:16px; color:var(--text-primary); }

/* Model cards */
.model-section { margin-bottom:32px; }
.model-cards { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.model-card { background:var(--bg-card); border:2px solid var(--border); border-radius:var(--radius-lg); padding:20px; cursor:pointer; transition:var(--transition); position:relative; }
.model-card:hover { border-color:var(--accent); background:var(--bg-hover); }
.model-card.selected { border-color:var(--accent); background:var(--accent-light); box-shadow:0 0 20px var(--accent-glow); }
.model-card .check-mark { position:absolute; top:12px; right:12px; width:24px; height:24px; border-radius:50%; background:var(--accent); display:flex; align-items:center; justify-content:center; opacity:0; transform:scale(0.5); transition:var(--transition); color:#fff; font-size:12px; }
.model-card.selected .check-mark { opacity:1; transform:scale(1); }
.model-card.loading { grid-column:1/-1; text-align:center; color:var(--text-muted); cursor:default; }
.model-name { font-size:1.05rem; font-weight:600; margin-bottom:4px; }
.model-desc { font-size:0.85rem; color:var(--text-secondary); margin-bottom:8px; }
.model-stats { font-size:0.8rem; color:var(--text-muted); }

/* Upload */
.upload-section { margin-bottom:32px; }
.upload-area { background:var(--bg-card); border:2px dashed var(--border); border-radius:var(--radius-lg); padding:48px 24px; text-align:center; cursor:pointer; transition:var(--transition); }
.upload-area:hover, .upload-area.drag-over { border-color:var(--accent); background:var(--accent-light); }
.upload-text { font-size:1rem; color:var(--text-secondary); margin-bottom:8px; }
.upload-link { color:var(--accent); font-weight:500; }
.upload-hint { font-size:0.8rem; color:var(--text-muted); }

/* File info */
.file-info { margin-top:16px; }
.file-card { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; display:flex; align-items:center; gap:14px; }
.file-details { flex:1; min-width:0; }
.file-name { font-weight:500; font-size:0.95rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.file-meta { display:flex; gap:12px; font-size:0.82rem; color:var(--text-muted); }
.btn-remove { background:transparent; border:none; color:var(--text-muted); cursor:pointer; font-size:1.4rem; padding:4px 8px; border-radius:var(--radius-sm); transition:var(--transition); }
.btn-remove:hover { color:var(--error); background:var(--error-light); }

/* Params */
.params-section { margin-top:20px; background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:20px; }
.param-row { display:flex; flex-direction:column; gap:12px; }
.param-label { font-size:0.9rem; font-weight:500; color:var(--text-secondary); }
.param-tip { font-weight:400; color:var(--text-muted); font-size:0.8rem; margin-left:8px; }
.pitch-control { display:flex; align-items:center; gap:12px; }
.pitch-btn { width:36px; height:36px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--bg-secondary); color:var(--text-primary); font-size:1.2rem; cursor:pointer; transition:var(--transition); }
.pitch-btn:hover { border-color:var(--accent); background:var(--accent-light); }
.pitch-value { font-size:1.5rem; font-weight:700; color:var(--accent); min-width:40px; text-align:center; }
.pitch-slider { flex:1; -webkit-appearance:none; height:6px; background:var(--bg-secondary); border-radius:3px; outline:none; }
.pitch-slider::-webkit-slider-thumb { -webkit-appearance:none; width:20px; height:20px; border-radius:50%; background:var(--accent); cursor:pointer; box-shadow:0 0 10px var(--accent-glow); }

/* Submit */
.btn-submit { margin-top:20px; width:100%; padding:14px 20px; border:none; border-radius:var(--radius); background:var(--accent); color:#fff; font-size:1rem; font-weight:600; cursor:pointer; transition:var(--transition); }
.btn-submit:hover:not(:disabled) { background:var(--accent-hover); transform:translateY(-1px); box-shadow:0 4px 20px var(--accent-glow); }
.btn-submit:disabled { opacity:0.5; cursor:not-allowed; }

/* Error */
.error-msg { margin-top:12px; padding:12px 16px; background:var(--error-light); border:1px solid rgba(239,68,68,0.3); border-radius:var(--radius-sm); color:#fca5a5; font-size:0.9rem; }

/* Status */
.status-section { margin-bottom:32px; }
.status-card { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-lg); padding:24px; }
.status-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.status-badge { padding:4px 12px; border-radius:20px; font-size:0.82rem; font-weight:600; background:var(--accent-light); color:var(--accent); }
.status-badge.status-processing { background:var(--warning-light); color:var(--warning); }
.status-badge.status-completed { background:var(--success-light); color:var(--success); }
.status-badge.status-failed { background:var(--error-light); color:var(--error); }
.status-model { font-size:0.85rem; color:var(--text-muted); }

/* Stage list */
.stage-list { margin-bottom:20px; }
.stage { display:flex; align-items:center; gap:10px; padding:6px 0; font-size:0.9rem; color:var(--text-muted); }
.stage-dot { width:10px; height:10px; border-radius:50%; background:var(--border); flex-shrink:0; }
.stage.active { color:var(--accent); font-weight:500; }
.stage.active .stage-dot { background:var(--accent); box-shadow:0 0 8px var(--accent-glow); }
.stage.done { color:var(--success); }
.stage.done .stage-dot { background:var(--success); }

/* Details */
.status-details { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; padding-top:16px; border-top:1px solid var(--border); }
.detail-item { text-align:center; }
.detail-label { display:block; font-size:0.78rem; color:var(--text-muted); margin-bottom:4px; }
.detail-value { display:block; font-size:0.9rem; font-weight:500; }

/* Download */
.download-section { margin-top:24px; text-align:center; padding:32px; background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-lg); }
.success-text { font-size:1.2rem; font-weight:600; color:var(--success); margin-bottom:24px; }
.btn-download { display:inline-flex; align-items:center; gap:8px; padding:14px 32px; background:var(--success); color:#fff; text-decoration:none; border-radius:var(--radius); font-weight:600; margin-bottom:12px; }
.btn-download:hover { background:#059669; transform:translateY(-1px); }
.btn-retry { display:block; margin:12px auto 0; padding:10px 24px; background:transparent; border:1px solid var(--border); border-radius:var(--radius); color:var(--text-secondary); cursor:pointer; }
.btn-retry:hover { border-color:var(--accent); color:var(--accent); }

/* Footer */
.footer { text-align:center; padding:32px 24px; border-top:1px solid var(--border); color:var(--text-muted); font-size:0.82rem; }
.footer a { color:var(--accent); text-decoration:none; }
.footer-credits { display:flex; justify-content:center; gap:32px; margin-top:20px; opacity:0.7; }
.credit-item { display:flex; flex-direction:column; align-items:center; gap:6px; font-size:0.78rem; transition:all 0.3s; }
.credit-item img { width:52px; height:52px; border-radius:50%; object-fit:cover; border:2px solid var(--border); transition:transform 0.3s cubic-bezier(.34,1.56,.64,1); cursor:pointer; }
.credit-item:hover img, .credit-item:active img { transform:scale(3); border-color:var(--accent); box-shadow:0 4px 30px var(--accent-glow); }
.credit-item:hover { opacity:1; }

/* Toast */
.toast-container { position:fixed; top:72px; right:20px; z-index:1000; display:flex; flex-direction:column; gap:8px; }
.toast { padding:12px 20px; border-radius:var(--radius-sm); font-size:0.9rem; font-weight:500; box-shadow:var(--shadow); animation:toastIn 0.3s; max-width:360px; }
.toast.error { background:var(--error); color:#fff; }
.toast.warning { background:var(--warning); color:#1a1a1a; }
.toast.success { background:var(--success); color:#fff; }
.toast.info { background:var(--accent); color:#fff; }
@keyframes toastIn { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }

/* Responsive */
@media (max-width:640px) {
    .hero-section h1 { font-size:1.6rem; }
    .model-cards { grid-template-columns:1fr; }
    .status-details { grid-template-columns:1fr; }
    .detail-item { text-align:left; display:flex; justify-content:space-between; align-items:center; }
    .detail-label { margin-bottom:0; }
    .pitch-slider { flex-basis:100%; width:100%; }
}
