* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    min-height: 100vh;
    color: #e0e0e0;
}
.header {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 24px 0;
}
.header h1 {
    font-size: 20px; font-weight: 700;
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}
.search-box input {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 8px 14px; border-radius: 10px; color: #fff;
    font-size: 14px; outline: none; width: 200px; transition: all 0.2s;
}
.search-box input:focus {
    border-color: #a78bfa; background: rgba(255,255,255,0.12);
}
.search-box input::placeholder { color: rgba(255,255,255,0.3); }
.notice-bar {
    text-align: center; font-size: 13px; color: rgba(255,255,255,0.4);
    padding: 8px 0 10px;
}
.container { max-width: 1400px; margin: 0 auto; padding: 24px 24px 40px; }
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}
.cat-tab {
    flex: 0 0 auto;
    padding: 8px 22px; border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.6);
    border-radius: 12px; cursor: pointer; font-size: 15px; font-weight: 600; text-align: center;
    transition: all 0.25s;
}
.cat-tab:hover { background: rgba(255,255,255,0.1); color: #fff; }
.cat-tab.active {
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    color: #fff; border-color: transparent;
    box-shadow: 0 4px 15px rgba(167,139,250,0.3);
}
/* CSS Grid + inline-block fallback for old browsers */
.game-grid {
    display: block;
    min-height: 200px;
    letter-spacing: -0.31em; /* inline-block gap hack */
    text-align: left;
}
.game-grid > .game-card {
    display: inline-block;
    vertical-align: top;
    width: calc(25% - 12px);
    margin: 0 8px 16px 8px;
    letter-spacing: normal;
}
@supports (display: grid) {
    .game-grid {
        display: grid;
        letter-spacing: normal;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 16px;
    }
    .game-grid > .game-card {
        display: block;
        width: auto;
        margin: 0;
    }
}
.game-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px; overflow: hidden; cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}
.game-card:hover {
    transform: translateY(-4px);
    border-color: rgba(167,139,250,0.3);
    box-shadow: 0 12px 40px rgba(167,139,250,0.15);
}
.game-img {
    width: 100%; display: block;
}
.game-info { padding: 14px 16px 16px; }
.game-title {
    font-size: 14px; font-weight: 600; color: #fff;
    line-height: 1.3; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.game-tags {
    font-size: 11px; color: rgba(255,255,255,0.4);
    margin-top: 4px;
    white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis;
}
.game-badge {
    position: absolute; font-size: 11px; font-weight: 600;
    padding: 3px 10px; border-radius: 8px; color: #fff;
    bottom: 10px; right: 10px;
}
.game-badge.normal {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}
.game-badge.maintenance {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    box-shadow: 0 2px 8px rgba(124,58,237,0.3);
}
.loading, .empty-state {
    text-align: center; padding: 60px 20px;
    color: rgba(255,255,255,0.3); font-size: 15px; grid-column: 1 / -1;
}
/* Fallback for old positioning - avoid inset:0 */
.modal-overlay {
    display: none; position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
    z-index: 1000; align-items: center; justify-content: center;
    padding: 20px; animation: fadeIn 0.3s ease;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #1e1b4b; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px; width: 90%; max-width: 480px; max-height: 85vh;
    overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    position: relative; animation: slideUp 0.3s ease; padding: 28px;
    text-align: left !important;
}
.modal-close {
    position: absolute; top: 16px; right: 16px;
    width: 32px; height: 32px; border-radius: 50%; border: none;
    background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5);
    font-size: 18px; cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: all 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.15); color: #fff; }
.modal-title { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 20px; text-align: center; }
.modal-error {
    color: #f87171; font-size: 14px; text-align: center; margin-bottom: 16px;
    display: none; background: rgba(248,113,113,0.1);
    border: 1px solid rgba(248,113,113,0.2); padding: 8px 12px; border-radius: 10px;
}
.modal-error.show { display: block; }
.modal-input {
    width: 100%; padding: 12px 16px; background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
    font-size: 15px; color: #fff; outline: none; margin-bottom: 16px;
    transition: all 0.2s;
}
.modal-input:focus {
    border-color: #a78bfa; background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 3px rgba(167,139,250,0.15);
}
.modal-input::placeholder { color: rgba(255,255,255,0.3); }
.modal-btn {
    width: 100%; padding: 12px;
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    color: #fff; border: none; border-radius: 12px;
    font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.modal-btn:hover {
    background: linear-gradient(135deg, #b99cff, #8b5cf6);
    box-shadow: 0 4px 15px rgba(124,58,237,0.3);
}
.modal-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.modal-content { display: none; margin-top: 16px; text-align: left; }
.modal-content.show { display: block; text-align: left; }
.modal-info-content {
    font-size: 14px; line-height: 1.8; color: rgba(255,255,255,0.7);
    text-align: left;
}
.modal-info-content p { margin-bottom: 10px; }
.modal-info-content strong { color: #e0e0e0; }
.modal-info-content a { color: #a78bfa; text-decoration: none; word-break: break-all; }
.modal-info-content a:hover { text-decoration: underline; }
#passwordSection { text-align: left; }
.pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 6px; margin-top: 32px; flex-wrap: wrap;
}
.page-btn {
    padding: 6px 14px; border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.6);
    border-radius: 8px; cursor: pointer; font-size: 13px;
    transition: all 0.2s; min-width: 36px; text-align: center;
}
.page-btn:hover:not(.active):not(:disabled) {
    background: rgba(255,255,255,0.1); border-color: rgba(167,139,250,0.3); color: #fff;
}
.page-btn.active {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    color: #fff; border-color: transparent;
}
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-info { font-size: 13px; color: rgba(255,255,255,0.3); padding: 0 4px; }
.report-btn {
    display: block; width: 100%; padding: 12px 16px; margin-top: 20px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff; border: none; border-radius: 12px;
    font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.report-btn:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 4px 15px rgba(245,158,11,0.3);
}
.report-btn.recovered {
    background: linear-gradient(135deg, #10b981, #059669);
}
.report-btn.recovered:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 4px 15px rgba(16,185,129,0.3);
}
.report-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.report-btn .checkmark { display: none; }
.report-btn.submitted .checkmark { display: inline; }
.report-btn.submitted .btn-text { display: none; }
.confirm-modal-overlay {
    display: none; position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
    z-index: 2000; align-items: center; justify-content: center;
    padding: 20px; animation: fadeIn 0.3s ease;
}
.confirm-modal-overlay.show { display: flex; }
.confirm-modal-box {
    background: #1e1b4b; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px; width: 90%; max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease; padding: 32px 28px 24px;
    text-align: center;
}
.confirm-modal-box .icon {
    font-size: 48px; margin-bottom: 16px;
}
.confirm-modal-box .msg {
    font-size: 15px; line-height: 1.6; color: rgba(255,255,255,0.85);
    margin-bottom: 24px;
}
.confirm-modal-box .msg strong { color: #fbbf24; }
.confirm-modal-actions {
    display: flex; gap: 12px;
}
.confirm-modal-actions button {
    flex: 1; padding: 11px; border-radius: 12px;
    font-size: 15px; font-weight: 600; cursor: pointer; border: none;
    transition: all 0.2s;
}
.confirm-btn-cancel {
    background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6);
}
.confirm-btn-cancel:hover { background: rgba(255,255,255,0.15); color: #fff; }
.confirm-btn-ok {
    background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff;
}
.confirm-btn-ok:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 4px 15px rgba(245,158,11,0.3);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes zoomIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.game-img-wrap { position: relative; overflow: hidden; }
.zoom-btn {
    position: absolute; bottom: 6px; right: 6px;
    width: 30px; height: 30px;
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px; color: #fff; font-size: 16px;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; z-index: 10;
    backdrop-filter: blur(4px); line-height: 1; padding: 0;
    transition: all 0.2s;
}
.zoom-btn:hover {
    background: rgba(167,139,250,0.7);
    border-color: rgba(167,139,250,0.4);
    transform: scale(1.1);
}
.zoom-overlay {
    display: none; position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.88);
    z-index: 9999; align-items: center; justify-content: center;
    padding: 20px; animation: fadeIn 0.25s ease;
}
.zoom-overlay.show { display: flex; }
.zoom-overlay .zoom-scroll-wrap {
    max-width: 80vw; max-height: 80vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    animation: zoomIn 0.3s ease;
}
.zoom-overlay .zoom-scroll-wrap img {
    display: block;
    width: 100%;
    height: auto;
    min-width: 100%;
}

/* 手机端：2列布局 */
@media (max-width: 640px) {
    .category-tabs {
        justify-content: flex-start;
        gap: 8px;
    }
    .cat-tab {
        font-size: 13px;
        padding: 7px 12px;
    }
    .header-inner {
        padding: 12px 16px 0;
        flex-direction: column;
        align-items: stretch;
    }
    .header h1 {
        font-size: 18px;
        text-align: center;
    }
    .search-box input {
        width: 100%;
    }
    .container {
        padding: 16px;
    }
    .game-info {
        padding: 10px 12px 12px;
    }
    .game-title {
        font-size: 13px;
    }
    .game-tags {
        font-size: 10px;
    }
}

@media (max-width: 400px) {
    .game-info {
        padding: 8px 10px 10px;
    }
    .game-title {
        font-size: 12px;
    }
}
