* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #1a1a2e;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

.main-container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-bottom: 40px;
}

.top-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.user-section { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn-auth {
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.btn-auth:hover { background: rgba(255,255,255,0.2); }
.btn-auth.btn-register { background: rgba(108,99,255,0.3); border-color: rgba(108,99,255,0.7); }
.user-welcome {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    padding: 6px 12px;
    border-radius: 20px;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid rgba(255,255,255,0.25);
}
.btn-logout {
    padding: 4px 10px;
    border: 1px solid rgba(255,80,80,0.4);
    background: rgba(255,80,80,0.25);
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
    font-size: 11px;
}
.btn-logout:hover { background: rgba(255,80,80,0.5); }
.top-right-text { color: rgba(255,255,255,0.6); font-size: 12px; }

.site-title { color: #fff; font-size: 24px; font-weight: 900; text-align: center; }

.click-card {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}
.click-info { color: #666; font-size: 13px; }
.click-count-display { font-size: 42px; font-weight: 900; color: #1a1a2e; }
.click-rate { color: #888; font-size: 12px; }
.btn-click {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: #e74c3c;
    color: #fff;
    font-size: 20px;
    font-weight: 900;
}
.btn-click:active { background: #c0392b; }
.btn-click:disabled { cursor: not-allowed; opacity: 0.5; }
.click-hint { color: #aaa; font-size: 12px; }

.shop-card { width: 100%; background: #fff; border-radius: 12px; padding: 16px; }
.shop-title { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.shop-items { display: flex; flex-direction: column; gap: 6px; }
.shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #eee;
    font-size: 13px;
}
.shop-item.owned { border-color: #2ecc71; background: #f0fff4; }
.shop-item.affordable { border-color: #f39c12; }
.shop-item.locked { opacity: 0.5; }
.shop-item-info { flex: 1; }
.shop-item-name { font-weight: 700; font-size: 14px; }
.shop-item-desc { font-size: 11px; color: #888; }
.shop-item-cost { font-size: 12px; font-weight: 600; color: #666; }
.shop-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    color: #fff;
    white-space: nowrap;
}
.shop-btn.buy { background: #2ecc71; }
.shop-btn.owned-btn { background: #bbb; cursor: default; }
.shop-btn.locked-btn { background: #ddd; color: #999; cursor: not-allowed; }

.leaderboard-card { width: 100%; background: #fff; border-radius: 12px; padding: 16px; }
.leaderboard-title { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.leaderboard-table { width: 100%; border-collapse: separate; border-spacing: 0 3px; }
.leaderboard-table th { text-align: left; padding: 6px 8px; font-size: 11px; color: #999; border-bottom: 1px solid #eee; }
.leaderboard-table td { padding: 8px; font-size: 13px; font-weight: 600; color: #333; background: #fafafa; border-radius: 4px; }
.leaderboard-table .rank-1 td:first-child { color: #f9a825; }
.leaderboard-table .rank-2 td:first-child { color: #9e9e9e; }
.leaderboard-table .rank-3 td:first-child { color: #e65100; }
.leaderboard-table .current-user-row td { background: #fffde8; }

#toastContainer { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; }
.toast { padding: 10px 20px; border-radius: 20px; font-weight: 700; font-size: 13px; color: #fff; margin-bottom: 6px; text-align: center; }
.toast-success { background: #2ecc71; }
.toast-error { background: #e74c3c; }
.toast-info { background: #6c63ff; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 1000; display: flex; justify-content: center; align-items: center; }
.modal-dialog { background: #fff; border-radius: 14px; padding: 24px 20px; width: 90%; max-width: 360px; position: relative; }
.modal-close { position: absolute; top: 8px; right: 12px; background: none; border: none; font-size: 20px; cursor: pointer; color: #999; }
.modal-title { font-size: 20px; font-weight: 800; text-align: center; margin-bottom: 16px; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-weight: 600; font-size: 12px; margin-bottom: 4px; color: #444; }
.form-group input { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; outline: none; }
.form-group input:focus { border-color: #6c63ff; }
.btn-submit { width: 100%; padding: 10px; background: #6c63ff; color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; }
.form-switch { text-align: center; margin-top: 10px; font-size: 12px; color: #888; }
.form-switch a { color: #6c63ff; cursor: pointer; font-weight: 700; text-decoration: underline; }
.form-error { color: #e74c3c; font-size: 11px; font-weight: 600; margin-top: 2px; }

@media (max-width: 480px) {
    .site-title { font-size: 20px; }
    .btn-click { width: 130px; height: 130px; font-size: 18px; }
    .click-count-display { font-size: 34px; }
    .shop-item { flex-direction: column; align-items: flex-start; gap: 6px; }
    .shop-btn { width: 100%; text-align: center; }
}