* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(145deg, #0b1721 0%, #071016 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', 'PingFang SC', Roboto, 'Helvetica Neue', sans-serif;
    padding: 20px 12px;
}

.app-wrapper {
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* 头部 */
.app-header {
    text-align: center;
    padding: 16px 12px 8px;
    background: rgba(255, 248, 225, 0.12);
    backdrop-filter: blur(8px);
    border-radius: 48px;
    border: 1px solid rgba(255, 215, 150, 0.3);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.app-header h1 {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(135deg, #ffd966, #ffb347);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.sub {
    font-size: 0.75rem;
    color: #ffdd99;
    margin-top: 6px;
    opacity: 0.9;
}

/* 手机卡片容器 */
.app-container {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(2px);
    border-radius: 56px;
    padding: 20px 16px 28px;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 圆盘画布区 */
.wheel-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.3));
}
canvas {
    width: 100%;
    max-width: 340px;
    height: auto;
    background: #fef7e8;
    border-radius: 50%;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255,255,200,0.8);
    transition: all 0.2s;
}

/* 7个待显示号码球 */
.balls-area {
    background: rgba(0, 0, 0, 0.45);
    border-radius: 80px;
    padding: 12px 16px;
    margin-bottom: 28px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,215,150,0.3);
}
.balls-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.ball {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f5f5f5, #d0d0d0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: bold;
    color: #1e2a36;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.1), 0 6px 12px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    font-family: monospace;
}
.ball.red-ball {
    background: radial-gradient(circle at 35% 35%, #ff5e6b, #c72a3a);
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 4px 10px rgba(199,42,58,0.4);
}
.ball.blue-ball {
    background: radial-gradient(circle at 35% 35%, #3b82f6, #1e40af);
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 4px 10px rgba(30,64,175,0.4);
}
.ball.empty {
    background: #2c3e33;
    color: #7f8c8d;
    box-shadow: inset 0 0 0 2px rgba(255,255,200,0.2);
    background-image: radial-gradient(circle at 30% 30%, #3e5a4a, #1e2e26);
}

/* 按钮双雄 */
.buttons-row {
    display: flex;
    gap: 18px;
    margin-bottom: 32px;
    justify-content: center;
}
.btn {
    flex: 1;
    padding: 14px 0;
    border: none;
    border-radius: 60px;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 2px;
    transition: 0.2s;
    cursor: pointer;
    background: #2c3e33;
    color: #ecf0f1;
    box-shadow: 0 6px 0 #0f191f;
    transform: translateY(-2px);
}
.btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #0f191f;
}
.btn-start {
    background: #e67e22;
    color: white;
    box-shadow: 0 6px 0 #b45d1a;
}
.btn-record {
    background: #2980b9;
    box-shadow: 0 6px 0 #1a5276;
}
.btn:disabled {
    opacity: 0.5;
    transform: translateY(0);
    cursor: not-allowed;
    filter: grayscale(0.1);
}

/* 历史记录区 */
.history-section {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 36px;
    padding: 14px 12px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,215,150,0.2);
}
.history-title {
    font-size: 1rem;
    font-weight: bold;
    color: #ffdd99;
    padding-left: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.limit-tip {
    font-size: 0.7rem;
    background: #2c3e33;
    padding: 2px 8px;
    border-radius: 30px;
    color: #f1c40f;
}
.history-list {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 6px;
}
.history-item {
    background: rgba(20, 30, 40, 0.8);
    border-radius: 40px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
    border-left: 4px solid #f39c12;
    transition: 0.1s;
}
.history-reds {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.history-red {
    background: #c72a3a;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
}
.history-blue {
    background: #1e40af;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}
.history-num {
    font-family: monospace;
    font-weight: bold;
    color: #f1c40f;
}
.empty-history {
    color: #aaa;
    text-align: center;
    padding: 18px;
    font-style: italic;
}

/* 滚动条 */
.history-list::-webkit-scrollbar {
    width: 4px;
}
.history-list::-webkit-scrollbar-track {
    background: #2c3e33;
    border-radius: 10px;
}
.history-list::-webkit-scrollbar-thumb {
    background: #e67e22;
    border-radius: 10px;
}

/* 底部 */
.app-footer {
    text-align: center;
    padding: 12px;
    font-size: 0.7rem;
    color: #bbb;
    background: rgba(0,0,0,0.3);
    border-radius: 40px;
    backdrop-filter: blur(4px);
}