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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: #eef1f6;
    min-height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.container {
    display: flex;
    background: white;
    border-radius: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    padding: 40px;
    gap: 50px;
    width: auto;
    height: auto;
    align-items: center;
}

/* 左侧面板 */
.left-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;
    min-width: 160px;
}

/* 显示区域 - 圆角卡片 */
.display {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border-radius: 20px;
    padding: 16px 22px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.play-icon {
    font-size: 28px;
    color: #2c3e50;
    cursor: pointer;
    transition: transform 0.2s;
}

.play-icon:hover {
    transform: scale(1.1);
}

/* 数字显示框 */
.number-box {
    background: #f8f9fa;
    border: 3px solid #2c3e50;
    border-radius: 16px;
    padding: 8px 24px;
    min-width: 90px;
    text-align: center;
}

.number {
    font-size: 52px;
    font-weight: bold;
    color: #2c3e50;
    font-family: 'Arial', sans-serif;
    line-height: 1.2;
}

/* 清零按钮 */
.reset-btn {
    background: #5bc0de;
    color: white;
    border: none;
    border-radius: 14px;
    padding: 14px 0;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    box-shadow: 0 4px 10px rgba(91, 192, 222, 0.3);
}

.reset-btn:hover {
    background: #46b8da;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(91, 192, 222, 0.4);
}

/* 右侧面板 */
.right-panel {
    background: white;
    border-radius: 20px;
    padding: 10px;
}

.digits {
    display: flex;
    gap: 35px;
}

/* 数位列 */
.digit-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

/* 杆容器 */
.rod-container {
    position: relative;
    width: 65px;
    height: 380px;
    background: #f5f7fa;
    border-radius: 16px;
    overflow: visible;
}

/* 杆 */
.rod {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 100%;
    border-radius: 3px;
}

/* 每个数位的杆颜色 */
.digit-column[data-digit="4"] .rod { background: #e74c3c; }
.digit-column[data-digit="3"] .rod { background: #f39c12; }
.digit-column[data-digit="2"] .rod { background: #4a90e2; }
.digit-column[data-digit="1"] .rod { background: #7b68ee; }
.digit-column[data-digit="0"] .rod { background: #e84393; }

/* 珠子容器 */
.beads-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    padding-bottom: 10px;
}

/* 珠子 - 圆盘形状 */
.bead {
    width: 52px;
    height: 28px;
    border-radius: 50%;
    margin-bottom: 4px;
    box-shadow: 
        0 3px 8px rgba(0,0,0,0.2),
        inset 0 -3px 6px rgba(0,0,0,0.1),
        inset 0 3px 6px rgba(255,255,255,0.4);
    animation: beadJump 0.5s ease-out;
    position: relative;
}

/* 珠子高光效果 */
.bead::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 8px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
}

@keyframes beadJump {
    0% {
        transform: translateY(80px) scale(0.8);
        opacity: 0;
    }
    60% {
        transform: translateY(-10px) scale(1.05);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* 珠子颜色 - 与杆和标签一致 */
.digit-column[data-digit="4"] .bead { background: linear-gradient(180deg, #ff7675, #e74c3c); }
.digit-column[data-digit="3"] .bead { background: linear-gradient(180deg, #fdcb6e, #f39c12); }
.digit-column[data-digit="2"] .bead { background: linear-gradient(180deg, #74b9ff, #4a90e2); }
.digit-column[data-digit="1"] .bead { background: linear-gradient(180deg, #a29bfe, #7b68ee); }
.digit-column[data-digit="0"] .bead { background: linear-gradient(180deg, #fd79a8, #e84393); }

/* 数位标签 */
.digit-label {
    color: white;
    font-size: 28px;
    font-weight: bold;
    width: 65px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    margin-top: -10px;
    position: relative;
    z-index: 2;
}

/* 标签颜色 */
.digit-column[data-digit="4"] .digit-label { background: #e74c3c; }
.digit-column[data-digit="3"] .digit-label { background: #f39c12; }
.digit-column[data-digit="2"] .digit-label { background: #4a90e2; }
.digit-column[data-digit="1"] .digit-label { background: #7b68ee; }
.digit-column[data-digit="0"] .digit-label { background: #e84393; }

/* 控制按钮 */
.controls {
    display: flex;
    gap: 10px;
}

.btn-add, .btn-sub {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 12px;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.btn-add:hover, .btn-sub:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.2);
}

.btn-add:active, .btn-sub:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* 每个数位的按钮颜色 */
.digit-column[data-digit="4"] .btn-add { background: #e74c3c; }
.digit-column[data-digit="4"] .btn-sub { background: #c0392b; }
.digit-column[data-digit="3"] .btn-add { background: #f39c12; }
.digit-column[data-digit="3"] .btn-sub { background: #d68910; }
.digit-column[data-digit="2"] .btn-add { background: #4a90e2; }
.digit-column[data-digit="2"] .btn-sub { background: #357abd; }
.digit-column[data-digit="1"] .btn-add { background: #7b68ee; }
.digit-column[data-digit="1"] .btn-sub { background: #6c5ce7; }
.digit-column[data-digit="0"] .btn-add { background: #e84393; }
.digit-column[data-digit="0"] .btn-sub { background: #d63031; }