* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 隐藏滚动条 */
html {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

html::-webkit-scrollbar {
    width: 0; /* Chrome, Safari, Opera */
    display: none;
}

body {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

body::-webkit-scrollbar {
    width: 0; /* Chrome, Safari, Opera */
    display: none;
}

/* 隐藏所有元素的滚动条 */
*::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

body {
    font-family: 'Arial', sans-serif;
    background: #000000;
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="%23FFD700" opacity="0.3"/><circle cx="80" cy="40" r="1.5" fill="%23FFA500" opacity="0.4"/><circle cx="60" cy="80" r="1" fill="%23FFD700" opacity="0.2"/></svg>') repeat; */
    /* animation: sparkle 10s linear infinite; */
    pointer-events: none;
    z-index: 0;
}

@keyframes sparkle {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-100px); }
}

.container {
    margin: 0 auto;
    position: relative;
    padding-bottom: 100px;
    z-index: 1;
}

.home-img {
    width: 100%;
}

/* 转盘区域 */
.lottery-container {
    display: flex;
    justify-content: center;
    position: relative;
    /* height: 1080px; */
    margin-bottom: 400px;
    margin-top: 165px;
    /* background-image: url('../image/lottery_bg.png'); */
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
}

.lottery-wheel-wrapper {
    position: relative;
    width: 722px;
    aspect-ratio: 1 / 1;
    margin-top: -137px;
    /* 使用变量统一控制内边距，避免与 aspect-ratio 冲突 */
    --wheel-inset: 66px;
    background-image: url('../image/lottery.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    transform-origin: center center;
}

/* 添加光效层 */
.lottery-wheel-wrapper::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle at center,
        transparent 30%,
        rgba(255, 215, 0, 0.1) 40%,
        transparent 50%,
        rgba(255, 215, 0, 0.05) 60%,
        transparent 70%);
    animation: glow-rotate 20s linear infinite;
    pointer-events: none;
}

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

.lottery-wheel {
    position: absolute;
    /* 通过 inset 代替外层 padding，确保外框保持严格正方形（兼容 Safari） */
    inset: var(--wheel-inset);
    border-radius: 50%;
    overflow: hidden;
    /* background-image: url('../image/lottery-pan.png'); */
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    transform-origin: center center;
}

.wheel-segments {
    position: absolute;
    /* width: 100%; */
    /* height: 100%; */
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    border-radius: 50%;
    z-index: 2;
}

.wheel-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    top: 50%;
    left: 50%;
    transform-origin: 0 0;
    overflow: visible;
}

/* Dynamic segment rotation will be set via JavaScript inline styles */

.segment-content {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.segment-inner {
    position: absolute;
    top: 28%;
    left: 28%;
    width: 40%;
    height: 40%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    /* 移除 transform */
}

/* Dynamic inner rotation will be set via JavaScript inline styles */

.segment-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.2));
}

.segment-content img.segment-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.segment-text {
    /* color: #AE6C24; */
    text-align: center;
    font-family: Asap;
    font-size: 22px;
    font-style: normal;
    font-weight: 600;
    line-height: 22px;
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.spin-button {
    width: 140px;
    height: 170px;
    border-radius: 50%;
    background: transparent;
    background-image: url('../image/lottery_index.png');
    background-size: 100% auto;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.spin-button:hover {
    transform: scale(1.05);
}

.spin-button:active {
    transform: scale(0.95);
}

.spin-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 规则说明 */
.rule-section {
    text-align: center;
    margin-bottom: 120px;
}

.rule-section h3 {
    position: relative;
    color: #FFF;
    width: 240px;
    margin: 0px auto;
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 64px;
}

.rule-section h3::before {
    content: '';
    display: block;
    width: 100%;
    height: 40%;
    margin-top: 8%;
    background: linear-gradient(90deg, #E5832E 0%, #AAD437 100%);
    filter: blur(24.850000381469727px);
    position: absolute;
    top: 0;
    left: 0;
}

.rule-content {
    margin: 0px auto;
    width: 1000px;
    flex-shrink: 0;
    border-radius: 20px;
    padding: 40px 30px;
    border: 4px solid rgba(161, 161, 161, 0.00);
    background: linear-gradient(91deg, #2C2D28 2.65%, #0D1005 67.01%);
    box-shadow: -4px -4px 4px 0px rgba(28, 41, 215, 0.25) inset, 4px 4px 4px 0px rgba(28, 41, 215, 0.25) inset;
    color: #FFF;
    font-family: Asap;
    text-align: start;
    font-size: 16px;
    font-weight: 500;
    line-height: 26px;
}

/* 奖品列表 */
.prize-section {
    text-align: center;
}

.prize-section h3 {
    position: relative;
    color: #FFF;
    width: 240px;
    margin: 0px auto;
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 64px;
}

.prize-section h3::before {
    content: '';
    display: block;
    width: 100%;
    height: 40%;
    margin-top: 8%;
    background: linear-gradient(90deg, #E5832E 0%, #AAD437 100%);
    filter: blur(24.850000381469727px);
    position: absolute;
    top: 0;
    left: 0;
}

.prize-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    min-height: 300px;
}

/* 加载状态 */
.loading-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    z-index: 5;
}

/* 全局加载状态 */
.global-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    border-top-color: #FFD700;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    color: #FFD700;
    font-size: 18px;
    font-weight: 600;
}

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

.prize-item {
    width: 306px;
    height: 298px;
    flex-shrink: 0;
    cursor: pointer;
    background-image: url('../image/prize_item_bg.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.prize-item:hover {
    transform: translateY(-8px);
}

.prize-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.prize-item img.prize-icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.prize-name {
    color: #FFF;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    line-height: 24px;
    width: 80%;
}

/* 中奖弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1810 100%);
    border-radius: 25px;
    padding: 40px 30px;
    padding-top: 20px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 3px solid #FFD700;
    box-shadow:
        0 25px 80px rgba(255, 215, 0, 0.5),
        inset 0 0 30px rgba(255, 215, 0, 0.1);
    transform: scale(0.7);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.modal-close{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end; /* 随 html[dir] 自动镜像 */
  cursor: pointer;
}

/* 查询结果正文：用逻辑对齐，RTL 下自动靠右 */
.query-result-body {
  text-align: start;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* .modal-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg 60deg,
        rgba(255, 215, 0, 0.1) 60deg 120deg,
        transparent 120deg 180deg,
        rgba(255, 215, 0, 0.1) 180deg 240deg,
        transparent 240deg 300deg,
        rgba(255, 215, 0, 0.1) 300deg 360deg
    );
    animation: rotate 4s linear infinite;
    z-index: -1;
} */

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

.modal-header {
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.modal-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 1.5s infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    60% { transform: translateY(-8px); }
}

.modal-title {
    font-size: 2.5rem;
    color: #FFD700;
    margin-bottom: 15px;
    text-shadow:
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 15px rgba(255, 215, 0, 0.5);
    font-weight: bold;
}

.modal-body {
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.prize-display {
    background: rgba(139, 69, 19, 0.4);
    border-radius: 20px;
    padding: 30px;
    display: flex   ;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    border: 2px solid rgba(255, 215, 0, 0.5);
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.1);
}

.prize-display .prize-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.prize-display .prize-name {
    font-size: 2rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.modal-message {
    font-size: 1.3rem;
    color: #E0E0E0;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.modal-footer {
    display: flex;
    gap: 20px;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.claim-button, .close-button {
    padding: 15px 35px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.claim-button {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.claim-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.8);
}

.close-button {
    background: rgba(139, 69, 19, 0.6);
    color: #fff;
    border: 2px solid rgba(255, 215, 0, 0.5);
}

.close-button:hover {
    background: rgba(139, 69, 19, 0.8);
    border-color: #FFD700;
    transform: translateY(-3px);
}

/* 彩带效果 */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: confetti-fall 2s linear forwards;
    z-index: 999;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}




/* 移动端兼容优化 */

/* 添加移动端基础优化 */
html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 转盘区域移动端优化 */
.lottery-container {
    max-width: 100vw;
    /* overflow: hidden; */
    /* 添加移动端Safari特殊优化 */
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.lottery-wheel-wrapper {
    will-change: transform;
    transform: translateZ(0);
    /* 添加移动端Safari特殊优化 */
    -webkit-transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    position: relative;
    z-index: 1;
}

.lottery-wheel {
    will-change: transform;
    transform: translateZ(0);
}

/* 触摸优化 */
.spin-button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.prize-item {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.claim-button, .close-button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
    min-width: 44px;
}

/* 平板设备优化 (769px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .lottery-container {
        /* height: 800px; */
        margin-bottom: 200px;
        margin-top: 100px;
    }

    .lottery-wheel-wrapper {
        width: 500px;
        aspect-ratio: 1 / 1;
        --wheel-inset: 30px;
        margin-top: -100px;
    }

    .prize-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
        max-width: 800px;
    }

    .rule-content {
        width: 90%;
        padding: 35px 25px;
    }
}

/* 中等屏幕设备优化 (481px - 768px) */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .lottery-container {
        /* height: 600px; */
        margin-bottom: 120px;
        margin-top: 80px;
        padding: 20px;
    }

    .lottery-wheel-wrapper {
        width: min(400px, 80vw);
        aspect-ratio: 1 / 1;
        --wheel-inset: min(50px, 10vw);
         margin-top: -60px;
    }

    .segment-text {
        font-size: 18px;
    }

    .segment-icon {
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
    }

    .segment-content img.segment-icon {
        width: 50px;
        height: 50px;
    }

    .prize-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 20px;
    }

    .prize-item {
        width: 100%;
        max-width: 350px;
        margin: 0 auto;
        height: auto;
        min-height: 250px;
    }

    .prize-icon {
        width: 80px;
        height: 80px;
        font-size: 2.8rem;
    }

    .prize-item img.prize-icon {
        width: 80px;
        height: 80px;
    }

    .prize-name {
        font-size: 20px;
    }

    .modal-content {
        padding: 30px 20px;
        max-width: 90vw;
        max-height: 85vh;
        overflow-y: auto;
    }

    .modal-footer {
        flex-direction: column;
        gap: 15px;
    }

    .claim-button, .close-button {
        width: 100%;
        padding: 15px 20px;
        font-size: 16px;
    }

    .rule-content {
        padding: 25px 20px;
        width: 95%;
        font-size: 15px;
    }

    .rule-section h3, .prize-section h3 {
        font-size: 24px;
        margin-bottom: 30px;
    }
}

/* 小屏手机优化 (320px - 480px) */
@media (max-width: 480px) {
    .lottery-container {
        /* height: 450px; */
        margin-bottom: 80px;
        margin-top: 50px;
        padding: 15px;
    }

    .lottery-wheel-wrapper {
        width: min(320px, 85vw);
        aspect-ratio: 1 / 1;
        --wheel-inset: min(40px, 8vw);
    }

    .wheel-center {
        width: min(80px, 16vw);
        height: min(80px, 16vw);
    }

    .spin-button {
        width: min(110px, 22vw);
        height: min(140px, 28vw);
    }

    .segment-text {
        font-size: 12px;
        line-height: 1.2;
    }

    .segment-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .segment-content img.segment-icon {
        width: 40px;
        height: 40px;
    }

    .segment-inner {
        gap: 15px;
    }

    .prize-item {
        min-height: 220px;
        padding: 15px;
    }

    .prize-icon {
        width: 70px;
        height: 70px;
        font-size: 2.5rem;
        margin-bottom: 15px;
    }

    .prize-item img.prize-icon {
        width: 70px;
        height: 70px;
    }

    .prize-name {
        font-size: 18px;
        line-height: 1.3;
    }

    .modal-content {
        padding: 25px 15px;
        max-width: 95vw;
        border-radius: 20px;
    }

    .modal-title {
        font-size: 1.8rem;
    }

    .modal-icon {
        font-size: 3.5rem;
    }

    .prize-display .prize-icon {
        font-size: 3rem;
    }

    .prize-display .prize-name {
        font-size: 1.5rem;
    }

    .modal-message {
        font-size: 1.1rem;
    }

    .rule-content {
        padding: 20px 15px;
        font-size: 14px;
        line-height: 1.6;
    }

    .rule-section h3, .prize-section h3 {
        font-size: 22px;
        margin-bottom: 25px;
    }
}

/* 超小屏设备优化 (320px 及以下) */
@media (max-width: 360px) {
    .lottery-container {
        /* height: 400px; */
        margin-bottom: 40px;
        margin-top: 50px;
    }

    .lottery-wheel-wrapper {
        width: min(280px, 90vw);
        aspect-ratio: 1 / 1;
        --wheel-inset: min(35px, 7vw);
    }

    .spin-button {
        width: min(90px, 20vw);
        height: min(120px, 26vw);
    }

    .segment-text {
        font-size: 12px;
    }

    .segment-icon {
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }

    .segment-content img.segment-icon {
        width: 35px;
        height: 35px;
    }

    .prize-item {
        min-height: 200px;
    }

    .prize-icon {
        width: 60px;
        height: 60px;
        font-size: 2.2rem;
    }

    .prize-item img.prize-icon {
        width: 60px;
        height: 60px;
    }

    .prize-name {
        font-size: 16px;
    }

    .modal-content {
        padding: 20px 12px;
    }

    .rule-content {
        padding: 18px 12px;
    }

    .rule-section h3, .prize-section h3 {
        font-size: 20px;
    }
}

/* 横屏模式优化 */
@media (max-height: 600px) and (orientation: landscape) {
    .lottery-container {
        /* height: auto; */
        margin-top: 20px;
        padding: 10px;
    }

    .lottery-wheel-wrapper {
        width: min(350px, 50vh);
        aspect-ratio: 1 / 1;
    }

    .modal-content {
        max-height: 90vh;
        padding: 20px;
    }

    .rule-content {
        padding: 20px;
    }

    .prize-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .lottery-wheel-wrapper,
    .lottery-wheel,
    .prize-item {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 无障碍支持 - 减少动画 */
@media (prefers-reduced-motion: reduce) {
    .lottery-wheel-wrapper::before,
    .modal-icon,
    .confetti {
        animation: none;
    }

    .prize-item:hover,
    .spin-button:hover,
    .claim-button:hover,
    .close-button:hover {
        transform: none;
    }
}


.text-ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-multiline-ellipsis {
  display: -webkit-box;
  -webkit-line-clamp: 2; /* 控制显示的行数 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
