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

:root {
    /* 主题色 - 深邃蓝紫渐变 */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    
    /* 背景色 - 清爽白色主题 */
    --bg-color: #ffffff;
    --surface-color: #f8fafc;
    --surface-light: #f1f5f9;
    
    /* 文字颜色 */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    /* 阴影 */
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 方案2：优雅深灰系（取消注释使用）
:root {
    --bg-color: #0d1117;
    --surface-color: #161b22;
    --surface-light: #21262d;
    --border-color: #30363d;
}
*/

/* 方案3：深绿金融系（取消注释使用）
:root {
    --bg-color: #0a1612;
    --surface-color: #132620;
    --surface-light: #1a3329;
    --border-color: #2d4a3e;
}
*/

/* 方案4：紫罗兰梦幻系（取消注释使用）
:root {
    --bg-color: #120d1f;
    --surface-color: #1a1429;
    --surface-light: #251e35;
    --border-color: #332d45;
}
*/

/* 方案5：深蓝海洋系（取消注释使用）
:root {
    --bg-color: #061121;
    --surface-color: #0d1b2a;
    --surface-light: #1b2838;
    --border-color: #2d3b4a;
}
*/

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    /* 添加微妙的径向渐变，增加层次感 */
    background-image: radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
                      radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.03) 0%, transparent 50%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 背景动画 */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    animation: float 20s infinite;
}

.circle-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    top: -200px;
    right: -200px;
    animation-duration: 25s;
    filter: blur(80px);
}

.circle-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    bottom: -150px;
    left: -150px;
    animation-duration: 30s;
    animation-delay: -10s;
    filter: blur(80px);
}

.circle-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--primary-light), var(--success-color));
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 35s;
    animation-delay: -5s;
    filter: blur(80px);
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(50px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-30px, 30px) scale(0.9);
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

.header-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

/* 浏览器标签页标题优化 */
html {
    /* 确保favicon正确显示 */
}

/* 标签页图标在不同状态下的优化 */
@media (prefers-color-scheme: dark) {
    /* 深色模式下的图标优化 */
}

@media (prefers-color-scheme: light) {
    /* 浅色模式下的图标优化 */
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 2.5rem;
    animation: fadeIn 1s ease-out;
    align-items: start;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        gap: 1.5rem;
    }
}

/* Card Styles */
.card {
    background: var(--surface-color);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideUp 0.6s ease-out backwards;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.5);
}

.card:hover::before {
    opacity: 1;
}

.calculator-section {
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

.calculator-section::-webkit-scrollbar {
    width: 6px;
}

.calculator-section::-webkit-scrollbar-track {
    background: transparent;
}

.calculator-section::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.calculator-section::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.calculator-card {
    animation-delay: 0.1s;
}

.result-card {
    animation-delay: 0.2s;
}

.chart-card {
    animation-delay: 0.3s;
    margin-top: 1.5rem;
}

.info-card {
    animation-delay: 0.4s;
    margin-top: 1.5rem;
}

.quick-options-card {
    animation-delay: 0.15s;
    margin-top: 1.5rem;
}

@media (max-width: 1200px) {
    .calculator-section {
        position: static;
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.4rem;
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

.card-badge {
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-light);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.card-badge.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(52, 211, 153, 0.2));
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success-color);
}

.icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

/* Form Styles */
.form-group {
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-out backwards;
}

.form-group:nth-child(2) { animation-delay: 0.05s; }
.form-group:nth-child(3) { animation-delay: 0.1s; }
.form-group:nth-child(4) { animation-delay: 0.15s; }
.form-group:nth-child(5) { animation-delay: 0.2s; }
.form-group:nth-child(6) { animation-delay: 0.25s; }

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
}

.input-prefix {
    position: absolute;
    left: 1rem;
    top: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    z-index: 1;
}

.input-wrapper input[type="number"] {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.input-wrapper input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.input-slider-wrapper {
    margin-top: 0.75rem;
}

.slider {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 10px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.6);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem 1.25rem;
    background: #ffffff;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    flex: 1;
}

.radio-label:hover {
    border-color: var(--primary-light);
    background: var(--surface-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.radio-label input[type="radio"]:checked ~ .radio-custom {
    border-color: var(--primary-color);
    background: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.radio-label input[type="radio"]:checked ~ .radio-custom::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-text {
    color: var(--text-secondary);
    font-weight: 500;
}

.radio-label input[type="radio"]:checked ~ .radio-text {
    color: var(--text-primary);
}

/* Select */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    padding: 1rem;
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
}

.select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

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

.btn-icon {
    width: 24px;
    height: 24px;
}

/* Quick Options */
.quick-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.quick-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.quick-btn {
    padding: 0.8rem 0.5rem;
    background: #ffffff;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quick-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.quick-btn:hover::before {
    width: 200px;
    height: 200px;
}

.quick-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Results Section */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-summary {
    margin-bottom: 2rem;
}

.main-result {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 2px solid rgba(99, 102, 241, 0.2);
}

.main-result .result-label {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.main-result .result-value {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

.currency {
    font-size: 2.2rem;
    opacity: 0.8;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

@media (max-width: 600px) {
    .result-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.result-item {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.result-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-item:hover {
    background: var(--surface-color);
    border-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

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

.result-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.result-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.result-value-small {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-value-small.highlight {
    color: var(--success-color);
}

/* Progress Bars */
.progress-container {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    transition: width 1s ease-out;
    border-radius: 10px;
}

.principal-fill {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

.interest-fill {
    background: linear-gradient(90deg, var(--success-color), #34d399);
}

/* Chart */
.chart-controls {
    display: flex;
    gap: 0.5rem;
}

.chart-btn {
    padding: 0.4rem 0.8rem;
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-btn:hover {
    background: var(--surface-color);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.chart-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

#growthChart {
    width: 100%;
    height: 320px;
    margin-top: 1.5rem;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

/* Info List */
.info-list {
    list-style: none;
}

.info-list li {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #ffffff;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    border-left-width: 4px;
}

.info-list li:hover {
    background: var(--surface-color);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .logo {
        font-size: 1.8rem;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
    }

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

    .card {
        padding: 1.5rem;
    }

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

    .quick-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-result .result-value {
        font-size: 2.2rem;
    }

    .currency {
        font-size: 1.6rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .card-badge {
        align-self: flex-start;
    }
}

/* Number input appearance */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 0.5;
}

select option {
    background: #ffffff;
    color: var(--text-primary);
}

