/* 响应式客户端样式 - 适配手机端 */

/* 类型选项样式 */
.types-section {
    margin-bottom: 30px;
}

.types-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.types-header h3 {
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

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

.types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.type-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    outline: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 80px;
}

.type-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.type-tag-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    display: none; /* 默认隐藏，有图片时显示 */
}

.type-tag-text {
    text-align: center;
    font-size: 12px;
}

.type-tag:active {
    transform: translateY(0);
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notice {
    font-size: 14px;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 10px;
}

/* 主要内容 */
.main {
    min-height: calc(100vh - 140px);
    padding: 20px 0;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
}

/* 游戏网格 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.game-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.game-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.game-info {
    padding: 16px;
}

.game-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.account-count {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* 搜索区域 */
.search-section {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.search-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.back-btn {
    background: #f5f5f5;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.3s ease;
}

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

.selected-game-name {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.game-remark {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-left: 4px solid #409eff;
    border-radius: 4px;
    line-height: 1.5;
}

.search-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    outline: none;
}

.sort-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sort-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.sort-select {
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    background: #f8f9fa;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sort-select:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.search-input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 搜索结果 */
.results-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 200px;
}

.search-tip {
    text-align: center;
    color: #999;
    font-size: 16px;
    padding: 40px 0;
}

.accounts-list {
    display: grid;
    gap: 16px;
}

.account-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.account-card:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.account-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.id-label {
    font-weight: 600;
    color: #4f46e5;
}

.copy-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    color: #64748b;
    font-size: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: #e2e8f0;
    color: #475569;
    border-color: #cbd5e1;
}

.account-id {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.account-price {
    color: #f56c6c;
    font-weight: 600;
    font-size: 16px;
}

.special-price {
    color: #e6a23c;
    font-size: 14px;
    text-decoration: line-through;
    margin-right: 8px;
}

.account-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

/* 移动端账号信息布局优化 */
@media (max-width: 768px) {
    .account-info {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: space-between;
    }
    
    .account-info .info-item {
        flex: 1;
        min-width: calc(33.33% - 4px);
        text-align: center;
        background: #f8fafc;
        padding: 4px 6px;
        border-radius: 4px;
        font-size: 12px;
    }
}

.info-item {
    font-size: 14px;
    color: #666;
}

.info-label {
    font-weight: 500;
    color: #333;
}

.account-types {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

/* 移动端类型布局优化 - 一行显示5个 */
@media (max-width: 768px) {
    .account-types {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
        margin-bottom: 12px;
    }
}

.type-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    min-width: 80px;
    max-width: 120px;
    transition: all 0.3s ease;
}

/* 当没有图片时显示的占位符 */
.type-item .type-placeholder {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.type-item .type-placeholder .placeholder-text {
    color: white;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* 移动端类型项目优化 */
@media (max-width: 768px) {
    .type-item {
        padding: 4px 2px;
        min-width: unset;
        max-width: unset;
        border-radius: 6px;
    }
    
    .type-item .type-placeholder {
        width: 40px;
        height: 40px;
        margin-bottom: 3px;
        border-radius: 4px;
    }
    
    .type-item .type-placeholder .placeholder-text {
        font-size: 14px;
    }
}

.type-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.type-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    margin-bottom: 6px;
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
    border: 1px solid #e2e8f0;
    display: none; /* 默认隐藏，有图片时显示 */
}

/* 移动端类型图片优化 */
@media (max-width: 768px) {
    .type-image {
        width: 40px;
        height: 40px;
        margin-bottom: 3px;
        border-radius: 4px;
    }
}

.type-name {
    font-size: 11px;
    font-weight: 500;
    color: #475569;
    text-align: center;
    line-height: 1.2;
    word-break: break-all;
}

/* 移动端类型名称优化 - 超过5字换行 */
@media (max-width: 768px) {
    .type-name {
        font-size: 9px;
        line-height: 1.1;
        height: 20px;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2; /* 标准属性 */
        -webkit-box-orient: vertical;
        word-break: break-all;
        position: relative;
    }
}

/* 保留原来的标签样式作为备用 */
.type-tag {
    background: #f0f9ff;
    color: #0369a1;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.account-remark {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px 0;
    color: #999;
    font-size: 16px;
}

.loading i {
    margin-right: 8px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.detail-label {
    font-weight: 500;
    color: #333;
    min-width: 80px;
}

.detail-value {
    color: #666;
    text-align: right;
    flex: 1;
}

/* 底部 */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

.footer p {
    font-size: 14px;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
    
    .game-image {
        height: 140px;
    }
    
    .search-box {
        padding: 16px;
        gap: 12px;
    }
    
    .search-input-wrapper {
        flex-direction: row;
        gap: 8px;
    }
    
    .search-input {
        flex: 1;
        min-width: 0;
    }
    
    .search-btn {
        flex-shrink: 0;
        padding: 12px 16px;
    }
    
    .sort-wrapper {
        justify-content: center;
    }
    
    .sort-select {
        width: 100%;
        max-width: 200px;
        padding: 10px 12px;
        font-size: 16px;
    }
    
    /* 移动端账号信息布局已在上方定义，这里移除冲突的样式 */
    
    .account-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .modal-content {
        margin: 10px;
        max-height: 90vh;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .detail-value {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .search-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .back-btn {
        align-self: flex-start;
    }
    
    /* 超小屏幕下的类型布局优化 */
    .account-types {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }
    
    .type-item {
        padding: 3px 1px;
    }
    
    .type-image {
        width: 35px;
        height: 35px;
    }
    
    .type-name {
        font-size: 8px;
        height: 18px;
    }
    
    /* 账号信息在超小屏幕下的优化 */
    .account-info .info-item {
        min-width: calc(50% - 3px);
        font-size: 11px;
        padding: 3px 4px;
    }
    
    /* 超小屏幕搜索框优化 */
    .search-box {
        padding: 12px;
        gap: 10px;
    }
    
    .search-input {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 10px 12px;
    }
    
    .search-btn {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .sort-select {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    /* 超小屏幕占位符优化 */
    .type-item .type-placeholder {
        width: 35px;
        height: 35px;
    }
    
    .type-item .type-placeholder .placeholder-text {
        font-size: 12px;
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #666;
}

.empty-state p {
    font-size: 14px;
}
