* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    font-family: 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 300% 100%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

h1 {
    text-align: center;
    color: #2d3748;
    margin-bottom: 40px;
    font-size: 36px;
    font-weight: 700;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    margin: 15px auto 0;
    border-radius: 2px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group.full-width {
    width: 100%;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #4a5568;
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-group:focus-within label {
    color: #667eea;
    transform: translateY(-2px);
}

input[type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #f7fafc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    border-color: #667eea;
    outline: none;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), 0 8px 25px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

input[type="number"]:hover,
input[type="text"]:hover,
select:hover {
    border-color: #cbd5e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

input[readonly] {
    background-color: #f1f3f5;
    color: #495057;
    cursor: not-allowed;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 28px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    margin-top: 30px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

button:hover::before {
    left: 100%;
}

button:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

button.loading {
    position: relative;
    color: transparent;
}

button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.result-container {
    margin-top: 40px;
    padding: 35px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.result-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.result-container h2 {
    color: #2d3748;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    position: relative;
}

.result-container h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    margin: 15px auto 0;
    border-radius: 2px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.result-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 5px solid #667eea;
    position: relative;
    overflow: hidden;
}

.result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.result-item:hover::before {
    opacity: 1;
}

.result-item.total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-left: none;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.result-item.total:hover {
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.result-item.total span:first-child {
    color: rgba(255, 255, 255, 0.9);
}

.result-item.total span:last-child {
    color: white;
    font-size: 24px;
    font-weight: 800;
}

.result-item.primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border-left: none;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
    grid-column: 1 / -1;
}

.result-item.primary:hover {
    box-shadow: 0 15px 40px rgba(255, 107, 107, 0.4);
}

.result-item.primary span:first-child {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
}

.result-item.primary span:last-child {
    color: white;
    font-size: 32px;
    font-weight: 800;
}

.result-item span:first-child {
    display: block;
    color: #718096;
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-item span:last-child {
    display: block;
    font-weight: 700;
    color: #2d3748;
    font-size: 22px;
    position: relative;
    z-index: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 15px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .container {
        padding: 30px 20px;
        margin: 10px;
        border-radius: 20px;
        backdrop-filter: blur(8px);
    }
    
    h1 {
        font-size: 28px;
        margin-bottom: 30px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    input[type="number"],
    input[type="text"],
    select {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .result-container {
        padding: 25px 20px;
        margin-top: 30px;
    }
    
    .result-container h2 {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .result-item {
        padding: 20px;
        border-radius: 14px;
    }
    
    .result-item span:last-child {
        font-size: 20px;
    }
    
    .result-item.total span:last-child {
        font-size: 22px;
    }
    
    .result-item.primary span:first-child {
        font-size: 14px;
    }
    
    .result-item.primary span:last-child {
        font-size: 28px;
    }
    
    button {
        padding: 16px 24px;
        font-size: 17px;
        margin-top: 25px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 25px 15px;
        margin: 5px;
        border-radius: 18px;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    h1::after {
        width: 80px;
    }
    
    .form-row {
        margin-bottom: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    label {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    input[type="number"],
    input[type="text"],
    select {
        padding: 12px 14px;
        font-size: 15px;
        border-radius: 10px;
    }
    
    .result-container {
        padding: 20px 15px;
        margin-top: 25px;
        border-radius: 16px;
    }
    
    .result-container h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .result-container h2::after {
        width: 60px;
    }
    
    .result-grid {
        gap: 15px;
    }
    
    .result-item {
        padding: 18px;
        border-radius: 12px;
        border-left-width: 4px;
    }
    
    .result-item span:first-child {
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    .result-item span:last-child {
        font-size: 18px;
    }
    
    .result-item.total span:last-child {
        font-size: 20px;
    }
    
    .result-item.primary span:first-child {
        font-size: 12px;
    }
    
    .result-item.primary span:last-child {
        font-size: 24px;
    }
    
    button {
        padding: 14px 20px;
        font-size: 16px;
        border-radius: 10px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 375px) {
    .container {
        padding: 20px 12px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    .result-item {
        padding: 15px;
    }
    
    .result-item span:last-child {
        font-size: 16px;
    }
}