/* 交接班系统 - 样式文件 */

/* CSS变量 - 高度百分比 */
:root {
    --primary-color: #1890ff;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #f5222d;
    --text-color: #333;
    --text-secondary: #666;
    --border-color: #e8e8e8;
    --bg-color: #f5f5f5;
    --card-bg: #fff;
    --step-height: 8%;
    --content-gap: 2%;
    --card-padding: 4%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

.app-container {
    max-width: 800px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========== 头部 ========== */
.app-header {
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    color: white;
    height: var(--header-height);
    min-height: 35px;
    padding: 0 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.app-header h1 {
    font-size: 1.1em;
    font-weight: 600;
}

.header-info {
    display: flex;
    gap: 12px;
    font-size: 0.85em;
    opacity: 0.9;
}

/* ========== 步骤指示器 ========== */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--step-height);
    min-height: 40px;
    flex-shrink: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ddd;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.step.active .step-num {
    background: var(--primary-color);
    color: white;
}

.step.completed .step-num {
    background: var(--success-color);
    color: white;
}

.step-title {
    font-size: 0.65em;
    color: var(--text-secondary);
    margin-top: 3px;
}

.step.active .step-title {
    color: var(--primary-color);
    font-weight: 500;
}

.step-line {
    width: 10%;
    height: 2px;
    background: #ddd;
    margin: 0 2%;
}

.step-line.active {
    background: var(--primary-color);
}

/* ========== 步骤内容区 ========== */
.step-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.step-content.active {
    display: flex;
}

/* ========== 卡片 ========== */
.card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: var(--card-padding);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card h2 {
    font-size: 1em;
    margin-bottom: 3%;
    padding-bottom: 3%;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* ========== 步骤1：现金计算器 ========== */
.step1-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: var(--content-gap) 4%;
}

.cash-calculator {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.cash-grid {
    flex: 1;
    display: grid;
    gap: 2%;
    overflow-y: auto;
}

.cash-item {
    display: flex;
    align-items: center;
    padding: 2% 3%;
    background: #fafafa;
    border-radius: 6px;
}

.cash-item label {
    width: 50px;
    font-size: 0.85em;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.cash-item input {
    flex: 1;
    min-width: 0;
    padding: 2% 3%;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95em;
    text-align: right;
}

.cash-item input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.cash-subtotal {
    width: 65px;
    text-align: right;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--primary-color);
    flex-shrink: 0;
}

.cash-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3% 4%;
    margin-top: 3%;
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    border-radius: 8px;
    color: white;
    flex-shrink: 0;
}

.btn-reset {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-reset:active {
    background: rgba(255,255,255,0.3);
}

.total-content {
    text-align: right;
}

.total-label {
    font-size: 0.8em;
    opacity: 0.9;
    display: block;
}

.total-amount {
    font-size: 1.3em;
    font-weight: 700;
}

/* ========== 步骤2：商品交接 ========== */
.step2-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.step2-card h2 {
    flex-shrink: 0;
    text-align: center;
}

#productCount {
    font-size: 0.8em;
    color: var(--text-secondary);
    font-weight: normal;
}

.product-header {
    display: flex;
    padding: 3% 2%;
    background: #f0f0f0;
    border-radius: 6px;
    margin-bottom: 2%;
    font-size: 0.75em;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.product-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2%;
}

.product-item {
    display: flex;
    align-items: center;
    padding: 3% 2%;
    background: #fafafa;
    border-radius: 6px;
}

.col-name {
    flex: 2;
    font-size: 0.85em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-price {
    width: 70px;
    font-size: 0.85em;
    color: #e74c3c;
    font-weight: 600;
    text-align: center;
}

.col-spucode {
    width: 70px;
    font-size: 0.75em;
    color: var(--text-secondary);
    text-align: center;
}

.col-storage {
    width: 50px;
    font-size: 0.85em;
    text-align: center;
    color: var(--primary-color);
    font-weight: 600;
}

.col-actual {
    width: 60px;
}

.col-actual input {
    width: 100%;
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    font-size: 0.9em;
}
    color: var(--text-secondary);
}

.product-confirm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: transparent;
    flex-shrink: 0;
}

.product-confirm.checked {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

/* ========== 步骤3：班次数据 ========== */
.shift-data {
    flex: 1;
    overflow-y: auto;
    display: grid;
    gap: 3%;
    align-content: start;
}

.shift-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3%;
}

.shift-stat {
    padding: 4%;
    background: #fafafa;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    font-size: 0.75em;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.stat-value {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--primary-color);
}

.payment-details {
    display: grid;
    gap: 2%;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    padding: 3% 4%;
    background: #fafafa;
    border-radius: 6px;
    font-size: 0.9em;
}

.payment-label {
    color: var(--text-secondary);
}

.payment-value {
    font-weight: 600;
}

/* ========== 步骤4：汇总 ========== */
.summary-card {
    flex: 1;
    overflow-y: auto;
}

.summary-section {
    margin-bottom: 3%;
    padding-bottom: 3%;
    border-bottom: 1px dashed var(--border-color);
}

.summary-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.summary-section h3 {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 2%;
}

.cash-calc-toggle {
    float: right;
    font-size: 0.85em;
    color: var(--primary);
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f0f0f0;
}

.cash-calc-toggle:hover {
    background: #e0e0e0;
}

.cash-calculator.expandable {
    background: #fafafa;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.cash-calculator.expandable .cash-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cash-calculator.expandable .cash-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid #eee;
    flex: 1 1 calc(50% - 3px);
    min-width: 0;
}

.cash-calculator.expandable .cash-item:last-child {
    flex: 1 1 100%;
}

.cash-calculator.expandable .cash-item label {
    font-size: 12px;
    min-width: 40px;
    color: #666;
}

.cash-calculator.expandable .cash-item input {
    flex: 0 0 50px;
    min-width: 0;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: right;
}

.cash-calculator.expandable .cash-item .cash-subtotal {
    font-size: 13px;
    color: #333;
    min-width: 55px;
    text-align: right;
    flex-shrink: 0;
}

.cash-calculator.expandable .cash-pagination {
    display: none;
}
    color: #888;
}

.cash-calculator.expandable .cash-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 10px 0 8px;
}

.cash-calculator.expandable .page-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
}

.cash-calculator.expandable .page-dot.active {
    background: var(--primary);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 2% 0;
    font-size: 0.9em;
}

.summary-row.highlight {
    background: #fff7e6;
    margin: 2% -4%;
    padding: 3% 4%;
    border-radius: 6px;
    font-weight: 600;
}

.person-input {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.person-input label {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.person-input input {
    width: 100%;
    padding: 3%;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
}

.person-input input.display-style {
    border: none;
    padding: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    background: transparent;
    outline: none;
}

.summary-section.person-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4%;
}

textarea {
    width: 100%;
    min-height: 35px;
    padding: 3%;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9em;
    resize: none;
    font-family: inherit;
}

/* ========== 按钮 ========== */
.step-actions {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.btn {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:active {
    background: #096dd9;
}

.btn-secondary {
    background: #f5f5f5;
    color: var(--text-color);
}

.btn-secondary:active {
    background: #e8e8e8;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:active {
    background: #389e0d;
}

.btn-danger {
    background: #ff4d4f;
    color: white;
}

.btn-danger:active {
    background: #cf1322;
}

/* ========== 加载动画 ========== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10%;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 模态框 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px 20px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
}

.modal-icon.success {
    background: #f6ffed;
    color: var(--success-color);
}

.modal-icon.error {
    background: #fff1f0;
    color: var(--error-color);
}

.modal-content h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.modal-content p {
    color: #666;
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

.modal-content .btn {
    width: 100%;
    margin-top: 8px;
}

/* ========== 空提示 ========== */
.empty-tip,
.error-tip {
    text-align: center;
    padding: 10%;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.error-tip {
    color: var(--error-color);
}

/* ========== 响应式 ========== */
@media (max-width: 400px) {
    :root {
        --header-height: 9%;
        --step-height: 11%;
    }
    
    .step-num {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .step-title {
        font-size: 0.6em;
    }
    
    .shift-summary {
        grid-template-columns: 1fr;
    }
}

/* 平板/中屏设备 (401px - 768px) */
@media (max-width: 768px) and (min-width: 401px) {
    .product-item {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .col-name {
        font-size: 0.8em;
    }
    
    .col-price,
    .col-storage {
        font-size: 0.8em;
    }
    
    .actual-input {
        width: 50px;
        font-size: 0.85em;
    }
}

/* 大屏设备 (769px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .product-list-container {
        max-height: 50vh;
    }
    
    .product-item {
        padding: 10px 12px;
    }
}

/* 超大屏设备 (> 1024px) - 多列布局 */
@media (min-width: 1200px) {
    .product-list-container {
        max-height: 60vh;
    }
    
    .product-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .product-item {
        margin: 0;
        border-radius: 8px;
    }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 500px) {
    .product-list-container {
        max-height: 55vh;
    }
    
    .step-progress {
        flex-direction: row;
        gap: 20px;
    }
    
    .step {
        flex: 1;
    }
}

/* 已修改的商品行 */
.product-item.modified {
    background: #fff3cd;
    border-color: #ffc107;
}

.product-item.modified .col-actual {
    color: #e74c3c;
    font-weight: 600;
}

.actual-input.modified {
    background: #fff3cd;
    border-color: #ffc107;
    color: #e74c3c;
    font-weight: 600;
}

/* 已确认的商品行 */
.product-item.confirmed .col-actual {
    color: #27ae60;
}

/* 未确认的商品行 */
.product-item:not(.confirmed) {
    background: #f8f9fa;
}

.product-item:not(.confirmed) .col-actual {
    color: #999;
}

.product-item:not(.confirmed) .actual-input {
    border-style: dashed;
    border-color: #ccc;
}

/* ========== 步骤3：班次数据 ========== */
.step3-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.step3-card h2 {
    text-align: center;
    flex-shrink: 0;
}

.shift-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shift-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.shift-item:hover {
    background: #f0f0f0;
}

.shift-item.selected {
    background: #e8f5e9;
    border: 2px solid #27ae60;
}

.shift-item .shift-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.shift-item .shift-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shift-item .shift-time {
    font-size: 0.9em;
    color: #333;
}

.shift-item .shift-cashier {
    font-size: 0.85em;
    color: #666;
}

.shift-item .shift-amount {
    font-size: 1.1em;
    font-weight: 700;
    color: #27ae60;
    text-align: right;
    min-width: 80px;
}

/* ========== 人员显示 ========== */
.person-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.person-display label {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.person-display span {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

/* 现金交接输入行 */
.cash-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cash-input-row span {
    flex-shrink: 0;
}

.cash-input-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    text-align: right;
}

.cash-input-row input:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* 商品差异列表 */
.product-diff-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 240px;
    overflow-y: auto;
}

.product-diff-header {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    background: #f0f0f0;
    border-radius: 6px 6px 0 0;
    font-size: 0.8em;
    color: #999;
    font-weight: 500;
}

.product-diff-row {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9em;
}

.product-diff-row:last-of-type {
    border-bottom: none;
    border-radius: 0 0 6px 6px;
}

.diff-col-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.diff-col-price {
    width: 70px;
    text-align: right;
    color: #666;
}

.diff-col-diff {
    width: 60px;
    text-align: right;
    font-weight: 600;
}

.diff-col-diff.positive {
    color: #e74c3c;
}

.diff-col-diff.negative {
    color: #3498db;
}

.product-diff-summary {
    text-align: center;
    color: #999;
    font-size: 0.8em;
    padding: 6px 0;
    border-top: 1px solid #f0f0f0;
}

.product-diff-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 0.9em;
}

.product-diff-item .product-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-diff-item .product-price {
    width: 70px;
    text-align: right;
    color: #666;
}

.product-diff-item .product-diff {
    width: 70px;
    text-align: right;
    font-weight: 600;
}

.product-diff-item .product-diff.more {
    color: #e74c3c;
}

.product-diff-item .product-diff.less {
    color: #3498db;
}

.product-diff-empty {
    text-align: center;
    color: #999;
    padding: 20px;
    font-size: 0.9em;
}

/* ========== 历史交接班列表 ========== */
.history-card {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.history-card h2 {
    flex-shrink: 0;
    margin-bottom: 12px;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.history-item {
    background: #fafafa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

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

.history-date {
    font-size: 0.85em;
    color: #666;
}

.history-cash-diff {
    font-weight: 600;
    font-size: 0.85em;
}

.history-cash-diff.positive {
    color: #e74c3c;
}

.history-cash-diff.negative {
    color: #27ae60;
}

.history-cash-diff.normal {
    color: #666;
}

.history-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-persons {
    font-size: 0.9em;
    color: #333;
}

.history-arrow {
    color: #999;
    margin: 0 6px;
}

.history-stats {
    display: flex;
    gap: 12px;
    font-size: 0.8em;
    color: #999;
    margin-top: 6px;
}

.history-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 0.9em;
}

/* 结算checkbox样式 */
.history-stats .checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8em;
    color: #666;
    cursor: pointer;
    margin-left: auto;
}

.settle-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #1890ff;
}


/* ========== 首页样式 ========== */
#homePage {
    flex-direction: column;
    height: 100%;
    position: relative;
}

#homePage.active {
    display: flex !important;
}

/* 管理入口按钮 */
.btn-settings {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.2s;
    z-index: 10;
}
.btn-settings:hover {
    opacity: 1;
}

/* 上段：Header */
.home-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px 20px;
    text-align: center;
    flex-shrink: 0;
}

.shop-logo {
    font-size: 48px;
    margin-bottom: 8px;
}

.shop-name {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
}

.welcome-text {
    font-size: 14px;
    opacity: 0.9;
}

/* 中段：列表区域 */
.home-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.home-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.home-list {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.list-empty,
.list-loading {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* 待接班列表项 */
.pending-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.pending-item:last-child {
    border-bottom: none;
}

.pending-item:hover {
    background: #f5f5f5;
}

.pending-item:active {
    background: #e8e8e8;
}

.pending-info {
    flex: 1;
}

.pending-person {
    font-size: 15px;
    color: #333;
    margin-bottom: 4px;
}

.pending-shift-time {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
    font-weight: 400;
}

.pending-cash {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    margin-right: 8px;
}

.pending-cash-actual {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.pending-meta {
    font-size: 12px;
    color: #999;
}

.pending-arrow {
    color: #ccc;
    font-size: 18px;
}

.rejected-item {
    border-left: 3px solid #ff9800;
}

.rejected-reason {
    font-size: 12px;
    color: #e65100;
    margin-top: 4px;
    line-height: 1.4;
}

/* 历史记录列表项 */
.history-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background: #f5f5f5;
}

.history-info {
    flex: 1;
}

.history-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.history-date {
    font-size: 13px;
    color: #666;
    margin-bottom: 2px;
}

.history-person {
    font-size: 14px;
    color: #333;
}

.history-amount {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.history-submit-amount {
    font-size: 13px;
    color: #888;
}

.history-submit-original {
    font-size: 11px;
    color: #aaa;
}

.history-diff {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

.history-diff.positive {
    background: #f6ffed;
    color: #52c41a;
}

.history-diff.negative {
    background: #fff2f0;
    color: #f5222d;
}

/* 下段：按钮导航 */
.home-footer {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

/* ========== 历史记录页面 ========== */
#historyPage {
    padding: 15px;
}

#historyPage .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.btn-back {
    background: transparent;
    border: none;
    color: #1890ff;
    font-size: 14px;
    cursor: pointer;
}

.history-full-list {
    flex: 1;
    overflow-y: auto;
}

.history-stats {
    display: flex;
    gap: 0;
    background: #fafafa;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.stat-item {
    flex: 1;
    text-align: center;
    padding: 10px 4px;
    border-right: 1px solid #eee;
}

.stat-item:last-child {
    border-right: none;
}

.stat-label {
    display: block;
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.stat-value.positive {
    color: #52c41a;
}

.stat-value.negative {
    color: #f5222d;
}

.history-filter {
    margin-bottom: 12px;
    flex-shrink: 0;
}

.filter-tabs {
    display: flex;
    gap: 0;
    background: #f0f0f0;
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 10px;
}

.filter-tab {
    flex: 1;
    padding: 7px 0;
    border: none;
    background: transparent;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.filter-tab.active {
    background: #fff;
    color: #1890ff;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.filter-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #999;
}

.filter-custom input[type="date"] {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
}

.filter-person input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.filter-person input:focus {
    border-color: #1890ff;
}

.history-footer {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.btn-history-back {
    flex: 1;
    height: 44px;
    font-size: 15px;
    border-radius: 8px;
}

.history-full-item {
    background: white;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    cursor: pointer;
}

.history-full-item:active {
    background: #f5f5f5;
}

.history-full-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.history-full-date {
    font-size: 13px;
    color: #666;
}

.history-full-body {
    display: flex;
    justify-content: space-between;
}

.history-full-person {
    font-size: 14px;
    color: #333;
}

.history-full-cash {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}


/* ========== 隐藏分页指示器 ========== */
.pagination {
    display: none !important;
}


/* ========== 步骤1标题居中 ========== */
.step1-card h2 {
    text-align: center;
}
