/* 报销助手 手机版样式(mobile-first) */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 16px; color: #222; background: #f3f4f6;
}

#content {
  padding: 16px 14px;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
  max-width: 720px; margin: 0 auto;
}
h1 { font-size: 22px; margin-bottom: 14px; }
h2 { font-size: 17px; margin-bottom: 12px; }
h3 { font-size: 15px; margin: 14px 0 8px; }
.page { display: none; }
.page.active { display: block; }

.card {
  background: #fff; border-radius: 14px; padding: 16px;
  margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.card-head h2 { margin-bottom: 0; }

.info-bar {
  background: #e0ecff; border-radius: 10px; padding: 11px 14px; margin-bottom: 14px;
  font-size: 14px; line-height: 1.5;
}
.info-bar.warn { background: #fff3cd; }

/* 表单:手机上标签在输入框上方 */
.form-row { margin-bottom: 14px; }
.form-row > label, .form-row div > label {
  display: block; margin-bottom: 6px; color: #444; font-size: 14px;
}
.form-row input[type=text], .form-row input[type=password],
.form-row input[type=number], .form-row input[type=date], .form-row select {
  font-size: 16px; padding: 11px 12px; border: 1px solid #ccd2dc; border-radius: 10px;
  width: 100%; font-family: inherit; background: #fff; appearance: none; -webkit-appearance: none;
}
.form-row input[type=date] { min-height: 46px; }
.form-row.two-col { display: flex; gap: 10px; }
.form-row.two-col > div { flex: 1; }
.hint-inline { color: #999; font-weight: normal; font-size: 12px; }

.checkbox-label { display: block; font-size: 15px; margin: 12px 0; cursor: pointer; }
.checkbox-label input { transform: scale(1.35); margin-right: 8px; vertical-align: middle; }

.btn {
  font-size: 15px; padding: 10px 16px; border-radius: 10px; border: 1px solid #ccd2dc;
  background: #fff; cursor: pointer; font-family: inherit; color: #222;
}
.btn:active { background: #f0f3f8; }
.btn.primary { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.btn.primary:active { background: #2f6fe0; }
.btn.success { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn.success:active { background: #128a3f; }
.btn.danger { background: #fff; color: #dc2626; border-color: #f2b9b9; }
.btn.big { font-size: 17px; padding: 13px 22px; }
.btn.small { font-size: 14px; padding: 8px 12px; }
.btn.wide { width: 100%; display: block; margin: 10px 0 4px; }
.btn.link { border: none; background: none; color: #3b82f6; text-decoration: underline; padding: 8px 0; }
.btn:disabled { opacity: .5; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

.hint { color: #777; font-size: 13px; margin-bottom: 10px; line-height: 1.5; }
.file-name { color: #555; font-size: 13px; margin: 6px 0 10px; }

.result-box {
  background: #f0fdf4; border: 1px solid #bbe7c8; border-radius: 10px;
  padding: 12px 14px; margin: 10px 0; font-size: 14px; line-height: 1.7;
  word-break: break-word;
}
.result-box.err { background: #fef2f2; border-color: #f3c2c2; }

.email-box {
  background: #f8fafc; border: 1px solid #dde3ec; border-radius: 10px;
  padding: 14px; white-space: pre-wrap; font-family: inherit;
  font-size: 14px; line-height: 1.7; margin-bottom: 10px; word-break: break-word;
}

/* 表格:窄屏横向滚动 */
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { border: 1px solid #e3e7ee; padding: 9px 10px; text-align: left; vertical-align: middle; }
.table th { background: #f6f8fb; font-weight: 600; white-space: nowrap; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table input { font-size: 16px; padding: 8px; border: 1px solid #ccd2dc; border-radius: 8px; width: 100%; min-width: 70px; font-family: inherit; }
.table input[type=number] { min-width: 84px; }
.table .empty { color: #999; text-align: center; padding: 18px; }
.table .btn { white-space: nowrap; }

/* 自动补全 */
.ac-wrap { position: relative; width: 100%; }
.ac-wrap input { width: 100%; }
.ac-list {
  position: absolute; top: 100%; left: 0; right: 0; background: #fff; z-index: 30;
  border: 1px solid #ccd2dc; border-radius: 0 0 10px 10px; display: none;
  max-height: 220px; overflow-y: auto; box-shadow: 0 6px 14px rgba(0,0,0,.12);
}
.ac-list.show { display: block; }
.ac-item { padding: 12px; cursor: pointer; font-size: 14px; border-bottom: 1px solid #f0f2f6; }
.ac-item:active { background: #eef4ff; }

.hidden { display: none !important; }

/* 常用地点 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 36px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: #eef4ff; border: 1px solid #c3d6f5; color: #1d4ed8;
  border-radius: 999px; padding: 9px 14px; font-size: 15px; cursor: pointer;
}
.chip .chip-x { color: #93a6c4; font-weight: bold; cursor: pointer; padding: 0 4px; }
.chip.chip-add { background: #fff; border-style: dashed; color: #555; }
.fav-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.fav-form input { font-size: 16px; padding: 11px 12px; border: 1px solid #ccd2dc; border-radius: 10px; font-family: inherit; width: 100%; }

/* 底部导航 */
#tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; background: #fff; border-top: 1px solid #e3e7ee;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}
.tab-btn {
  flex: 1; background: none; border: none; font-family: inherit;
  font-size: 12px; color: #889; padding: 8px 0 9px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tab-btn .tab-ico { font-size: 24px; line-height: 1.2; }
.tab-btn.active { color: #2f6fe0; font-weight: 600; }

/* 登录 */
.login {
  position: fixed; inset: 0; background: #f3f4f6; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-box {
  background: #fff; border-radius: 16px; padding: 32px 24px; width: 100%; max-width: 360px;
  box-shadow: 0 4px 20px rgba(0,0,0,.1); text-align: center;
}
.login-logo { font-size: 48px; margin-bottom: 8px; }
.login-box h1 { margin-bottom: 6px; }
.login-box input {
  width: 100%; font-size: 17px; padding: 13px; border: 1px solid #ccd2dc;
  border-radius: 10px; margin: 14px 0; text-align: center; font-family: inherit;
}
.login-box .btn { width: 100%; }
.login-err { color: #dc2626; font-size: 14px; margin-top: 12px; min-height: 20px; }

/* 遮罩与提示 */
#overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,.8); z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.spinner {
  width: 46px; height: 46px; border: 5px solid #cfd8ea; border-top-color: #3b82f6;
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#overlay-text { font-size: 16px; color: #333; padding: 0 24px; text-align: center; }

#toast {
  position: fixed; bottom: calc(90px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  background: #1f2a44; color: #fff; padding: 12px 22px; border-radius: 12px;
  font-size: 15px; z-index: 110; max-width: 86%; text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); line-height: 1.5;
}
#toast.err { background: #b91c1c; }
