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

/* 基础样式 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1e293b;
    line-height: 1.6;
    padding: 0;
    margin: 0;
    min-height: 100vh;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid #334155;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-logo {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: white;
    padding: 8px;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.app-logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.title-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
    color: white;
    font-family: 'Inter', sans-serif;
}

.app-version {
    font-size: 0.85rem;
    opacity: 0.8;
    font-weight: 400;
    color: #94a3b8;
}

.app-desc {
    font-size: 1rem;
    opacity: 0.9;
    max-width: none;
    margin: 0;
    line-height: 1.6;
    white-space: nowrap;
    overflow-x: auto;
}

.app-desc p {
    margin: 6px 0;
    color: #e2e8f0;
}

.app-desc .highlight {
    font-weight: 600;
    color: #3b82f6;
}

/* 主要内容区域 */
main {
    padding: 30px;
}

/* 描述部分 */
.description {
    background: #f8fafc;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.description:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 操作规则样式 */
.operation-rules {
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 20px;
    margin-bottom: 24px;
}

.operation-rules h3 {
    color: #1e293b;
    margin-bottom: 16px;
    font-size: 1.2rem;
    font-weight: 600;
}

.rules-list {
    list-style-position: inside;
    padding: 0;
    margin: 0;
}

.rules-list li {
    margin-bottom: 12px;
    padding-left: 8px;
    color: #475569;
    line-height: 1.6;
    font-size: 0.95rem;
}

.rules-list li:last-child {
    margin-bottom: 0;
}

.rules-list strong {
    color: #1e293b;
    font-weight: 600;
}

/* 突出显示的描述区域 */
.highlight-section {
    background: white;
    padding: 28px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid #3b82f6;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.1);
    animation: fadeIn 0.6s ease-out;
}

/* 突出显示的文本 */
.highlight-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #1e293b;
    font-weight: 400;
}

/* 关键特性 */
.key-feature {
    background: #f1f5f9;
    color: #3b82f6;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid #cbd5e1;
    margin: 0 2px;
    transition: all 0.2s ease;
}

.key-feature:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

/* 强调文本 */
.highlight-text strong {
    color: #1e293b;
    font-weight: 600;
}

.description p {
    margin-bottom: 15px;
    color: #475569;
}

.description p:last-child {
    margin-bottom: 0;
}

/* 分割线样式 */
hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 30px 0;
}

/* 标题样式 */
h2 {
    color: #1e293b;
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 600;
}

h3 {
    color: #334155;
    font-size: 1.4rem;
    margin-bottom: 15px;
    font-weight: 600;
}

/* 表单样式 */
.bigform {
    background: #ffffff;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

.form-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.form {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.form:hover {
    border-color: #3b82f6;
}

.form h3 {
    color: #1e293b;
    margin-bottom: 16px;
    font-size: 1.2rem;
    font-weight: 600;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

input, select {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white;
    font-family: inherit;
}

input:hover, select:hover {
    border-color: #94a3b8;
}

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

input::placeholder {
    color: #94a3b8;
}

/* 日期选择框样式 */
input[type="date"] {
    cursor: pointer;
    /* 隐藏默认样式，以便自定义 */
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
    /* 添加自定义日历图标 */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%233b82f6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 24px;
    padding-right: 50px;
    position: relative;
    transition: all 0.2s ease;
    /* 优化文本输入区域 */
    padding-left: 14px;
}

/* 移除Chrome等浏览器的清除按钮 */
input[type="date"]::-webkit-clear-button {
    display: none;
}

/* 移除Safari浏览器的上下箭头 */
input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* WebKit浏览器的日期选择器触发区域 */
input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    cursor: pointer;
    opacity: 0; /* 隐藏原生图标，使用自定义背景图 */
    z-index: 1;
}

/* 鼠标悬停效果 */
input[type="date"]:hover {
    border-color: #3b82f6;
}

/* 确保日期选择框在各种状态下都能正常点击 */
input[type="date"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background-color: #f1f5f9;
}

input[type="date"]:read-only {
    cursor: pointer;
    background-color: #f8fafc;
}

/* 焦点样式 */
input[type="date"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 金额提示样式 */
.amount-tip {
    font-size: 0.8rem;
    color: #ef4444;
    margin-top: -12px;
    margin-bottom: 16px;
    padding-left: 4px;
    font-style: italic;
    transition: all 0.2s ease;
}

/* 成功提示样式 */
.success-message {
    font-size: 0.8rem;
    color: #ef4444;
    margin-top: 10px;
    padding-left: 4px;
    font-style: italic;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

/* 按钮样式 */
.btn {
    padding: 12px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-family: inherit;
}

.btn:hover {
    background: #2563eb;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn:active {
    background: #1d4ed8;
    transform: translateY(1px);
}

.btn-bar {
    width: 100%;
}

.btn-primary {
    background: #10b981;
}

.btn-primary:hover {
    background: #059669;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.btn-primary:active {
    background: #047857;
}

#export-excel {
    background: #f59e0b;
}

#export-excel:hover {
    background: #d97706;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

#export-excel:active {
    background: #b45309;
}

/* 结果展示区 */
#result {
    background: #f0fdf4;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid #dcfce7;
}

#loan-change-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

#loan-change-list p {
    font-weight: 500;
    color: #065f46;
    margin: 0;
    font-size: 0.95rem;
}

#loan-change-list span {
    font-weight: 600;
    color: #15803d;
}

/* 还款计划表样式 */
#payment-schedule {
    margin-top: 24px;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
}

#schedule-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9rem;
}

#schedule-table caption {
    background: #f8fafc;
    padding: 12px 16px;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e2e8f0;
}

.schedule-table-caption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

#schedule-table th,
#schedule-table td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid #f1f5f9;
}

#schedule-table th:first-child,
#schedule-table td:first-child {
    text-align: left;
}

#schedule-table th:nth-child(2),
#schedule-table td:nth-child(2) {
    text-align: left;
}

#schedule-table th:nth-child(9),
#schedule-table td:nth-child(9) {
    text-align: left;
}

#schedule-table th:nth-child(10),
#schedule-table td:nth-child(10) {
    text-align: left;
}

#schedule-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #e2e8f0;
}

#schedule-table tr {
    transition: background-color 0.1s ease;
}

#schedule-table tr:hover {
    background: #f8fafc;
}

#schedule-table td {
    color: #475569;
    border-right: 1px solid #f1f5f9;
}

#schedule-table td:last-child {
    border-right: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    main {
        padding: 20px;
    }
    
    .form-group {
        grid-template-columns: 1fr;
    }
    
    #loan-change-list {
        grid-template-columns: 1fr;
    }
    
    .schedule-table-caption {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    #schedule-table {
        font-size: 0.9rem;
    }
    
    #schedule-table th,
    #schedule-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 1.6rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    .description,
    .form {
        padding: 20px;
    }
}

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

.container {
    animation: fadeIn 0.6s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 贷款变更记录样式 */
.loan-change-item {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid transparent;
    background-color: #f8fafc;
    transition: all 0.3s ease;
}

.loan-change-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 不同变更类型的颜色样式 */
.change-type-initial {
    border-left-color: #10b981; /* 绿色 - 初始贷款 */
}

.change-type-rate {
    border-left-color: #3b82f6; /* 蓝色 - 利率变更 */
}

.change-type-prepay {
    border-left-color: #f59e0b; /* 橙色 - 提前还款 */
}

.change-type-other {
    border-left-color: #64748b; /* 灰色 - 其他变更 */
}

/* 变更日期 */
.loan-change-date {
    font-weight: 600;
    color: #374151;
    margin-right: 10px;
}

/* FAQ常见问题板块样式 */
.faq-section {
    margin: 40px 0;
    padding: 30px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    animation: fadeIn 0.8s ease-out;
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #1e293b;
    font-size: 2rem;
    font-weight: 700;
}

.faq-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.faq-item {
    background: white;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.faq-item h3 {
    color: #1e293b;
    font-size: 1.2rem;
    margin-bottom: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.faq-item p {
    color: #475569;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* 用户案例展示样式 */
.user-cases-section {
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    animation: fadeIn 0.8s ease-out;
}

.user-cases-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #1e293b;
    font-size: 2rem;
    font-weight: 700;
}

.cases-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.case-item {
    background: white;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.case-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #10b981;
}

.case-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.case-type {
    background: #3b82f6;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.case-user {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.case-desc {
    color: #475569;
    line-height: 1.6;
    font-size: 0.95rem;
    font-style: italic;
    quotes: "\"" "\"";
}

/* 响应式调整 */
@media (max-width: 768px) {
    .faq-section,
    .user-cases-section {
        padding: 20px;
        margin: 30px 0;
    }
    
    .faq-container,
    .cases-container {
        grid-template-columns: 1fr;
    }
    
    .faq-section h2,
    .user-cases-section h2 {
        font-size: 1.6rem;
    }
    
    .case-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* 性能优化和移动端适配增强 */
@media (max-width: 480px) {
    .app-title {
        font-size: 1.4rem;
        line-height: 1.3;
    }
    
    .app-version {
        font-size: 0.8rem;
    }
    
    .app-desc p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .highlight-text {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .faq-item,
    .case-item {
        padding: 16px;
    }
    
    .faq-item h3 {
        font-size: 1.1rem;
    }
    
    .faq-item p,
    .case-desc {
        font-size: 0.9rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .faq-item:hover,
    .case-item:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }
    
    input:focus,
    select:focus {
        outline: 2px solid #3b82f6;
        outline-offset: 2px;
    }
}

/* 减少动画对性能的影响 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 图片优化 */
.app-logo {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* 字体加载优化 */
body {
    font-display: swap;
}

/* 滚动性能优化 */
.container {
    will-change: transform;
}

/* 表格性能优化 */
#schedule-table {
    transform: translateZ(0);
}

/* 变更说明 */
.loan-change-comment {
    font-weight: 600;
}

.change-type-initial .loan-change-comment {
    color: #059669; /* 绿色 */
}

.change-type-rate .loan-change-comment {
    color: #2563eb; /* 蓝色 */
}

.change-type-prepay .loan-change-comment {
    color: #d97706; /* 橙色 */
}

.change-type-other .loan-change-comment {
    color: #64748b; /* 灰色 */
}

/* 变更详情 */
.loan-change-detail {
    color: #475569;
    font-size: 0.9rem;
    margin: 8px 0 0 0;
    padding-left: 0;
}

.monthly-payment,
.remaining-loan {
    font-weight: 700;
    color: #4f46e5;
}

/* 工具推荐区块样式 */
.tool-recommendation {
    margin: 30px 0;
    animation: fadeIn 0.8s ease-out;
}

.recommendation-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    border: none;
    text-align: center;
    transition: all 0.3s ease;
}

.recommendation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
}

.recommendation-card h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 16px;
    font-weight: 700;
}

.recommendation-text {
    font-size: 1.1rem;
    margin-bottom: 24px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
}

.recommendation-text strong {
    color: white;
    font-weight: 700;
}

.recommendation-link {
    background: white;
    color: #667eea;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recommendation-link:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    color: #5568d8;
}

.recommendation-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .recommendation-card {
        padding: 24px 20px;
    }
    
    .recommendation-card h3 {
        font-size: 1.3rem;
    }
    
    .recommendation-text {
        font-size: 1rem;
    }
    
    .recommendation-link {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}