/* ==========================================================================
   全新现代 UI 样式库 (参考 App 商城设计)
   ========================================================================== */

:root {
    --primary-color: #ff4757;      /* 主色调：珊瑚红 */
    --primary-light: #fff0f0;     /* 主色淡色背景 */
    --accent-color: #ffa502;       /* 强调色：橙金 */
    --bg-color: #f1f2f6;          /* 全局背景：浅灰蓝 */
    --card-bg: #ffffff;           /* 卡片背景：纯白 */
    --text-main: #2f3542;         /* 主文字颜色 */
    --text-muted: #747d8c;        /* 次要文字颜色 */
    --border-color: #f1f2f6;      /* 边框颜色 */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 30px rgba(0,0,0,0.08);
}

/* 基础设置 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(1200px 500px at 50% -200px, rgba(255, 107, 129, 0.08), transparent),
        radial-gradient(600px 300px at -100px 300px, rgba(255, 165, 2, 0.06), transparent),
        radial-gradient(800px 400px at 110% 60%, rgba(79, 195, 247, 0.06), transparent);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 500px; /* 移动端优先，大屏居中 */
    margin: 0 auto;
    position: relative;
}

 

/* 轮播图广告位 */
.banner-container {
    margin: 20px 15px;
    height: 160px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-lg);
    background: #fff;
}

.banner-wrapper {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.banner-slide {
    min-width: 100%;
    height: 100%;
    text-decoration: none;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff9a9e, #fad0c4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.banner-dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: all 0.3s;
}

.dot.active {
    width: 15px;
    border-radius: 3px;
    background: #fff;
}

/* 分类 Tab 导航 */
.nav-container {
    margin: 0 15px 20px;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 12px 10px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    position: sticky;
    top: 10px;
    z-index: 100;
}
.nav-container::-webkit-scrollbar { display: none; }

.category-tabs {
    display: flex;
    gap: 25px;
    padding: 0 10px;
    justify-content: flex-start;
    min-width: max-content;
}

.tab-item {
    padding: 8px 2px;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.tab-item.active {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 17px;
    transform: scale(1.05);
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #ff6b81);
    border-radius: 4px;
    animation: tabIn 0.3s forwards;
}

@keyframes tabIn {
    from { width: 0; left: 50%; }
    to { width: 100%; left: 0; }
}

/* 抽奖主体区域 */
.lottery-section {
    padding: 0 15px 120px;
}

.lottery-wrapper {
    background: var(--card-bg);
    border-radius: 28px;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    border: 1px solid rgba(0,0,0,0.02);
}

.lottery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    aspect-ratio: 1 / 1;
    width: 100%;
}

.item, .center {
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    transition: all 0.2s;
}

.item {
    background: #f8f9fa;
    border: 1px solid #eee;
}

.item img {
    width: 65%;
    height: 65%;
    object-fit: contain;
    margin-bottom: 8px;
}

.item span {
    font-size: 12px;
    color: var(--text-main);
    font-weight: 600;
    text-align: center;
    padding: 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 90%;
}

.center {
    background: linear-gradient(135deg, var(--primary-color), #ff6b81);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.3);
}

#drawBtn {
    width: 100%;
    height: 100%;
    background: none;
    border: none;
    font-size: 22px;
    font-weight: 800;
    color: white;
    cursor: pointer;
    letter-spacing: 1px;
}

#drawBtn:active {
    transform: scale(0.95);
}

.item.active {
    border: 3px solid var(--primary-color);
    background: var(--primary-light);
    transform: scale(1.08);
    z-index: 10;
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.2);
    animation: itemPulse 0.6s infinite alternate;
}

@keyframes itemPulse {
    from { transform: scale(1.05); }
    to { transform: scale(1.1); }
}

/* 抽奖记录 */
#records {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 25px 20px;
    box-shadow: var(--shadow-md);
    margin-top: 20px;
}

#records h2 {
    margin: 0 0 15px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

#records h2::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 4px;
}

#recordList {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 250px;
    overflow-y: auto;
}

#recordList li {
    background: #f8f9fa;
    margin-bottom: 10px;
    padding: 12px 15px;
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-muted);
    border: 1px solid #eee;
    transition: all 0.2s;
}

/* 中奖弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.show { display: flex; opacity: 1; }

.modal-content {
    width: 85%;
    max-width: 320px;
    background: white;
    border-radius: 30px;
    padding: 30px 20px;
    text-align: center;
    transform: translateY(30px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.modal.show .modal-content { transform: translateY(0); }

.modal h2 {
    color: var(--primary-color);
    font-size: 24px;
    margin: 0 0 20px;
    font-weight: 800;
}

#prizeImg {
    width: 160px;
    height: 160px;
    object-fit: contain;
    margin: 0 auto 15px;
    display: block;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1));
}

#prizeName {
    color: var(--text-main);
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 25px;
}

#confirmBtn {
    background: linear-gradient(135deg, var(--primary-color), #ff6b81);
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(255, 71, 87, 0.3);
    transition: all 0.3s;
}

#confirmBtn:active { transform: scale(0.95); }

/* 统一去兑奖按钮样式 */
#claimBtn {
    background: linear-gradient(135deg, var(--primary-color), #ff6b81);
    color: #fff;
    border: none;
    padding: 12px 40px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(255, 71, 87, 0.3);
    transition: all 0.3s;
    width: 100%;
}

#claimBtn:active { transform: scale(0.95); }

/* 兑奖表单美化 */
#claimModal .modal-content {
    max-width: 440px;
}
#claimForm label {
    display: block;
    font-size: 13px;
    color: #636e72;
    margin-bottom: 6px;
    margin-left: 4px;
    font-weight: 600;
}
#claimForm input[type="text"],
#claimForm textarea,
#claimForm input[type="file"] {
    width: 100%;
    padding: 12px 12px;
    border: 1.5px solid #eee;
    border-radius: 12px;
    background: #f8f9fa;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.2s;
    margin-bottom: 10px;
}
#claimForm input[type="text"]:focus,
#claimForm textarea:focus {
    border-color: var(--primary-color);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.1);
}
#claimForm button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 15px rgba(255, 71, 87, 0.2);
    transition: all 0.2s;
}
#claimCancel {
    width: 100%;
    background: #f1f2f6;
    color: #747d8c;
    border: none;
    padding: 10px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}
/* 底部 Dock 栏 */
.dock {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 999px;
    padding: 8px 25px;
    display: flex;
    gap: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1500;
}

/* 认证弹窗美化 */
.modal-content h2 {
    color: #2d3436;
    font-size: 20px;
    margin-bottom: 25px;
    font-weight: 700;
}

#authForm div {
    margin-bottom: 15px;
    text-align: left;
}

#authForm label {
    display: block;
    font-size: 13px;
    color: #636e72;
    margin-bottom: 6px;
    margin-left: 4px;
    font-weight: 600;
}

#authForm input {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid #eee;
    border-radius: 12px;
    background: #f8f9fa;
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.2s;
}

#authForm input:focus {
    border-color: var(--primary-color);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.1);
}

#authForm button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 8px 15px rgba(255, 71, 87, 0.2);
    transition: all 0.2s;
}

#authForm button[type="submit"]:active {
    transform: scale(0.98);
}

#authCancel {
    width: 100%;
    background: transparent;
    color: #b2bec3;
    border: none;
    padding: 10px;
    font-size: 14px;
    margin-top: 5px;
    cursor: pointer;
}

#tabLogin, #tabRegister {
    border: none;
    padding: 10px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#tabLogin.active, #tabRegister.active {
    background: var(--primary-color);
    color: white;
}

.dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 45px;
    text-decoration: none !important; /* 强制去掉下划线 */
}

/* 认证表单样式优化 */
#authModal .modal-content {
    max-width: 360px;
    padding: 30px;
}

#authForm {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 12px;
}

#authForm label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: -4px;
}

#authForm input {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid #eee;
    border-radius: 12px;
    background: #f8f9fa;
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.2s;
}

#authForm input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-light);
}

#authForm button[type="submit"] {
    background: linear-gradient(135deg, var(--primary-color), #ff6b81);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 6px 15px rgba(255, 71, 87, 0.3);
}

#authModal button#tabLogin, #authModal button#tabRegister {
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

#authModal button#tabLogin.active {
    background: var(--primary-color);
    color: white;
}

#authModal button#tabRegister.active {
    background: var(--primary-color);
    color: white;
}

#authModal button#authCancel {
    background: #f1f2f6;
    color: #747d8c;
    border: none;
    padding: 10px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

.dock-item.active {
    color: var(--primary-color);
}

.dock-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}

/* 响应式微调 */
@media (max-width: 400px) {
    .app-header h1 { font-size: 22px; }
    .lottery-wrapper { padding: 15px; }
    .lottery-grid { gap: 8px; }
    .banner-card { min-width: 130px; height: 75px; font-size: 14px; }
}
