/* ===== 全国人民合唱收集平台 · 前台样式 =====
   亮/暗主题通过 <html data-theme="light|dark"> 切换 */
:root {
    --bg: #faf7f2;
    --card: #ffffff;
    --text: #1f2937;
    --text-2: #6b7280;
    --text-3: #9ca3af;
    --border: #d1d5db;
    --input-bg: #ffffff;
    --soft: #f3f4f6;
    --hover-bg: #f9fafb;
    --shadow: rgba(0, 0, 0, 0.07);
    --shadow-strong: rgba(185, 28, 28, 0.14);
    --red-bg: #fef2f2;
    --red-border: #fecaca;
}
[data-theme="dark"] {
    --bg: #161b22;
    --card: #1f2735;
    --text: #e5e7eb;
    --text-2: #9ca3af;
    --text-3: #6b7280;
    --border: #374151;
    --input-bg: #11161d;
    --soft: #252d3d;
    --hover-bg: #232b3a;
    --shadow: rgba(0, 0, 0, 0.35);
    --shadow-strong: rgba(0, 0, 0, 0.45);
    --red-bg: #3f1d2a;
    --red-border: #7f1d1d;
}

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

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background .25s, color .25s;
}

a { color: #b91c1c; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶部导航 ---------- */
.site-top {
    background: #7f1d1d;
    color: #fff;
    padding: 12px 0;
}
.site-top .inner {
    max-width: 1080px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between;
}
.brand { font-size: 18px; font-weight: 700; }
.brand small { font-size: 12px; opacity: .75; margin-left: 6px; font-weight: 400; }
.site-top a { color: #fff; font-size: 13px; opacity: .9; }
.site-top a:hover { opacity: 1; }

/* 主题切换按钮 */
.theme-btn {
    background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
    color: #fff; border-radius: 8px; padding: 4px 10px; font-size: 14px;
    cursor: pointer; line-height: 1.2; transition: background .15s;
}
.theme-btn:hover { background: rgba(255,255,255,.3); }
.top-right { display: flex; align-items: center; gap: 12px; }

/* ---------- 主页大横幅 ---------- */
.banner {
    position: relative;
    background: linear-gradient(135deg, #7f1d1d, #b91c1c 45%, #f59e0b);
    color: #fff;
    text-align: center;
    padding: 46px 20px 54px;
    overflow: hidden;
}
.banner::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 40px;
    background: var(--bg); border-radius: 50% 50% 0 0 / 100% 100% 0 0; transform: scale(1.6);
    transition: background .25s;
}
.banner .slider { max-width: 860px; margin: 0 auto; position: relative; min-height: 90px; }
.banner .slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s; pointer-events: none; }
.banner .slide.active { opacity: 1; position: relative; pointer-events: auto; }
.banner h1 { font-size: 30px; font-weight: 800; letter-spacing: 2px; text-shadow: 0 2px 10px rgba(0,0,0,.25); }
.banner p { margin-top: 10px; font-size: 14px; opacity: .9; }
.banner .dots { margin-top: 18px; display: flex; justify-content: center; gap: 8px; position: relative; z-index: 1; }
.banner .dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.4); cursor: pointer; }
.banner .dots span.active { background: #fff; }

/* ---------- 主体 ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.section-title { font-size: 20px; font-weight: 700; margin: 10px 0 18px; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 5px; height: 20px; background: #b91c1c; border-radius: 3px; }

/* ---------- 活动卡片 ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}
.card {
    background: var(--card); border-radius: 14px; overflow: hidden;
    box-shadow: 0 4px 14px var(--shadow);
    border-top: 6px solid #b91c1c;
    transition: transform .18s, box-shadow .18s, background .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 26px var(--shadow-strong); }
.card.closed { border-top-color: #9ca3af; }
.card.publish { border-top-color: #059669; }
.card .cover {
    height: 100px;
    background: linear-gradient(135deg, #b91c1c, #f59e0b);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 46px; font-weight: 800;
}
.card .cover.thumb { background: var(--soft); color: var(--text-3); }
.card .body { padding: 16px; }
.card h3 { font-size: 16px; line-height: 1.4; min-height: 46px; }
.card .desc {
    font-size: 12px; color: var(--text-2); margin-top: 6px; line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px;
}
.card .meta {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 12px; font-size: 12px; color: var(--text-2);
}
.card .meta .num { font-size: 20px; font-weight: 700; color: #b91c1c; }
.card .deadline { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* ---------- 徽章 ---------- */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 700;
}
.badge-open    { background: #d1fae5; color: #065f46; }
.badge-closed  { background: var(--soft); color: var(--text-2); }
.badge-publish { background: #fde68a; color: #92400e; }
.badge-expired { background: #f3e8ff; color: #6b21a8; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block; padding: 10px 22px; border-radius: 10px; font-size: 14px; font-weight: 700;
    border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; text-align: center;
    transition: transform .15s, box-shadow .15s, background .25s;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn-primary {
    background: linear-gradient(90deg, #b91c1c, #f59e0b); color: #fff; border: 0;
    box-shadow: 0 6px 16px rgba(185,28,28,.25);
}
.btn-primary:hover { opacity: .94; }
.btn-muted { background: var(--soft); color: var(--text-3); border-color: transparent; cursor: not-allowed; }

/* ---------- 参与页 ---------- */
.join-layout { display: grid; grid-template-columns: 1fr 360px; gap: 22px; }
@media (max-width: 860px) { .join-layout { grid-template-columns: 1fr; } }

.panel {
    background: var(--card); border-radius: 14px; box-shadow: 0 4px 14px var(--shadow);
    padding: 22px; margin-bottom: 18px;
    transition: background .25s, box-shadow .25s;
}
.panel h2 { font-size: 17px; margin-bottom: 14px; }
.panel h2::before { content: ""; display: inline-block; width: 5px; height: 16px; background: #b91c1c; border-radius: 3px; margin-right: 8px; vertical-align: -2px; }

.form label { display: block; font-size: 13px; color: var(--text-2); margin: 14px 0 6px; }
.form textarea, .form input[type=text] {
    width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
    background: var(--input-bg); color: var(--text); transition: border-color .2s, background .25s;
}
.form textarea { min-height: 90px; resize: vertical; }
.form input:focus, .form textarea:focus { outline: none; border-color: #b91c1c; box-shadow: 0 0 0 3px var(--red-border); }
.form .hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* 录音区 */
.record-box {
    border: 2px dashed var(--border); border-radius: 12px; padding: 18px; margin-top: 10px; text-align: center;
    transition: border-color .2s, background .25s;
}
.record-box.recording { border-color: #b91c1c; background: var(--red-bg); }
.record-box .timer { font-size: 30px; font-weight: 800; color: #b91c1c; margin: 6px 0 10px; font-variant-numeric: tabular-nums; }
.record-box .btns { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.record-box .note { font-size: 12px; color: var(--text-3); margin-top: 10px; }

/* 上传模式 */
.upload-drop {
    border: 2px dashed var(--border); border-radius: 12px; padding: 26px; text-align: center; margin-top: 10px; cursor: pointer;
    transition: border-color .15s, background .15s, color .25s;
    color: var(--text-2);
}
.upload-drop:hover, .upload-drop.drag { border-color: #b91c1c; background: var(--red-bg); }
.upload-drop .icon { font-size: 34px; }
.upload-drop p { font-size: 13px; color: var(--text-2); margin-top: 6px; }

/* 模式切换 */
.tabs { display: flex; gap: 8px; margin-top: 10px; }
.tabs .tab {
    flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--card);
    font-size: 13px; cursor: pointer; text-align: center; color: var(--text-2);
    transition: background .25s, border-color .2s;
}
.tabs .tab.active { border-color: #b91c1c; background: var(--red-bg); color: #b91c1c; font-weight: 700; }

/* 试听 */
.preview { margin-top: 12px; }
.preview audio { width: 100%; height: 36px; }

/* 提示条 */
.alert { padding: 12px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.alert-error   { background: var(--red-bg); color: #b91c1c; border: 1px solid var(--red-border); }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
[data-theme="dark"] .alert-success { background: #123524; color: #6ee7a0; border-color: #14532d; }
[data-theme="dark"] .alert-info    { background: #12233d; color: #93c5fd; border-color: #1e3a5f; }

/* ---------- 结果页 ---------- */
.result-item {
    display: flex; gap: 14px; align-items: flex-start;
    background: var(--card); border-radius: 12px; padding: 16px; margin-bottom: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: background .25s;
}
.result-item .avatar {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #b91c1c, #f59e0b); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px;
}
.result-item .info { flex: 1; }
.result-item .info .name { font-weight: 700; font-size: 14px; }
.result-item .info .lyric { font-size: 13px; color: var(--text-2); margin-top: 4px; white-space: pre-wrap; }
.result-item .info .time { font-size: 11px; color: var(--text-3); margin-top: 6px; }
.result-item audio { width: 220px; height: 32px; margin-top: 8px; }
.result-player { margin-top: 18px; }
.result-player h2 { font-size: 16px; color: var(--text); }
.sl-item {
    display: flex; align-items: center; gap: 8px;
    background: var(--soft); border: 1px solid var(--border); border-radius: 999px;
    padding: 6px 14px 6px 6px;
    transition: background .25s;
}
.sl-avatar {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #b91c1c, #f59e0b); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}
.sl-name { font-size: 13px; font-weight: 600; color: var(--text); }
.like-btn { cursor: pointer; }
.like-btn.liked {
    background: #fecaca; border-color: #f87171; color: #b91c1c;
}
[data-theme="dark"] .like-btn.liked { background: #3f1d2a; border-color: #7f1d1d; color: #fca5a5; }

/* ---------- 页脚 ---------- */
.site-foot { text-align: center; padding: 24px; font-size: 12px; color: var(--text-3); }

.empty {
    text-align: center; padding: 60px 20px; color: var(--text-3); background: var(--card);
    border-radius: 14px; box-shadow: 0 4px 14px var(--shadow); transition: background .25s;
}