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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

/* ===== 头部 ===== */
.site-header {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
    color: #fff;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-logo {
    font-size: 28px;
}

.site-title {
    font-size: 18px;
    font-weight: 700;
}

.site-subtitle {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

/* ===== 内容区 ===== */
.page-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
}

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 16px;
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.hint {
    font-weight: 400;
    color: #94a3b8;
    font-size: 12px;
}

.form-select,
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    color: #0f172a;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.date-row {
    display: flex;
    gap: 8px;
}

.date-row select {
    flex: 1;
}

/* ===== 性别选择 ===== */
.gender-group {
    display: flex;
    gap: 10px;
}

.gender-btn {
    flex: 1;
    padding: 14px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.gender-btn:hover {
    border-color: #93c5fd;
}

.gender-btn.active {
    border-color: #3b82f6;
    background: #eff6ff;
}

.gender-label {
    font-size: 15px;
    font-weight: 600;
    color: #334155;
}

.gender-desc {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.gender-btn.active .gender-label {
    color: #1d4ed8;
}

.gender-btn.active .gender-desc {
    color: #3b82f6;
}

/* ===== 输入框带单位 ===== */
.input-with-unit {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-unit .form-input {
    flex: 1;
}

.input-unit {
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

.hint-text {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    display: block;
}

/* ===== 分割线 ===== */
.divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 16px 0;
}

/* ===== 主按钮 ===== */
.btn-primary {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
    margin-bottom: 16px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.35);
}

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

/* ===== 脚注 ===== */
.footnote {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.8;
    margin-bottom: 24px;
}

/* ===== 页脚 ===== */
.site-footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 20px;
    text-align: center;
    margin-top: 32px;
}

.footer-text {
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
}

.footer-copy {
    display: block;
    font-size: 11px;
    opacity: 0.7;
}

/* ===== 结果页样式 ===== */
.result-section {
    margin-bottom: 16px;
}

.retire-notice {
    background: #fef3c7;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.retire-notice .bold {
    font-weight: 700;
}

.retire-notice .sub {
    font-size: 12px;
    color: #92400e;
    display: block;
    margin-top: 4px;
}

/* 最低缴费年限警告 */
.min-years-warning {
    background: #fee2e2;
    border-radius: 10px;
    padding: 12px 14px;
    border-left: 4px solid #dc2626;
    margin-bottom: 12px;
    font-size: 13px;
    color: #5f6368;
    line-height: 1.6;
}

/* ===== 档次选择 ===== */
.tier-section {
    margin-bottom: 16px;
}

.tier-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.tier-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 8px;
    -webkit-overflow-scrolling: touch;
}

.tier-pill {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.tier-pill:hover {
    background: #e2e8f0;
}

.tier-pill.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #3b82f6;
}

.tier-pill .small {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}

.tier-pill.active .small {
    color: #3b82f6;
}

/* ===== 对比卡片 ===== */
.comp-card {
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.comp-card.worker {
    background: linear-gradient(145deg, #eff6ff, #dbeafe);
    border: 2px solid #93c5fd;
}

.comp-card.resident {
    background: linear-gradient(145deg, #ecfdf5, #d1fae5);
    border: 2px solid #6ee7b7;
}

.comp-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 8px;
    color: #fff;
}

.comp-badge.blue {
    background: #1d4ed8;
}

.comp-badge.green {
    background: #059669;
}

.comp-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.comp-card.worker .comp-title {
    color: #1e40af;
}

.comp-card.resident .comp-title {
    color: #047857;
}

.comp-subtitle {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 10px;
}

.comp-big-number {
    font-size: 32px;
    font-weight: 800;
    margin: 6px 0 4px;
    line-height: 1.1;
}

.comp-big-number.blue {
    color: #1d4ed8;
}

.comp-big-number.green {
    color: #059669;
}

.comp-big-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
}

.comp-detail {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 12px;
}

.comp-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 13px;
}

.comp-row-label {
    color: #64748b;
}

.comp-row-value {
    font-weight: 600;
    color: #0f172a;
}

.comp-divider {
    border: none;
    border-top: 1px dashed #cbd5e1;
    margin: 8px 0;
}

/* ===== 回本分析 ===== */
.insight-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.7;
    color: #92400e;
}

/* ===== 详细页面样式 ===== */
.formula-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
}

.f-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #334155;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 13px;
}

.detail-row .dl {
    color: #64748b;
}

.detail-row .dv {
    font-weight: 600;
    color: #0f172a;
}

/* ===== 按钮组 ===== */
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.btn-secondary {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline {
    background: #fff;
    color: #1d4ed8;
    border: 2px solid #3b82f6;
}

.btn-outline:hover {
    background: #eff6ff;
}

.btn-text {
    background: transparent;
    color: #64748b;
    border: none;
}

.btn-text:hover {
    color: #1d4ed8;
}

/* ===== 响应式 ===== */
@media (min-width: 640px) {
    .page-content {
        padding: 24px;
    }
    
    .card {
        padding: 24px;
    }
    
    .site-header {
        padding: 20px 24px;
    }
    
    .comp-card {
        padding: 20px;
    }
}
