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

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(180deg, #ff6b6b 0%, #ee5a5a 50%, #d63031 100%);
    min-height: 100vh;
    color: #333;
}

/* SVG 图标通用样式 */
[data-icon] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
[data-icon] svg {
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.icon-sm { font-size: 16px; }
.icon-md { font-size: 20px; }
.icon-lg { font-size: 28px; }

/* 顶部导航栏 */
.navbar {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: bold;
    color: #d63031;
    text-decoration: none;
}
.nav-logo-icon { font-size: 24px; }
.nav-links {
    display: flex;
    gap: 8px;
}
.nav-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    transition: all .2s;
}
.nav-links a:hover {
    background: #fff0f0;
    color: #d63031;
}
.nav-links a.active {
    background: #d63031;
    color: #fff;
}
.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #333;
}
.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffe5e5;
    color: #d63031;
    font-size: 16px;
}
.nav-username { font-weight: 500; }
.nav-logout {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #999;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}
.nav-logout:hover { color: #d63031; }
.nav-btn-login, .nav-btn-register {
    padding: 6px 18px;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
}
.nav-btn-login {
    color: #d63031;
    border: 1px solid #d63031;
}
.nav-btn-register {
    background: #d63031;
    color: #fff;
}


.lottery-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* 活动标题 */
.lottery-header {
    text-align: center;
    margin-bottom: 20px;
}

.activity-title {
    font-size: 28px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 8px;
}

.activity-time {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

/* 转盘区域 */
.wheel-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.wheel-outer {
    position: relative;
    width: 320px;
    height: 320px;
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 0 8px #ffd700, 0 0 0 12px #ff9500, 0 8px 30px rgba(0, 0, 0, 0.3);
    transition: transform 5s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

/* 转盘灯光 */
.wheel-lights {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.wheel-lights .light {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 8px #fff, 0 0 12px #ffd700;
    animation: blink 1s infinite alternate;
}

@keyframes blink {
    0% { opacity: 0.3; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

/* 中心按钮 */
.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ee0979);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    border: 4px solid #fff;
    transition: transform 0.2s;
}

.wheel-center:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.wheel-center:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.draw-text {
    color: #fff;
    font-size: 22px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.wheel-center.disabled {
    background: linear-gradient(135deg, #ccc, #999);
    cursor: not-allowed;
}

/* 指针 */
.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 28px solid #ffd700;
    z-index: 11;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* 用户信息栏 */
.user-info-bar {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #333;
}

.user-detail .layui-icon {
    color: #ee5a5a;
    font-size: 18px;
}

.remain-times {
    font-size: 14px;
    color: #666;
}

.remain-times strong {
    color: #ee5a5a;
    font-size: 18px;
    margin: 0 2px;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.action-buttons .layui-btn {
    flex: 1;
    border-radius: 10px;
}

/* 奖品预览 */
.prize-preview {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.prize-preview h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.prize-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.prize-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f8f8;
    border-radius: 8px;
}

.prize-item img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

.prize-item-info {
    flex: 1;
    min-width: 0;
}

.prize-item-title {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prize-item-stock {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* 中奖弹窗 */
.win-modal .layui-layer-content {
    text-align: center;
}

.win-prize-icon {
    width: 80px;
    height: 80px;
    margin: 20px auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ff9500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.win-prize-name {
    font-size: 22px;
    color: #ee5a5a;
    font-weight: bold;
    margin-bottom: 8px;
}

.win-tip {
    font-size: 13px;
    color: #999;
    margin-bottom: 20px;
}

/* 规则弹窗 */
.rules-content {
    padding: 10px 5px;
    line-height: 1.8;
    color: #666;
    font-size: 14px;
}

.rules-content h4 {
    color: #333;
    margin-bottom: 10px;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
