:root {
    --primary: #1677FF;
    --primary-bg: #E6F4FF;
    --bg: #F5F7FA;
    --border: #DDE2E9;
    --text-main: #1D2129;
    --text-sec: #4E5969;
    --accent: #F53F3F;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text-main); font-size: 13px; }

/* Header */
.app-header { background: #fff; padding: 12px 16px; border-bottom: 2px solid var(--primary); text-align: left; }
.app-header h1 { font-size: 16px; color: var(--primary); font-weight: 700; }

.app-content { padding: 12px; padding-bottom: 110px; }

/* Utility */
.form-card { background: #fff; padding: 12px; border-radius: 4px; margin-bottom: 12px; border: 1px solid var(--border); }
.form-row { display: flex; gap: 8px; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.form-group label { display: block; font-size: 11px; color: var(--text-sec); margin-bottom: 4px; font-weight: 700; }
select, input { width: 100%; height: 32px; border: 1px solid var(--border); border-radius: 2px; padding: 0 6px; font-size: 13px; }

/* Add Area */
.add-member-area { margin-bottom: 16px; }
.input-actions { display: flex; gap: 8px; }
.select-full { flex: 1; border-color: var(--primary); }
.btn-add-ext { background: #fff; color: var(--primary); border: 1px solid var(--primary); padding: 0 10px; height: 32px; font-weight: 700; }

/* Table Section */
.section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.section-header .title { font-weight: 700; font-size: 14px; color: var(--primary); }
.badge { font-size: 11px; padding: 1px 6px; border-radius: 10px; background: var(--primary); color: #fff; }
.badge.yellow { background: #ff7d00; }

.table-container { background: #fff; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.excel-table { width: 100%; border-collapse: collapse; min-width: 1600px; table-layout: auto; }
.excel-table th, .excel-table td { border: 1px solid var(--border); padding: 3px 2px; text-align: center; }
.excel-table th { background: #F7F8FA; font-weight: 700; font-size: 11px; color: var(--text-sec); height: 30px; white-space: nowrap; }
.excel-table .sticky-col { position: sticky; left: 0; background: #fff; z-index: 20; border-right: 2px solid var(--border); box-shadow: 2px 0 5px rgba(0,0,0,0.03); min-width: 70px; }
.excel-table th.sticky-col { background: #F7F8FA; z-index: 30; }

/* Category Colors */
.sub-subsidy { background: #E6F4FF !important; color: #0050B3 !important; }
.sub-reimburse { background: #F6FFED !important; color: #237804 !important; }
.sub-corp { background: #FFF7E8 !important; color: #874D00 !important; }
/* 双金额录入样式 */
.attr-box { display: flex; flex-direction: column; gap: 4px; min-width: 80px; }
.attr-item { display: flex; align-items: center; background: #f8f9fa; border-radius: 4px; padding: 2px 4px; border: 1px solid #eee; }
.attr-item span { width: 16px; font-size: 10px; color: #666; font-weight: bold; }
.attr-item input { border: none !important; background: transparent !important; padding: 2px !important; margin: 0 !important; font-size: 11px !important; }

.field-header th { font-size: 10px; background: #fafafa; }

/* Inputs in Table */
.excel-table input { border: none; background: transparent; text-align: center; height: 26px; width: 100%; outline: none; font-size: 13px; min-width: 30px; }
.excel-table input:focus { background: #fff; border: 1px solid var(--primary); }
.excel-table select { border: none; background: transparent; height: 26px; font-size: 11px; cursor: pointer; padding: 0 2px; }

/* Themes */
.ext-theme th { background: #FFF7E8; color: #855800; }
.ext-theme .sticky-col { background: #FFFCF5; }

/* Buttons */
.btn-remove-row { color: #f53f3f; border: none; background: none; font-size: 18px; cursor: pointer; padding: 0 4px; }
.btn-primary { background: var(--primary); color: #fff; border: none; font-weight: 700; border-radius: 4px; }

/* Sticky Footer */
.total-summary-sticky { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; padding: 12px 16px; border-top: 1px solid var(--border); box-shadow: 0 -4px 10px rgba(0,0,0,0.08); z-index: 1000; }
.total-row { display: flex; justify-content: space-between; align-items: center; }
.total-info p { font-size: 12px; color: var(--text-sec); }
.total-amount { font-size: 18px; font-weight: 800; color: var(--accent); }
.btn-submit { padding: 0 24px; height: 44px; font-size: 15px; }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; justify-content: center; align-items: center; }
.modal-content { background: #fff; width: 80%; max-width: 300px; padding: 20px; border-radius: 8px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions .btn { flex: 1; height: 36px; border-radius: 4px; border: none; cursor: pointer; }
.btn-secondary { background: #f2f3f5; color: #4e5969; }
