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

:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-hover: #273549;
    --primary: #f97316;
    --primary-hover: #ea580c;
    --accent: #38bdf8;
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --border: #334155;
    --gold: #facc15;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.5;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(90deg, #f97316, #facc15);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tag-beta {
    font-size: 11px;
    background: rgba(249, 115, 22, 0.2);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 1px 6px;
    border-radius: 6px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e;
}

.btn-mini {
    background: var(--surface-hover);
    color: var(--accent);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    cursor: pointer;
}

.portal-grid {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 18px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.sub-hint {
    font-size: 12px;
    color: var(--text-sub);
}

.filter-pills {
    display: flex;
    gap: 6px;
}

.pill {
    background: var(--surface);
    color: var(--text-sub);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
}

.pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* 游戏卡片网格 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.game-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, border-color 0.2s;
}

.game-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
}

.game-cover {
    height: 90px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    margin-bottom: 12px;
    position: relative;
}

.heat-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.65);
    color: #fb923c;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
}

.game-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.game-desc {
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 12px;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 12px;
}

.game-actions {
    display: flex;
    gap: 8px;
}

.btn-play {
    flex: 1;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.btn-play:hover {
    background: var(--primary-hover);
}

.btn-like-card {
    background: var(--surface-hover);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
}

/* 排行榜 */
.rank-tabs {
    display: flex;
    background: var(--bg);
    padding: 3px;
    border-radius: 8px;
}

.rank-tab {
    background: transparent;
    color: var(--text-sub);
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.rank-tab.active {
    background: var(--primary);
    color: #fff;
}

.rank-list, .activity-list {
    list-style: none;
}

.rank-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 6px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.rank-item:last-child {
    border-bottom: none;
}

.rank-num {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--surface-hover);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    margin-right: 8px;
}

.rank-1 { background: #eab308; color: #000; }
.rank-2 { background: #94a3b8; color: #000; }
.rank-3 { background: #b45309; color: #fff; }

/* 用户ID实时活动 */
.live-tag {
    font-size: 10px;
    background: #dc2626;
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.activity-item {
    padding: 9px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 12px;
    color: var(--text-sub);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item b {
    color: var(--accent);
}

.activity-item .highlight {
    color: var(--gold);
}

/* 吐槽区 */
.roast-input-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.roast-input-bar select, .roast-input-bar input {
    background: var(--bg);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
}

.roast-input-bar input {
    flex: 1;
    min-width: 180px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.roast-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 280px;
    overflow-y: auto;
}

.roast-item {
    background: var(--bg);
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
    font-size: 13px;
}

.roast-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-sub);
    margin-bottom: 4px;
}

/* 弹窗与内置小游戏舞台 */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 16px;
}

.hidden {
    display: none !important;
}

.game-window {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    padding: 18px;
}

.game-window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-sub);
    font-size: 26px;
    cursor: pointer;
}

.playable-stage {
    background: #0b1120;
    border: 1px solid var(--border);
    border-radius: 12px;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    margin-bottom: 14px;
}

.stage-btn {
    background: linear-gradient(135deg, #f97316, #eab308);
    color: #000;
    font-weight: 800;
    border: none;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 12px;
}

.stage-btn:active {
    transform: scale(0.95);
}

.game-window-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.btn-like {
    background: var(--surface-hover);
    color: #fff;
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 14px;
    cursor: pointer;
}

.quick-roast {
    display: flex;
    gap: 8px;
}

.quick-roast input {
    flex: 1;
    background: var(--bg);
    color: #fff;
    border: 1px solid var(--border);
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12px;
}

.btn-secondary {
    background: var(--accent);
    color: #0f172a;
    border: none;
    padding: 7px 14px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
}

@media (max-width: 860px) {
    .portal-grid {
        grid-template-columns: 1fr;
    }
}
