/* ===== 全局样式 ===== */
:root {
    --bg-gradient-start: #0f0c29;
    --bg-gradient-mid: #302b63;
    --bg-gradient-end: #24243e;
    --card-bg: rgba(255, 255, 255, 0.06);
    --card-border: rgba(255, 255, 255, 0.12);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #ffd700;
    --accent-hover: #ffed4a;
    --accent-dark: #e6b800;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius: 20px;
    --radius-sm: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --danger: #ef4444;
    --success: #10b981;
}

[data-theme="light"] {
    --bg-gradient-start: #e2e8f0;
    --bg-gradient-mid: #f8fafc;
    --bg-gradient-end: #cbd5e1;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.08);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

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

html, body {
    height: 100%;
    font-family: var(--font);
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-mid), var(--bg-gradient-end));
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 80px; /* 底部导航高度 */
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 10px;
}

/* ===== 玻璃卡片 ===== */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 20px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

/* ===== 头部 ===== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    padding-top: max(16px, env(safe-area-inset-top));
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--card-border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon {
    font-size: 28px;
    color: var(--accent);
}

.app-header h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition);
}

.icon-btn:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.05);
}

.icon-btn:active {
    transform: scale(0.92);
}

/* ===== 主内容 ===== */
.app-main {
    flex: 1;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
}

.section-title i {
    font-size: 20px;
}

/* ===== 表单 ===== */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 60px 14px 16px;
    background: rgba(0,0,0,0.3);
    border: 1.5px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 500;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input-wrapper input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.input-wrapper .unit {
    position: absolute;
    right: 16px;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    pointer-events: none;
}

.error-msg {
    display: none;
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
    padding-left: 4px;
}

.input-group.error .error-msg {
    display: block;
}

.input-group.error input {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* 单选组 */
.radio-group {
    display: flex;
    gap: 12px;
}

.radio-label {
    flex: 1;
    padding: 12px 8px;
    background: rgba(0,0,0,0.2);
    border: 1.5px solid var(--card-border);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.radio-label i {
    font-size: 16px;
}

.radio-label.active {
    background: rgba(255, 215, 0, 0.12);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.05);
}

.radio-label:hover {
    border-color: var(--accent-dark);
}

/* 主按钮 */
.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border: none;
    border-radius: var(--radius-sm);
    color: #1a1a2e;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 1px;
    margin-top: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-outline {
    padding: 10px 20px;
    background: transparent;
    border: 1.5px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255,215,0,0.05);
}

.btn-outline.danger {
    border-color: var(--danger);
    color: var(--danger);
}

.btn-outline.danger:hover {
    background: rgba(239,68,68,0.1);
}

/* ===== 结果区域 ===== */
.result-section {
    animation: fadeSlideUp 0.5s ease;
}

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

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.result-item {
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-sm);
    padding: 16px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-item.highlight {
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    grid-column: 1 / -1;
    padding: 20px;
}

.result-item .result-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.result-item .result-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--accent);
    word-break: break-all;
}

.result-item.highlight .result-value {
    font-size: 36px;
}

.result-item .result-unit {
    font-size: 12px;
    color: var(--text-muted);
}

/* 图表 */
.chart-container {
    background: rgba(0,0,0,0.15);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 20px;
    max-height: 260px;
}

.chart-container canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 240px;
}

/* 还款明细 */
.detail-compare h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0,0,0,0.15);
}

#repaymentTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 400px;
}

#repaymentTable th {
    background: rgba(255,215,0,0.1);
    color: var(--accent);
    padding: 10px 8px;
    text-align: right;
    position: sticky;
    top: 0;
    z-index: 2;
    font-weight: 600;
}

#repaymentTable th:first-child {
    text-align: center;
}

#repaymentTable td {
    padding: 8px 8px;
    text-align: right;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-secondary);
}

#repaymentTable td:first-child {
    text-align: center;
    color: var(--text-muted);
}

#repaymentTable tbody tr:hover td {
    background: rgba(255,255,255,0.03);
}

#showMoreBtn {
    margin-top: 12px;
    width: 100%;
}

/* ===== 底部导航 ===== */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: rgba(15, 12, 41, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--card-border);
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    z-index: 200;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
    padding: 4px 0;
}

.nav-item i {
    font-size: 22px;
    transition: transform var(--transition);
}

.nav-item.active {
    color: var(--accent);
}

.nav-item.active i {
    transform: scale(1.1);
}

.nav-item:hover {
    color: var(--text-secondary);
}

/* ===== 模态框 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 500;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.25s ease;
}

.modal-overlay.active {
    display: flex;
}

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

.modal-content {
    width: 100%;
    max-width: 500px;
    max-height: 70vh;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    min-height: 100px;
}

.history-item {
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    border: 1px solid transparent;
    transition: border-color var(--transition);
}

.history-item:hover {
    border-color: var(--card-border);
}

.history-item .history-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-item .history-info strong {
    color: var(--text-primary);
}

.history-item .history-info small {
    color: var(--text-muted);
    font-size: 12px;
}

.history-item .history-result {
    text-align: right;
    color: var(--accent);
    font-weight: 600;
}

.history-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
    font-size: 15px;
}

.modal-footer {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

/* ===== 关于页 ===== */
.hidden {
    display: none !important;
}

.about-content {
    max-width: 600px;
    width: 100%;
    margin: 20px auto;
    padding: 0 16px;
}

.about-card {
    text-align: center;
    padding: 40px 24px;
}

.about-icon {
    font-size: 60px;
    color: var(--accent);
    margin-bottom: 16px;
}

.about-card h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-card p {
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.about-card .version {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.about-card hr {
    border: none;
    border-top: 1px solid var(--card-border);
    margin: 16px 0;
}

.about-features {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.about-features span {
    background: rgba(255,215,0,0.08);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== 响应式 ===== */
@media (min-width: 768px) {
    .app-main {
        padding: 30px 24px;
        gap: 24px;
    }
    .result-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
    .result-item.highlight {
        grid-column: 1 / -1;
    }
}

@media (max-width: 420px) {
    .app-header h1 {
        font-size: 17px;
    }
    .input-wrapper input {
        font-size: 16px;
        padding: 12px 50px 12px 12px;
    }
    .result-item .result-value {
        font-size: 22px;
    }
    .result-item.highlight .result-value {
        font-size: 28px;
    }
    .radio-label {
        font-size: 13px;
        padding: 10px 6px;
    }
}
```
```file