:root { --nvc: #c41e3a; --nvc-dark: #9e1830; --dark: #1a1a1a; --gray: #4a4a4a; --light: #f5f5f5; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "PingFang SC","Microsoft YaHei",sans-serif; color: var(--gray); line-height: 1.6; background: #fff; }
a { color: var(--nvc); text-decoration: none; }
a:hover { color: var(--nvc-dark); }
.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

.header { background: var(--dark); color: #fff; padding: 14px 0; }
.header .container { display: flex; justify-content: space-between; align-items: center; }
.header a { color: #fff; margin-left: 20px; font-size: 14px; }
.header .user { color: rgba(255,255,255,0.9); font-size: 14px; }
.header .user span { margin-right: 12px; }

.main { padding: 32px 0 48px; min-height: 60vh; }
.page-title { font-size: 28px; color: var(--dark); margin-bottom: 24px; }

.project-list { display: grid; gap: 20px; }
.project-card { border: 1px solid #eee; border-radius: 12px; overflow: hidden; display: flex; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.06); transition: box-shadow 0.2s; position: relative; }
.project-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.1); }
.project-card .thumb { width: 200px; min-height: 140px; background: var(--light); object-fit: cover; flex-shrink: 0; }
.project-card .body { padding: 20px 160px 20px 20px; flex: 1; position: relative; }
.project-card h3 { font-size: 18px; color: var(--dark); margin-bottom: 8px; }
.project-card .meta { font-size: 13px; color: #888; margin-bottom: 12px; }
.project-card .badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 12px; margin-right: 8px; }
.project-card .badge.ongoing { background: #e8f5e9; color: #2e7d32; }
.project-card .badge.ended { background: #ffebee; color: #c62828; }
.project-card .link { display: inline-block; margin-top: 8px; padding: 8px 16px; background: var(--nvc); color: #fff !important; border-radius: 8px; font-size: 14px; }
.project-card .link:hover { background: var(--nvc-dark); color: #fff !important; }

/* 卡片内 TOP3 榜单 - 放在右边空白处 */
.project-card .card-top3 { 
    position: absolute; 
    right: 20px; 
    top: 50%; 
    transform: translateY(-50%); 
    background: linear-gradient(135deg, #fff9e6 0%, #fff5d6 100%); 
    border: 1px solid #ffe0b2;
    border-radius: 10px; 
    padding: 10px 14px;
    min-width: 100px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 10;
}
.project-card .card-top3 .top3-title { 
    font-size: 11px; 
    font-weight: 600; 
    color: #e65100; 
    display: block;
    margin-bottom: 4px;
    text-align: center;
    border-bottom: 1px solid #ffe0b2;
    padding-bottom: 4px;
}
.project-card .card-top3 .top3-item { 
    display: block;
    font-size: 12px; 
    color: #333; 
    padding: 2px 0;
    white-space: nowrap;
}
.project-card .card-top3 .top3-item:nth-child(2) { color: #f57c00; font-weight: 600; }
.project-card .card-top3 .top3-item:nth-child(3) { color: #666; }
.project-card .card-top3 .top3-item:nth-child(4) { color: #999; }

/* 项目详情 */
.detail-hero { margin-bottom: 24px; }
.detail-hero h1 { font-size: 26px; color: var(--dark); margin-bottom: 12px; }
.countdown { font-size: 18px; font-weight: 600; color: var(--nvc); margin-bottom: 16px; }
.countdown.ended { color: #c62828; }
.media-box { margin-bottom: 24px; }
.media-box img { max-width: 100%; height: auto; border-radius: 8px; margin-right: 12px; margin-bottom: 12px; max-height: 300px; object-fit: cover; }
.media-box video { max-width: 100%; border-radius: 8px; margin-top: 12px; }
.text-intro { background: var(--light); padding: 20px; border-radius: 12px; margin-bottom: 24px; white-space: pre-wrap; }
.tiers-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.tiers-table th, .tiers-table td { padding: 12px; border: 1px solid #eee; text-align: left; }
.tiers-table th { background: var(--light); font-weight: 600; }
.order-box { background: #f0f7ff; padding: 24px; border-radius: 12px; margin-bottom: 24px; }
.order-box h3 { margin-bottom: 12px; font-size: 18px; }
.order-box input[type=number] { width: 120px; padding: 10px; border: 1px solid #ccc; border-radius: 8px; margin-right: 12px; }
.btn { padding: 10px 24px; background: var(--nvc); color: #fff !important; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; }
.btn:hover { background: var(--nvc-dark); }
.btn-secondary { background: #666; }
.btn-secondary:hover { background: #444; }
.my-orders { margin-top: 24px; }
.my-orders table { width: 100%; border-collapse: collapse; }
.my-orders th, .my-orders td { padding: 10px; border-bottom: 1px solid #eee; font-size: 14px; }
.login-tip { background: #fff3e0; padding: 16px; border-radius: 8px; margin-bottom: 20px; }

/* 弹窗 */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.modal.show { display: flex; }
.modal-content { background: #fff; border-radius: 12px; padding: 32px; max-width: 420px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-content h3 { margin-bottom: 20px; font-size: 20px; }
.modal-content .form-group { margin-bottom: 16px; }
.modal-content label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--dark); }
.modal-content input { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.modal-content .btn { width: 100%; margin-top: 8px; padding: 12px; }
.modal-content .err { color: #c62828; font-size: 13px; margin-top: 6px; }
.modal-content .link { display: block; text-align: center; margin-top: 16px; font-size: 14px; }

/* 管理后台 */
.admin-wrap { min-height: 100vh; background: var(--light); padding: 40px 0; }
.admin-login { max-width: 400px; margin: 0 auto; background: #fff; padding: 40px; border-radius: 16px; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
.admin-login h1 { text-align: center; margin-bottom: 28px; font-size: 24px; }
.admin-dash .toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.admin-dash .card { background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 24px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.admin-dash table { width: 100%; border-collapse: collapse; }
.admin-dash th, .admin-dash td { padding: 12px; border-bottom: 1px solid #eee; text-align: left; font-size: 14px; }
.admin-dash th { background: var(--light); font-weight: 600; }
.admin-dash .btn-sm { padding: 6px 12px; font-size: 13px; margin-right: 6px; }
.admin-dash .logout { color: var(--gray); font-size: 14px; }
.form-row { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.form-row label { min-width: 80px; }
.form-row input, .form-row textarea { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; }
.form-row textarea { min-height: 80px; resize: vertical; }
#tiersContainer .tier-row { display: flex; gap: 12px; margin-bottom: 10px; align-items: center; }
#tiersContainer .tier-row input { width: 100px; }
.upload-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.upload-preview img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
.upload-preview .item { position: relative; }
.upload-preview .item .del { position: absolute; top: 2px; right: 2px; background: #c62828; color: #fff; border: none; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; font-size: 12px; line-height: 1; }

/* TOP10 榜单 */
.top10-section { background: linear-gradient(135deg, #fff9e6 0%, #fff5d6 100%); padding: 24px; border-radius: 12px; margin-bottom: 24px; border: 1px solid #ffe0b2; }
.top10-section h3 { font-size: 18px; color: #e65100; margin-bottom: 16px; text-align: center; }
.top10-list { display: flex; flex-direction: column; gap: 8px; }
.top10-item { display: flex; align-items: center; padding: 10px 16px; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.top10-item .rank { width: 40px; font-size: 18px; font-weight: bold; text-align: center; }
.top10-item .name { flex: 1; font-size: 15px; color: #333; font-weight: 500; }
