* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

html, body {
    height: 100%;
    overflow: hidden; /* 防止滚动条 */
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.screen {
    display: none;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.screen.active {
    display: block;
    position: relative; /* active的screen使用相对定位 */
}

/* 欢迎页样式 */
#welcome-screen {
    background-image: url('购物商城.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#welcome-screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-content {
    text-align: center;
}

.enter-mall-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 20px 40px;
    border-radius: 50px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.enter-mall-btn:hover {
    background: linear-gradient(45deg, #45a049, #3d8b40);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(76, 175, 80, 0.4);
}

/* 商场内部页样式 */
#mall-screen {
    background-image: url('商场内部.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#mall-screen.active {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.mall-content {
    margin-left: 50px;
    height: 100vh;
    display: flex;
    align-items: center;
}

.floor-buttons {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 70vh;
    min-height: 400px;
}

.floor-btn {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 25px 50px;
    border-radius: 35px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(33, 150, 243, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    min-width: 180px;
    min-height: 80px;
}

#l2-btn {
    align-self: flex-start;
}

#l1-btn {
    align-self: center;
}

#b1-btn {
    align-self: flex-end;
}

.floor-btn:hover {
    background: linear-gradient(45deg, #1976D2, #1565C0);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 40px rgba(33, 150, 243, 0.4);
}

/* 水果超市外部页样式 */
#fruit-market-screen {
    background-image: url('水果超市内部.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#fruit-market-screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.market-content {
    text-align: center;
}

.enter-market-btn {
    background: linear-gradient(45deg, #FF9800, #F57C00);
    color: white;
    border: none;
    padding: 30px 60px;
    border-radius: 60px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 12px 40px rgba(255, 152, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.enter-market-btn:hover {
    background: linear-gradient(45deg, #F57C00, #E65100);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 16px 50px rgba(255, 152, 0, 0.4);
}

/* 水果商店样式 */
#fruit-shop {
    padding: 20px;
    overflow-y: auto; /* 允许垂直滚动浏览水果 */
    height: 100vh;
}

/* 设计台页面样式 */
#selected-fruits {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
    gap: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

/* 设计台页面中的标题栏样式 */
#selected-fruits .header {
    margin-bottom: 0;
    border-radius: 15px; /* 保持与画板一致的圆角 */
    padding: 15px 20px;
    flex-shrink: 0; /* 防止压缩 */
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2); /* 与画板相同的边框 */
}

.header h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.selected-count {
    font-size: 1.2em;
    color: #666;
    font-weight: bold;
}

/* 标题栏中的水果选择区域 */
.header-fruits {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: center;
    min-height: 40px;
}

.fruits-label {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
}

.selected-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #4CAF50 transparent;
}

.selected-list::-webkit-scrollbar {
    height: 4px;
}

.selected-list::-webkit-scrollbar-track {
    background: transparent;
}

.selected-list::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 2px;
}

/* 画板内的按钮 */
.canvas-brush-btn {
    position: absolute;
    top: 15px;
    right: 280px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
    z-index: 1000;
}

.canvas-brush-btn:hover {
    background: linear-gradient(45deg, #45a049, #3d8b40);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.canvas-brush-btn.active {
    background: linear-gradient(45deg, #ff9800, #f57c00);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.canvas-eraser-btn {
    position: absolute;
    top: 15px;
    right: 175px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
    z-index: 1000;
}

.canvas-eraser-btn:hover {
    background: linear-gradient(45deg, #45a049, #3d8b40);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.canvas-eraser-btn.active {
    background: linear-gradient(45deg, #ff9800, #f57c00);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.canvas-clear-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a5a);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
    z-index: 1000;
}

.canvas-clear-btn:hover {
    background: linear-gradient(45deg, #ee5a5a, #dc4545);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.canvas-back-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 1000;
}

.canvas-back-btn:hover {
    background: #ee5a5a;
    transform: scale(1.05);
}

/* SVG绘图层 */
.drawing-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50; /* 在水果上层 */
    border-radius: 15px;
    overflow: hidden;
}

/* 当绘图模式时，SVG层可以接收鼠标事件 */
.drawing-layer.drawing-mode {
    pointer-events: all;
}

/* 当橡皮擦模式时，SVG层可以接收鼠标事件 */
.drawing-layer.eraser-mode {
    pointer-events: all;
}

/* 绘制的路径样式 */
.drawing-layer path {
    fill: none;
    stroke: #ff4444;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 脉冲动画 */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.selected-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: grab;
    transition: all 0.3s ease;
    user-select: none;
    border: 2px solid transparent;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.selected-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: #4CAF50;
}

.selected-item:active {
    cursor: grabbing;
}

.selected-item.dragging {
    opacity: 0.7;
    transform: rotate(5deg) scale(0.9);
}

.selected-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 4px;
    pointer-events: none;
}

.selected-item .fruit-name {
    font-size: 0.8em;
    font-weight: bold;
    margin-bottom: 2px;
    color: #333;
    line-height: 1;
}

.selected-item .fruit-price {
    font-size: 0.7em;
    color: #4CAF50;
    font-weight: bold;
    background: rgba(76, 175, 80, 0.1);
    padding: 2px 6px;
    border-radius: 8px;
    display: inline-block;
    line-height: 1;
}

/* 设计工作台布局 - 改为上下结构 */
.design-workspace {
    display: flex;
    flex-direction: column;
    flex: 1; /* 使用弹性布局填充剩余空间 */
    gap: 0;
    overflow: hidden;
}

.fruit-canvas {
    flex: 1;
    background: rgba(255, 255, 255, 0.95); /* 与标题栏相同的背景透明度 */
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2); /* 与标题栏相同的边框 */
    min-height: 400px; /* 保持合理的最小高度 */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); /* 与标题栏相同的阴影 */
    backdrop-filter: blur(10px); /* 与标题栏相同的模糊效果 */
    width: 100%;
}

/* 画板内的水果 */
.canvas-fruit {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: move;
    transition: all 0.3s ease;
    user-select: none;
    border: 2px solid transparent;
    z-index: 10;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 果篮在画板中的特殊尺寸 */
.canvas-fruit[data-fruit-key="basket"],
.canvas-fruit[data-fruit-key="giftbox4"],
.canvas-fruit[data-fruit-key="giftbox6"] {
    width: 320px;
    height: 320px;
    padding: 20px;
    border-radius: 20px;
    z-index: 5;
}

.canvas-fruit:hover {
    border-color: #4CAF50;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

.canvas-fruit.dragging {
    opacity: 0.8;
    transform: rotate(3deg) scale(0.95);
    z-index: 100;
}

.canvas-fruit img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    pointer-events: none;
}

/* 果篮图片的特殊尺寸 */
.canvas-fruit[data-fruit-key="basket"] img,
.canvas-fruit[data-fruit-key="giftbox4"] img,
.canvas-fruit[data-fruit-key="giftbox6"] img {
    width: 280px;
    height: 280px;
}

.canvas-fruit .fruit-name {
    font-size: 0.9em;
    font-weight: bold;
    color: #333;
    margin: 0;
    display: none;
}

/* 拖拽放置区域高亮 */
.fruit-canvas.drag-over {
    background: rgba(76, 175, 80, 0.1);
    border: 2px dashed #4CAF50;
}

.fruit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.fruit-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.fruit-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.fruit-item.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
    box-shadow: 0 12px 35px rgba(76, 175, 80, 0.4);
    transform: translateY(-8px) scale(1.05);
}

.fruit-item.selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(76, 175, 80, 0.15) 50%, transparent 60%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.fruit-item.promotion {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.95);
}

.fruit-item.promotion.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
    box-shadow: 0 12px 35px rgba(76, 175, 80, 0.4);
    transform: translateY(-8px) scale(1.05);
}

.promotion-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
    transform: rotate(15deg);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.fruit-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.fruit-item:hover img {
    transform: scale(1.1);
}

.fruit-name {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.fruit-price {
    font-size: 1.1em;
    color: #666;
    font-weight: 600;
}

.fruit-item.promotion .fruit-price {
    color: #ff6b6b;
    font-weight: bold;
}

.confirm-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    z-index: 1000;
}

.confirm-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.confirm-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* 数量输入模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideIn 0.3s ease;
    overflow: hidden;
}

@keyframes slideIn {
    from { transform: scale(0.8) translateY(-20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.4em;
}

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

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    text-align: center;
}

.modal-body img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 20px;
    border-radius: 50%;
    border: 3px solid #4CAF50;
    padding: 10px;
    background: rgba(76, 175, 80, 0.1);
}

.quantity-input-group {
    margin: 20px 0;
}

.quantity-input-group label {
    display: block;
    margin-bottom: 15px;
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
}

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.quantity-controls button {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-controls button:hover {
    background: linear-gradient(45deg, #45a049, #3d8b40);
    transform: scale(1.1);
}

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

#quantity-input {
    width: 80px;
    height: 40px;
    border: 2px solid #4CAF50;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    background: rgba(255, 255, 255, 0.9);
    outline: none;
    transition: all 0.3s ease;
    user-select: auto;
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
}

#quantity-input:focus {
    border-color: #45a049;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
    transform: scale(1.05);
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.confirm-quantity-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.confirm-quantity-btn:hover {
    background: linear-gradient(45deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.cancel-btn {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #ddd;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #e0e0e0;
    border-color: #bbb;
    transform: translateY(-2px);
}

/* 果篮样式 */
.fruit-item.basket-item {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.95);
}

.fruit-item.basket-item.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
    box-shadow: 0 12px 35px rgba(76, 175, 80, 0.4);
    transform: translateY(-8px) scale(1.05);
}

.fruit-item.basket-item .fruit-price {
    display: none;
}

 