* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 600px;
}

.input-section {
    padding: 40px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
}

.results-section {
    padding: 40px;
    background: white;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.calculate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.results-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #2c3e50;
    font-weight: 700;
    text-align: center;
}

.comparison-cards {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.result-card.offset {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.result-card.debt-cycle {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.result-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.result-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

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

.comparison-table {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.comparison-table th {
    background: #e9ecef;
    font-weight: 600;
    color: #495057;
}

.breakeven-info {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    text-align: center;
}

.breakeven-info h4 {
    color: #d63384;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.breakeven-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #d63384;
}

/* 移动设备适配 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .header p {
        font-size: 1rem;
    }

    .main-content {
        grid-template-columns: 1fr;
    }

    .input-section {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        padding: 30px 20px;
    }

    .results-section {
        padding: 30px 20px;
    }

    .results-title {
        font-size: 1.5rem;
    }

    .result-value {
        font-size: 1.8rem;
    }

    .comparison-table {
        overflow-x: auto;
    }

    .comparison-table table {
        min-width: 300px;
        font-size: 0.9rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .input-section,
    .results-section {
        padding: 20px 15px;
    }

    .form-group input {
        padding: 10px 12px;
    }

    .calculate-btn {
        padding: 12px;
        font-size: 1rem;
    }

    .result-card {
        padding: 20px;
    }

    .result-value {
        font-size: 1.6rem;
    }

    .comparison-table table {
        font-size: 0.8rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 8px 6px;
        font-size: 0.75rem;
        line-height: 1.2;
    }
}

.info-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    color: #6c757d;
    cursor: help;
}

.info-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
}

.hidden {
    display: none;
}

.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 5px;
}

.lang-btn {
    padding: 8px 16px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lang-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
}

.lang-btn.active {
    background: rgba(255,255,255,0.9);
    color: #4facfe;
    border-color: white;
    font-weight: 600;
}

@media (max-width: 768px) {
    .language-selector {
        position: relative;
        top: 0;
        right: 0;
        text-align: center;
        margin-bottom: 20px;
    }
}