/* --- 1. 核心变量 --- */
:root {
    --primary: #007aff;
    --bg-body: #f2f2f7;
    --bg-card: rgba(255, 255, 255, 0.75);
    --border-card: rgba(255, 255, 255, 0.8);
    --text-main: #1d1d1f;
    --text-sub: #86868b;
    --radius: 24px;
    --gap: 20px;
}

/* --- 2. 全局重置 --- */
body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
* { box-sizing: border-box; }

/* --- 3. 动态背景 Orbs --- */
.orb {
    position: fixed; border-radius: 50%; filter: blur(100px); z-index: -1; opacity: 0.5;
}
.orb-1 { top: -20%; left: -20%; width: 60vw; height: 60vw; background: #a1c4fd; }
.orb-2 { bottom: -20%; right: -20%; width: 50vw; height: 50vw; background: #c2e9fb; }

/* --- 4. 顶部导航栏 (极窄) --- */
.navbar {
    height: 50px;
    display: flex; align-items: center; padding: 0 5%;
    background: rgba(255,255,255,0.5); backdrop-filter: blur(20px);
    position: sticky; top: 0; z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.logo { font-weight: 800; font-size: 16px; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
.logo img { height: 24px; }

/* --- 5. Bento Grid 主容器 --- */
.main-container {
    max-width: 1200px; margin: 20px auto; padding: 0 20px 40px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}

/* --- 通用卡片样式 --- */
.bento-box {
    background: var(--bg-card);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.02);
    transition: transform 0.2s;
    overflow: hidden;
}
.bento-box:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.04); }

/* --- 第一行：标题 + 搜索 --- */
.box-title {
    grid-column: span 1;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #fff 0%, #f0f7ff 100%);
}
.box-title h1 { margin: 0; font-size: 28px; font-weight: 900; letter-spacing: -0.5px; }

.box-search {
    grid-column: span 2;
    display: flex; align-items: center;
}
.search-wrapper {
    width: 100%; position: relative; display: flex; gap: 10px;
}
.search-input {
    flex: 1; padding: 15px 20px; border-radius: 12px; border: none;
    background: rgba(0,0,0,0.05); font-size: 16px; outline: none; transition: 0.2s;
}
.search-input:focus { background: white; box-shadow: 0 0 0 2px var(--primary); }
.btn-go {
    padding: 0 25px; background: var(--text-main); color: white;
    border: none; border-radius: 12px; font-weight: bold; cursor: pointer;
}

/* --- 第二行：介绍 + 部署按钮 --- */
.box-intro {
    grid-column: span 3;
    display: flex; justify-content: space-between; align-items: stretch;
    padding: 0;
}
.intro-text {
    padding: 30px; flex: 2;
    display: flex; flex-direction: column; justify-content: center;
}
.intro-text h2 { margin: 0 0 10px; font-size: 24px; }
.intro-text p { 
    margin: 0 0 20px; color: var(--text-sub); font-size: 14px; line-height: 1.6; 
    white-space: pre-line; 
}
.contact-info {
    font-size: 12px; color: #999; background: rgba(0,0,0,0.03);
    padding: 10px 15px; border-radius: 8px; display: inline-block; width: fit-content;
}

.deploy-area {
    flex: 1; min-width: 200px;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    text-align: center; color: white;
    cursor: pointer; transition: 0.2s;
    text-decoration: none;
}
.deploy-area:hover { filter: brightness(1.1); }
.deploy-content { transform: scale(1); transition: 0.2s; }
.deploy-area:hover .deploy-content { transform: scale(1.05); }
.icon-rocket { font-size: 40px; display: block; margin-bottom: 5px; }
.btn-label { font-size: 20px; font-weight: bold; }

/* --- 第三行：精选 (Grid) + 热榜 (List) --- */
.box-featured {
    grid-column: span 2;
    min-height: 500px;
}
.section-header { margin-bottom: 20px; font-weight: bold; font-size: 18px; display: flex; align-items: center; gap: 8px;}
.dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; display: inline-block;}

.featured-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px;
}
.mini-card {
    background: rgba(255,255,255,0.8); border-radius: 12px; padding: 15px;
    border: 1px solid rgba(0,0,0,0.05); transition: 0.2s; display: block;
}
.mini-card:hover { transform: translateY(-3px); background: white; border-color: var(--primary); }
.mini-icon { font-size: 24px; margin-bottom: 10px; }
.mini-title { font-weight: bold; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-author { font-size: 12px; color: #999; }

.box-hot {
    grid-column: span 1;
    min-height: 500px;
}
.hot-list { list-style: none; padding: 0; margin: 0; }
.hot-item {
    display: flex; align-items: center; padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.hot-rank {
    font-size: 16px; font-weight: 900; width: 30px; color: #ddd; font-style: italic;
}
.hot-item:nth-child(1) .hot-rank { color: #FFD700; }
.hot-item:nth-child(2) .hot-rank { color: #C0C0C0; }
.hot-item:nth-child(3) .hot-rank { color: #CD7F32; }
.hot-info { flex: 1; overflow: hidden; }
.hot-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot-views { font-size: 12px; color: #999; }

/* --- 第四行：团队 --- */
.box-teams {
    grid-column: span 3;
    display: flex; gap: 40px;
}
.team-col { flex: 1; }
.col-title { font-size: 14px; font-weight: bold; color: #999; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px; }
.logo-row { display: flex; gap: 20px; align-items: center; }
.team-logo { height: 40px; opacity: 0.6; filter: grayscale(100%); transition: 0.2s; }
.team-logo:hover { opacity: 1; filter: grayscale(0%); }

/* --- 底部 --- */
footer {
    text-align: center; padding: 20px; font-size: 12px; color: #aaa;
}

/* --- 模态窗样式 (Modal) --- */
.modal-overlay {
    display: none; /* 默认隐藏 */
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(5px);
    z-index: 1000; justify-content: center; align-items: center;
}
.modal-card {
    background: white; width: 90%; max-width: 400px;
    padding: 30px; border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    text-align: center; position: relative;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.close-btn {
    position: absolute; top: 15px; right: 20px; font-size: 24px; cursor: pointer; color: #999;
}
.modal-title { font-size: 20px; font-weight: bold; margin-bottom: 5px; }
.modal-author { color: #666; font-size: 14px; margin-bottom: 20px; }

/* 状态标签 */
.status-badge {
    display: inline-block; padding: 6px 12px; border-radius: 20px;
    font-size: 12px; font-weight: bold; margin-bottom: 20px;
}
.badge-vip { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge-exp { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
/* 🔥 新增：待核销状态样式 */
.badge-pending { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }

/* 按钮组 */
.modal-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-enter {
    background: #007bff; color: white; padding: 12px; border-radius: 12px;
    text-decoration: none; font-weight: bold; display: block;
}
.btn-redeem {
    background: #f3f4f6; color: #333; padding: 12px; border-radius: 12px;
    border: 1px solid #eee; cursor: pointer; font-size: 14px;
}

/* 补票输入区域 */
.redeem-area {
    display: none; margin-top: 15px; padding-top: 15px; border-top: 1px solid #eee;
}
.redeem-input {
    width: 100%; padding: 10px; margin-bottom: 10px;
    border: 2px solid #eee; border-radius: 8px; box-sizing: border-box;
}
.btn-confirm-redeem {
    background: #10b981; color: white; border: none; padding: 10px;
    width: 100%; border-radius: 8px; cursor: pointer; font-weight: bold;
}

/* --- 📱 移动端适配 --- */
@media (max-width: 768px) {
    .main-container { grid-template-columns: 1fr; padding: 0 15px 20px; }
    .box-title, .box-search, .box-intro, .box-featured, .box-hot, .box-teams { grid-column: span 1; }
    .box-intro { flex-direction: column; }
    .deploy-area { padding: 30px; }
    .box-teams { flex-direction: column; gap: 20px; }
    .navbar { display: none; }
}