/* ==========================================
   levels.css - 闯关列表页专属样式 v4.0
   ========================================== */

/* ===== Hero 区域 ===== */
.lv-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(170deg, #f0fdf4 0%, #f0f9ff 30%, #faf5ff 70%, #fdf2f8 100%);
}
.lv-hero-bg {
    position: absolute; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(ellipse 600px 400px at 15% 20%, rgba(59,130,246,0.07), transparent),
        radial-gradient(ellipse 500px 350px at 85% 70%, rgba(139,92,246,0.06), transparent),
        radial-gradient(ellipse 400px 300px at 50% 50%, rgba(16,185,129,0.06), transparent);
}
.lv-hero-wave {
    position: absolute; bottom: 0; left: 0; right: 0; height: 60px; z-index: 5;
}
.lv-hero-wave svg { width: 100%; height: 100%; }

/* 徽章 */
.lv-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 16px; border-radius: 9999px; font-size: 0.75rem;
    font-weight: 700; margin-bottom: 8px;
}
.lv-badge-guest { background: #fef3c7; color: #b45309; border: 1.5px solid #fde68a; }
.lv-badge-vip  { background: #ede9fe; color: #6d28d9; border: 1.5px solid #c4b5fd; }
.lv-badge-user { background: #dbeafe; color: #1d4ed8; border: 1.5px solid #93c5fd; }

/* 统计行 */
.lv-stats-row {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 16px;
    max-width: 560px; margin: 0 auto 20px;
}
.lv-stat-item {
    background: rgba(255,255,255,0.8); backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(226,232,240,0.7); border-radius: 16px;
    padding: 12px 20px; text-align: center; min-width: 100px;
    transition: all 0.3s ease;
}
.lv-stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(14,165,233,0.1);
}
.lv-stat-icon {
    display: block; font-size: 1.3rem; margin-bottom: 2px;
}
.lv-stat-val {
    display: block; font-size: 1.5rem; font-weight: 900;
    background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; line-height: 1.2;
    font-family: 'JetBrains Mono', monospace;
}
.lv-stat-lbl {
    display: block; font-size: 0.68rem; color: #94a3b8; font-weight: 600; margin-top: 2px;
}

/* 进度条 */
.lv-progress-bar-wrap {
    max-width: 400px; margin: 0 auto;
    height: 10px; background: rgba(226,232,240,0.5); border-radius: 5px;
    overflow: hidden; position: relative;
}
.lv-progress-bar {
    height: 100%; border-radius: 5px;
    background: linear-gradient(90deg, #10b981, #0ea5e9, #8b5cf6);
    background-size: 200% 100%; animation: progressShine 2s ease-in-out infinite;
    transition: width 1.5s cubic-bezier(0.16,1,0.3,1);
    position: relative; min-width: 0;
}
.lv-progress-label {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    font-size: 0.6rem; font-weight: 800; color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
@keyframes progressShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ===== 筛选栏 ===== */
.lv-filter-bar {
    background: rgba(255,255,255,0.9); backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(226,232,240,0.6); border-radius: 18px;
    padding: 14px 18px; display: flex; flex-wrap: wrap;
    align-items: center; justify-content: space-between; gap: 12px;
    box-shadow: 0 1px 8px rgba(15,23,42,0.03);
}
.lv-filter-left, .lv-filter-right {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.lv-filter-label {
    font-size: 0.78rem; font-weight: 700; color: #64748b; white-space: nowrap;
}
.lv-filter-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 14px; border-radius: 9999px; font-size: 0.74rem;
    font-weight: 600; cursor: pointer; text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25,0.8,0.25,1);
    border: 2px solid #e2e8f0; background: #fff; color: #64748b;
    white-space: nowrap; user-select: none;
}
.lv-filter-chip:hover {
    border-color: #93c5fd; color: #2563eb; transform: translateY(-1px);
}
.lv-filter-chip.active {
    color: #fff; border-color: transparent;
    box-shadow: 0 4px 14px rgba(59,130,246,0.3);
}
.lv-filter-select {
    padding: 7px 32px 7px 12px; border-radius: 10px; font-size: 0.76rem;
    font-weight: 600; border: 1.5px solid #e2e8f0; background: #fff;
    color: #64748b; cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
    transition: all 0.25s; outline: none;
}
.lv-filter-select:focus { border-color: #93c5fd; }
.lv-clear-btn {
    padding: 7px 14px; background: #f1f5f9; color: #64748b;
    font-weight: 700; border-radius: 10px; font-size: 0.76rem;
    border: 1.5px solid #e2e8f0; text-decoration: none;
    white-space: nowrap; transition: all 0.25s;
}
.lv-clear-btn:hover { background: #e2e8f0; color: #475569; }

/* ===== 关卡卡片 ===== */
.lv-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.25,0.8,0.25,1);
    position: relative; overflow: hidden; display: flex; flex-direction: column;
    cursor: pointer;
}
.lv-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(14,165,233,0.1), 0 4px 16px rgba(0,0,0,0.04);
    border-color: #93c5fd;
}
.lv-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 4px; background: var(--bar-color, #e2e8f0);
    transition: height 0.4s ease;
}
.lv-card:hover::before { height: 5px; }
/* 鼠标光效 */
.lv-card::after {
    content: ''; position: absolute; inset: 0; border-radius: 20px;
    pointer-events: none; opacity: 0; transition: opacity 0.4s;
    background: radial-gradient(500px circle at var(--mx,50%) var(--my,50%), var(--glow-color, rgba(59,130,246,0.06)), transparent 40%);
    z-index: 1;
}
.lv-card:hover::after { opacity: 1; }

/* 已通关 */
.lv-card-done { border-color: #a7f3d0; }
.lv-card-done::before { background: #10b981 !important; }

/* 锁定 */
.lv-card-locked { opacity: 0.7; }
.lv-card-locked:hover { transform: translateY(-2px); }
.lv-card-locked::before { background: #cbd5e1 !important; }

/* 已完成飘带 */
.lv-card-ribbon {
    position: absolute; top: 0; right: 0; z-index: 10;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff; font-size: 0.62rem; font-weight: 800;
    padding: 4px 12px; border-radius: 0 18px 0 16px;
    display: flex; align-items: center; gap: 5px;
    box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}

/* 卡片顶部 */
.lv-card-top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px 0;
}
.lv-card-num {
    font-family: 'JetBrains Mono', monospace; font-size: 0.72rem;
    font-weight: 800; color: #3b82f6;
    background: #eff6ff; padding: 3px 10px; border-radius: 8px;
}
.lv-card-locked .lv-card-num { color: #94a3b8; background: #f1f5f9; }
.lv-card-done .lv-card-num { color: #059669; background: #ecfdf5; }

.lv-card-lock-icon {
    width: 32px; height: 32px; border-radius: 10px;
    background: #f1f5f9; display: flex; align-items: center; justify-content: center;
    color: #94a3b8; font-size: 0.7rem;
}
.lv-card-play-hint {
    width: 32px; height: 32px; border-radius: 10px;
    background: #eff6ff; display: flex; align-items: center; justify-content: center;
    color: #3b82f6; opacity: 0; transform: scale(0.8);
    transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.lv-card:hover .lv-card-play-hint { opacity: 1; transform: scale(1); }

/* 标题与描述 */
.lv-card-body { padding: 12px 18px 0; flex: 1; }
.lv-card-title {
    font-size: 0.95rem; font-weight: 800; color: #1e293b;
    margin-bottom: 6px; line-height: 1.4;
}
.lv-card-locked .lv-card-title { color: #94a3b8; }
.lv-card-desc {
    font-size: 0.72rem; color: #94a3b8; line-height: 1.5;
    margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}

/* 标签 */
.lv-card-tags {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px;
}
.lv-card-diff {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 10px; border-radius: 9999px; font-size: 0.65rem;
    font-weight: 700;
}
.lv-card-knowledge, .lv-card-codecount {
    font-size: 0.65rem; color: #94a3b8; display: inline-flex; align-items: center; gap: 3px;
}

/* 星级 */
.lv-card-stars {
    display: flex; align-items: center; gap: 2px;
    padding: 8px 12px; background: #fffbeb; border-radius: 12px;
    margin-bottom: 4px; border: 1px solid #fde68a;
}
.lv-star {
    font-size: 1.1rem; transition: transform 0.3s ease;
}
.lv-star.on  { color: #f59e0b; }
.lv-star.off { color: #d1d5db; }
.lv-card:hover .lv-star.on { transform: scale(1.2); }
.lv-star-acc {
    font-size: 0.65rem; font-weight: 700; color: #64748b; margin-left: auto;
}

/* 底部 */
.lv-card-footer { padding: 12px 18px 16px; margin-top: auto; }

/* 按钮 */
.lv-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 12px; border-radius: 14px; font-size: 0.82rem;
    font-weight: 700; cursor: pointer; transition: all 0.3s ease;
    text-decoration: none; border: none; outline: none;
}
.lv-btn-play {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff; box-shadow: 0 4px 16px rgba(59,130,246,0.3);
}
.lv-btn-play:hover {
    box-shadow: 0 6px 24px rgba(59,130,246,0.45);
    transform: translateY(-1px);
}
.lv-btn-play:active { transform: scale(0.97); }
.lv-btn-vip {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: #fff; box-shadow: 0 4px 14px rgba(245,158,11,0.3);
}
.lv-btn-vip:hover {
    box-shadow: 0 6px 22px rgba(245,158,11,0.45);
    transform: translateY(-1px);
}
.lv-btn-vip:active { transform: scale(0.97); }
.lv-btn-login {
    background: #eff6ff; color: #2563eb; border: 1.5px solid #bfdbfe;
}
.lv-btn-login:hover { background: #dbeafe; }
.lv-btn-login:active { transform: scale(0.97); }

/* 提示文字 */
.lv-card-tip {
    font-size: 0.65rem; color: #94a3b8; margin-top: 8px;
    display: flex; align-items: center; gap: 4px;
}

/* ===== 弹窗 ===== */
.lv-modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(15,23,42,0.55); backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px; opacity: 0; visibility: hidden;
    transition: all 0.35s ease;
}
.lv-modal-overlay.show { opacity: 1; visibility: visible; }
.lv-modal {
    background: #fff; border-radius: 24px; padding: 32px 28px;
    max-width: 400px; width: 100%; text-align: center;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
    transform: translateY(30px); transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
}
.lv-modal-overlay.show .lv-modal { transform: translateY(0); }
.lv-modal-icon {
    width: 64px; height: 64px; border-radius: 20px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.lv-modal-title {
    font-size: 1.15rem; font-weight: 800; color: #1e293b; margin-bottom: 8px;
}
.lv-modal-text {
    color: #64748b; font-size: 0.88rem; line-height: 1.7; margin-bottom: 20px;
}
.lv-modal-actions {
    display: flex; gap: 10px; justify-content: center;
}
.lv-modal-btn-close {
    padding: 11px 24px; background: #f1f5f9; color: #64748b;
    border: none; border-radius: 14px; font-weight: 700; font-size: 0.85rem;
    cursor: pointer; transition: all 0.2s; min-height: 44px;
}
.lv-modal-btn-close:hover { background: #e2e8f0; }
.lv-modal-btn-action {
    padding: 11px 24px; background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff; border-radius: 14px; font-weight: 700; font-size: 0.85rem;
    text-decoration: none; transition: all 0.2s; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(59,130,246,0.3);
}
.lv-modal-btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59,130,246,0.4);
}

/* ===== 滚动入场动画 ===== */
.lv-card-reveal {
    opacity: 0; transform: translateY(36px);
    transition: all 0.65s cubic-bezier(0.16,1,0.3,1);
    transition-delay: var(--delay, 0ms);
}
.lv-card-reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== 空状态 ===== */
.lv-empty {
    text-align: center; padding: 64px 16px;
}
.lv-empty h3 {
    font-size: 1.2rem; font-weight: 700; color: #64748b; margin: 16px 0 8px;
}
.lv-empty p { color: #94a3b8; font-size: 0.88rem; }

/* ===== shimmer 动画 ===== */
@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.animate-shimmer {
    animation: shimmer 3s ease-in-out infinite;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .lv-filter-bar { border-radius: 14px; padding: 12px; }
    .lv-filter-chip { padding: 5px 10px; font-size: 0.7rem; }
    .lv-card { border-radius: 16px; }
    .lv-card:hover { transform: translateY(-3px); }
    .lv-card::after { display: none; }
    .lv-card-ribbon { border-radius: 0 14px 0 12px; }
    .lv-hero { padding: 20px 0; }
    .lv-stat-item { min-width: 72px; padding: 10px 14px; }
    .lv-stat-val { font-size: 1.2rem; }
}
@media (max-width: 480px) {
    .lv-stats-row { gap: 8px; }
    .lv-stat-item { min-width: 64px; padding: 8px 10px; border-radius: 12px; }
    .lv-stat-val { font-size: 1.05rem; }
    .lv-stat-lbl { font-size: 0.62rem; }
    .lv-filter-bar { flex-direction: column; align-items: flex-start; }
    .lv-filter-left, .lv-filter-right { width: 100%; }
    .lv-filter-select { width: 100%; }
    .lv-modal { border-radius: 20px; padding: 24px 18px; }
    .lv-modal-actions { flex-direction: column; }
    .lv-card-title { font-size: 0.85rem; }
}

/* 触摸优化 */
@media (hover: none) {
    .lv-card-play-hint { opacity: 0.6; transform: scale(1); }
    .lv-btn-play, .lv-btn-vip, .lv-btn-login { min-height: 44px; }
}
