* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: #f5f5f5;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::-webkit-scrollbar {
    display: none;
    width: 0 !important;
    height: 0 !important;
    -webkit-appearance: none;
    background: transparent;
}

/* 页面切换 */
.page {
    display: block;
    width: 100%;
    min-height: 100vh;
}

.page.hidden {
    display: none;
}

/* ============ 输入页：黄色顶部背景 + 白色卡片 ============ */

/* 顶部导航栏 - 亮黄色 */
.page-head {
    background-color: #FFFF00;
    height: 50px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: env(safe-area-inset-top);
}

.page-head-hd {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.page-head-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.back-icon {
    color: #000;
    font-size: 30px;
    font-style: normal;
    font-weight: bold;
    line-height: 1;
}

.page-head-bd {
    position: absolute;
    left: 50px;
    right: 50px;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.page-head-title {
    font-size: 18px;
    color: #000;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-head-ft {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

/* 黄色banner区 - 延伸黄色背景 */
.banner {
    background-color: #FFFF00;
    height: 220px;
    width: 100%;
}

/* 页面容器 - 向上偏移覆盖banner区 */
.container {
    padding: 0;
    width: 100%;
    position: relative;
    margin-top: -180px;
}

/* 输入卡片 - 白色大圆角卡片浮在黄色上 */
.input-list {
    background-color: #FFFFFF;
    border-radius: 24px;
    padding: 24px 16px;
    margin: 0 16px;
}

/* 每个输入框 - 浅灰色圆角矩形 */
.input-col {
    background-color: #f4f4f4;
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.input-col:last-child {
    margin-bottom: 0;
}

/* 前缀 - 左侧标签 */
.prefix {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    flex-shrink: 0;
}

/* 单位文字 */
.unit {
    font-size: 14px;
    color: #666;
    font-weight: 400;
    margin-left: 4px;
}

/* 输入包装器 - 右侧输入区 */
.uni-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 12px;
}

/* 输入框 */
.uni-input-input {
    width: 100%;
    font-size: 16px;
    color: #000;
    text-align: right;
    border: none;
    outline: none;
    background: transparent;
    padding: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: inherit;
}

.uni-input-input::-webkit-inner-spin-button,
.uni-input-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.uni-input-input[type=number] {
    -moz-appearance: textfield;
}

.uni-input-input::placeholder {
    color: #999;
}

/* 期数选择显示区 */
.input-like {
    flex: 1;
    font-size: 16px;
    color: #000;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.input-like.empty {
    color: #999;
}

.input-like:not(.empty) {
    color: #000;
}

/* 箭头指示图标 */
.term-select .unit {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-left: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.term-select .unit svg {
    width: 16px;
    height: 16px;
}

/* 计算按钮 - 亮黄色胶囊按钮 */
.apply1 {
    margin: 32px 16px;
    height: 56px;
    background-color: #FFFF00;
    color: #000;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.2s;
}

.apply1:active {
    opacity: 0.85;
}

.apply1 span {
    color: #000;
    font-size: 20px;
    font-weight: bold;
}

/* 错误提示 */
.error-tip {
    position: fixed;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 16px;
    padding: 12px 20px;
    border-radius: 12px;
    z-index: 9999;
    display: none;
    white-space: nowrap;
}

.error-tip.show {
    display: block;
}

/* 期数选择器 */
.picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.picker-modal.hidden {
    display: none;
}

.picker-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.picker-content {
    width: 100%;
    background: #fff;
    border-radius: 24px 24px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: slideUp 0.3s ease;
    position: relative;
    z-index: 2001;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.picker-header {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.picker-action {
    font-size: 18px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.picker-action-confirm {
    color: #007aff;
    font-weight: 500;
}

.picker-select {
    padding: 16px 0;
    max-height: 300px;
    overflow-y: auto;
}

.picker-item {
    padding: 20px;
    font-size: 18px;
    color: #333;
    text-align: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.picker-item:active {
    background: #f5f5f5;
}

.picker-item.selected {
    color: #007aff;
    font-weight: 500;
    background: rgba(0, 122, 255, 0.08);
}

/* ========== 结果页样式 ========== */

/* 结果页头部黄色区域 */
.result-header {
    background-color: #FFFF00;
    padding: 24px 20px 48px;
}

.result-amount-label {
    font-size: 20px;
    color: #000;
    font-weight: 500;
    margin-bottom: 10px;
}

.result-amount-value {
    font-size: 36px;
    color: #000;
    font-weight: bold;
    margin-bottom: 28px;
    line-height: 1.2;
}

/* 三栏统计 */
.result-stats {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stat-col {
    flex: 1;
    text-align: left;
}

.stat-col:nth-child(2) {
    text-align: center;
}

.stat-col:nth-child(3) {
    text-align: right;
}

.stat-label {
    font-size: 16px;
    color: #000;
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 20px;
    color: #000;
    font-weight: bold;
    line-height: 1.2;
}

/* 结果表格 */
.result-table {
    background-color: #fff;
    margin-top: 0;
}

/* 表格头部 */
.table-header {
    display: flex;
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f0;
    background-color: #f5f5f5;
}

.table-header .table-col {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* 表格内容行 */
.table-body {
    background-color: #fff;
}

.table-row {
    display: flex;
    padding: 24px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row .table-col {
    font-size: 16px;
    color: #333;
}

/* 三列布局 */
.table-col {
    flex: 1;
    text-align: center;
}

.table-col.col-term {
    text-align: left;
    flex: 1;
}

.table-col.col-amount {
    text-align: center;
    flex: 1;
}

.table-col.col-date {
    text-align: right;
    flex: 1.2;
}

/* ========== 桌面端适配（移动端优先） ========== */
@media (min-width: 769px) {
    body {
        max-width: 480px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    }
}
