/* 全局样式 — 移动端优先 */
:root {
    --bg: #f3f5f9;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --radius: 14px;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(960px, 94vw);
    margin: 0 auto;
    padding: 12px 0 88px;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.logo {
    font-weight: 700;
    font-size: 18px;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}

h1,
h2,
h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.sub {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 10px;
}

.btn-row {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    z-index: 50;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:active {
    background: var(--primary-dark);
}

.btn-outline {
    background: #fff;
    color: var(--primary);
    border: 2px solid rgba(37, 99, 235, 0.35);
}

/* 弹幕：纯 CSS 横向循环滚动 */
.danmu-wrap {
    overflow: hidden;
    height: 36px;
    background: #0f172a;
    color: #fff;
    border-radius: 10px;
    position: relative;
}

.danmu-track {
    display: flex;
    gap: 36px;
    white-space: nowrap;
    align-items: center;
    height: 36px;
    padding-left: 16px;
    animation: vh-marquee 28s linear infinite;
}

.danmu-item {
    display: inline-flex;
    font-size: 13px;
    opacity: 0.95;
}

@keyframes vh-marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.stat-pill {
    background: #eef2ff;
    border-radius: 12px;
    padding: 10px 12px;
}

.stat-pill b {
    display: block;
    font-size: 18px;
}

.stat-pill span {
    font-size: 12px;
    color: var(--muted);
}

.help-mini {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.review-item {
    border-left: 3px solid var(--primary);
    padding: 8px 10px;
    background: #fafafa;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.swiper {
    width: 100%;
    padding-bottom: 8px;
}

.swiper-slide {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px;
    min-height: 120px;
}

.tag {
    font-size: 12px;
    color: var(--muted);
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
}

.flex-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

label {
    display: block;
    font-weight: 600;
    margin: 8px 0 4px;
    font-size: 14px;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 16px;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.btn-small {
    min-height: 40px;
    font-size: 14px;
    width: auto;
    padding: 0 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.badge-blue {
    background: #dbeafe;
    color: #1e40af;
}
.badge-yellow {
    background: #fef9c3;
    color: #854d0e;
}
.badge-green {
    background: #dcfce7;
    color: #166534;
}
.badge-purple {
    background: #f3e8ff;
    color: #6b21a8;
}
.badge-red {
    background: #fee2e2;
    color: #991b1b;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.modal-backdrop.show {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 14px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    padding: 14px;
}

.modal h3 {
    margin-top: 0;
}

.step-box {
    border: 1px dashed #cbd5f5;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    background: #fafbff;
}

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.thumb-grid img {
    width: 100%;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
}

.tpl-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.tpl-tab {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
}

.tpl-tab.active {
    border-color: var(--primary);
    background: #eff6ff;
}

@media (min-width: 720px) {
    .tpl-tabs {
        grid-template-columns: repeat(4, 1fr);
    }
    .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
