* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    color: white;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 28px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.4);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.wheel-list {
    display: grid;
    gap: 15px;
}

.wheel-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.5);
    position: relative;
    overflow: hidden;
}

.wheel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.wheel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.wheel-card:active {
    transform: translateY(-2px);
}

.wheel-card h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 600;
}

.wheel-card .meta {
    color: #888;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wheel-card .meta::before {
    content: '🎯';
}

.wheel-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    position: relative;
}

#wheelCanvas {
    width: 500px;
    height: 500px;
    border-radius: 50%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    background: white;
}

.spin-btn {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    border: 5px solid white;
    cursor: pointer;
    font-size: 22px;
    font-weight: bold;
    box-shadow: 0 8px 30px rgba(255, 107, 107, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.spin-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(255, 107, 107, 0.5);
}

.spin-btn:active:not(:disabled) {
    transform: scale(1.05);
}

.spin-btn:disabled {
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: not-allowed;
}

.result {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 16px;
    margin-bottom: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.result span {
    animation: popIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.result-history {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
}

.result-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e8ecf4;
}

.result-history-header h3 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 10px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.result-item .result-text {
    color: #667eea;
    font-weight: 600;
    font-size: 15px;
}

.result-item .result-time {
    color: #999;
    font-size: 12px;
}

.result-list:empty::after {
    content: '暂无记录';
    display: block;
    text-align: center;
    color: #999;
    padding: 30px 0;
}

.edit-form {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.12);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #444;
    font-weight: 600;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e8ecf4;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #a0a0a0;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #888;
    font-size: 12px;
}

.items-editor {
    margin-bottom: 20px;
}

.item-row {
    display: grid;
    grid-template-columns: 1fr 80px 40px;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
    animation: slideIn 0.3s ease;
}

#itemsEditor .item-row {
    grid-template-columns: 1fr 80px 40px;
}

#createItemsEditor .item-row {
    grid-template-columns: 1fr 80px 40px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.item-row input {
    padding: 12px 14px;
    border: 2px solid #e8ecf4;
    border-radius: 10px;
    font-size: 14px;
    background: #fafbfc;
    transition: all 0.3s ease;
}

.item-row input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.item-row .remove-btn {
    background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
    color: white;
    border: none;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(255, 71, 87, 0.3);
}

.item-row .remove-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e8ecf4;
}

.item-help {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4ff 100%);
    border-left: 4px solid #4ECDC4;
    padding: 18px;
    margin-bottom: 20px;
    border-radius: 10px;
}

.item-help strong {
    display: block;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 15px;
}

.item-help code {
    background: white;
    padding: 3px 8px;
    border-radius: 4px;
    color: #2980b9;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.item-help ul {
    margin: 10px 0 0 20px;
}

.item-help li {
    margin: 8px 0;
    color: #555;
    line-height: 1.6;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: modalFadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 35px;
    max-width: 450px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 700;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    cursor: pointer;
    color: #999;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    color: #333;
    background: #f0f0f0;
}

.modal-form {
    margin-top: 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: white;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 25px;
    opacity: 0.9;
}

.empty-state::before {
    content: '🎡';
    font-size: 60px;
    display: block;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 22px;
    }

    #wheelCanvas {
        width: 320px;
        height: 320px;
    }

    .spin-btn {
        width: 70px;
        height: 70px;
        font-size: 18px;
    }

    .item-row {
        grid-template-columns: 1fr 60px 100px 30px;
    }

    .item-row input {
        font-size: 12px;
    }
}
