/* =========================================
   设置面板与弹窗样式
   ========================================= */

/* 遮罩层 */
.modal-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px); 
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000; 
    opacity: 0; 
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex; 
    justify-content: center; 
    align-items: center;
}

.modal-overlay.active { 
    opacity: 1; 
    pointer-events: auto; 
}

/* 面板基础 */
.info-panel {
    background-color: var(--panel-body-bg);
    background-image: linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px),
                      linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: none; 
    flex-direction: column;
    border-radius: var(--panel-radius); 
    overflow: hidden; 
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.27);
    position: relative;
    z-index: 1001;
    margin: auto;
}

.modal-overlay.active .info-panel.active { 
    display: flex; 
    transform: translateY(0); 
}

.info-panel.type-narrow { 
    width: 400px; 
    min-height: 260px; 
}

.type-narrow .panel-content {
    padding: 40px; 
    display: flex; 
    flex-direction: column;
    gap: 20px; 
    align-items: center; 
    justify-content: center;
}

.info-panel.type-wide { 
    width: 800px; 
    height: 520px; 
    max-width: 90vw;
    max-height: 90vh;
}

/* 面板头部 */
.panel-header {
    height: 60px; 
    background-color: var(--panel-header-bg);
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    padding: 0 0 0 30px; 
    color: white; 
    flex-shrink: 0;
}

.header-main-title { 
    font-size: 18px; 
    font-weight: bold; 
    letter-spacing: 1px; 
}

.header-deco {
    flex-grow: 1; 
    height: 100%; 
    display: flex; 
    align-items: center; 
    margin: 0 20px; 
    opacity: 0.3;
    background-image: url('data:image/svg+xml;utf8,<svg width="10" height="10" viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="5" r="1" fill="white" /></svg>');
    background-repeat: repeat-x; 
    background-position: center left;
}

.btn-close-panel {
    width: 60px; 
    height: 60px; 
    background: transparent; 
    border: none;
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: white; 
    transition: background-color 0.2s;
}

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

.btn-close-panel svg { 
    width: 24px; 
    height: 24px; 
    fill: white; 
}

/* 动态布局 */
.dynamic-layout {
    display: flex; 
    width: 100%; 
    height: 100%;
    overflow: hidden; 
    position: relative;
}

/* 图片区域 */
.layout-image-area {
    flex: 6; 
    background-color: #e6e6e6;
    display: flex; 
    justify-content: center; 
    align-items: center;
    overflow: hidden; 
    position: relative; 
    border-bottom: 2px solid #ddd;
}

.layout-image-area img {
    height: 85%; 
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.15));
    transition: transform 0.5s ease;
}

.layout-image-area:hover img { 
    transform: scale(1.05) rotate(2deg); 
}

.image-deco-tag {
    position: absolute; 
    top: 20px; 
    left: 20px;
    background: #1a1a1a; 
    color: #fff;
    padding: 4px 10px; 
    font-size: 11px; 
    font-weight: bold; 
    border-radius: 4px;
}

/* 文字区域 */
.layout-text-area {
    flex: 4; 
    background: var(--panel-body-bg);
    display: flex; 
    flex-direction: column;
    overflow-y: auto; 
    padding: 0 40px; 
    position: relative;
}

.dynamic-layout.mode-text-only .layout-text-area { 
    flex: 1; 
}

.dynamic-layout.mode-text-only .layout-image-area { 
    display: none; 
}

.layout-text-area::-webkit-scrollbar { 
    width: 6px; 
}

.layout-text-area::-webkit-scrollbar-track { 
    background: transparent; 
}

.layout-text-area::-webkit-scrollbar-thumb { 
    background-color: #ccc; 
    border-radius: 3px; 
}

.layout-text-area::-webkit-scrollbar-thumb:hover { 
    background-color: #999; 
}

.text-content-wrapper {
    min-height: 100%; 
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    padding: 25px 0 80px 0;
}

.content-sub-title {
    font-size: 20px; 
    font-weight: 800; 
    margin-bottom: 12px;
    display: flex; 
    align-items: center; 
    color: #000; 
    flex-shrink: 0;
}

.content-sub-title::before {
    content: ''; 
    display: inline-block; 
    width: 6px; 
    height: 20px;
    background-color: var(--yellow-normal); 
    margin-right: 12px; 
    border-radius: 2px;
}

.content-desc {
    font-size: 14px; 
    line-height: 1.8; 
    color: #444;
    text-align: justify; 
    font-weight: 500;
}

.highlight-kw {
    color: #bfa300; 
    background-color: var(--highlight-bg);
    padding: 0 4px; 
    border-radius: 4px; 
    font-weight: bold; 
    margin: 0 2px;
}

.continue-btn-wrapper {
    position: absolute; 
    bottom: 30px; 
    right: 40px;
    z-index: 20; 
    animation: slideInRight 0.3s ease;
}

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

/* 按钮样式 */
.enf-btn {
    height: 44px; 
    padding: 0 6px 0 16px;
    border-radius: 22px; 
    border: none; 
    outline: none;
    display: flex; 
    align-items: center; 
    justify-content: flex-start;
    cursor: pointer; 
    font-size: 14px; 
    font-weight: bold;
    transition: background-color 0.2s ease, transform 0.1s, box-shadow 0.2s;
    position: relative; 
    box-sizing: border-box;
    gap: 8px; 
    width: fit-content; 
    white-space: nowrap;
    text-decoration: none; 
    flex-shrink: 0; 
    color: #1a1a1a;
}

.enf-btn:active { 
    transform: scale(0.98); 
}

.enf-deco-line {
    flex: 0 0 70px; 
    height: 1px;
    background-color: currentColor; 
    opacity: 0.3;
    position: relative; 
    display: flex; 
    align-items: center;
}

.enf-deco-line::before {
    content: ''; 
    position: absolute; 
    left: 0;
    width: 3px; 
    height: 3px; 
    background-color: currentColor; 
    border-radius: 50%;
}

.enf-text { 
    flex-shrink: 0; 
    margin-right: 0; 
}

.enf-icon {
    width: 32px; 
    height: 32px; 
    border-radius: 50%;
    display: flex; 
    justify-content: center; 
    align-items: center;
    flex-shrink: 0; 
    margin-left: 4px;
}

.enf-icon svg { 
    width: 14px; 
    height: 14px; 
    fill: currentColor; 
}

/* 按钮变体 */
.enf-btn.btn-white {
    background-color: var(--white-btn); 
    color: #1a1a1a;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.enf-btn.btn-white:hover { 
    background-color: #ffffff; 
}

.enf-btn.btn-white .enf-icon { 
    background-color: rgba(0,0,0,0.1); 
}

.enf-btn.btn-yellow {
    background-color: var(--yellow-normal); 
    color: #1a1a1a;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15); 
}

.enf-btn.btn-yellow:hover {
    background-color: var(--yellow-hover);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.enf-btn.btn-yellow .enf-icon { 
    background-color: rgba(0,0,0,0.1); 
}

.enf-btn.btn-gray {
    background-color: var(--gray-normal); 
    color: #ffffff;
}

.enf-btn.btn-gray:hover { 
    background-color: var(--gray-hover); 
}

.enf-btn.btn-gray .enf-icon { 
    background-color: rgba(255,255,255,0.2); 
}

/* 兑换码弹窗 */
.redeem-modal-wrapper {
    position: relative; 
    z-index: 2000;
    display: none; 
    flex-direction: column; 
    align-items: center;
    animation: fadeIn 0.3s ease;
    margin: auto;
}

.redeem-modal-wrapper.active { 
    display: flex; 
}

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

.modal-panel {
    width: 460px; 
    background: #fff;
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    align-items: center;
    border-radius: var(--panel-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative; 
    padding: 30px 20px 60px 20px;
}

.modal-title-box { 
    font-size: 18px; 
    font-weight: 800; 
    color: #000; 
    margin-bottom: 25px; 
    letter-spacing: 1px; 
}

.redeem-input-container { 
    width: 80%; 
    position: relative; 
    margin-bottom: 10px; 
}

.redeem-input {
    width: 100%; 
    height: 50px; 
    background: #f5f5f5;
    border: 2px solid transparent; 
    border-bottom: 2px solid #ccc;
    padding: 0 15px; 
    font-size: 20px; 
    font-weight: bold; 
    font-family: monospace;
    text-align: center; 
    color: #333; 
    outline: none; 
    transition: all 0.3s;
    box-sizing: border-box; 
    border-radius: 8px 8px 0 0;
}

.redeem-input:focus { 
    background: #fff; 
    border-bottom-color: var(--yellow-normal); 
}

.input-hint { 
    font-size: 12px; 
    color: #999; 
    margin-top: 5px; 
    text-align: center; 
    font-weight: bold; 
}

.modal-actions {
    position: absolute; 
    bottom: 0; 
    left: 50%;
    transform: translate(-50%, 50%);
    display: flex; 
    gap: 20px; 
    z-index: 10;
}

.btn-wrapper {
    position: relative; 
    border-radius: 26px; 
    padding: 4px;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex; 
    width: fit-content; 
    height: fit-content;
}

.error-msg {
    color: #ff4d4f; 
    font-size: 12px; 
    height: 20px; 
    margin-top: 5px;
    opacity: 0; 
    transition: opacity 0.2s; 
    font-weight: bold; 
    text-align: center;
}

.error-msg.show { 
    opacity: 1; 
}

/* 清除账户确认弹窗 (覆盖层) */
#clear-account-modal {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px); 
    -webkit-backdrop-filter: blur(2px);
    display: flex; 
    justify-content: center; 
    align-items: center;
    opacity: 0; 
    pointer-events: none;
    transition: opacity 0.3s ease; 
    z-index: 2000;
}

#clear-account-modal.active { 
    opacity: 1; 
    pointer-events: auto; 
}

#clear-account-modal .modal-panel {
    width: 100%; 
    max-width: none; 
    height: 33.33vh;
    background: #fff; 
    border-radius: 0;
    padding: 0;
}

#clear-account-modal .modal-text {
    font-size: 14px; 
    font-weight: bold; 
    color: #8B0000; 
    margin-bottom: 0; 
    letter-spacing: 1px;
}

#clear-account-modal .modal-actions { 
    gap: 40px; 
}

/* 移动端适配 - 竖屏 */
@media screen and (max-width: 950px) and (orientation: portrait) {
    #clear-account-modal .modal-panel {
        width: 100%; 
        max-width: none; 
        height: 33.33vh;
        border-radius: 0; 
        transform: none; 
        overflow: visible;
    }
    
    #clear-account-modal .modal-actions {
        transform: translate(-50%, 50%) scale(0.85);
        gap: 20px;
    }
    
    /* 教程面板适配 */
    .info-panel.type-wide {
        width: 90vw;
        height: 80vh;
        max-width: 800px;
        max-height: 600px;
    }
    
    .dynamic-layout {
        flex-direction: column;
    }
    
    .layout-image-area {
        flex: 4;
        border-bottom: 1px solid #ddd;
        border-right: none;
    }
    
    .layout-text-area {
        flex: 6;
        padding: 0 20px;
    }
    
    .text-content-wrapper {
        padding: 20px 0 60px 0;
    }
    
    .content-sub-title {
        font-size: 18px;
    }
    
    .content-desc {
        font-size: 13px;
    }
}

/* 移动端适配 - 横屏 (针对原生横屏设备) */
@media screen and (max-width: 950px) and (orientation: landscape) {
    .info-panel.type-wide {
        flex-direction: column !important; 
        aspect-ratio: 1.6 / 1;
        width: min(85vw, calc(90vh * 1.6)) !important;
        height: min(90vh, calc(85vw / 1.6)) !important;
        max-width: none !important;
        max-height: none !important;
        margin: auto !important;
        font-size: 12px; 
    }

    /* 头部缩小 */
    .panel-header {
        height: 15% !important;
        min-height: 32px;
        max-height: 45px;
        padding: 0 15px !important;
    }
    
    .header-main-title { 
        font-size: 1.2em !important; 
    }
    
    .btn-close-panel { 
        width: 32px !important; 
        height: 100% !important; 
    }
    
    .btn-close-panel svg { 
        width: 18px; 
        height: 18px; 
    }

    /* 内容区布局 */
    .dynamic-layout {
        flex-direction: row !important;
        flex: 1 !important;
        width: 100%;
        height: 85% !important;
        overflow: hidden;
    }

    /* 左侧图片区 */
    .layout-image-area {
        flex: 1.1 !important;
        border-bottom: none !important;
        border-right: 1px solid #ddd !important;
        height: 100% !important; 
        width: auto !important;
        padding: 5px !important;
        display: flex;
        background-color: #e6e6e6;
    }
    
    .layout-image-area img {
        width: 100%; 
        height: 100%; 
        object-fit: contain;
    }
    
    .image-deco-tag {
        top: 10px !important; 
        left: 10px !important;
        font-size: 10px !important; 
        padding: 2px 6px !important;
    }

    /* 右侧文字区 */
    .layout-text-area {
        flex: 1 !important;
        padding: 0 15px !important;
        height: 100% !important;
        position: relative;
    }

    .text-content-wrapper {
        padding: 15px 0 50px 0 !important; 
    }

    /* 文字缩小 */
    .content-sub-title {
        font-size: 1.2em !important;
        margin-bottom: 5px !important;
    }
    
    .content-sub-title::before {
        height: 14px !important; 
        margin-right: 6px !important;
    }
    
    .content-desc {
        font-size: 1em !important;
        line-height: 1.4 !important;
    }

    /* 按钮强行缩小 (UI控件适配) */
    .continue-btn-wrapper {
        bottom: 10px !important; 
        right: 15px !important;
    }
    
    /* 强制覆盖按钮样式 */
    .enf-btn {
        height: 32px !important;
        padding: 0 4px 0 12px !important;
        border-radius: 16px !important;
        font-size: 11px !important;
        gap: 4px !important;
    }
    
    /* 图标圆圈变小 */
    .enf-icon {
        width: 24px !important; 
        height: 24px !important;
    }
    
    .enf-icon svg {
        width: 10px !important;
        height: 10px !important;
    }
}

/* 强制横屏下的特殊适配 (当容器被旋转时) */
@media screen and (max-height: 500px) {
    .info-panel.type-wide {
        width: 85vw;
        height: 90vh;
        flex-direction: row;
    }
    
    .dynamic-layout {
        flex-direction: row;
    }
    
    .layout-image-area {
        flex: 1.2;
        border-bottom: none;
        border-right: 1px solid #ddd;
    }
    
    .layout-text-area {
        flex: 1;
        padding: 0 20px;
    }
    
    .text-content-wrapper {
        padding: 15px 0 50px 0;
    }
    
    .content-sub-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .content-desc {
        font-size: 12px;
        line-height: 1.5;
    }
    
    .panel-header {
        height: 40px;
    }
    
    .header-main-title {
        font-size: 14px;
    }
    
    .btn-close-panel {
        width: 40px; 
        height: 40px;
    }
    
    .btn-close-panel svg {
        width: 18px; 
        height: 18px;
    }
    
    /* 调整继续按钮位置 */
    .continue-btn-wrapper {
        bottom: 10px; 
        right: 20px;
    }
    
    .enf-btn {
        height: 32px; 
        font-size: 12px;
    }
    
    .enf-icon {
        width: 24px; 
        height: 24px;
    }
    
    .enf-icon svg {
        width: 10px; 
        height: 10px;
    }
}

/* 强制横屏模式下的特殊适配 (通过 body class 控制) */
.force-landscape-mode #settings-overlay,
.force-landscape-mode #level-select-layer,
.force-landscape-mode #gender-select-layer,
.force-landscape-mode #name-input-layer,
.force-landscape-mode #clear-account-modal,
.force-landscape-mode .bg-marquee-layer {
    width: 100vh !important;
    height: 100vw !important;
    transform: rotate(90deg) !important;
    transform-origin: center center !important;
    left: calc((100vw - 100vh) / 2) !important;
    top: calc((100vh - 100vw) / 2) !important;
    position: fixed !important;
    z-index: 2000 !important;
}

/* 背景层层级修正 */
.force-landscape-mode .bg-marquee-layer {
    z-index: 0 !important;
    transform: rotate(90deg) skewY(-5deg) !important;
    padding: 8vw 0 !important;
}

.force-landscape-mode .marquee-text {
    font-size: 15vw !important;
}

/* 信息面板适配 (统一比例) */
.force-landscape-mode .info-panel.type-wide {
    flex-direction: column !important;
    aspect-ratio: 1.6 / 1 !important;
    width: min(85vh, calc(90vw * 1.6)) !important;
    height: min(90vw, calc(85vh / 1.6)) !important;
    max-width: none !important;
    max-height: none !important;
    margin: auto !important;
    position: relative !important;
}

/* 内部区域布局：横向 (左图右文) */
.force-landscape-mode .dynamic-layout {
    flex-direction: row !important;
    flex: 1;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

/* 图片区域适配 */
.force-landscape-mode .layout-image-area {
    flex: 1.1 !important;
    height: 100% !important;
    border-bottom: none !important;
    border-right: 1px solid #ddd !important;
    display: flex !important;
    justify-content: center;
    align-items: center;
    background-color: #e6e6e6;
    padding: 5px !important;
}

.force-landscape-mode .layout-image-area img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: none !important;
}

.force-landscape-mode .image-deco-tag {
    top: 10px !important; 
    left: 10px !important;
    font-size: 10px !important; 
    padding: 2px 6px !important;
}

/* 文字区域适配 */
.force-landscape-mode .layout-text-area {
    flex: 1 !important;
    height: 100% !important;
    padding: 0 15px !important;
    overflow-y: auto;
}

.force-landscape-mode .text-content-wrapper {
    padding: 15px 0 50px 0 !important;
    justify-content: center;
}

.force-landscape-mode .content-sub-title {
    font-size: 1.2em !important;
    margin-bottom: 5px !important;
}

.force-landscape-mode .content-desc {
    font-size: 1em !important;
    line-height: 1.4 !important;
}

/* 头部适配 */
.force-landscape-mode .panel-header {
    height: 15% !important;
    min-height: 32px;
    max-height: 45px;
    padding: 0 15px !important;
}

.force-landscape-mode .header-main-title { 
    font-size: 1.2em !important; 
}

.force-landscape-mode .btn-close-panel { 
    width: 32px !important; 
    height: 100% !important; 
}

/* 按钮适配 */
.force-landscape-mode .continue-btn-wrapper {
    bottom: 10px !important; 
    right: 15px !important;
}

.force-landscape-mode .enf-btn {
    height: 32px !important;
    padding: 0 4px 0 12px !important;
    border-radius: 16px !important;
    font-size: 11px !important;
    gap: 4px !important;
}

.force-landscape-mode .enf-icon {
    width: 24px !important; 
    height: 24px !important;
}

.force-landscape-mode .enf-icon svg {
    width: 10px !important; 
    height: 10px !important;
}

/* 设置面板适配 (Type Narrow) */
.force-landscape-mode .info-panel.type-narrow {
    width: 400px !important;
    min-height: 260px !important;
    max-width: 85vh !important;
}

/* 清除账户弹窗适配 */
.force-landscape-mode #clear-account-modal .modal-panel {
    height: 33.33vw !important; 
}

/* 针对小屏幕的强制横屏进一步缩小 */
@media screen and (max-width: 500px) {
    .force-landscape-mode .panel-header {
        height: 40px;
    }
    
    .force-landscape-mode .header-main-title {
        font-size: 14px;
    }
    
    .force-landscape-mode .content-sub-title {
        font-size: 16px;
        margin-bottom: 5px;
    }
    
    .force-landscape-mode .content-desc {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .force-landscape-mode .text-content-wrapper {
        padding: 10px 0 40px 0;
    }
    
    .force-landscape-mode .continue-btn-wrapper {
        bottom: 10px; 
        right: 10px;
    }
    
    .force-landscape-mode .enf-btn {
        height: 30px;
    }
}

/* =========================================
   针对系统设置面板的特殊调整 (覆盖 type-wide)
   ========================================= */
#panel-settings.info-panel.type-wide {
    width: 500px;
    height: 320px;
}

/* 移动端竖屏适配 - 系统设置面板 */
@media screen and (max-width: 950px) and (orientation: portrait) {
    #panel-settings.info-panel.type-wide {
        width: 85vw;
        height: auto;
        min-height: 300px;
        max-height: 400px;
    }
}

/* 移动端横屏适配 - 系统设置面板 */
@media screen and (max-width: 950px) and (orientation: landscape) {
    #panel-settings.info-panel.type-wide {
        width: 480px !important;
        height: 280px !important;
        aspect-ratio: auto !important;
    }
    
    /* 确保设置面板内的按钮装饰线不被压缩 */
    #panel-settings .enf-deco-line {
        flex: 0 0 50px !important; 
        min-width: 50px;
    }
}

/* 强制横屏模式下的适配 - 系统设置面板 */
.force-landscape-mode #panel-settings.info-panel.type-wide {
    width: 480px !important;
    height: 280px !important;
    aspect-ratio: auto !important;
}

.force-landscape-mode #panel-settings .enf-deco-line {
    flex: 0 0 50px !important;
    min-width: 50px;
}

/* =========================================
   寻访记录面板样式
   ========================================= */
.history-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 40px;
    background-color: #f2f2f2;
    overflow: hidden;
}

.history-header-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 2px solid #ccc;
    font-weight: bold;
    color: #666;
    font-size: 14px;
    flex-shrink: 0;
}

.h-col {
    flex: 1;
    text-align: center;
}

.h-col.name { flex: 1; }
.h-col.time { flex: 1.5; }

.history-list-wrapper {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    /* 自定义滚动条 */
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.history-list-wrapper::-webkit-scrollbar {
    width: 6px;
}
.history-list-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.history-list-wrapper::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.history-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s;
}

.history-item:hover {
    background-color: rgba(0,0,0,0.02);
}

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

.history-item .h-col {
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-item .name {
    font-weight: bold;
}

.history-item.rarity-6 .name { color: #ff4500; }
.history-item.rarity-5 .name { color: #f1c40f; }
.history-item.rarity-4 .name { color: #9b59b6; }

.history-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding-top: 10px;
    border-top: 1px solid #ccc;
    flex-shrink: 0;
}

.history-pagination #history-page-num {
    font-weight: bold;
    color: #666;
    font-family: monospace;
    font-size: 16px;
    text-align: center;
}

.small-btn {
    height: 32px;
    padding: 0 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    color: #fff;
}

.small-btn .enf-text {
    margin: 0;
    color: inherit;
    text-align: center;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 移动端适配 */
@media screen and (max-width: 950px) {
    .history-container {
        padding: 15px 20px;
    }
    
    .history-item {
        font-size: 12px;
        padding: 10px 0;
    }
    
    .history-header-row {
        font-size: 12px;
    }
}

/* =========================================
   分享战绩弹窗样式
   ========================================= */
.stats-share-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: transparent;
    position: relative;
    z-index: 1001;
    /* 外框自适应屏幕，可以被压缩 */
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
}

.stats-image-wrapper {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: #000;
    /* 图片容器根据外框可用空间自适应，保持 1.6:1 宽高比 */
    width: min(800px, 90vw, calc((90vh - 120px) * 1.6));
    height: auto;
    aspect-ratio: 1.6 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 1;
}

.stats-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.stats-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    flex-shrink: 0;
}

/* 移动端适配 - 分享战绩弹窗 */
@media screen and (max-width: 950px) {
    .stats-share-panel {
        padding: 15px;
        gap: 15px;
    }
    
    .stats-image-wrapper {
        /* 根据屏幕高度计算最大宽度，减去按钮和间距的高度（约100px） */
        width: min(600px, 85vw, calc((90vh - 100px) * 1.6));
        aspect-ratio: 1.6 / 1;
    }
    
    .stats-actions {
        gap: 15px;
    }
    
    .stats-actions .enf-btn {
        height: 40px;
        font-size: 13px;
    }
    
    .stats-actions .enf-deco-line {
        flex: 0 0 50px;
    }
}

/* 竖屏适配 */
@media screen and (max-width: 950px) and (orientation: portrait) {
    .stats-share-panel {
        padding: 10px;
        gap: 10px;
    }
    
    .stats-image-wrapper {
        /* 竖屏时优先考虑高度限制 */
        width: min(500px, 85vw, calc((85vh - 90px) * 1.6));
        aspect-ratio: 1.6 / 1;
    }
    
    .stats-actions .enf-btn {
        height: 36px;
        font-size: 12px;
    }
}

/* 横屏适配 */
@media screen and (max-width: 950px) and (orientation: landscape) {
    .stats-share-panel {
        padding: 10px;
        gap: 10px;
    }
    
    .stats-image-wrapper {
        /* 横屏时高度受限更严重 */
        width: min(600px, 70vw, calc((80vh - 80px) * 1.6));
        aspect-ratio: 1.6 / 1;
    }
    
    .stats-actions .enf-btn {
        height: 32px;
        font-size: 11px;
        padding: 0 4px 0 12px;
    }
    
    .stats-actions .enf-deco-line {
        flex: 0 0 40px;
    }
}

/* 移动端长按保存提示 */
.mobile-save-hint {
    color: var(--yellow-normal);
    font-family: var(--font-tech);
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    text-shadow: 0 0 5px rgba(255, 239, 1, 0.3);
    margin-right: 10px;
    animation: pulse-hint 2s infinite;
    letter-spacing: 1px;
}

.mobile-save-hint::before {
    content: '// ';
    opacity: 0.5;
    margin-right: 4px;
}

@keyframes pulse-hint {
    0% { opacity: 0.7; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 0.7; transform: scale(0.98); }
}

/* =========================================
   兑换结果提示面板样式
   ========================================= */

.redeem-result-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.redeem-result-panel.active {
    opacity: 1;
}

.result-content {
    background: #fff;
    border-radius: var(--panel-radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    padding: 40px 30px 70px 30px;
    min-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
    animation: resultSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.27);
}

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

.result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    color: #fff;
    animation: iconPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s backwards;
}

@keyframes iconPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.result-content.success .result-icon {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
}

.result-content.error .result-icon {
    background: linear-gradient(135deg, #f44336, #ef5350);
    box-shadow: 0 4px 20px rgba(244, 67, 54, 0.4);
}

.result-message {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    text-align: center;
    letter-spacing: 0.5px;
    animation: messageFadeIn 0.4s ease 0.3s backwards;
}

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

.result-close-btn {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 50%);
    animation: btnSlideUp 0.4s ease 0.4s backwards;
}

/* 修复：点击时保持位置不变 */
.result-close-btn:active {
    transform: translate(-50%, 50%) scale(0.98);
}

.result-content .btn-wrapper {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 50%);
    border-radius: 26px;
    padding: 4px;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    width: fit-content;
    height: fit-content;
    animation: btnSlideUp 0.4s ease 0.4s backwards;
}

/* 修复：点击时保持位置不变 */
.result-content .btn-wrapper:active {
    transform: translate(-50%, 50%) scale(0.98);
}

@keyframes btnSlideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 70px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 50%);
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .result-content {
        min-width: 320px;
        max-width: 90vw;
        padding: 30px 20px 60px 20px;
    }
    
    .result-icon {
        width: 60px;
        height: 60px;
        font-size: 36px;
    }
    
    .result-message {
        font-size: 16px;
    }
}