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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: -webkit-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

.page {
    display: none;
    min-height: 100vh;
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    padding-bottom: calc(20px + constant(safe-area-inset-bottom, 0px));
}

/* 首次用户默认显示欢迎页，其余页面隐藏 */
#welcome-page {
    display: block;
}

.page.active {
    display: block;
}

.container {
    max-width: 550px;
    margin: 0 auto;
    width: 100%;
}

/* 主页面样式 */
.app-title {
    text-align: center;
    font-size: 3.2em;
    color: white;
    margin-top: 40px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.app-title-icon {
    height: 0.9em;
    vertical-align: -0.08em;
    margin-right: 0.15em;
}

.app-subtitle {
    text-align: center;
    color: rgba(255,255,255,0.9);
    font-size: 1.5em;
    margin-top: 10px;
    margin-bottom: 55px;
}

/* 用户名输入区域 */
.user-input-section {
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.user-input-section h3 {
    text-align: center;
    color: white;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.user-input-wrap {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: center;
    justify-content: center;
}

.username-input {
    width: 100%;
    max-width: 280px;
    padding: 12px 16px;
    font-size: 1.1em;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    color: white;
    text-align: center;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.username-input::placeholder {
    color: rgba(255,255,255,0.6);
}

.username-input:focus {
    border-color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.3);
}

/* 首页用户信息栏 */
.home-user-info {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    background: rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 24px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.home-user-info:active {
    background: rgba(255,255,255,0.25);
}

.profile-entry-btn {
    background: rgba(255,255,255,0.25);
    color: white;
    border: 1.5px solid rgba(255,255,255,0.5);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 4px;
}

.profile-entry-icon {
    vertical-align: middle;
}

.sound-toggle-btn {
    background: rgba(255,255,255,0.2);
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    margin-right: 8px;
}

.sound-toggle-btn:active {
    background: rgba(255,255,255,0.35);
}

.profile-entry-btn:active {
    background: rgba(255,255,255,0.4);
}

.user-avatar {
    font-size: 2em;
    margin-right: 12px;
    line-height: 1;
}

.user-details {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
}

.user-greeting {
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    white-space: nowrap;
}

.user-grade-label {
    color: rgba(255,255,255,0.8);
    font-size: 0.9em;
    margin-top: 2px;
}

.switch-user-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85em;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.switch-user-btn:active {
    background: rgba(255,255,255,0.35);
}

.icon-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.2em;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.icon-btn:active {
    background: rgba(255,255,255,0.35);
}

/* 关于页面样式 */
.about-hero {
    text-align: center;
    padding: 30px 20px;
}

.about-app-icon {
    margin-bottom: 10px;
}

.about-app-icon-img {
    width: 80px;
    height: 80px;
}

.about-app-name {
    font-size: 1.8em;
    color: #2c3e50;
    margin-bottom: 5px;
}

.about-version {
    color: #95a5a6;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.about-slogan {
    color: #7f8c8d;
    font-size: 1.05em;
}

.about-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.about-section h4 {
    color: #2c3e50;
    font-size: 1.15em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.about-section p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 8px;
}

.about-contact {
    color: #3498db;
    font-size: 0.95em;
}

.about-feature-grid {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 10px;
}

.about-feature-chip {
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 4px;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.9em;
    color: #2c3e50;
    white-space: nowrap;
}

.about-feature-chip span {
    font-size: 1.1em;
}

/* 时间控制 */
.time-control-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    z-index: 9999;
}

.time-control-card {
    background: white;
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.rest-icon, .parent-icon {
    font-size: 3em;
    margin-bottom: 12px;
}

.rest-title, .parent-title {
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.rest-msg, .parent-msg {
    color: #555;
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 16px;
}

.rest-countdown {
    font-size: 3em;
    font-weight: bold;
    color: #e67e22;
    margin: 16px 0;
    font-variant-numeric: tabular-nums;
}

.rest-hint {
    color: #95a5a6;
    font-size: 0.85em;
}

.parent-challenge {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 20px;
    margin-top: 16px;
}

.parent-challenge p {
    color: #555;
    margin-bottom: 8px;
}

.parent-question {
    font-size: 2em;
    font-weight: bold;
    color: #2c3e50;
    margin: 12px 0;
}

.parent-input-wrap {
    display: -webkit-flex;
    display: flex;
    gap: 8px;
    -webkit-justify-content: center;
    justify-content: center;
    margin-top: 12px;
}

.parent-input {
    width: 120px;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.2em;
    text-align: center;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.parent-input:focus {
    border-color: #667eea;
}

.parent-submit-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.parent-submit-btn:active {
    opacity: 0.85;
}

.parent-hint {
    color: #95a5a6;
    font-size: 0.8em;
    margin-top: 10px;
}

.feedback-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95em;
    resize: vertical;
    outline: none;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.feedback-textarea:focus {
    border-color: #667eea;
}

.feedback-submit-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.feedback-submit-btn:active {
    opacity: 0.85;
}

.donate-section {
    background: linear-gradient(135deg, #fff9e6 0%, #fff0f0 100%);
}

.donate-qr {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    margin: 16px 0;
}

.donate-qr-img {
    width: 180px;
    border-radius: 12px;
    border: 2px solid #eee;
}

.donate-qr-amount {
    text-align: center;
    font-size: 0.9em;
    color: #e67e22;
    margin: 8px 0 0 0;
}

.donate-note {
    text-align: center;
    color: #e67e22;
    font-size: 0.9em;
    margin-top: 8px;
}

.donate-options {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 10px;
    -webkit-justify-content: center;
    justify-content: center;
    margin: 16px 0;
}

.donate-option-btn {
    padding: 12px 20px;
    border: 2px solid #e67e22;
    border-radius: 25px;
    background: white;
    color: #e67e22;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-width: 70px;
    text-align: center;
}

.donate-option-btn:active {
    background: #e67e22;
    color: white;
}

.donate-option-btn.selected {
    background: #e67e22;
    color: white;
}

.donate-custom {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 8px;
    -webkit-justify-content: center;
    justify-content: center;
    margin: 10px 0;
}

.donate-custom-input {
    width: 100px;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    text-align: center;
    outline: none;
}

.donate-custom-input:focus {
    border-color: #e67e22;
}

.donate-submit-btn {
    padding: 12px 30px;
    background: #e67e22;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    display: block;
    margin: 16px auto 0;
}

.donate-submit-btn:active {
    background: #d35400;
}

.grade-section {
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.grade-section h3 {
    text-align: center;
    color: white;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.grade-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.grade-btn {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    padding: 12px 8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 15px;
    background: rgba(255,255,255,0.1);
    color: white;
    cursor: pointer;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
    -webkit-appearance: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.grade-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

.grade-btn.active {
    background: rgba(255,255,255,0.95);
    border-color: white;
    color: #333;
}

.grade-icon {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.grade-name {
    font-size: 0.85em;
    font-weight: 500;
}

/* 年级变化通知 */
.grade-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    background: rgba(0,0,0,0.45);
    -webkit-animation: fadeIn 0.3s ease-out;
    animation: fadeIn 0.3s ease-out;
    padding: 20px;
}

.notification-content {
    background: white;
    border-radius: 24px;
    padding: 30px 28px 24px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    position: relative;
    -webkit-animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.notification-icon {
    font-size: 3em;
    display: block;
    margin-bottom: 10px;
    line-height: 1;
}

.notification-text {
    color: #333;
}

.notification-text strong {
    display: block;
    font-size: 1.2em;
    color: #333;
    margin-bottom: 8px;
}

.notification-text p {
    font-size: 0.95em;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.notification-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.6em;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-appearance: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    line-height: 1;
}

.notification-close:active {
    background: #f0f0f0;
}

@-webkit-keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@-webkit-keyframes popIn {
    from { -webkit-transform: scale(0.7); opacity: 0; }
    to { -webkit-transform: scale(1); opacity: 1; }
}
@keyframes popIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}



.current-grade-display {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: #f0f7ff;
    border-radius: 15px;
    margin-bottom: 25px;
}

#current-grade-name {
    font-size: 1.5em;
    font-weight: bold;
    color: #2c3e50;
}

#current-difficulty {
    font-size: 1.1em;
    color: #667eea;
}

.menu-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.menu-btn {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    padding: 22px 10px;
    border: none;
    border-radius: 20px;
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    cursor: pointer;
    -webkit-transition: -webkit-transform 0.2s, box-shadow 0.2s;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    text-align: center;
    min-width: 0;
    white-space: nowrap;
}

.menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.menu-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 3em;
    margin-bottom: 8px;
    line-height: 1;
}

.btn-text {
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
}

.btn-desc {
    display: block;
    font-size: 0.95em;
    color: #666;
    margin-top: 4px;
    line-height: 1.2;
}

.math-btn .btn-text {
    color: #e74c3c;
}

.memory-btn .btn-text {
    color: #3498db;
}

.about-btn .btn-text {
    color: #7f8c8d;
}

.about-icon-badge {
    display: inline-block;
    width: 1.3em;
    height: 1.3em;
    line-height: 1.3em;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-style: normal;
    font-weight: bold;
    font-size: 0.7em;
    text-align: center;
    vertical-align: middle;
    box-shadow: 0 3px 10px rgba(102,126,234,0.45);
}

.pattern-btn .btn-text {
    color: #9b59b6;
}

.compare-btn .btn-text {
    color: #e67e22;
}

.sudoku-btn .btn-text {
    color: #16a085;
}

.sort-btn .btn-text {
    color: #2980b9;
}

.sum-btn .btn-text {
    color: #8e44ad;
}

.clock-btn .btn-text {
    color: #d35400;
}

.match-btn .btn-text {
    color: #1abc9c;
}

/* 找规律题目显示 */
.pattern-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    font-size: min(2.5em, 8vw);
    font-weight: bold;
    color: #333;
    padding: 10px;
}

.pattern-num-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2em;
    height: 2.2em;
    background: #e3f2fd;
    border: 2px solid #90caf9;
    border-radius: 8px;
    box-sizing: border-box;
    transition: transform 0.2s;
}

.pattern-num-box:hover {
    transform: scale(1.05);
}

.pattern-blank {
    background: #fff3e0;
    border-color: #ffb74d;
    color: #e65100;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* 比大小题目显示 */
.compare-display {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    padding: 10px 5px;
    overflow: hidden;
}

.compare-side {
    font-size: min(2em, 6vw);
    font-weight: bold;
    color: #333;
    min-width: 0;
    text-align: center;
    background: #e3f2fd;
    border: 3px solid #90caf9;
    padding: 10px 12px;
    border-radius: 12px;
    white-space: nowrap;
    box-sizing: border-box;
}

.compare-symbol {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
    min-width: 40px;
    text-align: center;
    line-height: 1;
}

.compare-symbol.correct {
    color: #27ae60;
}

.compare-symbol.wrong {
    color: #e74c3c;
}

.compare-buttons {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.compare-choice-btn {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    width: 110px;
    height: 100px;
    border: 3px solid #e0e0e0;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

.compare-choice-btn:active:not(:disabled) {
    -webkit-transform: scale(0.95);
    transform: scale(0.95);
}

.compare-choice-btn:disabled {
    opacity: 0.6;
}

.compare-btn-symbol {
    font-size: 3em;
    font-weight: bold;
    color: #333;
    line-height: 1;
}

.compare-btn-label {
    font-size: 1.5em;
    color: #666;
    margin-top: 4px;
    font-weight: bold;
}

.compare-choice-btn.correct {
    border-color: #27ae60;
    background: #e8f8f0;
}

.compare-choice-btn.correct .compare-btn-symbol {
    color: #27ae60;
}

.compare-choice-btn.wrong {
    border-color: #e74c3c;
    background: #fdeaea;
}

.compare-choice-btn.wrong .compare-btn-symbol {
    color: #e74c3c;
}

.compare-choice-btn.selected {
    border-color: #667eea;
    background: #f0f0ff;
}

/* 数独网格 */
.sudoku-grid {
    display: grid;
    gap: 0;
    margin: 15px auto;
    max-width: 400px;
    width: 100%;
    border: 3px solid #333;
    border-radius: 8px;
    overflow: hidden;
    background: #333;
    grid-gap: 1px;
}

.sudoku-4 {
    grid-template-columns: repeat(4, 1fr);
}

.sudoku-6 {
    grid-template-columns: repeat(6, 1fr);
}

.sudoku-9 {
    grid-template-columns: repeat(9, 1fr);
}

.sudoku-cell {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    background: white;
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    aspect-ratio: 1;
    position: relative;
}

.sudoku-cell.fixed {
    color: #333;
    background: #f8f9fa;
    cursor: default;
}

.sudoku-cell.user-input {
    color: #2980b9;
}

.sudoku-cell.selected {
    background: #bbdefb !important;
    z-index: 1;
    box-shadow: 0 0 0 2px #1976d2 inset;
}

.sudoku-cell.highlight {
    background: #e3f2fd;
}

.sudoku-cell.same-number {
    background: #c8e6c9;
}

.sudoku-cell.conflict {
    color: #e74c3c;
    background: #ffebee;
}

.sudoku-cell.border-left {
    border-left: 2px solid #333;
}

.sudoku-cell.border-top {
    border-top: 2px solid #333;
}

.sudoku-cell.border-right {
    border-right: 2px solid #333;
}

.sudoku-cell.border-bottom {
    border-bottom: 2px solid #333;
}

/* 数独数字选择器 */
.sudoku-number-picker {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-justify-content: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.sudoku-num-btn {
    width: 44px;
    height: 44px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-transition: all 0.15s ease;
    transition: all 0.15s ease;
}

.sudoku-num-btn:active {
    -webkit-transform: scale(0.9);
    transform: scale(0.9);
    background: #e3f2fd;
}

.sudoku-num-btn.completed {
    opacity: 0.35;
    pointer-events: none;
}

.sudoku-clear-btn {
    width: auto;
    padding: 0 16px;
    font-size: 1em;
    color: #e74c3c;
    border-color: #f5c6cb;
}

@media (max-width: 360px) {
    .compare-choice-btn {
        width: 90px;
        height: 85px;
    }

    .compare-btn-symbol {
        font-size: 2.5em;
    }

    .compare-btn-label {
        font-size: 1.2em;
    }

    .compare-side {
        font-size: min(1.6em, 5.5vw);
        padding: 8px 10px;
    }

    .compare-symbol {
        font-size: 2em;
    }

    .compare-display {
        gap: 6px;
    }

    .sudoku-cell {
        font-size: 1.1em;
    }

    .sudoku-num-btn {
        width: 38px;
        height: 38px;
        font-size: 1.1em;
    }

    .ability-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }

    .ability-cell {
        padding: 8px 4px;
    }

    .ability-icon {
        font-size: 1.2em;
    }

    .ability-val {
        font-size: 1.2em;
    }

    .ability-label {
        font-size: 0.7em;
    }
}

/* 页面头部 */
.page-header {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 30px;
}

.back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.1em;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    margin-right: 15px;
    -webkit-appearance: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
}

.page-header h2 {
    color: white;
    font-size: 1.8em;
}

/* 设置区域 */
.setup-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.setup-section h3 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5em;
}

.question-count {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    font-size: 1.1em;
}

.question-count select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    background: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.start-btn {
    width: 100%;
    padding: 18px;
    background: -webkit-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    -webkit-transition: -webkit-transform 0.2s, box-shadow 0.2s;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

/* 答题区域 */
.quiz-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.quiz-info {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    margin-bottom: 30px;
    font-size: 1em;
    color: #666;
}

.question-display {
    text-align: center;
    margin-bottom: 40px;
}

#math-question {
    font-size: min(3em, 10vw);
    font-weight: bold;
    color: #333;
    white-space: nowrap;
}

.answer-section {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: center;
    justify-content: center;
}

.answer-boxes {
    display: -webkit-flex;
    display: flex;
    gap: 10px;
    -webkit-justify-content: center;
    justify-content: center;
}

.answer-box {
    width: 55px;
    height: 65px;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    font-size: 2em;
    text-align: center;
    outline: none;
    -webkit-transition: border-color 0.2s;
    transition: border-color 0.2s;
    caret-color: #667eea;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.answer-box:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.answer-box.disabled {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.answer-box.correct {
    border-color: #27ae60;
    background-color: #eafaf1;
}

.answer-box.wrong {
    border-color: #e74c3c;
    background-color: #fdeaea;
}

.feedback {
    text-align: center;
    margin-top: 20px;
    font-size: min(1.4em, 5vw);
    font-weight: bold;
    min-height: 40px;
}

.feedback.correct {
    color: #27ae60;
}

.feedback.wrong {
    color: #e74c3c;
}

.next-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    background: #e67e22;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    -webkit-transition: background 0.2s;
    transition: background 0.2s;
    -webkit-appearance: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.next-btn:hover {
    background: #d35400;
}

/* 结果页面 */
.result-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

.result-section h3 {
    font-size: 2em;
    color: #333;
    margin-bottom: 30px;
}

.result-stats {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-around;
    justify-content: space-around;
    margin-bottom: 40px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 1em;
    color: #666;
    margin-top: 5px;
}

.assessment-info {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 15px 20px;
    margin-bottom: 25px;
    text-align: left;
}

.assessment-info h4 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 1em;
}

.assessment-info p {
    font-size: 0.85em;
    color: #666;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.assessment-info p:last-child {
    border-bottom: none;
}

.result-buttons {
    display: -webkit-flex;
    display: flex;
    gap: 15px;
}

.retry-btn, .home-btn {
    -webkit-flex: 1;
    flex: 1;
    padding: 18px;
    border: none;
    border-radius: 15px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    -webkit-transition: -webkit-transform 0.2s;
    transition: transform 0.2s;
    -webkit-appearance: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.retry-btn {
    background: #667eea;
    color: white;
}

.retry-btn:hover {
    background: #5a6fd6;
}

.home-btn {
    background: #e0e0e0;
    color: #333;
}

.home-btn:hover {
    background: #d0d0d0;
}

/* 数字记忆游戏样式 */
.memory-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.memory-display {
    text-align: center;
}

.numbers-display {
    font-weight: bold;
    color: #333;
    gap: 8px;
    margin-bottom: 30px;
    min-height: 80px;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
}

.memory-show-box {
    width: 50px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: bold;
    background: #e3f2fd;
    border: 3px solid #90caf9;
    border-radius: 12px;
    box-sizing: border-box;
    color: #333;
}

.timer-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 20px;
}

.timer-fill {
    height: 100%;
    background: -webkit-linear-gradient(90deg, #667eea, #764ba2);
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 100%;
    -webkit-transition: width 1s linear;
    transition: width 1s linear;
}

.timer-wrap {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.timer-wrap .timer-bar {
    margin-bottom: 0;
    -webkit-flex: 1;
    flex: 1;
}

.timer-text {
    font-size: 1.1em;
    font-weight: bold;
    color: #667eea;
    min-width: 40px;
    text-align: right;
}

/* 过关奖励画面 */
.reward-section {
    background: linear-gradient(135deg, #fff9e6 0%, #fff0f0 100%);
}

.reward-stars {
    font-size: 3em;
    margin-bottom: 10px;
    -webkit-animation: pulse 0.6s ease-in-out 3;
    animation: pulse 0.6s ease-in-out 3;
}

.reward-star {
    display: inline-block;
    color: #f1c40f;
    -webkit-text-stroke: 1px #e67e22;
}

.reward-star.half {
    background: linear-gradient(90deg, #f1c40f 50%, #ccc 50%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 0;
}

.reward-star.empty {
    color: #ccc;
    -webkit-text-stroke: 1px #bbb;
}

.reward-section h3 {
    color: #e67e22;
    font-size: 2em;
    margin-bottom: 20px;
}

.reward-info {
    background: white;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 15px;
    text-align: left;
}

.reward-info p {
    padding: 6px 0;
    font-size: 1.05em;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
}

.reward-info p:last-child {
    border-bottom: none;
}

.reward-info span {
    font-weight: bold;
    color: #667eea;
}

.reward-next-hint {
    background: #eaf4ff;
    border-radius: 10px;
    padding: 10px 15px;
    margin-bottom: 20px;
    font-size: 0.95em;
    color: #4a90d9;
}

.reward-next-hint span {
    font-weight: bold;
}

.reward-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22) !important;
    font-size: 1.2em !important;
    padding: 18px !important;
}

.reward-btn:hover {
    background: linear-gradient(135deg, #e67e22, #d35400) !important;
}

.memory-hint {
    color: #666;
    font-size: 1.1em;
}

.input-display {
    text-align: center;
}

.rules {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
}

.rules p {
    padding: 8px 0;
    font-size: 1.1em;
    color: #555;
}

.memory-answer-boxes {
    display: -webkit-flex;
    display: flex;
    gap: 8px;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: 20px 0;
}

.memory-box {
    width: 50px;
    height: 60px;
    border: 3px solid #667eea;
    border-radius: 12px;
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
    text-align: center;
    outline: none;
    -webkit-transition: border-color 0.2s;
    transition: border-color 0.2s;
    caret-color: #667eea;
    background: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.memory-box:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.memory-box.disabled {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.memory-box.correct {
    border-color: #27ae60;
    background-color: #eafaf1;
}

.memory-box.wrong {
    border-color: #e74c3c;
    background-color: #fdeaea;
}

.memory-fixed-digit {
    width: 50px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
    background: #f0f0f0;
    border-radius: 12px;
    border: 3px solid #d0d0d0;
}

.memory-answer-cross {
    font-size: 28px;
    color: #e74c3c;
    margin-bottom: 5px;
}

.memory-answer-feedback {
    display: -webkit-flex;
    display: flex;
    gap: 8px;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    margin-top: 10px;
}

.memory-answer-box {
    width: 50px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    border-radius: 12px;
    border: 3px solid #d0d0d0;
    color: #333;
    background: #f0f0f0;
}

.memory-answer-box.correct {
    border-color: #27ae60;
    background: #eafaf1;
    color: #27ae60;
}

.memory-answer-box.wrong {
    border-color: #e74c3c;
    background: #fdeaea;
    color: #e74c3c;
}

.memory-info {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    margin-bottom: 30px;
    font-size: 1em;
    color: #666;
}

.input-hint {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

/* 动画效果 */
@-webkit-keyframes shake {
    0%, 100% { -webkit-transform: translateX(0); transform: translateX(0); }
    25% { -webkit-transform: translateX(-10px); transform: translateX(-10px); }
    75% { -webkit-transform: translateX(10px); transform: translateX(10px); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@-webkit-keyframes pulse {
    0% { -webkit-transform: scale(1); transform: scale(1); }
    50% { -webkit-transform: scale(1.05); transform: scale(1.05); }
    100% { -webkit-transform: scale(1); transform: scale(1); }
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.shake {
    -webkit-animation: shake 0.5s ease-in-out;
    animation: shake 0.5s ease-in-out;
}

.pulse {
    -webkit-animation: pulse 0.5s ease-in-out;
    animation: pulse 0.5s ease-in-out;
}

/* 个人中心页面 */
.profile-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.profile-section h3 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
}

/* 个人中心用户名 */
.profile-user-section {
    padding: 16px 25px;
}

.profile-user-info {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    gap: 10px;
}

.profile-avatar {
    font-size: 1.8em;
    line-height: 1;
}

.profile-username {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
}

.radar-chart-container {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: center;
    justify-content: center;
    margin-bottom: 20px;
}

#radar-chart {
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
    -webkit-aspect-ratio: 1;
}

.ability-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.ability-cell {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    padding: 10px 5px;
    background: #f8f9fa;
    border-radius: 12px;
}

.ability-icon {
    font-size: 1.4em;
    margin-bottom: 4px;
}

.ability-val {
    font-size: 1.4em;
    font-weight: bold;
    color: #667eea;
    line-height: 1.2;
}

.ability-label {
    font-size: 0.75em;
    color: #888;
    margin-top: 2px;
}

.dimension-group {
    margin-bottom: 18px;
}

.dimension-group:last-child {
    margin-bottom: 0;
}

.dimension-group-title {
    font-size: 0.95em;
    font-weight: bold;
    color: #555;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-card {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 15px;
}

.stat-icon {
    font-size: 2em;
    margin-right: 15px;
}

.stat-number {
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
}

.stat-text {
    font-size: 0.85em;
    color: #666;
}

.current-level-display {
    text-align: center;
    padding: 20px;
    background: -webkit-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
}

.level-badge {
    font-size: 2em;
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
}

.level-desc {
    font-size: 1.1em;
    color: rgba(255,255,255,0.9);
}

.grade-edit {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.grade-edit label {
    font-size: 0.95em;
    color: #666;
    white-space: nowrap;
}

.grade-edit select {
    -webkit-flex: 1;
    flex: 1;
    max-width: 200px;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    background: white;
    color: #333;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

.history-tabs {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.history-tab {
    -webkit-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 70px;
    padding: 10px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    font-size: 0.9em;
    cursor: pointer;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
    -webkit-appearance: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    white-space: nowrap;
}

.history-tab:hover {
    border-color: #667eea;
}

.history-tab.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.history-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

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

.history-date {
    font-size: 0.85em;
    color: #999;
    margin-bottom: 8px;
}

.history-details {
    display: -webkit-flex;
    display: flex;
    gap: 15px;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
}

.history-details span {
    font-size: 0.9em;
    color: #555;
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 8px;
}

.history-empty {
    text-align: center;
    padding: 30px;
    color: #999;
}

.clear-data-btn {
    width: 100%;
    padding: 15px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    cursor: pointer;
    -webkit-transition: background 0.2s;
    transition: background 0.2s;
    -webkit-appearance: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.clear-data-btn:hover {
    background: #c0392b;
}

/* 响应式设计 */

/* 大屏幕平板 (768px+) */
@media (min-width: 768px) {
    .container {
        max-width: 700px;
    }

    .grade-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .result-stats {
        gap: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* 中等屏幕 (481px ~ 767px) - 默认样式已覆盖，无需额外调整 */

/* 小屏幕手机 (max-width: 480px) */
@media (max-width: 480px) {
    .page {
        padding: 15px;
    }

    .app-title {
        font-size: 3em;
        margin-top: 25px;
    }

    .app-subtitle {
        font-size: 1.4em;
        margin-bottom: 30px;
    }

    .menu-btn {
        padding: 20px 6px;
    }

    .btn-icon {
        font-size: 2.8em;
    }

    .btn-text {
        font-size: 1.2em;
    }

    .btn-desc {
        font-size: 0.85em;
    }

    .grade-section {
        padding: 15px;
    }

    .grade-grid {
        gap: 8px;
    }

    .grade-btn {
        padding: 10px 6px;
    }

    .grade-icon {
        font-size: 1.3em;
    }

    .grade-name {
        font-size: 0.8em;
    }

    .setup-section,
    .quiz-section,
    .memory-section,
    .result-section {
        padding: 20px;
        border-radius: 15px;
    }

    .setup-section h3 {
        font-size: 1.3em;
    }

    #math-question {
        font-size: 1.8em;
    }

    .pattern-display {
        font-size: 1.6em;
        gap: 6px;
    }

    .pattern-num-box {
        min-width: 1.8em;
        height: 1.8em;
    }

    .feedback {
        font-size: 2em;
    }

    .parent-question {
        font-size: 1.5em;
    }

    .numbers-display {
        gap: 6px;
    }

    .answer-box, .memory-box, .memory-show-box {
        width: 45px;
        height: 55px;
        font-size: 1.5em;
    }

    .memory-answer-box {
        width: 45px;
        height: 55px;
        font-size: 24px;
    }

    .memory-answer-cross {
        font-size: 24px;
    }

    .memory-fixed-digit {
        width: 45px;
        height: 55px;
        font-size: 1.5em;
    }

    .memory-answer-boxes {
        gap: 6px;
    }

    .result-section h3 {
        font-size: 1.6em;
    }

    .stat-value {
        font-size: 2em;
    }

    .stat-label {
        font-size: 0.9em;
    }

    .result-buttons {
        -webkit-flex-direction: column;
        flex-direction: column;
        gap: 10px;
    }

    .retry-btn, .home-btn {
        padding: 15px;
    }

    .profile-section {
        padding: 18px;
        border-radius: 15px;
    }

    .stat-number {
        font-size: 1.5em;
    }

    .stat-text {
        font-size: 0.8em;
    }

    .stat-icon {
        font-size: 1.6em;
        margin-right: 10px;
    }

    .ability-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }

    .ability-cell {
        padding: 6px 3px;
    }

    .ability-icon {
        font-size: 1.1em;
    }

    .ability-val {
        font-size: 1.1em;
    }

    .ability-label {
        font-size: 0.65em;
    }

    .history-details {
        gap: 8px;
    }

    .history-details span {
        font-size: 0.8em;
        padding: 3px 8px;
    }

    .page-header h2 {
        font-size: 1.4em;
    }

    .back-btn {
        font-size: 1em;
        padding: 8px 12px;
    }

    .history-tab {
        padding: 7px 5px;
        font-size: 0.8em;
        min-width: 55px;
    }

    .home-user-info {
        padding: 10px 12px;
    }

    .user-avatar {
        font-size: 1.6em;
    }

    .user-greeting {
        font-size: 1.1em;
    }

    .user-grade-label {
        font-size: 0.85em;
    }

    .sound-toggle-btn {
        width: 34px;
        height: 34px;
    }

    .profile-entry-btn {
        padding: 6px 12px;
        font-size: 0.8em;
    }

    .icon-btn {
        width: 32px;
        height: 32px;
        font-size: 1.1em;
    }

    .about-app-icon-img {
        width: 64px;
        height: 64px;
    }

    .about-app-name {
        font-size: 1.5em;
    }

    .about-feature-item {
        gap: 10px;
    }

    .about-feature-icon {
        font-size: 1.4em;
        width: 30px;
    }

    .donate-qr-img {
        width: 150px;
    }

    .donate-options {
        gap: 8px;
    }

    .donate-option-btn {
        padding: 10px 14px;
        font-size: 0.9em;
    }

    .username-input {
        max-width: 240px;
        padding: 10px 14px;
        font-size: 1em;
    }

    /* 新游戏响应式 */
    .sort-num-btn {
        min-width: 48px;
        height: 48px;
        font-size: 1.3em;
    }

    .sort-slot {
        min-width: 48px;
        height: 48px;
        font-size: 1.3em;
    }

    .sort-num-btn.wide,
    .sort-slot.wide {
        min-width: 60px;
        font-size: 1.05em;
    }

    .sum-cell {
        height: 52px;
        font-size: 1.3em;
    }

    .sum-grid {
        gap: 8px;
    }

    .clock-choice-btn {
        padding: 12px;
        font-size: 1.1em;
    }

    .match-item {
        padding: 10px 8px;
        font-size: 1em;
    }

    .match-columns {
        gap: 10px;
    }

    .bt-riddle-text {
        font-size: 1.2em;
    }

    .bt-riddle-box {
        padding: 20px 15px;
    }

    .bt-answer-text {
        font-size: 1.4em;
    }

    .bt-reveal-btn {
        padding: 12px;
        font-size: 1.1em;
    }

    .seek-range-value {
        font-size: 1.6em;
    }

    .seek-input {
        padding: 12px;
        font-size: 1.1em;
    }

    .seek-submit-btn {
        padding: 12px 20px;
        font-size: 1.1em;
    }

    .twentyfour-num-box {
        width: 50px;
        height: 50px;
        font-size: 1.6em;
    }

    .twentyfour-calc-screen {
        font-size: 1.4em;
        padding: 12px 14px;
    }

    .twentyfour-key {
        width: 48px;
        height: 42px;
        font-size: 1.1em;
    }

    .maze-arrow-btn,
    .maze-arrow-spacer {
        width: 44px;
        height: 44px;
        font-size: 1.15em;
    }

    .maze-arrow-center {
        width: 44px;
        height: 44px;
        font-size: 0.75em;
    }

    .maze-info-items {
        font-size: 0.8em;
    }

    .rmb-item {
        padding: 8px 6px;
        min-width: 70px;
    }

    .rmb-item-emoji {
        font-size: 1.8em;
    }

    .rmb-item-name {
        font-size: 0.75em;
    }

    .rmb-item-price {
        font-size: 0.9em;
    }
}

/* 超小屏幕 (max-width: 360px) */
@media (max-width: 360px) {
    .page {
        padding: 10px;
    }

    .app-title {
        font-size: 2.6em;
        margin-top: 15px;
    }

    .app-subtitle {
        font-size: 1.25em;
        margin-bottom: 20px;
    }

    .menu-buttons {
        gap: 10px;
    }

    .menu-btn {
        padding: 18px 4px;
        border-radius: 16px;
    }

    .btn-icon {
        font-size: 2.6em;
    }

    .btn-text {
        font-size: 1.1em;
    }

    .btn-desc {
        font-size: 0.8em;
    }

    .home-user-info {
        padding: 8px 10px;
        margin-bottom: 16px;
    }

    .user-avatar {
        font-size: 1.6em;
        margin-right: 8px;
    }

    .user-greeting {
        font-size: 1em;
    }

    .user-grade-label {
        font-size: 0.8em;
    }

    .sound-toggle-btn {
        width: 30px;
        height: 30px;
    }

    .profile-entry-btn {
        padding: 5px 10px;
        font-size: 0.72em;
        border-radius: 16px;
    }

    .grade-grid {
        gap: 6px;
    }

    .grade-btn {
        padding: 8px 4px;
    }

    .grade-icon {
        font-size: 1.2em;
    }

    .grade-name {
        font-size: 0.7em;
    }

    #math-question {
        font-size: 1.5em;
    }

    .pattern-display {
        font-size: 1.3em;
        gap: 5px;
    }

    .pattern-num-box {
        min-width: 1.6em;
        height: 1.6em;
        border-radius: 6px;
    }

    .feedback {
        font-size: 1.6em;
    }

    .parent-question {
        font-size: 1.3em;
    }

    .numbers-display {
        gap: 5px;
    }

    .answer-box, .memory-box, .memory-show-box {
        width: 40px;
        height: 50px;
        font-size: 1.3em;
    }

    .memory-answer-box {
        width: 40px;
        height: 50px;
        font-size: 21px;
    }

    .memory-answer-cross {
        font-size: 21px;
    }

    .memory-fixed-digit {
        width: 40px;
        height: 50px;
        font-size: 1.3em;
    }

    .setup-section,
    .quiz-section,
    .memory-section,
    .result-section,
    .profile-section {
        padding: 15px;
        border-radius: 12px;
    }

    .stat-value {
        font-size: 1.6em;
    }

    .level-badge {
        font-size: 1.6em;
    }

    .ability-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }

    .ability-cell {
        padding: 5px 2px;
        border-radius: 8px;
    }

    .ability-icon {
        font-size: 1em;
    }

    .ability-val {
        font-size: 1em;
    }

    .ability-label {
        font-size: 0.6em;
    }

    /* 新游戏响应式 */
    .sort-num-btn {
        min-width: 42px;
        height: 42px;
        font-size: 1.1em;
    }

    .sort-slot {
        min-width: 42px;
        height: 42px;
        font-size: 1.1em;
    }

    .sort-num-btn.wide,
    .sort-slot.wide {
        min-width: 52px;
        font-size: 0.95em;
    }

    .sum-cell {
        height: 46px;
        font-size: 1.1em;
    }

    .sum-grid {
        gap: 6px;
        grid-template-columns: repeat(3, 1fr);
    }

    .clock-choice-btn {
        padding: 10px;
        font-size: 1em;
    }

    .clock-choices {
        gap: 8px;
    }

    .match-item {
        padding: 8px 6px;
        font-size: 0.9em;
    }

    .match-columns {
        gap: 8px;
    }

    .sort-hint {
        font-size: 1em;
    }

    .sum-target {
        font-size: 1.1em;
    }

    .clock-question-text {
        font-size: 1em;
    }

    .bt-riddle-text {
        font-size: 1.1em;
    }

    .bt-riddle-box {
        padding: 15px 12px;
    }

    .bt-riddle-icon {
        font-size: 2em;
    }

    .bt-answer-text {
        font-size: 1.2em;
    }

    .bt-reveal-btn {
        padding: 10px;
        font-size: 1em;
    }

    .seek-range-value {
        font-size: 1.4em;
    }

    .seek-input {
        padding: 10px;
        font-size: 1em;
    }

    .seek-submit-btn {
        padding: 10px 15px;
        font-size: 1em;
    }

    .seek-feedback {
        font-size: 1em;
        padding: 10px;
    }
}

/* ============ 数字排序游戏 ============ */
.sort-hint {
    text-align: center;
    font-size: 1.2em;
    color: #667eea;
    margin-bottom: 15px;
    font-weight: bold;
}

.sort-numbers {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-justify-content: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.sort-num-btn {
    min-width: 55px;
    height: 55px;
    border: 3px solid #667eea;
    border-radius: 12px;
    background: white;
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
    padding: 0 10px;
}

.sort-num-btn:active {
    -webkit-transform: scale(0.95);
    transform: scale(0.95);
}

.sort-num-btn.selected {
    background: #e0e0e0;
    border-color: #ccc;
    opacity: 0.4;
}

.sort-num-btn.wide,
.sort-slot.wide {
    min-width: 70px;
    font-size: 1.2em;
    padding: 0 6px;
    white-space: nowrap;
}

.sort-slots {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-justify-content: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.sort-slot {
    min-width: 55px;
    height: 55px;
    border: 3px dashed #ccc;
    border-radius: 12px;
    background: #f8f9fa;
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    cursor: pointer;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
    padding: 0 10px;
}

.sort-slot.filled {
    border-style: solid;
    border-color: #667eea;
    background: #f0f0ff;
}

.sort-slot.correct {
    border-color: #27ae60;
    background: #eafaf1;
}

.sort-slot.wrong {
    border-color: #e74c3c;
    background: #fdeaea;
}

/* ============ 凑十法游戏 ============ */
.sum-target {
    text-align: center;
    font-size: 1.3em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px;
}

.sum-target span {
    font-size: 1.5em;
    color: #e74c3c;
}

.sum-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 350px;
    margin: 0 auto 20px;
}

.sum-cell {
    height: 60px;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
}

.sum-cell.selected {
    border-color: #667eea;
    background: #f0f0ff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.sum-cell.matched {
    border-color: #27ae60;
    background: #eafaf1;
    opacity: 0.5;
    pointer-events: none;
}

.sum-cell.wrong-flash {
    border-color: #e74c3c;
    background: #fdeaea;
}

/* ============ 时钟认知游戏 ============ */
.clock-display {
    text-align: center;
    margin: 15px 0;
}

#clock-canvas {
    max-width: 100%;
    height: auto;
}

.clock-question-text {
    text-align: center;
    font-size: 1.2em;
    color: #555;
    margin-bottom: 15px;
}

.clock-choices {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 350px;
    margin: 0 auto;
}

.clock-choice-btn {
    padding: 15px;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
}

.clock-choice-btn:active {
    -webkit-transform: scale(0.95);
    transform: scale(0.95);
}

.clock-choice-btn.correct {
    border-color: #27ae60;
    background: #eafaf1;
}

.clock-choice-btn.wrong {
    border-color: #e74c3c;
    background: #fdeaea;
}

/* ============ 数学连线游戏 ============ */
.match-columns {
    display: -webkit-flex;
    display: flex;
    gap: 15px;
    margin: 10px 0 20px;
}

.match-left-col,
.match-right-col {
    -webkit-flex: 1;
    flex: 1;
}

.match-col-title {
    text-align: center;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1em;
}

.match-items {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    gap: 10px;
}

.match-item {
    padding: 12px 10px;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    text-align: center;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
}

.match-item:active {
    -webkit-transform: scale(0.97);
    transform: scale(0.97);
}

.match-item.selected {
    border-color: #667eea;
    background: #f0f0ff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.match-item.matched {
    border-color: #27ae60;
    background: #eafaf1;
    opacity: 0.6;
    pointer-events: none;
}

.match-item.wrong-flash {
    border-color: #e74c3c;
    background: #fdeaea;
}

/* ============ 脑筋急转弯游戏 ============ */
.brainteaser-btn .btn-text {
    color: #e67e22;
}

.bt-riddle-box {
    background: #fff9e6;
    border: 3px solid #f39c12;
    border-radius: 16px;
    padding: 25px 20px;
    margin: 15px 0;
    text-align: center;
}

.bt-riddle-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.bt-riddle-text {
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
    line-height: 1.6;
}

.bt-answer-box {
    background: #eafaf1;
    border: 3px solid #27ae60;
    border-radius: 16px;
    padding: 20px;
    margin: 15px 0;
    text-align: center;
}

@-webkit-keyframes btReveal {
    from { opacity: 0; -webkit-transform: scale(0.8); transform: scale(0.8); }
    to { opacity: 1; -webkit-transform: scale(1); transform: scale(1); }
}

@keyframes btReveal {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.bt-reveal-animate {
    -webkit-animation: btReveal 0.5s ease;
    animation: btReveal 0.5s ease;
}

.bt-answer-label {
    font-size: 0.9em;
    color: #27ae60;
    font-weight: bold;
    margin-bottom: 5px;
}

.bt-answer-text {
    font-size: 1.6em;
    font-weight: bold;
    color: #27ae60;
}

.bt-reveal-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    border: none;
    border-radius: 15px;
    background: #f39c12;
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
}

.bt-reveal-btn:active {
    -webkit-transform: scale(0.95);
    transform: scale(0.95);
    background: #e67e22;
}

/* ============ 数字捉迷藏游戏 ============ */
.seek-btn .btn-text {
    color: #27ae60;
}

.seek-range-display {
    text-align: center;
    background: #eafaf1;
    border: 3px solid #27ae60;
    border-radius: 16px;
    padding: 20px;
    margin: 15px 0;
}

.seek-range-label {
    font-size: 0.9em;
    color: #27ae60;
    font-weight: bold;
    margin-bottom: 5px;
}

.seek-range-value {
    font-size: 2em;
    font-weight: bold;
    color: #27ae60;
}

.seek-guess-info {
    text-align: center;
    font-size: 1em;
    color: #888;
    margin-bottom: 15px;
}

.seek-input-section {
    display: -webkit-flex;
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.seek-input {
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
    max-width: 60%;
    padding: 15px;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1.3em;
    font-weight: bold;
    text-align: center;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    background: #fff;
}

.seek-input:focus {
    border-color: #27ae60;
}

.seek-submit-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    background: #27ae60;
    color: white;
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
}

.seek-submit-btn:active {
    -webkit-transform: scale(0.95);
    transform: scale(0.95);
    background: #219a52;
}

.seek-feedback {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    padding: 15px;
    border-radius: 12px;
    color: #888;
    background: #f8f9fa;
}

.seek-feedback.seek-small {
    color: #e67e22;
    background: #fff3e0;
}

.seek-feedback.seek-big {
    color: #3498db;
    background: #e3f2fd;
}

.seek-feedback.seek-correct {
    color: #27ae60;
    background: #eafaf1;
}

.seek-feedback.seek-timeout {
    color: #e74c3c;
    background: #fdeaea;
}

.seek-feedback.seek-warn {
    color: #e67e22;
    background: #fff3e0;
}

/* ============ 数字键盘 ============ */
.numpad-wrap {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: center;
    justify-content: center;
    pointer-events: none;
}

.numpad {
    width: 100%;
    max-width: 500px;
    background: #e8ecf1;
    padding: 6px 6px 10px;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    gap: 5px;
    -webkit-transform: translateY(100%);
    transform: translateY(100%);
    -webkit-transition: -webkit-transform 0.25s ease;
    transition: transform 0.25s ease;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: auto;
}

.numpad.show {
    -webkit-transform: translateY(0);
    transform: translateY(0);
}

/* 键盘打开时给页面内容留出空间 */
body.numpad-open .page.active {
    padding-bottom: 260px;
}

.numpad-row {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: center;
    justify-content: center;
    gap: 5px;
}

.numpad-key {
    -webkit-flex: 1;
    flex: 1;
    height: 52px;
    border: none;
    border-radius: 10px;
    background: white;
    color: #333;
    font-size: 1.6em;
    font-weight: 600;
    cursor: pointer;
    -webkit-transition: background 0.1s;
    transition: background 0.1s;
    -webkit-appearance: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.numpad-key:active {
    background: #d0d5dd;
    -webkit-transform: scale(0.95);
    transform: scale(0.95);
}

.numpad-wide {
    -webkit-flex: 2.15;
    flex: 2.15;
}

.numpad-del {
    background: #f0f0f0;
    font-size: 1.3em;
    color: #e74c3c;
}

.numpad-del:active {
    background: #e0e0e0;
}

/* 输入框聚焦时不弹出系统键盘 */
.answer-box,
.memory-box {
    caret-color: transparent;
}

/* ========== 24点游戏 ========== */
.twentyfour-display {
    text-align: center;
    margin: 15px 0;
}

.twentyfour-numbers {
    display: -webkit-flex;
    display: flex;
    gap: 12px;
    -webkit-justify-content: center;
    justify-content: center;
    margin-bottom: 10px;
}

.twentyfour-num-box {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
    color: #333;
    background: #e8f4fd;
    border: 3px solid #667eea;
    border-radius: 12px;
}

.twentyfour-target {
    font-size: 1.3em;
    font-weight: bold;
    color: #e67e22;
    margin-bottom: 10px;
}

.twentyfour-count {
    font-size: 0.75em;
    font-weight: normal;
    color: #999;
}

.twentyfour-calc-screen {
    width: 100%;
    max-width: 360px;
    margin: 0 auto 12px;
    padding: 14px 16px;
    font-size: 1.6em;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    text-align: right;
    color: #333;
    background: #e8f4fd;
    border: 2px solid #667eea;
    border-radius: 12px;
    min-height: 1.8em;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.twentyfour-calc-screen.correct {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.twentyfour-calc-screen.wrong {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

.twentyfour-all-solutions {
    margin: 10px auto;
    max-width: 360px;
    max-height: 200px;
    overflow-y: auto;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 14px;
    text-align: left;
}

.solutions-title {
    font-size: 0.85em;
    font-weight: bold;
    color: #666;
    margin-bottom: 8px;
}

.solutions-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.solution-item {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: #333;
    padding: 4px 8px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
}

.twentyfour-keyboard {
    margin-top: 10px;
}

.twentyfour-key-row {
    display: -webkit-flex;
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    -webkit-justify-content: center;
    justify-content: center;
}

.twentyfour-key {
    width: 55px;
    height: 48px;
    font-size: 1.2em;
    font-weight: bold;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    color: #333;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-transition: background 0.1s;
    transition: background 0.1s;
}

.twentyfour-key:active {
    background: #e0e0e0;
}

.twentyfour-key-op {
    background: #fff3e0;
    border-color: #ff9800;
    color: #e65100;
}

.twentyfour-key-submit {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.twentyfour-key-disabled {
    background: #f0f0f0;
    border-color: #ddd;
    color: #ccc;
    cursor: not-allowed;
    -webkit-tap-highlight-color: transparent;
    pointer-events: none;
}

.twentyfour-answer-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 16px;
    font-size: 0.9em;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    text-decoration: underline;
}

.twentyfour-answer-btn:active {
    color: #666;
}

/* ========== 迷宫游戏 ========== */
.maze-size-option {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}
.maze-size-option label {
    font-size: 1.05em;
    color: #555;
    font-weight: 500;
}
.maze-size-option select {
    padding: 10px 18px;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-size: 1.05em;
    background: white;
    color: #333;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
.maze-size-option select:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

#maze-quiz {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    min-height: calc(100vh - 60px);
    padding: 15px;
}
#maze-quiz .quiz-info {
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 8px;
}
.maze-info-items {
    display: -webkit-flex;
    display: flex;
    font-size: 14px;
    color: #999;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
    -webkit-font-smoothing: antialiased;
}
.maze-play-area {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    gap: 14px;
    -webkit-flex: 1;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    width: 100%;
}
.maze-grid {
    display: grid;
    gap: 0;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 0;
    background: #fafafa;
    border: none;
    box-sizing: border-box;
    padding: 0;
}
.maze-cell {
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    font-size: 0.8em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-transition: background 0.15s;
    transition: background 0.15s;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}
.maze-cell.start {
    background: #c8e6c9;
}
.maze-cell.end {
    background: #ffe0b2;
}
.maze-cell.end::after {
    content: '🏁';
    font-size: 1.1em;
}
.maze-cell.player {
    background: #90caf9;
    -webkit-transition: background 0.1s;
    transition: background 0.1s;
}
.maze-cell.player::after {
    content: '🔵';
    font-size: 0.9em;
}
.maze-cell.path-hint {
    background: #fff9c4;
}
.maze-controls {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    gap: 10px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}
.maze-arrows {
    display: inline-block;
    background: linear-gradient(145deg, #e8ecf1, #f5f7fa);
    border-radius: 20px;
    padding: 10px 12px;
    -webkit-box-shadow: inset 0 2px 6px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
}
.maze-arrow-row {
    display: -webkit-flex;
    display: flex;
    gap: 6px;
    -webkit-justify-content: center;
    justify-content: center;
    margin-bottom: 6px;
}
.maze-arrow-row:last-child {
    margin-bottom: 0;
}
.maze-arrow-spacer {
    width: 48px;
    height: 48px;
}
.maze-arrow-btn {
    width: 48px;
    height: 48px;
    font-size: 1.3em;
    font-weight: bold;
    border: none;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff, #d4d8de);
    color: #444;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-transition: all 0.08s;
    transition: all 0.08s;
    -webkit-box-shadow:
        3px 3px 8px rgba(0,0,0,0.15),
        -2px -2px 6px rgba(255,255,255,0.8),
        inset 0 1px 0 rgba(255,255,255,0.6);
    box-shadow:
        3px 3px 8px rgba(0,0,0,0.15),
        -2px -2px 6px rgba(255,255,255,0.8),
        inset 0 1px 0 rgba(255,255,255,0.6);
    -webkit-user-select: none;
    user-select: none;
}
.maze-arrow-btn:hover {
    background: linear-gradient(145deg, #ffffff, #e0e3e8);
}
.maze-arrow-btn:active {
    background: linear-gradient(145deg, #667eea, #764ba2);
    color: #fff;
    -webkit-box-shadow: inset 0 2px 6px rgba(0,0,0,0.25);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.25);
    -webkit-transform: scale(0.93);
    transform: scale(0.93);
}
.maze-arrow-center {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f0f2f5;
    border: none;
    -webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
    color: #888;
    font-size: 0.8em;
    font-weight: 600;
    cursor: default;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    line-height: 1;
}
.maze-answer-btn {
    font-size: 0.85em;
    padding: 6px 16px;
}
#maze-feedback {
    margin-top: 6px;
    text-align: center;
    font-size: 0.95em;
}

/* 横屏：迷宫左侧，控制区右侧 */
@media (orientation: landscape) {
    .maze-play-area {
        -webkit-flex-direction: row;
        flex-direction: row;
        -webkit-justify-content: center;
        justify-content: center;
        -webkit-align-items: center;
        align-items: center;
        gap: 12px;
    }
    .maze-grid {
        margin: 0;
        -webkit-flex-shrink: 0;
        flex-shrink: 0;
    }
    .maze-controls {
        -webkit-flex-shrink: 0;
        flex-shrink: 0;
    }
}

/* ========== 认识人民币游戏 ========== */
.rmb-scene {
    text-align: center;
    margin: 10px 0;
}

.rmb-items {
    display: -webkit-flex;
    display: flex;
    gap: 10px;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.rmb-item {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px 14px;
    min-width: 80px;
    text-align: center;
}

.rmb-item-emoji {
    font-size: 2em;
    margin-bottom: 4px;
}

.rmb-item-name {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 2px;
}

.rmb-item-price {
    font-size: 1.1em;
    font-weight: bold;
    color: #e67e22;
}

.rmb-total {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    padding: 6px 12px;
    background: #fff9c4;
    border-radius: 8px;
    display: inline-block;
}

.rmb-question {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
}

.rmb-answer-area {
    display: -webkit-flex;
    display: flex;
    gap: 8px;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 10px;
}

.rmb-input {
    width: 100px;
    padding: 10px;
    font-size: 1.3em;
    text-align: center;
    border: 2px solid #667eea;
    border-radius: 10px;
    background: #fff;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.rmb-unit {
    font-size: 1.2em;
    font-weight: bold;
    color: #555;
}

.rmb-submit-btn {
    padding: 10px 20px;
    font-size: 1.1em;
    font-weight: bold;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.rmb-submit-btn:active {
    background: #5a6fd6;
}

/* 小屏手机键盘适配 */
@media (max-width: 360px) {
    .numpad-key {
        height: 46px;
        font-size: 1.4em;
        border-radius: 8px;
    }
    .numpad {
        padding: 4px 4px 8px;
        gap: 4px;
    }
    .numpad-row {
        gap: 4px;
    }
    .donate-options {
        -webkit-flex-wrap: wrap;
        flex-wrap: wrap;
    }
    .donate-option-btn {
        padding: 8px 12px;
        font-size: 0.85em;
    }

    .twentyfour-num-box {
        width: 44px;
        height: 44px;
        font-size: 1.4em;
    }

    .twentyfour-calc-screen {
        font-size: 1.2em;
        padding: 10px 12px;
    }

    .twentyfour-key {
        width: 42px;
        height: 38px;
        font-size: 1em;
    }

    .twentyfour-key-row {
        gap: 4px;
    }

    .maze-arrow-btn,
    .maze-arrow-spacer {
        width: 40px;
        height: 40px;
        font-size: 1.05em;
    }

    .maze-arrow-center {
        width: 40px;
        height: 40px;
        font-size: 0.7em;
    }

    .maze-arrows {
        padding: 8px 10px;
        border-radius: 16px;
    }

    .maze-info-items {
        font-size: 0.75em;
        gap: 1px 6px;
    }

    .rmb-item {
        padding: 6px 4px;
        min-width: 60px;
    }

    .rmb-item-emoji {
        font-size: 1.5em;
    }

    .rmb-item-name {
        font-size: 0.7em;
    }

    .rmb-item-price {
        font-size: 0.85em;
    }
}
