/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
        Arial, sans-serif;
    background-color: #f7f7f7;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

#app {
    max-width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* 访问密码模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px 25px;
    text-align: center;
    max-width: 90%;
    width: 350px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 25px;
}

#password-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 50px;
    font-size: 16px;
    margin-bottom: 20px;
    outline: none;
}

#password-input:focus {
    border-color: #1296db;
}

#submit-password {
    background: #1296db;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
}

#submit-password:hover {
    background: #007acc;
}

/* 微信登录浮层样式 - 始终显示在最上层 */
.wechat-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* 游戏完成登录提示模态框样式 */
.login-prompt-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.login-prompt-content {
    background: white;
    border-radius: 20px;
    padding: 30px 25px;
    text-align: center;
    max-width: 90%;
    width: 350px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: loginSlideIn 0.5s ease-out;
}

.login-prompt-content h3 {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.login-prompt-content p {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.5;
}

.login-prompt-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

#login-confirm-btn, #login-cancel-btn {
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

#login-confirm-btn {
    background: linear-gradient(135deg, #07c160, #00a854);
    color: white;
    box-shadow: 0 5px 15px rgba(7, 193, 96, 0.3);
}

#login-confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(7, 193, 96, 0.4);
}

#login-cancel-btn {
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    color: #333;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#login-cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 响应式调整 */
@media (max-width: 360px) {
    .login-prompt-content {
        padding: 25px 20px;
        width: 95%;
    }
    
    .login-prompt-content h3 {
        font-size: 20px;
    }
    
    .login-prompt-content p {
        font-size: 14px;
    }
    
    #login-confirm-btn, #login-cancel-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

.wechat-login-container {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: loginSlideIn 0.5s ease-out;
}

.wechat-login-header {
    margin-bottom: 30px;
}

.wechat-login-header i {
    font-size: 60px;
    color: #07c160;
    margin-bottom: 20px;
    display: block;
}

.wechat-login-header h2 {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.wechat-login-header p {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

.wechat-login-btn {
    background: linear-gradient(135deg, #07c160, #00a854);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(7, 193, 96, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
}

.wechat-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(7, 193, 96, 0.4);
}

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

.wechat-login-btn i {
    font-size: 20px;
}

.wechat-login-status {
    margin-top: 20px;
    min-height: 20px;
    font-size: 14px;
}

.wechat-login-status.success {
    color: #07c160;
}

.wechat-login-status.error {
    color: #ff4d4f;
}

.wechat-login-status.loading {
    color: #1890ff;
}

@keyframes loginSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 退出登录按钮样式 */
.logout-btn {
    background: #ff4d4f;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.logout-btn:hover {
    background: #ff7875;
    transform: translateY(-1px);
}

.logout-btn i {
    font-size: 12px;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 15px;
    display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.page.active {
    display: block;
}

/* 登录页面样式 */
#login-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px 15px;
}

.logo-container {
    margin-bottom: 20px;
    text-align: center;
}

.logo-container i {
    font-size: 50px;
    color: #1296db;
    margin-bottom: 10px;
}

.logo-container h1 {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.description {
    font-size: 14px;
    color: #666;
    margin-bottom: 25px;
    max-width: 90%;
    text-align: center;
    line-height: 1.6;
    padding: 0 10px;
    z-index: 10;
    position: relative;
}

/* 针对小屏幕的调整 */
@media (max-width: 360px) {
    .description {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .wechat-login-container {
        padding: 30px 20px;
        width: 95%;
    }
    
    .wechat-login-header h2 {
        font-size: 20px;
    }
    
    .wechat-login-header p {
        font-size: 14px;
    }
    
    .wechat-login-btn {
        padding: 12px 30px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .wechat-login-container {
        padding: 35px 25px;
        width: 90%;
    }
    
    .wechat-login-header i {
        font-size: 50px;
    }
    
    .wechat-login-header h2 {
        font-size: 22px;
    }
    
    .wechat-login-btn {
        padding: 14px 35px;
        font-size: 17px;
    }
}

@media (max-width: 768px) {
    .wechat-login-container {
        padding: 35px 25px;
        width: 85%;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .wechat-login-container {
        padding: 25px 20px;
    }
    
    .wechat-login-header {
        margin-bottom: 20px;
    }
    
    .wechat-login-header i {
        font-size: 40px;
        margin-bottom: 15px;
    }
    
    .wechat-login-header h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .wechat-login-header p {
        font-size: 14px;
    }
    
    .wechat-login-btn {
        padding: 12px 30px;
        font-size: 16px;
    }
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #1296db;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:active {
    background-color: #0e7cb0;
}

#login-btn {
    background-color: #07c160;
    padding: 12px 35px;
    position: relative;
    z-index: 3001;
    /* 确保按钮在其他元素之上 */
}

#login-btn i {
    margin-right: 8px;
}

/* 主页样式 */
header {
    text-align: center;
    padding: 15px 0;
    margin-bottom: 15px;
}

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

#user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #1296db;
}

#user-nickname {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

header h1 {
    font-size: 20px;
    color: #333;
    margin: 0;
}

main {
    padding: 0 10px;
}

.game-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.game-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #1296db, #0e7cb0);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.game-icon i {
    font-size: 24px;
    color: white;
}

.game-card h2 {
    font-size: 16px;
    color: #333;
    margin: 0 0 5px 0;
    font-weight: 600;
}

.game-card p {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

footer {
    text-align: center;
    padding: 15px 0;
    margin-top: 20px;
    font-size: 12px;
    color: #999;
}

/* 游戏容器样式 */
.game-container {
    padding: 15px;
    max-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.game-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
    padding: 8px 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    align-items: center !important;
}

.game-title-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.game-title {
    font-size: 18px;
    color: #333;
    margin: 0;
    font-weight: 600;
}

.game-desc {
    font-size: 12px;
    color: #666;
    font-weight: 400;
}

.game-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    width: 100%;
    flex-wrap: wrap;
}

.level-info {
    order: 1;
}

.score {
    order: 2;
}

.correct-count {
    order: 3;
    font-size: 12px;
    color: #07c160;
}

.wrong-count {
    order: 4;
    font-size: 12px;
    color: #ff4d4f;
}

.timer {
    order: 5;
}

.level-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.level-label {
    font-size: 12px;
    color: #666;
}

.level-number {
    font-size: 14px;
    font-weight: bold;
    color: #1296db;
}

.level-progress {
    font-size: 12px;
    color: #666;
}

.timer {
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    color: #333;
    font-weight: 500;
    border: 1px solid #e9ecef;
}

.score {
    background: linear-gradient(135deg, #ffd700, #ffb347);
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 游戏板样式 */
.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    min-height: 200px;
}

/* 名字部分样式 */
.names-section {
    margin-bottom: 20px;
}

.names-container h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

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

.name-item {
    background: white;
    padding: 10px 8px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
    white-space: normal;
    line-height: 1.4;
}

.name-item:hover {
    border-color: #1296db;
    background: #f8f9ff;
}

.name-item.matched {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
}

.name-item.hint {
    border-color: #ffc107;
    background: #fff3cd;
    animation: hint-pulse 1s infinite;
}

/* 卡片样式 */
.card-item {
    aspect-ratio: 1;
    cursor: pointer;
    transition: transform 0.3s;
    border-radius: 8px;
    overflow: hidden;
}

.card-item:hover {
    transform: scale(1.05);
}

.card-item.flipped {
    transform: rotateY(180deg);
}

.card-item.hint {
    animation: hint-pulse 1s infinite;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-item.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-front {
    background: linear-gradient(135deg, #1296db, #0e7cb0);
    color: white;
    font-size: 24px;
}

.card-back {
    background: white;
    transform: rotateY(180deg);
    border: 2px solid #e9ecef;
}

.card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

/* 游戏按钮样式 */
.game-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.game-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    min-width: 80px;
}

.restart-btn {
    background: #6c757d;
    color: white;
}

.restart-btn:hover {
    background: #5a6268;
}

.hint-btn {
    background: #ffc107;
    color: #212529;
}

.hint-btn:hover {
    background: #e0a800;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    /* 增强居中效果 */
    -webkit-box-align: center;
    -webkit-box-pack: center;
    -moz-box-align: center;
    -moz-box-pack: center;
    box-align: center;
    box-pack: center;
}

.modal.show {
    display: flex;
    animation: modal-fade-in 0.3s ease-out;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin: 20px;
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modal-slide-in 0.3s ease-out;
}

@keyframes modal-slide-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

.level-stats, .final-stats {
    margin-bottom: 20px;
}

.level-stats p, .final-stats p {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-buttons .btn {
    padding: 10px 20px;
    font-size: 14px;
    min-width: 80px;
}

/* 动画效果 */
@keyframes correct-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

/* 返回按钮样式 */
.back-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 100;
}

.back-btn .btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-btn .btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* 分享按钮样式 */
.share-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
    background: #07c160;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(7, 193, 96, 0.4);
    transition: all 0.3s;
    z-index: 100;
}

.share-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(7, 193, 96, 0.6);
}

/* 响应式设计 - 移动端优先 */
@media (max-width: 768px) {
    .page {
        padding: 12px;
    }
    
    .game-info {
        flex-direction: row;
        gap: 10px;
        text-align: center;
        justify-content: space-between;
        padding: 6px 0;
    }
    
    .game-title h1 {
        font-size: 16px;
    }
    
    .game-desc {
        font-size: 11px;
    }
    
    .game-stats {
        gap: 6px;
    }
    
    .names-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .game-board {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        min-height: 180px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 15px;
        max-width: 95%;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .game-card {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .game-icon {
        width: 45px;
        height: 45px;
    }
    
    .game-icon i {
        font-size: 20px;
    }
    
    .game-card h2 {
        font-size: 15px;
    }
    
    .game-card p {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .page {
        padding: 10px;
    }
    
    .game-board {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
        padding: 10px;
        min-height: 160px;
    }
    
    .names-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }
    
    .game-btn {
        padding: 8px 16px;
        font-size: 13px;
        min-width: 70px;
    }
    
    .share-btn {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    .back-btn {
        top: 10px;
        left: 10px;
    }
    
    .back-btn .btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .logo-container i {
        font-size: 45px;
    }
    
    .logo-container h1 {
        font-size: 22px;
    }
    
    .description {
        font-size: 13px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 15px;
    }
    
    #login-btn {
        padding: 10px 30px;
    }
    
    header h1 {
        font-size: 18px;
    }
    
    .user-info {
        margin-bottom: 8px;
    }
    
    #user-avatar {
        width: 35px;
        height: 35px;
    }
    
    #user-nickname {
        font-size: 13px;
    }
    
    .game-card {
        padding: 10px;
        margin-bottom: 8px;
        gap: 12px;
    }
    
    .game-icon {
        width: 40px;
        height: 40px;
    }
    
    .game-icon i {
        font-size: 18px;
    }
    
    .game-card h2 {
        font-size: 14px;
        margin-bottom: 3px;
    }
    
    .game-card p {
        font-size: 11px;
    }
    
    .timer, .score {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .level-label, .level-progress {
        font-size: 11px;
    }
    
    .level-number {
        font-size: 13px;
    }
    
    .game-title {
        font-size: 15px;
    }
    
    .game-desc {
        font-size: 10px;
    }
    
    .name-item {
        padding: 8px 6px;
        font-size: 12px;
        min-height: 35px;
    }
    
    .card-front {
        font-size: 20px;
    }
    
    .modal-content h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .level-stats p, .final-stats p {
        font-size: 13px;
        margin: 6px 0;
    }
    
    .modal-buttons .btn {
        padding: 8px 16px;
        font-size: 13px;
        min-width: 70px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .page {
        padding: 8px;
    }
    
    .game-board {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        min-height: 140px;
    }
    
    .names-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }
    
    .game-card {
        padding: 8px;
        margin-bottom: 6px;
        gap: 10px;
    }
    
    .game-icon {
        width: 35px;
        height: 35px;
    }
    
    .game-icon i {
        font-size: 16px;
    }
    
    .game-card h2 {
        font-size: 13px;
    }
    
    .game-card p {
        font-size: 10px;
    }
    
    .name-item {
        padding: 6px 4px;
        font-size: 11px;
        min-height: 30px;
    }
    
    .card-front {
        font-size: 18px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 6px;
        padding: 4px 0;
    }

    .game-title {
        font-size: 14px;
    }
    
    .game-desc {
        font-size: 9px;
    }
    
    .game-stats {
        gap: 4px;
    }
    
    .timer, .score {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .level-label, .level-progress {
        font-size: 10px;
    }
    
    .level-number {
        font-size: 12px;
    }
    
    .game-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 60px;
    }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 500px) {
    .page {
        padding: 8px;
    }
    
    header {
        padding: 8px 0;
        margin-bottom: 8px;
    }
    
    .game-card {
        padding: 8px;
        margin-bottom: 6px;
    }
    
    .game-info {
        flex-direction: column;
        margin-bottom: 10px;
        gap: 8px;
        padding: 6px 0;
    }

    .game-title {
        font-size: 16px;
    }
    
    .game-desc {
        font-size: 11px;
    }
    
    .game-board {
        min-height: 120px;
        margin-bottom: 15px;
    }
    
    .names-grid {
        margin-bottom: 15px;
    }
    
    .game-buttons {
        margin-top: 10px;
    }
    
    .modal-content {
        padding: 15px;
        margin: 10px;
    }
    
    .modal-content h2 {
        margin-bottom: 10px;
    }
    
    .level-stats, .final-stats {
        margin-bottom: 10px;
    }
}

/* 图片容器样式 */
.image-container {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-container img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 选项容器样式 */
.options-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.option {
    background: white;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.option:hover {
    border-color: #1296db;
    background: #f8f9ff;
}

.option.correct {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
}

.option.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
}

/* 排行榜样式 */
.ranking-tabs {
    display: flex;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 14px;
    color: #666;
}

.tab.active {
    background: #1296db;
    color: white;
}

.ranking-list {
    margin-bottom: 20px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rank {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-right: 12px;
    background: #f8f9fa;
    color: #666;
}

.rank.top3 {
    background: linear-gradient(135deg, #ffd700, #ffb347);
    color: white;
}

.ranking-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid #e9ecef;
}

.ranking-info {
    flex: 1;
}

.ranking-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    font-size: 14px;
}

.ranking-score {
    color: #1296db;
    font-weight: bold;
    font-size: 13px;
}

.ranking-time {
    color: #666;
    font-size: 12px;
}

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.loading-overlay.show {
    display: flex;
}

.loading-content {
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1296db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #666;
    font-size: 14px;
}

/* Toast 通知 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

.toast-success {
    background: #28a745;
}

.toast-error {
    background: #dc3545;
}

.toast-info {
    background: #17a2b8;
}

/* 游戏按钮样式 */
.game-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.game-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    min-width: 80px;
}

.restart-btn {
    background: #6c757d;
    color: white;
}

.restart-btn:hover {
    background: #5a6268;
}

.hint-btn {
    background: #ffc107;
    color: #212529;
}

.hint-btn:hover {
    background: #e0a800;
}

.next-btn {
    background: #28a745;
    color: white;
}

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

.next-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* 卡片提示样式 */
.card-item.hint {
    animation: hint-pulse 1s infinite;
}

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

/* 无数据提示 */
.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
}

.no-data i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
    display: block;
}

/* 分享按钮样式 */
.share-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
    background: #07c160;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(7, 193, 96, 0.4);
    transition: all 0.3s;
    z-index: 100;
}

.share-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(7, 193, 96, 0.6);
}