/* ---------- 全局重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: radial-gradient(ellipse at 30% 20%, #0b1a2e, #050b15);
    padding: 20px;
    overflow-y: auto;
    /* 全局过渡动画 */
    transition: background 0.4s ease, color 0.3s ease;
}
.game-card {
    width: 100%;
    max-width: 560px;
    padding: 32px 28px 36px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 48px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: #eaf0f8;
    margin: 0 auto;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 8px;
}
.title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #7dd3fc, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}
.title-icon {
    -webkit-text-fill-color: initial;
    font-size: 28px;
}
.btn {
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.btn:active {
    transform: scale(0.94);
}
.btn-primary {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: #0c1a2e;
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.30);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(56, 189, 248, 0.40);
}
.btn-danger {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
    transition: all 0.3s ease;
}
.btn-danger:hover {
    background: rgba(248, 113, 113, 0.3);
    transform: translateY(-2px);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #e2e8f0;
    transform: translateY(-2px);
}
.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}
.input-field {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}
.input-field:focus {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}
.input-field::placeholder {
    color: #475569;
}
.message {
    margin-top: 8px;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
}
.text-success {
    color: #4ade80;
}
.text-error {
    color: #f87171;
}

/* 登录/注册卡片 */
#page-login .btn {
    width: 100%;
    margin-top: 4px;
    justify-content: center;
}
#page-login a {
    color: #38bdf8;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}
#page-login a:hover {
    text-decoration: underline;
    color: #7dd3fc;
}

/* ---------- 游戏样式 ---------- */
.lives-section {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 100px;
    padding: 6px 18px 6px 22px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
    transition: all 0.3s ease;
}
.lives-label {
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    white-space: nowrap;
}
.lives-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
    align-items: center;
    min-height: 32px;
}
.life-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.18);
    border: 2px solid rgba(56, 189, 248, 0.25);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #7dd3fc;
    flex-shrink: 0;
}
.life-dot.active {
    background: rgba(56, 189, 248, 0.30);
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
    transform: scale(1);
}
.life-dot.used {
    background: rgba(71, 85, 105, 0.30);
    border-color: rgba(71, 85, 105, 0.40);
    color: #475569;
    transform: scale(0.85);
    opacity: 0.5;
}
.lives-count {
    font-size: 20px;
    font-weight: 700;
    color: #7dd3fc;
    min-width: 32px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    transition: all 0.3s ease;
}

.message-area {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    padding: 20px 24px;
    margin-bottom: 20px;
    min-height: 80px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.4s ease;
}
.message-area.high {
    border-color: rgba(251, 146, 60, 0.30);
    background: rgba(251, 146, 60, 0.05);
}
.message-area.low {
    border-color: rgba(96, 165, 250, 0.30);
    background: rgba(96, 165, 250, 0.05);
}
.message-area.correct {
    border-color: rgba(74, 222, 128, 0.40);
    background: rgba(74, 222, 128, 0.08);
    animation: pop 0.5s ease;
}
.message-area.gameover {
    border-color: rgba(248, 113, 113, 0.30);
    background: rgba(248, 113, 113, 0.08);
}
.message-text {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
    transition: all 0.3s ease;
}
.message-text .highlight {
    color: #facc15;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(250, 204, 21, 0.2);
}
.message-sub {
    font-size: 14px;
    color: #94a3b8;
    margin-top: 6px;
    transition: all 0.3s ease;
}
.history-section {
    margin-bottom: 20px;
}
.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: #64748b;
}
.history-list {
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid transparent;
    animation: slideIn 0.3s ease;
    transition: all 0.3s ease;
}
.history-item.high {
    border-left-color: #fb923c;
}
.history-item.low {
    border-left-color: #60a5fa;
}
.history-item.correct {
    border-left-color: #4ade80;
    background: rgba(74, 222, 128, 0.06);
    animation: pop 0.5s ease;
}
.history-item .h-index {
    font-weight: 600;
    color: #475569;
    min-width: 28px;
}
.history-item .h-number {
    font-weight: 700;
    font-size: 18px;
    color: #f1f5f9;
    min-width: 40px;
}
.history-item .h-result {
    font-size: 14px;
    font-weight: 500;
    margin-left: auto;
}
.history-item .h-result.high {
    color: #fb923c;
}
.history-item .h-result.low {
    color: #60a5fa;
}
.history-item .h-result.correct {
    color: #4ade80;
}
.empty-history {
    color: #475569;
    font-size: 14px;
    text-align: center;
    padding: 18px 0;
    font-style: italic;
}
.input-row {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}
.input-row input {
    flex: 1;
    padding: 14px 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #f1f5f9;
    font-size: 18px;
    font-weight: 600;
    outline: none;
    transition: all 0.3s ease;
    min-width: 0;
}
.input-row input:focus {
    border-color: rgba(56, 189, 248, 0.40);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}
.input-row input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.input-row input[type="number"]::-webkit-inner-spin-button,
.input-row input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.input-row input[type="number"] {
    -moz-appearance: textfield;
}
.btn-row {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.btn-row .btn {
    flex: 1;
    justify-content: center;
    min-width: 60px;
}
.settings-section {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 10px 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
    transition: all 0.3s ease;
}
.settings-section label {
    font-size: 14px;
    color: #94a3b8;
    white-space: nowrap;
}
.settings-section input[type="number"] {
    width: 70px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}
.settings-section input[type="number"]:focus {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(255, 255, 255, 0.08);
}
.footer {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    color: #334155;
    gap: 16px;
    flex-wrap: wrap;
}
.server-status {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 20px;
    transition: background 0.2s, transform 0.2s;
    user-select: none;
}
.server-status:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: scale(1.02);
}
.refresh-icon {
    font-size: 14px;
    transition: transform 0.5s ease;
    display: inline-block;
}
.server-status:active .refresh-icon {
    transform: rotate(180deg);
}
.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    background: #4ade80;
    animation: pulse-dot 1.8s ease-in-out infinite;
}
.dot.offline {
    background: #f87171;
    animation: none;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pop {
    0% { transform: scale(0.9); opacity: 0.5; }
    60% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* 管理面板 */
.admin-panel {
    margin-top: 16px;
}
.admin-panel h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #7dd3fc;
    transition: color 0.3s ease;
}
.admin-user-list {
    max-height: 400px;
    overflow-y: auto;
}
.admin-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
    transition: all 0.3s ease;
}
.admin-user-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(2px);
}
.admin-user-item .info {
    flex: 1;
    min-width: 120px;
    font-size: 14px;
    color: #e2e8f0;
}
.admin-user-item .info .username {
    font-weight: 600;
    color: #f1f5f9;
}
.admin-user-item .info .role {
    color: #94a3b8;
    font-size: 12px;
    margin-left: 8px;
}
.admin-user-item .info .status {
    color: #94a3b8;
    font-size: 13px;
}
.admin-user-item .actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.admin-user-item .actions .btn {
    padding: 4px 12px;
    font-size: 12px;
    transition: all 0.2s ease;
}
.admin-change-password {
    margin-top: 20px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}
.admin-change-password h3 {
    font-size: 16px;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 12px;
}
.admin-change-password .row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.admin-change-password .row .input-field {
    flex: 1;
    min-width: 120px;
}

/* 排行榜页面 */
.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
    transition: all 0.3s ease;
}
.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: translateX(4px);
}
.leaderboard-item .rank {
    font-weight: 700;
    color: #facc15;
    min-width: 30px;
}
.leaderboard-item .name {
    flex: 1;
    color: #e2e8f0;
}
.leaderboard-item .stats {
    color: #94a3b8;
    font-size: 13px;
    white-space: nowrap;
}
.leaderboard-item .stats span {
    margin-left: 12px;
}
.leaderboard-item .stats .wins {
    color: #4ade80;
}
.leaderboard-item .stats .avg {
    color: #60a5fa;
}
.leaderboard-item .stats .best {
    color: #facc15;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-box {
    background: rgba(15, 25, 40, 0.95);
    border-radius: 32px;
    padding: 32px;
    max-width: 500px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.3s ease;
}
@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.modal-box h3 {
    color: #eaf0f8;
    margin-bottom: 16px;
}
.modal-box .btn-row {
    margin-top: 12px;
    justify-content: flex-end;
}
.modal-box .btn {
    min-width: 80px;
    justify-content: center;
}
.modal-box .modal-body {
    flex: 1;
    overflow-y: auto;
}

/* ---------- 主题切换按钮 ---------- */
.theme-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #eaf0f8;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.25);
}
.theme-btn:active {
    transform: scale(0.9);
}
body.light-mode .theme-btn {
    background: rgba(0, 0, 0, 0.08);
    color: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
body.light-mode .theme-btn:hover {
    background: rgba(0, 0, 0, 0.15);
}

/* ---------- 浅色主题（白） ---------- */
body.light-mode {
    background: #f1f5f9 !important;
}
body.light-mode .game-card {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    color: #1e293b;
}
body.light-mode .title {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
body.light-mode .title-icon {
    -webkit-text-fill-color: initial;
}
body.light-mode .btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: #475569;
    border-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.10);
    color: #1e293b;
    transform: translateY(-2px);
}
body.light-mode .input-field {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.7);
    color: #1e293b;
}
body.light-mode .input-field:focus {
    border-color: rgba(37, 99, 235, 0.5);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
body.light-mode .input-field::placeholder {
    color: #94a3b8;
}
body.light-mode .lives-section {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.06);
}
body.light-mode .lives-label {
    color: #64748b;
}
body.light-mode .life-dot {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.3);
    color: #2563eb;
}
body.light-mode .life-dot.active {
    background: rgba(37, 99, 235, 0.25);
    border-color: #2563eb;
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.15);
}
body.light-mode .life-dot.used {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.15);
    color: #94a3b8;
}
body.light-mode .lives-count {
    color: #2563eb;
}
body.light-mode .message-area {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}
body.light-mode .message-area.high {
    border-color: rgba(251, 146, 60, 0.4);
    background: rgba(251, 146, 60, 0.05);
}
body.light-mode .message-area.low {
    border-color: rgba(96, 165, 250, 0.4);
    background: rgba(96, 165, 250, 0.05);
}
body.light-mode .message-area.correct {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.06);
}
body.light-mode .message-area.gameover {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.06);
}
body.light-mode .message-text {
    color: #1e293b;
}
body.light-mode .message-text .highlight {
    color: #2563eb;
    text-shadow: 0 0 20px rgba(37, 99, 235, 0.15);
}
body.light-mode .message-sub {
    color: #64748b;
}
body.light-mode .history-header {
    color: #64748b;
}
body.light-mode .history-item {
    background: rgba(0, 0, 0, 0.03);
}
body.light-mode .history-item .h-index {
    color: #94a3b8;
}
body.light-mode .history-item .h-number {
    color: #1e293b;
}
body.light-mode .empty-history {
    color: #94a3b8;
}
body.light-mode .settings-section {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}
body.light-mode .settings-section label {
    color: #64748b;
}
body.light-mode .settings-section input[type="number"] {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.7);
    color: #1e293b;
}
body.light-mode .settings-section input[type="number"]:focus {
    border-color: rgba(37, 99, 235, 0.5);
    background: rgba(255, 255, 255, 0.9);
}
body.light-mode .footer {
    color: #94a3b8;
}
body.light-mode .server-status:hover {
    background: rgba(0, 0, 0, 0.05);
}
body.light-mode .dot {
    background: #22c55e;
}
body.light-mode .dot.offline {
    background: #ef4444;
}
body.light-mode .status-badge {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.15);
}
body.light-mode .status-badge.playing {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.15);
}
body.light-mode .status-badge.won {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border-color: rgba(34, 197, 94, 0.2);
}
body.light-mode .status-badge.lost {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.2);
}
body.light-mode .admin-panel h2 {
    color: #2563eb;
}
body.light-mode .admin-user-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}
body.light-mode .admin-user-item:hover {
    background: rgba(0, 0, 0, 0.06);
}
body.light-mode .admin-user-item .info {
    color: #1e293b;
}
body.light-mode .admin-user-item .info .username {
    color: #0f172a;
}
body.light-mode .admin-user-item .info .role {
    color: #64748b;
}
body.light-mode .admin-user-item .info .status {
    color: #64748b;
}
body.light-mode .admin-change-password {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}
body.light-mode .admin-change-password h3 {
    color: #64748b;
}
body.light-mode .leaderboard-item {
    border-color: rgba(0, 0, 0, 0.06);
}
body.light-mode .leaderboard-item:hover {
    background: rgba(0, 0, 0, 0.03);
}
body.light-mode .leaderboard-item .name {
    color: #1e293b;
}
body.light-mode .leaderboard-item .stats {
    color: #64748b;
}
body.light-mode .modal-box {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .modal-box h3 {
    color: #1e293b;
}
body.light-mode #page-login a {
    color: #2563eb;
}
body.light-mode #page-login a:hover {
    color: #1d4ed8;
}
body.light-mode #page-login .btn {
    color: #0c1a2e;
}
body.light-mode #page-login .btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
}
body.light-mode #page-login .btn-primary:hover {
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.4);
}
body.light-mode .input-row input {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.7);
    color: #1e293b;
}
body.light-mode .input-row input:focus {
    border-color: rgba(37, 99, 235, 0.5);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
body.light-mode .input-row input::placeholder {
    color: #94a3b8;
}
body.light-mode .history-item .h-result.high {
    color: #f97316;
}
body.light-mode .history-item .h-result.low {
    color: #3b82f6;
}
body.light-mode .history-item .h-result.correct {
    color: #22c55e;
}

/* ---------- 设置页浅色模式适配（修复输入框不可见） ---------- */
body.light-mode #settingMaxGuesses {
    border-color: rgba(0, 0, 0, 0.25);
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
body.light-mode #settingMaxGuesses:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
body.light-mode #settingCurrentValue {
    color: #2563eb;
    font-weight: 600;
}
body.light-mode #settingSaveBtn {
    color: #0c1a2e;
}
body.light-mode #settingLogoutBtn {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.15);
}
body.light-mode #settingLogoutBtn:hover {
    background: rgba(220, 38, 38, 0.15);
    transform: translateY(-2px);
}

/* ---------- 页面切换淡入动画 ---------- */
#app > * {
    animation: fadeSlideIn 0.4s ease;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- 游戏页专有美化 ---------- */
#page-game .lives-dots {
    justify-content: center;
}
#page-game .lives-dots .life-dot {
    width: 28px;
    height: 28px;
    font-size: 12px;
}
#page-game .message-area {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 24px;
    padding: 24px 28px;
    min-height: 100px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
#page-game .message-text {
    font-size: 24px;
    font-weight: 700;
}
#page-game .message-text .highlight {
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}
#page-game .history-item {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 10px 16px;
}
#page-game .input-row input {
    font-size: 20px;
    padding: 16px 24px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}
#page-game .input-row input:focus {
    background: rgba(255, 255, 255, 0.10);
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}
#page-game .btn-primary {
    padding: 16px 32px;
    font-size: 18px;
    border-radius: 20px;
}
#page-game .btn-secondary {
    padding: 10px 20px;
    border-radius: 16px;
}
#page-game .footer {
    margin-top: 24px;
}
body.light-mode #page-game .message-area {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}
body.light-mode #page-game .history-item {
    background: rgba(0, 0, 0, 0.03);
}
body.light-mode #page-game .input-row input {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.12);
}
body.light-mode #page-game .input-row input:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
    .game-card {
        padding: 24px 16px 28px;
        border-radius: 32px;
        max-width: 100%;
    }
    .title {
        font-size: 20px;
    }
    .message-text {
        font-size: 18px;
    }
    .input-row input {
        font-size: 16px;
        padding: 12px 14px;
    }
    .btn {
        font-size: 13px;
        padding: 10px 14px;
    }
    .btn-guess {
        min-width: 60px;
    }
    .history-item .h-number {
        font-size: 16px;
        min-width: 32px;
    }
    .lives-section {
        padding: 4px 12px 4px 14px;
    }
    .life-dot {
        width: 18px;
        height: 18px;
        font-size: 8px;
    }
    .settings-section {
        flex-wrap: wrap;
        gap: 8px;
    }
    .settings-section input[type="number"] {
        width: 60px;
        font-size: 14px;
    }
    .admin-user-item {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-user-item .actions {
        justify-content: flex-start;
        margin-top: 6px;
    }
    .modal-box {
        padding: 20px;
        margin: 16px;
    }
    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .header .status-badge {
        align-self: flex-start;
    }
    .admin-change-password .row {
        flex-direction: column;
    }
    .admin-change-password .row .input-field {
        width: 100%;
    }
    .leaderboard-item {
        flex-wrap: wrap;
        gap: 4px;
    }
    .leaderboard-item .stats {
        width: 100%;
        text-align: right;
    }
}

@media (max-width: 400px) {
    .game-card {
        padding: 16px 12px 20px;
        border-radius: 24px;
    }
    .title {
        font-size: 18px;
    }
    .message-text {
        font-size: 16px;
    }
    .input-row input {
        font-size: 14px;
        padding: 10px 12px;
    }
    .btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    .life-dot {
        width: 16px;
        height: 16px;
        font-size: 7px;
        border-width: 1.5px;
    }
}