* {
    box-sizing: border-box;
    user-select: none;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e2b3c, #0f1a24);
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.app {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 1400px;
    width: 100%;
    align-items: flex-start;
}

.wheel-area {
    flex: 2;
    min-width: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border-radius: 48px;
    backdrop-filter: blur(4px);
    padding: 30px 20px;
    box-shadow: 0 20px 35px rgba(0,0,0,0.3);
}

.container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    font-size: 38px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    color: #ffecb3;
}

.wheel-wrapper {
    position: relative;
    width: 380px;
    height: 380px;
    margin: 0 auto;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    transition: transform 0s ease-out;
    position: relative;
    will-change: transform;
}

/* 奖品文字 - 靠近圆周边缘 */
.prize-text {
    position: absolute;
    inset: 0;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 3px black;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.prize-text span {
    position: absolute;
    transform: translateY(-140px);
    white-space: normal;
    word-break: break-word;
    text-align: center;
    max-width: 100px;
    font-size: 16px;
    line-height: 1.3;
    background: rgba(0, 0, 0, 0.65);
    padding: 4px 8px;
    border-radius: 30px;
    backdrop-filter: blur(4px);
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.prize-text span[data-long="true"] {
    font-size: 12px;
    max-width: 85px;
}

.center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 110px;
    height: 110px;
    background: #fff2df;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: #e67e22;
    font-weight: bold;
    font-family: monospace;
}

.pointer {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 34px solid transparent;
    border-right: 34px solid transparent;
    border-bottom: 85px solid #f1c40f;
    z-index: 20;
    filter: drop-shadow(0 8px 12px rgba(0,0,0,0.5));
}

.pointer::after {
    content: "⭐";
    position: absolute;
    font-size: 28px;
    left: -20px;
    top: 68px;
    color: #ffd966;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
}

button#spinBtn {
    margin-top: 40px;
    padding: 14px 50px;
    font-size: 28px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    transition: 0.2s;
    font-weight: bold;
}

button#spinBtn:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
    transform: scale(0.98);
}

/* 结果框样式 */
#result {
    font-size: 32px;
    margin-top: 25px;
    font-weight: bold;
    background: linear-gradient(135deg, #f9f3c1, #ffe28a);
    color: #2c3e2f;
    display: inline-block;
    padding: 12px 32px;
    border-radius: 60px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4), 0 0 0 3px rgba(255,215,0,0.6);
    backdrop-filter: blur(2px);
    text-shadow: 1px 1px 0 rgba(255,255,200,0.8);
    letter-spacing: 2px;
    transition: 0.2s;
}

/* 右侧面板 */
.panel {
    flex: 1.2;
    min-width: 320px;
    background: rgba(30, 40, 50, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 40px;
    padding: 20px 24px;
    box-shadow: 0 20px 35px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.2);
    color: #f0f0f0;
}

.panel h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 28px;
    border-bottom: 2px solid #ffb142;
    display: inline-block;
    width: 100%;
}

.sector-list {
    max-height: 460px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 6px;
}

.sector-card {
    background: rgba(0,0,0,0.5);
    border-radius: 28px;
    padding: 12px 15px;
    margin-bottom: 14px;
    transition: 0.1s;
    border-left: 6px solid #ffb142;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.sector-name-input {
    background: #2c3e44;
    border: none;
    color: white;
    font-size: 18px;
    padding: 6px 12px;
    border-radius: 32px;
    width: 130px;
    font-weight: bold;
    outline: none;
    text-align: center;
}

.sector-percent-input {
    font-size: 18px;
    font-weight: bold;
    background: #1e2a32;
    color: #f0f0f0;
    border: 2px solid transparent;
    padding: 6px 8px;
    border-radius: 32px;
    min-width: 70px;
    width: 80px;
    text-align: center;
    outline: none;
    cursor: text;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.sector-percent-input::-webkit-outer-spin-button,
.sector-percent-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sector-percent-input:focus {
    border-color: #ff9f43;
    background: #263544;
}

.sector-buttons {
    display: flex;
    gap: 8px;
}

.sector-buttons button {
    background: #2c3e50;
    border: none;
    color: white;
    font-size: 20px;
    font-weight: bold;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sector-buttons button:hover {
    background: #ff9f43;
    color: #2d3436;
}

.panel-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.btn-row {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.panel button {
    background: #2c3e50;
    border: none;
    color: white;
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.panel button.primary {
    background: #ff9f43;
    color: #2d3436;
}

.panel button.danger {
    background: #eb4d4b;
}

.panel button:hover {
    transform: scale(1.02);
    filter: brightness(1.05);
}

.total-info {
    text-align: center;
    margin-top: 15px;
    font-size: 15px;
    background: #00000066;
    border-radius: 30px;
    padding: 8px;
}

.total-info.warning {
    color: #ff8888;
    background: #44000066;
}

.footer-beian {
    position: fixed;
    bottom: 8px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    background: rgba(0,0,0,0.5);
    padding: 6px;
    z-index: 99;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.footer-beian a {
    pointer-events: auto;
    color: #ffd966;
    text-decoration: none;
    font-weight: bold;
}

::-webkit-scrollbar {
    width: 5px;
}