* {
    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;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 25px;
    padding: 15px 20px;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
}

.calculator-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.input-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.input-group {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #555;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group input:hover {
    border-color: #667eea;
}

.input-group label .required {
    color: #f5576c;
    font-size: 0.85rem;
    font-weight: 500;
}

.input-group label .optional {
    color: #999;
    font-size: 0.85rem;
    font-weight: 400;
}

.input-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #999;
}

.result-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 0;
}

.result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.result-card.main-result {
    grid-column: 1 / -1;
}

.result-card.profit {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 10px 30px rgba(245, 87, 108, 0.3);
}

.result-card.fee {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 10px 30px rgba(79, 172, 254, 0.3);
}

.result-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
}

.result-value {
    font-size: 1.7rem;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.result-note {
    display: block;
    font-size: 0.7rem;
    opacity: 0.85;
    margin-top: 6px;
    font-weight: 400;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.info-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.info-section h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.info-section ul {
    list-style: none;
    padding-left: 0;
}

.info-section li {
    padding: 12px 15px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    line-height: 1.5;
    font-size: 0.9rem;
}

.info-section li strong {
    color: #667eea;
}

.detail-section {
    margin-top: 20px;
    margin-bottom: 0;
    padding-top: 20px;
    padding-bottom: 0;
    border-top: 2px solid #f0f0f0;
}

.detail-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.detail-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.detail-item:hover {
    background: #f0f0f0;
}

.detail-item.total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    margin-top: 5px;
}

.detail-label {
    font-size: 0.95rem;
    color: #666;
}

.detail-item.total .detail-label {
    color: white;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.detail-item.total .detail-value {
    color: white;
    font-size: 1.3rem;
}

.fee-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.fee-info h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.fee-info p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .input-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }

    .calculator-card {
        padding: 20px;
    }

    .result-section {
        grid-template-columns: 1fr;
    }

    .result-card.main-result {
        grid-column: 1;
    }

    .button-group {
        flex-direction: column;
    }
}

