* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    font-size: 14px;
}
.header {
    background: #fff;
    border-bottom: 3px solid #1890ff;
    padding: 15px 0;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}
.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.logo a {
    display: block;
    line-height: 0;
}
.logo-image {
    height: 50px;
    width: auto;
    display: block;
    cursor: pointer;
    transition: opacity 0.3s;
}
.logo-image:hover {
    opacity: 0.8;
}
.nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}
.nav-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    gap: 5px;
}
.nav-list li {
    margin: 0;
}
.nav-list a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    font-size: 14px;
}
.nav-list a:hover,
.nav-list a.active {
    color: #1890ff;
    border-bottom-color: #1890ff;
}

@media (max-width: 768px) {
    .header {
        padding: 10px 0;
    }
    .header-content {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    .logo-image {
        height: 40px;
    }
    .nav {
        width: 100%;
    }
    .nav-list {
        justify-content: flex-start;
        gap: 0;
    }
    .nav-list li {
        flex: 0 0 auto;
    }
    .nav-list a {
        padding: 8px 12px;
        font-size: 13px;
        border-bottom: 2px solid transparent;
    }
}
.main-content {
    margin: 20px auto;
}
.calc-wrapper {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    margin-bottom: 20px;
    align-items: start;
}
.calc-wrapper.tax-wrapper {
    grid-template-columns: 350px minmax(520px, 1fr);
}
.result-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.calc-panel {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 15px;
    overflow: hidden;
}
.calc-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1890ff;
}
.form-item {
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}
.form-item label {
    color: #666;
    font-size: 13px;
    text-align: left;
    background: #f5f5f5;
    padding: 6px 10px;
    border-radius: 4px;
    height: 32px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.form-item input, .form-item select {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    height: 32px;
}
.form-item input:focus, .form-item select:focus {
    outline: none;
    border-color: #1890ff;
}
.input-group {
    display: flex;
    gap: 0;
    width: 100%;
    max-width: 100%;
}
.input-group input {
    flex: 1;
    min-width: 0;
    border-radius: 4px 0 0 4px;
    border-right: none;
}
.input-group span {
    padding: 6px 8px;
    background: #f5f5f5;
    border: 1px solid #d9d9d9;
    border-radius: 0 4px 4px 0;
    border-left: 1px solid #d9d9d9;
    width: 70px;
    flex-shrink: 0;
    text-align: center;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    white-space: nowrap;
}
.amount-text {
    margin-top: 8px;
    padding: 8px 12px;
    background: #e6f7ff;
    border-radius: 4px;
    font-size: 13px;
    color: #1890ff;
    text-align: center;
}
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.btn-primary {
    flex: 1;
    padding: 10px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    font-weight: bold;
    height: 40px;
    transition: background 0.3s;
}
.btn-primary:hover {
    background: #40a9ff;
}
.btn-secondary {
    flex: 1;
    padding: 10px;
    background: #fff;
    color: #666;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    height: 40px;
    transition: all 0.3s;
}
.btn-secondary:hover {
    border-color: #1890ff;
    color: #1890ff;
}
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.calc-btn {
    flex: 1;
    padding: 8px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    font-weight: bold;
    height: 36px;
}
.calc-btn:hover {
    background: #40a9ff;
}
.reset-btn {
    flex: 1;
    padding: 8px;
    background: #fff;
    color: #666;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    height: 36px;
}
.reset-btn:hover {
    border-color: #1890ff;
    color: #1890ff;
}
.pro-btn {
    width: 100%;
    padding: 8px;
    background: #faad14;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: bold;
    height: 36px;
}
.pro-btn:hover {
    background: #ffc53d;
}
.results-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.result-panel {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
}
.result-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
    color: #fff;
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
}
.result-panel.debx .result-header {
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
}
.result-panel.debj .result-header {
    background: linear-gradient(135deg, #ff4d4f 0%, #cf1322 100%);
}
.formula-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f5f5f5;
    padding: 10px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    gap: 4px;
}
.formula-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    overflow: hidden;
}
.formula-item.formula-months {
    width: 50px;
}
.formula-item:not(.formula-months):not(.formula-total) {
    width: 60px;
}
.formula-item.formula-total {
    width: 70px;
}
.formula-label {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.formula-value {
    font-size: 10px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.formula-operator {
    font-size: 14px;
    color: #666;
    font-weight: bold;
    padding: 0 3px;
    flex-shrink: 0;
}
.percent-bar {
    display: flex;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}
.percent-item {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    transition: width 0.5s;
}
.percent-principal {
    background: #1890ff;
}
.percent-interest {
    background: #ff4d4f;
}
.result-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
}
.result-item {
    padding: 12px 15px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    border-left: 3px solid #1890ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.result-item:last-child {
    border-bottom: none;
}
.result-item .label {
    font-size: 12px;
    color: #999;
}
.result-item .value {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}
.result-item .value.highlight {
    color: #ff4d4f;
    font-size: 16px;
}
.result-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-top: 15px;
}
.btn-detail,
.btn-copy {
    flex: 1;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}
.btn-detail {
    background: #1890ff;
    color: #fff;
}
.btn-detail:hover {
    background: #40a9ff;
    color: #fff;
}
.btn-copy {
    background: #52c41a;
    color: #fff;
}
.btn-copy:hover {
    background: #73d13d;
}
.copy-success {
    display: none;
    background: #52c41a;
    color: #fff;
    padding: 10px 15px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 10px;
    font-size: 14px;
}
.copy-success.show {
    display: block;
    animation: fadeInOut 3s ease-in-out;
}
.error-message {
    display: none;
    background: #ff4d4f;
    color: #fff;
    padding: 10px 15px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 10px;
    font-size: 14px;
}
.error-message.show {
    display: block;
    animation: fadeInOut 3s ease-in-out;
}
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-10px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}
.detail-btns {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}
.detail-btn {
    flex: 1;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    border: none;
    transition: all 0.3s;
}
.detail-btn:first-child {
    background: #1890ff;
    color: #fff;
}
.detail-btn:first-child:hover {
    background: #40a9ff;
}
.detail-btn:last-child {
    background: #52c41a;
    color: #fff;
}
.detail-btn:last-child:hover {
    background: #73d13d;
}
.detail-panel {
    grid-column: 1 / -1;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-top: 20px;
    box-sizing: border-box;
    max-width: 100%;
}
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}
.detail-header h3 {
    font-size: 18px;
    color: #333;
    margin: 0;
}
.btn-close {
    background: #ff4d4f;
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}
.btn-close:hover {
    background: #ff7875;
}
.detail-table {
    margin-top: 30px;
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.rate-info-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
}
.rate-card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
}
.rate-card h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}
.rate-table {
    width: 100%;
    border-collapse: collapse;
}
.rate-table th,
.rate-table td {
    padding: 10px;
    text-align: center;
    border: 1px solid #e8e8e8;
}
.rate-table th {
    background: #f5f5f5;
    font-weight: bold;
    color: #666;
    font-size: 14px;
}
.rate-table td {
    font-size: 14px;
    color: #333;
}
.rate-link {
    display: block;
    text-align: center;
    color: #1890ff;
    margin-top: 10px;
    font-size: 14px;
    text-decoration: none;
}
.rate-link:hover {
    text-decoration: underline;
}
.rate-note {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin-top: 10px;
}
@media (max-width: 768px) {
    .rate-info-section {
        grid-template-columns: 1fr;
    }
    .result-wrapper {
        grid-template-columns: 1fr;
    }
    .detail-panel {
        max-width: 100vw;
        overflow: hidden;
    }
    .detail-table {
        padding: 10px;
    }
    .table-wrapper {
        margin: 0 -10px;
        padding: 0 10px;
    }
}
.detail-table h3 {
    background: #1890ff;
    color: #fff;
    padding: 15px 20px;
    font-size: 16px;
}
.table-wrapper {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-wrapper table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
}
th, td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}
th {
    background: #fafafa;
    font-weight: bold;
    position: sticky;
    top: 0;
}
.content-section {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 30px;
    margin-top: 20px;
}
.content-section h2 {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 4px solid #1890ff;
}
.content-section h3 {
    font-size: 16px;
    color: #555;
    margin: 20px 0 10px;
}
.content-section p {
    line-height: 1.8;
    color: #666;
    margin-bottom: 15px;
    text-indent: 2em;
}
.footer {
    background: #001529;
    color: #fff;
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
}
.footer a {
    color: #1890ff;
    text-decoration: none;
}
.footer p {
    margin: 8px 0;
}
@media (max-width: 968px) {
    .calc-wrapper {
        grid-template-columns: 1fr;
    }
    .calc-wrapper.tax-wrapper {
        grid-template-columns: 1fr;
    }
    .results-wrapper {
        grid-template-columns: 1fr;
        margin-top: 16px;
        width: 100%;
    }
}
