/* 已开发票管理 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f0f2f5; color: #333; font-size: 14px; }

/* 登录 */
#loginScreen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; background: #652025; }
#loginScreen h1 { font-size: 22px; letter-spacing: 2px; margin-bottom: 6px; color: #fff; }
#loginScreen .sub { font-size: 13px; color: rgba(255,255,255,.62); margin-bottom: 34px; }
.pwd-box { width: 100%; max-width: 300px; position: relative; padding: 0 20px; }
#pwdInput { width: 100%; padding: 12px 14px; border: none; border-radius: 8px; font-size: 15px; outline: none; }
#loginBtn { margin-top: 18px; padding: 12px 0; width: 260px; border: none; border-radius: 8px; background: #C9660F; color: #fff; font-size: 16px; letter-spacing: 4px; }
#loginBtn:active { background: #a85608; }
#loginErr { font-size: 13px; color: #FFB3AB; margin-top: 12px; min-height: 18px; }

/* 顶栏 */
header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #652025; color: #fff; position: sticky; top: 0; z-index: 10; }
header .logo { font-size: 17px; font-weight: 600; letter-spacing: 1px; }
header .back { color: rgba(255,255,255,.8); font-size: 13px; text-decoration: none; }

/* 统计 */
.stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px 12px 0; }
.stat { background: #fff; border-radius: 10px; padding: 10px 8px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.stat-num { font-size: 15px; font-weight: 700; color: #652025; word-break: break-all; }
.stat-label { font-size: 11px; color: #999; margin-top: 3px; }

/* 筛选 */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
.filter-bar select, .filter-bar input { padding: 8px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; background: #fff; outline: none; }
.filter-bar select { max-width: 160px; }
.filter-bar input { flex: 1; min-width: 120px; }
.btn-add { background: #C9660F; color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 600; white-space: nowrap; }

/* 记录列表（卡片式，手机友好） */
.record-list { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 24px; }
.record-card { background: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.rc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rc-customer { font-size: 14px; font-weight: 600; line-height: 1.4; flex: 1; }
.rc-amount { font-size: 16px; font-weight: 700; color: #C9660F; white-space: nowrap; }
.rc-mid { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 12px; color: #666; }
.rc-tag { display: inline-block; background: #f3e6e6; color: #8a4444; border-radius: 4px; padding: 1px 6px; font-size: 11px; }
.status-chip { display: inline-block; border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 600; }
.st-settled { background: #e6f4ea; color: #2e7d4f; }
.st-pending { background: #fff3e0; color: #b26a00; }
.st-arrived { background: #e3f2fd; color: #1565c0; }
.st-charged { background: #eceff1; color: #546e7a; }
.rc-remark { margin-top: 6px; font-size: 12px; color: #999; line-height: 1.5; }
.rc-actions { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; flex-wrap: wrap; }
.rc-actions button { border: none; border-radius: 6px; padding: 6px 12px; font-size: 12px; }
.btn-arrive { background: #e3f2fd; color: #1565c0; font-weight: 600; }
.btn-charge { background: #eceff1; color: #546e7a; font-weight: 600; }
.btn-edit { background: #f0f2f5; color: #555; }
.btn-del { background: #fdeaea; color: #c0392b; }

.empty { text-align: center; color: #999; padding: 40px 0; font-size: 13px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; padding: 18px 16px; }
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-wide { grid-column: span 2; }
.field label { font-size: 12px; color: #888; }
.field input, .field select, .field textarea { padding: 9px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; outline: none; width: 100%; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #C9660F; }
.radio-row { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.radio-item { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #444; }
.radio-item input { width: auto; }
.modal-btns { display: flex; gap: 10px; margin-top: 16px; }
.modal-btns button { flex: 1; padding: 11px 0; border: none; border-radius: 8px; font-size: 15px; }
.btn-ghost { background: #f0f2f5; color: #555; }
.btn-primary { background: #C9660F; color: #fff; font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); background: rgba(0,0,0,.78); color: #fff; padding: 9px 18px; border-radius: 20px; font-size: 13px; display: none; z-index: 200; }

@media (max-width: 480px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .stat-num { font-size: 13px; }
}
