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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
    overflow-x: hidden;
    justify-content: center;
    align-items: center;
}

/* 网格背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(200, 200, 200, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(200, 200, 200, 0.3) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
}

.drink-lottery-container {
    width: 100%;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 100px;
}

.drink-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
     margin-bottom: 0px!important;
}

/* 抽奖容器 */
.drink-lottery-main {
    width: 100%;
    max-width: 800px;
    margin-bottom: 20px;
}

/* 标题区域 */
.drink-title-section {
    margin-bottom: 30px;
    display: flex
;
    align-content: center;
    justify-content: center;
    gap: 5px;
}
    


.drink-title {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
   
}

/* 结果卡片 */
.result-card {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    background: rgb(255 255 255 / 79%);
    border-radius: 12px;
    padding: 5px 8px 5px 2px;
    backdrop-filter: blur(10px);
    border:2px solid #d7d7d7;
    animation: resultCardShow 0.6s ease-out;
    margin-left: 5px;
}

.result-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.result-brand {
    font-size: 10px;
    color: #999;
    opacity: 0.6;
    line-height: 1;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    font-weight: 400;
}

.result-name {
    font-size: 1rem;
    font-weight: 600;
    color: #485463;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.result-card i {
    font-size: 35px;
    font-weight: 500;
}

@keyframes resultCardShow {
    0% {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) translateY(-10px);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* 分类提示 */
.category-hint {
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.4;
    max-width: 600px;
    word-wrap: break-word;
    word-break: break-all;
    text-align: center;
}

.lottery-box {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.items-track {
    display: flex;
    align-items: center;
    position: relative;
    gap: 15px;
    /* 硬件加速优化 */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.lottery-item {
    min-width: 85px;
    height: 85px;
    background: white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
    border: 2px solid #e1e8ed;
    position: relative;
    /* 性能优化 */
    will-change: transform, box-shadow;
    transform: translateZ(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.lottery-item i {
    font-size: 35px;
    margin-bottom: 5px;
}

.lottery-item .item-brand {
    font-size: 10px;
    color: #999;
    opacity: 0.4;
    text-align: center;
    margin-bottom: 2px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
    max-width: 100%;
}

.lottery-item .item-name {
    font-size: 11px;
    color: #2c3e50;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
    max-width: 100%;
}

.lottery-item.highlight {
    transform: scale(1.1);
    border-color: #3498db;
    box-shadow: 0 12px 24px rgba(52, 152, 219, 0.3);
}

/* 选择器线条 */
.selector-line {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 100px;
    background: linear-gradient(to bottom, transparent, #e74c3c, transparent);
    border-radius: 2px;
    z-index: 10;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}



/* 底部导航 */
.drink-bottom-nav {
    bottom:100px ;
    z-index: 100;
    margin: 100px 0;
}

.drink-nav-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 40px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.drink-nav-items {
    display: flex;
    gap: 10px;
}

.drink-nav-item {
    background: transparent;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.drink-nav-item:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.drink-nav-item.active {
    background: #3498db;
    color: white;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.start-btn {
    background: #2c3e50;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 12px rgba(44, 62, 80, 0.3);
    margin-left: 8px;
}

.start-btn:hover {
    background: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(44, 62, 80, 0.4);
}

.start-btn:active {
    transform: translateY(0);
}

.start-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 8px rgba(149, 165, 166, 0.3);
}

/* 动画效果 */
.lottery-item.highlight {
    transform: scale(1.15) translateZ(0);
    border-color: #3498db;
    box-shadow: 0 12px 24px rgba(52, 152, 219, 0.3), 0 0 20px rgba(52, 152, 219, 0.2);
    animation: highlight-glow 1s ease-in-out infinite alternate;
}

@keyframes highlight-glow {
    0% { 
        box-shadow: 0 12px 24px rgba(52, 152, 219, 0.3), 0 0 20px rgba(52, 152, 219, 0.2);
    }
    100% { 
        box-shadow: 0 16px 32px rgba(52, 152, 219, 0.4), 0 0 30px rgba(52, 152, 219, 0.3);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        align-items: center;
        justify-content: center;
        padding: 10px 0 120px 0;
    }
    
    .drink-lottery-container {
        padding: 15px 10px;
        min-height: auto;
        justify-content: center;
    }
    
    .drink-title {
        font-size: 2rem;
    }
    
    .category-hint {
        font-size: 12px;
        max-width: 90%;
        line-height: 1.3;
    }
    
    .lottery-box {
        padding: 15px;
    }

    
    .lottery-item {
        min-width: 80px;
        height: 80px;
    }
    
    .lottery-item i {
        font-size: 30px;
    }
    
    .selector-line {
        height: 100px;
    }
    
    .drink-nav-container {
        padding: 8px 10px;
        gap: 10px;
    }
    
    .drink-nav-item {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .start-btn {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
}

/* 自定义功能样式 */
.category-hint-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.customize-btn {
    background: transparent;
    color: #303E4E;
    border: none;
    padding: 5px 8px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.customize-btn:hover {
    color: #303E4E;
    background:#303e4e31;
}

.customize-btn:active {
    color: #303E4E;
}

/* 自定义弹窗样式 */
.drink-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.drink-modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.drink-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drink-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3em;
    font-weight: 600;
}

.drink-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.drink-modal-close:hover {
    background: #f5f5f5;
    color: #666;
}

.drink-modal-body {
    padding: 0 24px 24px;
}

.category-selector {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    background: rgba(52, 152, 219, 0.08);
    padding: 4px;
    border-radius: 16px;
}

.category-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    flex: 1;
    text-align: center;
    color: #7f8c8d;
}

.category-btn.active {
    background: #3498db;
    color: white;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    transform: translateY(-1px);
}

.category-btn:hover:not(.active) {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.add-section {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

#newBrandInput,
#newItemInput {
    padding: 8px 12px;
    border: 1px solid rgba(52, 152, 219, 0.2);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    min-width: 0;
}

#newBrandInput {
    flex: 1;
    min-width: 80px;
}

#newItemInput {
    flex: 1.2;
    min-width: 100px;
}

#newBrandInput:focus,
#newItemInput:focus {
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#newItemInput::placeholder {
    color: #bdc3c7;
}
#newBrandInput::placeholder {
    color: #bdc3c7;
}
.add-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 88px;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.add-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
}

.add-btn:active {
    transform: translateY(0);
}

.items-grid {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 2px;
}

.items-grid::-webkit-scrollbar {
    width: 4px;
}

.items-grid::-webkit-scrollbar-track {
    background: rgba(52, 152, 219, 0.1);
    border-radius: 2px;
}

.items-grid::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.3);
    border-radius: 2px;
}

.items-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.5);
}

.item-row {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid rgba(52, 152, 219, 0.1);
    white-space: nowrap;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.item-row:hover {
    background: white;
    border-color: rgba(52, 152, 219, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.icon-recha::before{
    font-size: 30px;
    margin: 0 3px;
}
.item-name {
    font-size: 13px;
    color: #2c3e50;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.delete-item-btn {
    background: #95a5a636;
    color: #5e5e5e;
    border: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.delete-item-btn:hover {
    background: #95a5a65b;
    transform: scale(1.05);
}

.drink-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.drink-action-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drink-action-btn.save {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.drink-action-btn.save:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
}

.drink-action-btn.cancel {
    background: rgba(149, 165, 166, 0.1);
    color: #7f8c8d;
    border: 1px solid rgba(149, 165, 166, 0.3);
}

.drink-action-btn.cancel:hover {
    background: rgba(149, 165, 166, 0.2);
    color: #2c3e50;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .category-hint-container {
        gap: 10px;
    }
    
    .customize-btn {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .drink-modal-content {
        width: 95%;
        max-width: 350px;
        margin: 10px;
    }
    
    .drink-modal-header {
        padding: 18px 20px 14px;
    }
    
    .drink-modal-header h3 {
        font-size: 18px;
    }
    
    .drink-modal-body {
        padding: 0 20px 20px;
    }
    
    .category-selector {
        margin-bottom: 16px;
    }
    
    .category-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .add-section {
        margin-bottom: 16px;
    }
    
    #newBrandInput,
    #newItemInput {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .add-btn {
        padding: 8px 10px;
        font-size: 14px;
        min-width: 40px;
    }
    
    .items-grid {
        max-height: 160px;
        margin-bottom: 16px;
    }
    
    .item-name {
        font-size: 12px;
        max-width: 80px;
    }
    
    .delete-item-btn {
        width: 14px;
        height: 14px;
        font-size: 9px;
    }
    
    .drink-action-btn {
        padding: 6px 8px;
        font-size: 13px;
        max-width: 80px;
    }
    .category-hint-container{
        flex-direction: column-reverse;
    }
}