/* 声匣 — 本地音频转换台（原创样式，非第三方框架） */

:root {
    --bg: #0f1419;
    --bg-elevated: #1a222d;
    --surface: #232d3b;
    --border: #334155;
    --text: #e8eef4;
    --text-muted: #94a3b8;
    --accent: #3dd6c6;
    --accent-dim: #2a9d8f;
    --danger: #f87171;
    --radius: 12px;
    --font: "Source Han Sans SC", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    background: radial-gradient(ellipse 120% 80% at 50% -20%, #1e3a4a 0%, transparent 55%),
        var(--bg);
    color: var(--text);
    line-height: 1.55;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 顶栏 */
.site-header {
    border-bottom: 1px solid var(--border);
    background: rgba(15, 20, 25, 0.85);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
    box-shadow: 0 4px 20px rgba(61, 214, 198, 0.25);
}

.site-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.site-tagline {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.header-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
}

.nav-btn:hover {
    border-color: var(--accent-dim);
    color: var(--accent);
}

.lang-switch {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.45rem 0.65rem;
    cursor: pointer;
    font-size: 0.8rem;
}

.lang-btn[aria-pressed="true"] {
    background: var(--surface);
    color: var(--accent);
}

/* 主区 */
.main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem 3rem;
}

.upload-panel {
    margin-bottom: 1.5rem;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: var(--bg-elevated);
    transition: border-color 0.2s, background 0.2s;
}

.drop-zone:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(61, 214, 198, 0.06);
}

.drop-zone-icon {
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.drop-zone-lead {
    margin: 0 0 1rem;
    font-size: 1.05rem;
}

.drop-zone-count {
    margin: 1rem 0 0.35rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.export-format-bar {
    margin: 0 auto 1.25rem;
    max-width: 360px;
    text-align: left;
}

.export-format-bar label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.export-format-bar select {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
}

.export-format-hint {
    margin: 0.4rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.export-action-hint {
    margin: 0.5rem 0 0;
    font-size: 0.82rem;
    color: var(--accent);
    line-height: 1.45;
}

.drop-zone.format-picked-pulse {
    animation: export-pulse-ring 1.1s ease-out 1;
}

@keyframes export-pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(61, 214, 198, 0.5);
    }
    100% {
        box-shadow: 0 0 0 14px transparent;
    }
}

.drop-zone-hint {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    font-family: inherit;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.9rem;
    padding: 0.55rem 1.1rem;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-dim), var(--accent));
    color: #0a0f12;
    font-weight: 600;
    border: none;
}

.btn-primary:hover {
    filter: brightness(1.08);
}

.btn-secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--accent);
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}

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

.btn-small {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}

/* 批量条 */
.batch-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* 结果列表 */
.section-title {
    font-size: 1.1rem;
    margin: 0 0 1rem;
    font-weight: 600;
}

.results-empty {
    color: var(--text-muted);
    padding: 1rem 0;
}

.results-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.job-card {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    align-items: start;
}

@media (max-width: 640px) {
    .job-card {
        grid-template-columns: 72px 1fr;
    }

    .job-card-actions {
        grid-column: 1 / -1;
    }
}

.job-cover {
    width: 88px;
    height: 88px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--surface);
    border: 1px solid var(--border);
}

.job-cover.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-align: center;
    padding: 0.25rem;
}

.job-main h3 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    word-break: break-all;
}

.job-meta {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.job-meta span + span::before {
    content: " · ";
}

.status-pill {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    margin-top: 0.35rem;
}

.status-waiting {
    background: #334155;
    color: var(--text-muted);
}

.status-running {
    background: rgba(61, 214, 198, 0.2);
    color: var(--accent);
}

.status-done {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.status-error {
    background: rgba(248, 113, 113, 0.15);
    color: var(--danger);
}

.job-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 88px;
}

.job-error {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    color: var(--danger);
    grid-column: 1 / -1;
}

/* 页脚 */
.site-footer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-disclaimer,
.footer-legal {
    margin: 0 0 0.75rem;
    max-width: 720px;
}

/* 弹层 */
.modal[hidden] {
    display: none !important;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}

.modal-dialog {
    position: relative;
    z-index: 1;
    max-width: 520px;
    width: 100%;
    max-height: 85vh;
    overflow: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.modal-close {
    position: absolute;
    top: 0.65rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.modal-dialog h3 {
    margin: 0 0 1rem;
    padding-right: 2rem;
}

.modal-body {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.modal-body ul {
    padding-left: 1.25rem;
}

.modal-body li {
    margin-bottom: 0.35rem;
}
