/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: linear-gradient(135deg, #f5f0e8 0%, #e8e0d0 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.app {
    max-width: 100%;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
}

@media (min-width: 430px) {
    .app {
        max-width: 430px;
        padding: 20px;
    }
}

@media (min-width: 768px) {
    .app {
        max-width: 500px;
        padding: 24px;
    }
}

/* 头部 */
.header {
    text-align: left;
    margin-bottom: 12px;
    padding-left: 8px;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 2px;
    background: linear-gradient(135deg, #4a3728 0%, #8b6914 50%, #c9a86c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 14px;
    background: linear-gradient(135deg, #8b7355 0%, #a08050 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 画布区 - 手串展示 */
.canvas-area {
    background: linear-gradient(145deg, #ffffff 0%, #f8f5f0 100%);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 
        0 8px 30px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.8);
    position: relative;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@media (min-width: 430px) {
    .canvas-area {
        min-height: 380px;
        padding: 20px;
    }
}

@media (min-width: 768px) {
    .canvas-area {
        min-height: 420px;
        padding: 24px;
    }
}

/* 设置按钮栏 */
.settings-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    width: calc(100% - 20px);
    margin-left: 10px;
    margin-right: 10px;
}

/* 设置控制组 */
.setting-control {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 6px 6px;
    background: linear-gradient(145deg, #ffffff 0%, #f5f0e8 100%);
    border: 1px solid #e8e0d8;
    border-radius: 10px;
}

/* +/- 文字按钮 */
.setting-btn-text {
    font-size: 20px;
    color: #c9a86c;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    padding: 4px 8px;
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
}

.setting-btn-text:active {
    color: #a08050;
    transform: scale(0.95);
}

.setting-btn-text:hover {
    color: #b8956a;
}

/* 设置显示区 */
.setting-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 70px;
}

.setting-display .setting-label {
    font-size: 11px;
    color: #8b7355;
}

.setting-display .setting-value {
    font-size: 14px;
    color: #4a3728;
    font-weight: 600;
}

/* 周长信息 */
.circumference-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: rgba(201, 168, 108, 0.1);
    border-radius: 8px;
    font-size: 11px;
    color: #8b7355;
    margin-bottom: 12px;
}

.circumference-info strong {
    color: #4a3728;
    font-size: 12px;
}

.setting-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    background: linear-gradient(145deg, #ffffff 0%, #f5f0e8 100%);
    border: 1px solid #e8e0d8;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 50px;
}

.setting-btn:active {
    transform: scale(0.98);
    background: #f0e8e0;
}

.setting-label {
    font-size: 10px;
    color: #8b7355;
}

.setting-value {
    font-size: 13px;
    color: #4a3728;
    font-weight: 600;
}

/* 设置弹窗 */
.setting-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.setting-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.setting-modal-content {
    position: relative;
    background: linear-gradient(145deg, #ffffff 0%, #f8f5f0 100%);
    border-radius: 20px;
    padding: 24px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.setting-modal-content h3 {
    font-size: 18px;
    color: #4a3728;
    margin-bottom: 20px;
}

.size-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.size-option {
    padding: 12px 8px;
    background: #f5f0e8;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    color: #4a3728;
    cursor: pointer;
    transition: all 0.2s;
}

.size-option.active {
    background: linear-gradient(135deg, #c9a86c 0%, #b8956a 100%);
    color: white;
    border-color: #a08050;
}

.size-option:active {
    transform: scale(0.95);
}

/* 画布布局 - 居中 */
.canvas-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

/* 侧面板 */
.side-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 50px;
}

.panel-label {
    font-size: 11px;
    color: #8b7355;
    font-weight: 500;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 2px;
}

.panel-value {
    font-size: 12px;
    color: #c9a86c;
    font-weight: 600;
}

/* 左侧竖式刻度转盘 */
.vertical-dial {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .vertical-dial {
        height: 220px;
    }
}

.v-dial-track {
    position: relative;
    width: 8px;
    height: 100%;
    background: linear-gradient(180deg, #e0d8d0 0%, #d0c8c0 100%);
    border-radius: 4px;
    box-shadow: inset 1px 0 3px rgba(0,0,0,0.2);
}

.v-dial-marks {
    position: absolute;
    top: 0;
    left: -12px;
    right: -12px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px 0;
}

.v-dial-mark {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    height: 20px;
}

.v-dial-mark::before {
    content: '';
    width: 12px;
    height: 2px;
    background: #b0a090;
    border-radius: 1px;
}

.v-dial-mark.major::before {
    width: 16px;
    height: 3px;
    background: #8b7355;
}

.v-dial-mark span {
    font-size: 10px;
    color: #8b7355;
}

.v-dial-slider {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: linear-gradient(145deg, #f5f0e8 0%, #e8e0d5 100%);
    border-radius: 50%;
    box-shadow: 
        0 3px 8px rgba(0,0,0,0.2),
        inset 0 1px 2px rgba(255,255,255,0.8);
    cursor: grab;
    transition: transform 0.1s;
    z-index: 10;
}

.v-dial-slider:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.1);
}

.v-dial-slider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: linear-gradient(145deg, #c9a86c 0%, #b8956a 100%);
    border-radius: 50%;
}

/* 右侧竖式手串圈选择 */
.vertical-wheel {
    height: 180px;
    background: #faf8f5;
    border-radius: 12px;
    border: 1px solid #e8e0d8;
    overflow: hidden;
}

@media (min-width: 768px) {
    .vertical-wheel {
        height: 220px;
    }
}

.v-wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    gap: 4px;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
}

.v-wheel-container::-webkit-scrollbar {
    display: none;
}

.v-wheel-item {
    padding: 6px 10px;
    background: #f5f0e8;
    border-radius: 16px;
    font-size: 12px;
    color: #8b7355;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    min-width: 36px;
    text-align: center;
}

.v-wheel-item:hover {
    background: #ebe5dc;
}

.v-wheel-item.active {
    background: linear-gradient(135deg, #c9a86c 0%, #b8956a 100%);
    color: white;
    border-color: #a08050;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(201, 168, 108, 0.3);
}

/* 盘子容器 - 完全居中 */
.plate-container {
    position: relative;
    width: 331px;
    height: 331px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plate-base {
    z-index: 1;
}

.game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    cursor: grab;
    pointer-events: auto;
}

.game-canvas:active {
    cursor: grabbing;
}

@media (min-width: 430px) {
    .plate-container {
        width: 359px;
        height: 359px;
    }
}

@media (min-width: 768px) {
    .plate-container {
        width: 414px;
        height: 414px;
    }
}

/* 3D质感圆形盘子底座 */
.plate-base {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(0,0,0,0.1) 0%, transparent 50%),
        linear-gradient(145deg, #e8e0d5 0%, #d4c8b8 50%, #c4b8a8 100%);
    box-shadow: 
        0 12px 30px rgba(0,0,0,0.2),
        0 4px 8px rgba(0,0,0,0.1),
        inset 0 2px 4px rgba(255,255,255,0.4),
        inset 0 -4px 8px rgba(0,0,0,0.15),
        inset 2px 2px 8px rgba(255,255,255,0.2),
        inset -2px -2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* 盘子边缘高光 */
.plate-base::before {
    content: '';
    position: absolute;
    top: 3%;
    left: 8%;
    width: 40%;
    height: 25%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.5) 0%, transparent 70%);
    transform: rotate(-20deg);
}

.plate-inner {
    width: 88%;
    height: 88%;
    border-radius: 50%;
    background: 
        radial-gradient(circle at 35% 35%, rgba(255,255,255,0.6) 0%, transparent 40%),
        radial-gradient(circle at 65% 65%, rgba(0,0,0,0.05) 0%, transparent 40%),
        linear-gradient(145deg, #f8f4ec 0%, #ede8e0 100%);
    box-shadow: 
        inset 0 4px 8px rgba(0,0,0,0.1),
        inset 0 -2px 4px rgba(255,255,255,0.6),
        inset 2px 2px 6px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* 盘子纹理 */
.plate-pattern {
    position: absolute;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    border: 2px dashed rgba(180, 160, 140, 0.25);
}

/* 盘子品牌文字 */
.plate-brand {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #c9a86c 0%, #8b6914 50%, #c9a86c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
}

.plate-pattern::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55%;
    height: 55%;
    border-radius: 50%;
    border: 1px solid rgba(180, 160, 140, 0.15);
}

/* 手串珠子区域 - 完全居中 */
.bracelet-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
}

.bracelet-ring.rotating {
    animation: rotateBracelet 8s linear infinite;
}

@keyframes rotateBracelet {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

.canvas-hint {
    margin-top: 16px;
    font-size: 13px;
    color: #a09080;
    opacity: 0.8;
}

/* 两行提示文字 - 放在按钮中间 */
.canvas-hint-two-line {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 12px;
    color: #a09080;
    opacity: 0.8;
    line-height: 1.4;
}

/* 画布中的珠子 - 3D质感 */
.bead-on-canvas {
    position: absolute;
    transform-origin: center center;
    z-index: 1000;
    cursor: pointer;
    box-sizing: border-box;
}

.bead-on-canvas:hover {
    z-index: 1001;
}

.bead-on-canvas.entering {
    transition: left 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                top 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease-out;
    transform: rotate(45deg) scale(0.8);
}

.bead-on-canvas.entering .bead-3d {
    animation: beadEnterSpin 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes beadEnterSpin {
    0% {
        transform: rotate(-90deg);
    }
    60% {
        transform: rotate(20deg);
    }
    80% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

.bead-on-canvas .bead-3d {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    transform-style: preserve-3d;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 
        0 4px 8px rgba(0,0,0,0.25),
        0 2px 4px rgba(0,0,0,0.15),
        inset 0 -3px 6px rgba(0,0,0,0.25),
        inset 0 3px 6px rgba(255,255,255,0.4),
        inset 1px 1px 2px rgba(255,255,255,0.3),
        inset -1px -1px 2px rgba(0,0,0,0.2);
}

.bead-on-canvas .bead-3d::before {
    content: '';
    position: absolute;
    top: 8%;
    left: 12%;
    width: 35%;
    height: 25%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.3) 50%, transparent 70%);
    transform: rotate(-25deg);
}

.bead-on-canvas .bead-3d::after {
    content: '';
    position: absolute;
    bottom: 15%;
    right: 20%;
    width: 20%;
    height: 15%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.4) 0%, transparent 70%);
}

@keyframes beadIdleSway {
    0%, 100% {
        transform: rotate(-3deg);
    }
    50% {
        transform: rotate(3deg);
    }
}

/* 珠子拖动状态 */
.bead-on-canvas.dragging {
    cursor: grabbing;
    z-index: 100;
    transform: scale(1.25);
    box-shadow: 
        0 15px 50px rgba(0,0,0,0.4),
        0 0 40px rgba(201, 168, 108, 0.6),
        0 0 60px rgba(201, 168, 108, 0.3);
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
}

.bead-on-canvas.to-delete {
    opacity: 0.4;
    transform: scale(0.7);
}

/* 珠子过渡动画 */
.bead-on-canvas {
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

/* 珠子长按准备拖动时的提示效果 */
.bead-on-canvas.pressing {
    animation: beadPressPulse 0.3s ease-out;
}

@keyframes beadPressPulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}



/* 按钮和提示文字在一行 */
.controls-row {
    position: relative;
    margin-top: 12px;
    width: 100%;
    max-width: 280px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

/* 提示文字 - 在两行显示 */
.hint-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: #a09080;
    opacity: 0.8;
    line-height: 1.3;
    pointer-events: none;
}

.card-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(145deg, #ffffff 0%, #f5f0e8 100%);
    box-shadow: 
        0 2px 8px rgba(0,0,0,0.12),
        inset 0 1px 2px rgba(255,255,255,0.8),
        0 0 0 2px rgba(201, 168, 108, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    pointer-events: auto;
    /* 旋转49度，靠近弧形角 */
    transform: rotate(49deg);
}

.card-btn svg {
    /* 图标反向旋转，保持正向显示 */
    transform: rotate(-49deg);
    width: 14px;
    height: 14px;
    color: #8b7355;
    transition: color 0.2s;
}

.card-btn:hover {
    transform: rotate(49deg) translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(0,0,0,0.15),
        inset 0 1px 2px rgba(255,255,255,0.8);
}

.card-btn:hover svg {
    color: #c9a86c;
}

.card-btn:active {
    transform: rotate(49deg) translateY(0);
    box-shadow: 
        0 2px 6px rgba(0,0,0,0.1),
        inset 0 1px 2px rgba(255,255,255,0.8);
}

.undo-btn svg {
    /* 回退按钮箭头朝左 */
    transform: rotate(-49deg) scaleX(-1);
}

.magic-btn svg {
    /* 魔法按钮图标 */
    transform: rotate(-49deg);
}

/* 盘子旋转 */
.bracelet-ring {
    transition: transform 0.1s ease-out;
}

/* 珠子大小 - 基于mm比例 */
.bead-on-canvas.small {
    width: 22px;
    height: 22px;
}

.bead-on-canvas.medium {
    width: 28px;
    height: 28px;
}

.bead-on-canvas.large {
    width: 34px;
    height: 34px;
}

@media (min-width: 768px) {
    .bead-on-canvas.small {
        width: 26px;
        height: 26px;
    }
    .bead-on-canvas.medium {
        width: 32px;
        height: 32px;
    }
    .bead-on-canvas.large {
        width: 38px;
        height: 38px;
    }
}

/* 刻度转盘选择器 */
.size-selector {
    margin-bottom: 16px;
    padding: 16px;
    background: rgba(255,255,255,0.6);
    border-radius: 16px;
}

.size-label {
    display: block;
    font-size: 14px;
    color: #6b5a4a;
    font-weight: 500;
    margin-bottom: 12px;
    text-align: center;
}

.dial-container {
    position: relative;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

/* 刻度轨道 */
.dial-track {
    position: relative;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, #e0d8d0 0%, #d0c8c0 100%);
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

/* 刻度标记 */
.dial-marks {
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 24px;
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
}

.dial-mark {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.dial-mark::before {
    content: '';
    width: 2px;
    height: 12px;
    background: #b0a090;
    border-radius: 1px;
}

.dial-mark.major::before {
    width: 3px;
    height: 16px;
    background: #8b7355;
}

.dial-mark span {
    font-size: 10px;
    color: #8b7355;
    margin-top: 4px;
}

/* 滑块 */
.dial-slider {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    background: linear-gradient(145deg, #f5f0e8 0%, #e8e0d5 100%);
    border-radius: 50%;
    box-shadow: 
        0 3px 8px rgba(0,0,0,0.2),
        inset 0 1px 2px rgba(255,255,255,0.8),
        inset 0 -1px 2px rgba(0,0,0,0.1);
    cursor: grab;
    transition: transform 0.1s;
    z-index: 10;
}

.dial-slider:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.1);
}

.dial-slider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: linear-gradient(145deg, #c9a86c 0%, #b8956a 100%);
    border-radius: 50%;
}

/* 当前值显示 */
.size-value {
    text-align: center;
    margin-top: 8px;
    font-size: 16px;
    color: #4a3728;
    font-weight: 600;
}

.size-value span {
    color: #c9a86c;
    font-size: 18px;
}

/* 手串圈大小选择器 */
.bracelet-size-selector {
    margin-bottom: 16px;
    padding: 16px;
    background: rgba(255,255,255,0.6);
    border-radius: 16px;
    display: block !important;
    visibility: visible !important;
}

.size-wheel {
    position: relative;
    height: 60px;
    overflow: visible;
    background: #faf8f5;
    border-radius: 12px;
    border: 1px solid #e8e0d8;
}

.wheel-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wheel-container::-webkit-scrollbar {
    height: 4px;
}

.wheel-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 2px;
}

.wheel-container::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 108, 0.5);
    border-radius: 2px;
}

.wheel-item {
    flex-shrink: 0;
    padding: 8px 14px;
    background: #f5f0e8;
    border-radius: 20px;
    font-size: 13px;
    color: #8b7355;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    white-space: nowrap;
}

.wheel-item:hover {
    background: #ebe5dc;
}

.wheel-item.active {
    background: linear-gradient(135deg, #c9a86c 0%, #b8956a 100%);
    color: white;
    border-color: #a08050;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(201, 168, 108, 0.3);
}

.wheel-indicator {
    display: none;
}

.wheel-item.active {
    background: linear-gradient(135deg, #c9a86c 0%, #b8956a 100%);
    color: white;
    border-color: #a08050;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(201, 168, 108, 0.3);
}

.wheel-indicator {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #c9a86c;
    pointer-events: none;
}

/* 珠子选择区 */
.bead-selector {
    background: rgba(255,255,255,0.6);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.bead-selector h3 {
    font-size: 16px;
    color: #4a3728;
    font-weight: 600;
}

.bead-count {
    font-size: 12px;
    color: #a09080;
    background: rgba(201, 168, 108, 0.15);
    padding: 4px 10px;
    border-radius: 12px;
}

.bead-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

/* 滚动条样式 */
.bead-grid::-webkit-scrollbar {
    width: 4px;
}

.bead-grid::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 2px;
}

.bead-grid::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 108, 0.5);
    border-radius: 2px;
}

.bead-item {
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    user-select: none;
    -webkit-user-select: none;
    border-radius: 12px;
    padding: 12px 8px;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.bead-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.bead-item.selected {
    background: rgba(201, 168, 108, 0.15);
    box-shadow: 0 0 0 2px rgba(201, 168, 108, 0.3);
}

/* 珠子信息 */
.bead-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 8px;
    text-align: center;
}

.bead-name {
    font-size: 13px;
    color: #4a3728;
    font-weight: 600;
    margin-bottom: 2px;
}

.bead-price {
    font-size: 11px;
    color: #8b7355;
    font-weight: 500;
}

.bead-item:hover {
    transform: scale(1.1);
    background: rgba(201, 168, 108, 0.1);
}

.bead-item:active {
    transform: scale(0.95);
}

.bead-item.selected {
    background: rgba(201, 168, 108, 0.2);
    animation: beadPulse 1s infinite;
}

@keyframes beadPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* 3D质感珠子 */
.bead-3d {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    transform-style: preserve-3d;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 
        /* 外阴影 - 立体感 */
        0 4px 8px rgba(0,0,0,0.25),
        0 2px 4px rgba(0,0,0,0.15),
        /* 内阴影 - 凹陷感 */
        inset 0 -3px 6px rgba(0,0,0,0.25),
        inset 0 3px 6px rgba(255,255,255,0.4),
        /* 边缘高光 */
        inset 1px 1px 2px rgba(255,255,255,0.3),
        inset -1px -1px 2px rgba(0,0,0,0.1);
}

/* 珠子多层高光效果 */
.bead-3d::before {
    content: '';
    position: absolute;
    top: 8%;
    left: 12%;
    width: 35%;
    height: 25%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.3) 50%, transparent 70%);
    transform: rotate(-25deg);
}

.bead-3d::after {
    content: '';
    position: absolute;
    bottom: 15%;
    right: 20%;
    width: 20%;
    height: 15%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.4) 0%, transparent 70%);
}

.bead-item .bead-3d {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    background-repeat: no-repeat;
    background-position: center;
}

.bead-item .bead-3d img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

.bead-item .bead-3d[style*="background-image"] {
    box-shadow: 
        inset 0 -3px 6px rgba(0,0,0,0.2),
        inset 0 3px 6px rgba(255,255,255,0.3),
        0 3px 8px rgba(0,0,0,0.15);
}

.bead-item:hover .bead-3d {
    transform: scale(1.15);
    box-shadow: 
        0 6px 14px rgba(0,0,0,0.3),
        0 3px 6px rgba(0,0,0,0.2),
        inset 0 -3px 6px rgba(0,0,0,0.25),
        inset 0 3px 6px rgba(255,255,255,0.4),
        inset 1px 1px 2px rgba(255,255,255,0.3);
}

.bead-item.selected .bead-3d {
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.5),
        0 4px 8px rgba(0,0,0,0.25),
        inset 0 -3px 6px rgba(0,0,0,0.25),
        inset 0 3px 6px rgba(255,255,255,0.4);
}

/* 操作按钮 */
.actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    min-width: 70px;
}

.btn-clear {
    background: #f0e8e0;
    color: #8b7355;
}

.btn-clear:hover {
    background: #e8ddd0;
}

.btn-undo {
    background: #f0f0f8;
    color: #6a6a8a;
}

.btn-undo:hover {
    background: #e0e0f0;
}

.btn-save {
    background: linear-gradient(135deg, #c9a86c 0%, #b8956a 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(201, 168, 108, 0.3);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(201, 168, 108, 0.4);
}

.btn-primary {
    background: linear-gradient(135deg, #c9a86c 0%, #b8956a 100%);
    color: white;
    padding: 14px 32px;
    font-size: 16px;
}

/* 拖拽中的珠子 */
.dragging-bead {
    position: fixed;
    width: 50px;
    height: 50px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transform: scale(1.2);
    transition: opacity 0.2s;
}

.dragging-bead.active {
    opacity: 0.9;
}

.dragging-bead .bead-3d {
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* 完成提示弹窗 */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.success-modal.show {
    display: flex;
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: sparkle 1s infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.modal-content h3 {
    font-size: 22px;
    color: #4a3728;
    margin-bottom: 10px;
}

.modal-content p {
    color: #8b7355;
    margin-bottom: 15px;
}

.design-info {
    margin-bottom: 25px;
    padding: 12px 20px;
    background: #faf6f0;
    border-radius: 10px;
}

.design-info span {
    font-size: 16px;
    color: #6b5a4a;
    font-weight: 500;
}

/* 提示弹窗 */
.toast-modal {
    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: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.toast-modal.show {
    opacity: 1;
    visibility: visible;
}

.toast-content {
    background: linear-gradient(145deg, #faf8f5 0%, #f5f0e8 100%);
    border-radius: 16px;
    padding: 24px 28px;
    text-align: center;
    max-width: 240px;
    width: 80%;
    border: 2px solid #c9a86c;
    box-shadow: 
        0 16px 48px rgba(0,0,0,0.12),
        0 6px 20px rgba(0,0,0,0.08),
        inset 0 1px 0 rgba(255,255,255,0.8),
        0 0 0 1px rgba(201, 168, 108, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast-modal.show .toast-content {
    transform: scale(1);
}

.toast-icon {
    font-size: 48px;
    margin-bottom: 0;
}

.toast-message {
    font-size: 15px;
    color: #5a4a3a;
    line-height: 1.5;
    margin-bottom: 20px;
    font-weight: 500;
}

.toast-content .btn-primary {
    padding: 10px 28px;
    font-size: 14px;
    border-radius: 20px;
    background: linear-gradient(145deg, #c9a86c 0%, #b8956a 100%);
    border: 2px solid #b8956a;
    color: #fff;
    font-weight: 500;
    box-shadow: 
        0 3px 10px rgba(201, 168, 108, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.3);
    transition: all 0.2s;
}

.toast-content .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 5px 15px rgba(201, 168, 108, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

.toast-content .btn-primary:active {
    transform: translateY(0);
}

/* 响应式 */
@media (max-width: 400px) {
    .bead-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .bead-item {
        padding: 8px 6px;
    }
    
    .bead-item .bead-3d {
        width: 44px;
        height: 44px;
    }
    
    .bead-name {
        font-size: 11px;
    }
    
    .bead-price {
        font-size: 10px;
    }
    
    .actions {
        gap: 6px;
    }
    
    .btn {
        padding: 10px 14px;
        font-size: 13px;
        min-width: 60px;
    }
    
    .plate-container {
        width: 240px;
        height: 240px;
    }
}

/* ============================================================
   下单按钮 & 弹窗
   ============================================================ */

.btn-order {
    background: linear-gradient(135deg, #c9a86c 0%, #b8956a 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(201, 168, 108, 0.35);
}

.btn-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(201, 168, 108, 0.45);
}

.btn-secondary {
    background: #f5f0e8;
    color: #8b7355;
    border: 1px solid #e0d5c8;
}

.btn-secondary:hover {
    background: #ebe4d8;
}

.order-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.order-modal.active {
    display: flex;
}

.order-modal-content {
    width: 90%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    background: #fffdf8;
    border-radius: 16px;
    padding: 28px 24px;
    position: relative;
    z-index: 2001;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #f0e8dc;
}

.order-modal-content h3 {
    text-align: center;
    color: #5c4a32;
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 600;
}

.order-subtitle {
    text-align: center;
    color: #a89680;
    font-size: 13px;
    margin: 0 0 20px 0;
}

.order-summary {
    background: #faf6ef;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    border: 1px solid #f0e8dc;
}

.order-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 14px;
    color: #6b5a42;
}

.order-summary-item span:last-child {
    font-weight: 600;
    color: #c9a86c;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #6b5a42;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group .required {
    color: #e74c3c;
    margin-left: 2px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e0d5c8;
    border-radius: 10px;
    font-size: 14px;
    color: #5c4a32;
    background: #fffdf8;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    box-sizing: border-box;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #c9a86c;
    box-shadow: 0 0 0 3px rgba(201, 168, 108, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #c8bba8;
}

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

.order-actions .btn {
    flex: 1;
}
