* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333333;
    min-height: 100vh;
}

header {
    background: linear-gradient(135deg, #4776E6 0%, #8E54E9 100%);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

/* 公告样式 */
.announcement {
    padding: 16px 20px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 10px 15px 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.announcement.standard-price {
    background: #4776E6;
    color: white;
    font-size: 1.2rem;
}

.announcement.extra-price {
    background: #e74c3c;
    color: white;
    margin-top: 30px;
    font-size: 1.5rem;
    padding: 20px 20px;
    font-weight: 700;
}

.announcement span {
    display: block;
}

/* 游戏卡片容器 - 确保正确的列数 */
.games-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 0 15px 15px;
}

/* 平板：每行2列 */
@media (max-width: 768px) {
    .games-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* 手机：每行2列 */
@media (max-width: 480px) {
    .games-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 10px 10px;
    }
}

/* 非常小的手机：保持2列 */
@media (max-width: 360px) {
    .games-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 8px 8px;
    }
}

/* 游戏卡片 */
.game-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* 竖版图片容器 */
.image-container {
    width: 100%;
    aspect-ratio: 4/5;
    background-color: #f0f0f0;
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.game-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 角标样式 */
.badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: 700;
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    min-width: 60px;
    text-align: center;
}

/* 补差价角标 */
.badge.extra {
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
}

/* 游戏卡片信息区域 - 新布局：第一行标题，第二行描述+按钮 */
.game-info {
    padding: 15px 15px 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 110px;
}

/* 标题 - 单行，居中，自适应字体大小 */
.game-title {
    font-size: clamp(1.1rem, 4vw, 1.4rem);
    color: #333333;
    font-weight: 700;
    text-align: center;
    margin: 0 0 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    flex-shrink: 0;
    max-width: 100%;
    display: block;
}

/* 第二行容器：描述+按钮 */
.game-second-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}

/* 描述 - 占剩余空间 */
.game-description {
    color: #666666;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* 选择按钮 - 扁平长方形 */
.select-btn {
    background: #4776E6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 6px 12px;
    min-width: 60px;
    height: 32px;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.select-btn:hover {
    background: #3a64d8;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* 清单按钮 */
.list-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #e74c3c;
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.list-btn .count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #00dbde;
    color: #1a1a2e;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 200;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 95%;
    max-width: 500px;
    max-height: 80vh;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    font-size: 1.3rem;
    color: #333333;
}

.modal-header h3 {
    font-size: 1.2rem;
    color: #333333;
}

.close-btn {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 1.5rem;
    cursor: pointer;
}

.list-items-container {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 15px;
}

.selected-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
}

.selected-item-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 10px;
}

.selected-item-info {
    flex: 1;
}

.selected-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 2px;
}

.remove-from-list {
    background-color: #e74c3c;
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
}

/* 模态框操作按钮区域 */
.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-actions button {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
}

.clear-btn {
    background-color: #95a5a6;
    color: white;
}

.submit-btn {
    background: #27ae60;
    color: white;
}

.submit-btn:hover {
    background: #219653;
}

.clear-btn:hover {
    background-color: #7f8c8d;
}

.empty-message {
    text-align: center;
    padding: 30px;
    color: #666666;
    font-size: 1rem;
}

/* 平板适配 */
@media (max-width: 768px) {
    .game-info {
        padding: 12px 12px 10px;
        min-height: 100px;
    }
    
    .game-title {
        font-size: clamp(1rem, 4vw, 1.2rem);
        margin-bottom: 6px;
    }
    
    .game-second-row {
        gap: 6px;
    }
    
    .game-description {
        font-size: 0.85rem;
    }
    
    .select-btn {
        font-size: 0.9rem;
        padding: 5px 10px;
        min-width: 55px;
        height: 30px;
    }
}

/* 手机适配 */
@media (max-width: 480px) {
    .game-info {
        padding: 10px 10px 8px;
        min-height: 95px;
    }
    
    .game-title {
        font-size: clamp(0.9rem, 4vw, 1.1rem);
        margin-bottom: 5px;
    }
    
    .game-second-row {
        gap: 5px;
    }
    
    .game-description {
        font-size: 0.8rem;
    }
    
    .select-btn {
        font-size: 0.85rem;
        padding: 4px 8px;
        min-width: 50px;
        height: 28px;
    }
}

/* 小手机适配 */
@media (max-width: 360px) {
    .game-info {
        padding: 8px 8px 6px;
    }
    
    .game-title {
        font-size: clamp(0.85rem, 4vw, 1rem);
    }
    
    .select-btn {
        min-width: 48px;
        padding: 3px 6px;
        font-size: 0.8rem;
    }
}

/* 游戏状态标签 */
.status-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: rgba(231, 76, 60, 0.8);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
}

/* 消息样式 */
.message {
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
    text-align: center;
    font-size: 0.9rem;
}

.success {
    background-color: rgba(39, 174, 96, 0.2);
    color: #27ae60;
}

.error {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}