/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主题色彩 */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary-color: #10b981;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 2rem 1rem;
}

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

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeInDown 0.6s ease-out;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

/* 主内容区 */
.main-content {
    animation: fadeInUp 0.6s ease-out;
}

.calculator-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    transition: transform 0.3s ease;
}

/* 表单样式 */
.calculator-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.75rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.form-group input,
.form-group select,
.form-group .period-input-group {
    position: relative;
    z-index: 10;
}

.label-text {
    font-size: 1rem;
}

.label-unit {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: var(--bg-secondary);
    pointer-events: auto;
    cursor: pointer;
}

.form-group input[type="number"] {
    cursor: text;
}

.form-group input[type="number"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input[type="number"]:hover,
.form-group select:hover {
    border-color: var(--primary-color);
}

/* 利率预设按钮 */
.rate-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.preset-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: white;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: var(--primary-light);
}

/* 期限输入组 */
.period-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    flex-wrap: nowrap;
}

.period-input-group input {
    flex: 1;
    pointer-events: auto !important;
    cursor: text !important;
    z-index: 10;
    position: relative;
    order: 1;
}

.period-unit {
    width: 100px;
    flex-shrink: 0;
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 10;
    position: relative;
    order: 2;
}

.period-input-group input:focus {
    z-index: 20;
}

.period-unit {
    width: 100px;
    flex-shrink: 0;
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 10;
    position: relative;
}

/* 单选按钮组 */
.radio-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.radio-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: white;
}

.radio-label:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.radio-label input[type="radio"] {
    margin-bottom: 0.5rem;
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

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

.radio-label:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.radio-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.radio-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* 复利频率 */
.frequency-select {
    width: 100%;
}

/* 计算按钮 */
.calculate-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    margin-top: 0.5rem;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

/* 结果展示 */
.results {
    animation: fadeIn 0.5s ease-out;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.result-card.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    grid-column: 1 / -1;
}

.result-label {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.result-card.primary .result-label {
    color: rgba(255, 255, 255, 0.9);
}

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

.result-card.primary .result-value {
    font-size: 2.25rem;
    color: white;
}

/* 结果详情 */
.result-details {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
}

.result-details h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item span:first-child {
    color: var(--text-secondary);
}

.detail-item span:last-child {
    font-weight: 500;
    color: var(--text-primary);
}

/* 页脚 */
.footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

/* 动画 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }

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

    .subtitle {
        font-size: 1rem;
    }

    .calculator-card {
        padding: 1.5rem;
    }

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

    .result-card.primary {
        grid-column: auto;
    }

    .radio-group {
        grid-template-columns: 1fr;
    }

    .rate-presets {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.75rem;
    }

    .calculator-card {
        padding: 1.25rem;
    }

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

    .result-card.primary .result-value {
        font-size: 1.875rem;
    }
}


/* 相关工具推荐 - 隐藏显示但保留SEO链接 */
.related-tools-seo {
    display: none;
}

/* 友情链接美化 */
.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    font-size: 0.9rem;
}

.footer-link {
    color: var(--primary-color, #3b82f6);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.footer-link:hover {
    color: var(--primary-dark, #2563eb);
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.footer-separator {
    color: var(--text-secondary, #6b7280);
}

