/* 充值系统样式文件 - 魔法风格 */

/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #e8d4b8;
    background-image: 
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(139, 90, 43, 0.03) 2px, rgba(139, 90, 43, 0.03) 4px),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(139, 90, 43, 0.03) 2px, rgba(139, 90, 43, 0.03) 4px);
    color: #3a2a1a;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(139, 90, 43, 0.05) 100%);
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

/* 页面头部 - 章节标题 */
.page-header {
    background: #f5e6d3;
    background-image: linear-gradient(to right, #f5e6d3 0%, #f9ead5 50%, #f5e6d3 100%);
    padding: 50px 50px 40px;
    color: #3a2a1a;
    text-align: center;
    box-shadow: 
        inset 0 0 50px rgba(139, 90, 43, 0.1),
        0 4px 0 rgba(0,0,0,0.2);
    border-top: 4px solid #8b5a2b;
    border-bottom: 4px solid #8b5a2b;
    position: relative;
}

.page-header h1 {
    font-size: 36px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0 rgba(139, 90, 43, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.page-header h1 i {
    color: #8b5a2b;
    font-size: 40px;
}

.page-header p {
    font-size: 14px;
    opacity: 0.85;
    font-style: italic;
}

/* 容器样式 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 50px;
}

/* 充值区域 */
.recharge-section {
    background: #faf6f0;
    background-image: 
        linear-gradient(to right, transparent 0%, rgba(139, 90, 43, 0.02) 50%, transparent 100%);
    border: 4px solid #8b5a2b;
    box-shadow: 6px 6px 0 rgba(0,0,0,0.2);
    padding: 25px;
    margin-bottom: 30px;
    position: relative;
}

.recharge-section::before {
    content: '';
    position: absolute;
    top: 10px;
    right: 20px;
    width: 24px;
    height: 24px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="%238b5a2b" viewBox="0 0 24 24"><path d="M12 0.5l3.09 6.26L22 7.27l-5 4.87L18.18 19L12 15.77 5.82 19 7 12.14l-5-4.87 6.91-.51L12 0.5z"/></svg>');
    background-size: contain;
    opacity: 0.2;
}

/* 选择器公共样式 */
.selector-title {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 12px;
    color: #3a2a1a;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.selector-title i {
    color: #8b5a2b;
    font-size: 26px;
}

.selector-subtitle {
    font-size: 14px;
    color: #8b5a2b;
    margin-bottom: 20px;
    font-style: italic;
    font-weight: 600;
}

/* 商品区域 */
.recharge-products {
    width: 100%;
    margin-bottom: 20px;
}

/* 商品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin: 0 auto;
    max-width: 1500px;
}

/* 商品卡片 */
.product-card {
    background: #faf6f0;
    background-image: 
        linear-gradient(to bottom, transparent 0%, rgba(139, 90, 43, 0.02) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 15px, rgba(139, 90, 43, 0.03) 15px, rgba(139, 90, 43, 0.03) 16px);
    border: 3px solid #8b5a2b;
    padding: 18px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    box-shadow: 
        4px 4px 0 rgba(0,0,0,0.2),
        inset 0 0 20px rgba(139, 90, 43, 0.03);
    display: flex;
    flex-direction: column;
    min-width: 0; /* 防止flex子元素溢出 */
}

.product-card:hover {
    transform: translateY(-4px) rotate(-0.5deg);
    box-shadow: 8px 8px 0 rgba(0,0,0,0.25);
}

.product-card.selected {
    border-color: #ff9500;
    box-shadow: 
        0 0 0 3px rgba(255, 149, 0, 0.3),
        8px 8px 0 rgba(0,0,0,0.25);
    transform: translateY(-4px);
}

.product-card.selected::after {
    content: '✓';
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    background: #ff9500;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
    animation: checkPulse 1.5s infinite;
}

@keyframes checkPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(255, 149, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0); }
}

/* 商品图片 */
.product-image {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139, 90, 43, 0.1) 0%, rgba(139, 90, 43, 0.05) 100%);
    color: #8b5a2b;
    font-size: 3.5em;
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
    margin-bottom: 15px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-image i {
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: gemFloat 3s ease-in-out infinite;
}

@keyframes gemFloat {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

/* 商品内容 */
.product-content {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* 防止flex子元素溢出 */
}

.product-title {
    font-size: 1.4em;
    color: #3a2a1a;
    margin-bottom: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}

.product-card:hover .product-title {
    color: #8b5a2b;
}

.product-price {
    color: #e53e3e;
    font-weight: 900;
    margin-bottom: 18px;
    font-size: 1.7em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.product-points {
    color: #4a5568;
    font-size: 1.1em;
    padding: 10px 6px;
    display: block;
    background: rgba(139, 90, 43, 0.1);
    border-radius: 8px;
    margin: 0 auto;
    width: 95%;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(139, 90, 43, 0.1) inset;
    line-height: 1.4;
    white-space: nowrap; /* 防止数字和文字之间换行 */
    overflow: hidden; /* 隐藏溢出 */
}

.product-points::before {
    content: '💎';
    margin-right: 4px;
    font-size: 0.9em;
}

.product-description {
    margin-top: 12px;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    font-size: 0.85em;
    color: #5a4a3a;
    line-height: 1.4;
    text-align: center;
    border: 1px dashed rgba(139, 90, 43, 0.3);
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* 分页样式 */
.pagination-container {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(250, 246, 240, 0.9);
    border-radius: 8px;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.15);
    border: 2px solid #8b5a2b;
}

.page-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: white;
    color: #8b5a2b;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
    border: 2px solid #8b5a2b;
}

.page-item:hover {
    background: rgba(139, 90, 43, 0.1);
    transform: translateY(-2px);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
}

.page-item.active {
    background: #8b5a2b;
    color: #f5e6d3;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

/* 二维码区域 */
.qrcode-section {
    text-align: center;
    margin-top: 40px;
    padding: 40px 30px;
    background: #faf6f0;
    border: 4px solid #8b5a2b;
    box-shadow: 6px 6px 0 rgba(0,0,0,0.2);
    animation: fadeScale 0.7s ease-out;
}

@keyframes fadeScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.qrcode-section h3 {
    font-size: 1.8em;
    color: #3a2a1a;
    margin-bottom: 30px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.qrcode-section h3 i {
    color: #8b5a2b;
    font-size: 1.2em;
}

/* 返回按钮容器 */
.back-button-container {
    margin-bottom: 25px;
    text-align: center;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #8b5a2b;
    color: #f5e6d3;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    border: 3px solid #654321;
    border-radius: 8px;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.back-button:hover {
    background: #654321;
    transform: translateY(-2px);
    box-shadow: 5px 5px 0 rgba(0,0,0,0.3);
}

.back-button:active {
    transform: translateY(0);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.back-button i {
    font-size: 18px;
}

/* 魔法书样式 */
.magic-book {
    max-width: 900px;
    margin: 0 auto 30px;
    perspective: 2000px;
}

.book-cover {
    display: flex;
    background: linear-gradient(to right, #d4b896 0%, #c9ad7f 50%, #d4b896 100%);
    border: 5px solid #8b5a2b;
    border-radius: 8px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        inset 0 0 30px rgba(139, 90, 43, 0.2);
    position: relative;
    min-height: 500px;
    animation: bookOpen 1s ease-out;
}

@keyframes bookOpen {
    0% {
        transform: rotateY(-15deg);
        opacity: 0;
    }
    100% {
        transform: rotateY(0deg);
        opacity: 1;
    }
}

/* 书页 */
.book-page {
    flex: 1;
    background: #f9f6f0;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 25px, rgba(139, 90, 43, 0.05) 25px, rgba(139, 90, 43, 0.05) 26px);
    padding: 30px;
    position: relative;
}

.book-page::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(139, 90, 43, 0.03) 100%);
    pointer-events: none;
}

.left-page {
    border-right: 2px solid rgba(139, 90, 43, 0.3);
}

.right-page {
    border-left: 2px solid rgba(139, 90, 43, 0.3);
}

/* 书脊 */
.book-spine {
    width: 20px;
    background: linear-gradient(to bottom, #8b5a2b 0%, #654321 50%, #8b5a2b 100%);
    box-shadow: 
        inset 2px 0 5px rgba(0, 0, 0, 0.3),
        inset -2px 0 5px rgba(0, 0, 0, 0.3);
    position: relative;
}

.book-spine::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 80%;
    background: rgba(255, 255, 255, 0.1);
}

/* 页面内容 */
.page-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.page-title {
    font-size: 1.5em;
    color: #3a2a1a;
    font-weight: 800;
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 1px 1px 0 rgba(139, 90, 43, 0.1);
}

.page-divider {
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #8b5a2b 50%, transparent 100%);
    margin: 0 auto 20px;
    position: relative;
}

.page-divider::before {
    content: '✦';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #f9f6f0;
    color: #8b5a2b;
    padding: 0 8px;
    font-size: 12px;
}

/* 支付详情 */
.payment-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(139, 90, 43, 0.2);
    border-radius: 8px;
}

/* 玩家ID特殊样式 */
.detail-item.player-id-item {
    background: linear-gradient(135deg, rgba(139, 90, 43, 0.15) 0%, rgba(139, 90, 43, 0.08) 100%);
    border: 2px solid rgba(139, 90, 43, 0.4);
    box-shadow: 0 2px 8px rgba(139, 90, 43, 0.15);
}

.detail-label {
    font-size: 14px;
    color: #5a4a3a;
    font-weight: 700;
}

.detail-value {
    font-size: 16px;
    color: #3a2a1a;
    font-weight: 800;
}

.detail-value.player-id {
    color: #8b5a2b;
    font-size: 1.1em;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.7);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(139, 90, 43, 0.3);
}

.detail-value.player-id::before {
    content: '👤 ';
}

.detail-value.price {
    color: #e53e3e;
    font-size: 1.3em;
}

.detail-value.gems {
    color: #8b5a2b;
}

.detail-value.gems::before {
    content: '💎 ';
}

/* 页面注释 */
.page-note {
    text-align: center;
    padding: 15px;
    background: rgba(139, 90, 43, 0.05);
    border-radius: 8px;
    border: 1px dashed rgba(139, 90, 43, 0.3);
}

.page-note i {
    color: #8b5a2b;
    font-size: 1.2em;
    margin-bottom: 8px;
    display: block;
}

.page-note p {
    font-size: 13px;
    color: #5a4a3a;
    font-style: italic;
    font-weight: 600;
    margin: 0;
}

/* 二维码容器 */
.qrcode-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

/* 魔法阵效果 */
.magic-circle {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.magic-circle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid #8b5a2b;
    border-radius: 50%;
    animation: rotate 20s linear infinite;
}

.magic-circle::after {
    content: '';
    position: absolute;
    width: 90%;
    height: 90%;
    border: 2px dashed rgba(139, 90, 43, 0.5);
    border-radius: 50%;
    animation: rotate 15s linear infinite reverse;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.qrcode-image {
    width: 220px;
    height: 220px;
    border: 3px solid #8b5a2b;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background: white;
    padding: 10px;
    position: relative;
    z-index: 1;
}

/* 扫描提示 */
.scan-hint {
    text-align: center;
    padding: 12px;
    background: rgba(139, 90, 43, 0.05);
    border-radius: 8px;
    border: 1px dashed rgba(139, 90, 43, 0.3);
}

.scan-hint i {
    color: #8b5a2b;
    font-size: 1.5em;
    margin-bottom: 8px;
    display: block;
    animation: scanPulse 2s ease-in-out infinite;
}

@keyframes scanPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

.scan-hint p {
    font-size: 13px;
    color: #5a4a3a;
    font-weight: 600;
    margin: 0;
}

/* 旧的二维码信息样式（保留以防需要） */
.qrcode-info {
    margin-top: 15px;
    color: #5a4a3a;
    font-size: 1.1em;
}

.qrcode-info p {
    margin: 8px 0;
    font-weight: 600;
}

.qrcode-info strong {
    color: #3a2a1a;
}

/* 领取说明样式 - 魔法纸张风格 */
.claim-instructions {
    background: #faf6f0;
    background-image: 
        linear-gradient(to right, transparent 0%, rgba(139, 90, 43, 0.02) 50%, transparent 100%);
    border: 4px solid #8b5a2b;
    border-radius: 12px;
    padding: 25px;
    margin: 25px auto;
    max-width: 500px;
    box-shadow: 6px 6px 0 rgba(0,0,0,0.2);
    position: relative;
    animation: slideUp 0.6s ease-out 0.3s both;
}

.claim-instructions::before {
    content: '';
    position: absolute;
    top: 10px;
    right: 15px;
    width: 24px;
    height: 24px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="%238b5a2b" viewBox="0 0 24 24"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 21 12 17.77 5.82 21 7 14.14l-5-4.87 6.91-1.01L12 2z"/></svg>');
    background-size: contain;
    opacity: 0.2;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.claim-title {
    font-size: 20px;
    color: #3a2a1a;
    font-weight: 900;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 0 rgba(139, 90, 43, 0.1);
}

.claim-title i {
    font-size: 24px;
    color: #8b5a2b;
}

.claim-content {
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(139, 90, 43, 0.2);
    border-radius: 8px;
    padding: 18px;
    margin-top: 10px;
}

.claim-desc {
    font-size: 14px;
    color: #5a4a3a;
    margin-bottom: 12px;
    font-weight: 700;
    text-align: center;
}

.claim-command {
    background: #3a2a1a;
    background-image: 
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(139, 90, 43, 0.1) 2px, rgba(139, 90, 43, 0.1) 4px);
    border: 3px solid #8b5a2b;
    border-radius: 8px;
    padding: 15px;
    margin: 12px 0;
    text-align: center;
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.3),
        3px 3px 0 rgba(0, 0, 0, 0.15);
}

.claim-command code {
    color: #4ade80;
    font-size: 20px;
    font-weight: bold;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.claim-tip {
    font-size: 13px;
    color: #8b5a2b;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
    font-style: italic;
}

.claim-tip i {
    color: #ff9500;
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 魔法书在平板上垂直排列 */
    .book-cover {
        flex-direction: column;
        min-height: auto;
    }
    
    .book-spine {
        width: 100%;
        height: 15px;
    }
    
    .book-spine::before {
        width: 80%;
        height: 2px;
    }
    
    .left-page {
        border-right: none;
        border-bottom: 2px solid rgba(139, 90, 43, 0.3);
    }
    
    .right-page {
        border-left: none;
        border-top: 2px solid rgba(139, 90, 43, 0.3);
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 30px 20px 20px;
    }

    .page-header h1 {
        font-size: 24px;
        flex-direction: column;
        gap: 10px;
    }

    .container {
        padding: 20px;
    }

    .recharge-section {
        padding: 20px;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .claim-instructions {
        max-width: 100%;
        padding: 15px;
    }
    
    .claim-title {
        font-size: 16px;
    }
    
    .claim-command code {
        font-size: 16px;
    }
    
    /* 魔法书移动端优化 */
    .qrcode-section {
        padding: 25px 15px;
    }
    
    .qrcode-section h3 {
        font-size: 1.4em;
    }
    
    .back-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .back-button i {
        font-size: 16px;
    }
    
    .book-page {
        padding: 20px 15px;
    }
    
    .page-title {
        font-size: 1.2em;
    }
    
    .magic-circle {
        width: 220px;
        height: 220px;
    }
    
    .qrcode-image {
        width: 180px;
        height: 180px;
    }
    
    .payment-details {
        gap: 10px;
    }
    
    .detail-item {
        padding: 10px;
    }
    
    .detail-label {
        font-size: 13px;
    }
    
    .detail-value {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .claim-command code {
        font-size: 14px;
    }
    
    .magic-circle {
        width: 200px;
        height: 200px;
    }
    
    .qrcode-image {
        width: 160px;
        height: 160px;
    }
}
