:root {
  --bg: #f5f6f7;
  --card: #ffffff;
  --text: #1f2329;
  --text-2: #646a73;
  --text-3: #8f959e;
  --line: #dee0e3;
  --line-2: #eff0f1;
  --primary: #3370ff;
  --primary-press: #245bdb;
  --green: #34c724;
  --green-bg: #f0fbef;
  --green-line: #b7edb0;
  --orange: #ff8800;
  --orange-bg: #fff8f0;
  --orange-line: #ffd3a1;
  --red: #f54a45;
  --grey-bg: #f2f3f5;
  --radius: 10px;
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}

#app { max-width: 560px; margin: 0 auto; padding: 14px 14px 40px; }
.hidden { display: none !important; }
.muted { color: var(--text-2); font-size: 13px; }
.tiny { color: var(--text-3); font-size: 12px; }

/* ---------- 测试模式条 ---------- */
.devbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff8e6; border-bottom: 1px solid #ffe08a;
  padding: 7px 14px; font-size: 12px; color: #8a6100;
}
.devbar select {
  border: 1px solid #ffd666; border-radius: 5px; background: #fff;
  padding: 3px 6px; font-size: 12px; color: #8a6100;
}
.devbar .devnote { color: #b08a3a; }

/* ---------- 表单头 ---------- */
.formhead { padding: 2px 2px 14px; }
.formhead h1 { font-size: 18px; margin: 0 0 4px; font-weight: 600; }
.formhead .applicant { font-size: 13px; color: var(--text-3); }
.formhead .applicant b { color: var(--text-2); font-weight: 500; }
.formhead .applicant span { margin-left: 6px; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px 16px; margin-bottom: 14px; }

/* ---------- 字段（对齐飞书审批表单形态） ---------- */
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-size: 14px; margin-bottom: 8px; font-weight: 500; }
.field .req { color: var(--red); margin-left: 3px; }

.field input[type='date'],
.field input[type='number'],
.field select {
  width: 100%; padding: 11px 12px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text);
  font-family: inherit;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); }

.row { display: flex; gap: 10px; }
.row > *:first-child { flex: 1 1 auto; min-width: 0; }
.row > *:last-child { flex: 0 0 96px; }

/* 单选 / 复选，做成飞书审批那种竖排选项 */
.radios { display: flex; flex-direction: column; gap: 10px; }
.radio { display: flex; align-items: flex-start; gap: 9px; font-size: 15px; cursor: pointer; }
.radio input { margin: 4px 0 0; flex: none; width: 16px; height: 16px; accent-color: var(--primary); }
#fDir.radios { flex-direction: row; gap: 26px; }

/* 股票选择器（点开是筛选条） */
.picker {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 12px; font-size: 15px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text);
  font-family: inherit;
}
.picker:active { background: var(--grey-bg); }
.picker .ph { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker .ph.placeholder { color: var(--text-3); }
.picker .chev { flex: none; color: var(--text-3); font-size: 19px; line-height: 1; }

/* ---------- 只读说明块（对齐审批表单里的灰底说明） ---------- */
.notice {
  background: var(--grey-bg); border-radius: 8px; padding: 12px 13px;
  font-size: 13px; line-height: 1.75; color: var(--text-2);
  white-space: pre-wrap; margin-bottom: 20px;
}

/* ---------- 就地提示（对应现有审批"对话框消失/保持不变"的说明框） ---------- */
.hintbox {
  border-radius: 8px; padding: 13px 14px; margin: -6px 0 20px;
  font-size: 14.5px; font-weight: 500; display: flex; gap: 8px; align-items: flex-start;
}
.hintbox .hicon { flex: none; font-size: 16px; line-height: 1.5; }
.hintbox.b { background: var(--green-bg); border: 1px solid var(--green-line); color: #1f8f16; }
.hintbox.a { background: var(--orange-bg); border: 1px solid var(--orange-line); color: #cc6d00; }

/* ---------- 按钮 ---------- */
.btn {
  display: block; width: 100%; padding: 13px 0; font-size: 16px; font-weight: 500;
  border: none; border-radius: 8px; background: var(--primary); color: #fff; cursor: pointer;
  font-family: inherit;
}
.btn:active { background: var(--primary-press); }
.btn[disabled] { background: #bacefd; cursor: not-allowed; }
.btn.ghost { background: none; color: var(--primary); border: 1px solid var(--line); }
.btn.ghost:active { background: var(--grey-bg); }
.btn + .btn { margin-top: 10px; }

.err {
  background: #fef1f1; border: 1px solid #fbc4c4; color: #c9302c;
  border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px;
}

/* ---------- 选择器覆盖层 ---------- */
.layer {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
  display: flex; flex-direction: column;
}
.layer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px; background: var(--card); border-bottom: 1px solid var(--line);
  font-size: 16px; font-weight: 500; flex: none;
}
.layer-head .lbtn {
  border: none; background: none; color: var(--primary); font-size: 15px;
  cursor: pointer; width: 44px; text-align: left; padding: 0; font-family: inherit;
}
.layer-filter { padding: 10px 12px; background: var(--card); border-bottom: 1px solid var(--line); flex: none; }
.layer-filter input {
  width: 100%; padding: 10px 12px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: var(--grey-bg); color: var(--text);
}
.layer-filter input:focus { outline: none; border-color: var(--primary); background: var(--card); }
.layer-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 13px 14px; border: none; background: var(--card);
  border-bottom: 1px solid var(--line-2); text-align: left; font-size: 15px;
  color: var(--text); cursor: pointer; font-family: inherit;
}
.opt:active { background: var(--grey-bg); }
.opt .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt .tag { flex: none; font-size: 11px; padding: 1px 7px; border-radius: 4px; background: var(--grey-bg); color: var(--text-2); }
.groupname { padding: 14px 14px 5px; font-size: 12px; color: var(--text-3); font-weight: 600; background: var(--bg); }
.empty { padding: 30px 14px; text-align: center; color: var(--text-3); font-size: 14px; }

/* ---------- 完成页 ---------- */
.done { text-align: center; padding: 34px 16px 26px; }
.done .big { font-size: 42px; line-height: 1; }
.done h2 { font-size: 18px; margin: 14px 0 6px; }
.done .order {
  display: inline-block; margin: 12px 0 4px; padding: 5px 12px;
  background: var(--grey-bg); border-radius: 6px; font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- 记录 ---------- */
.rec { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.rec:first-child { padding-top: 0; }
.rec:last-child { border-bottom: none; padding-bottom: 0; }
.rec .head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.rec .stock { font-weight: 500; word-break: break-all; }
.rec .meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.badge { flex: none; font-size: 12px; padding: 2px 9px; border-radius: 20px; font-weight: 500; }
.badge.pass { background: var(--green-bg); color: #1f8f16; }
.badge.reject { background: #fef1f1; color: #c9302c; }
.badge.expired { background: var(--grey-bg); color: var(--text-3); }
.badge.pending { background: #fff8f0; color: #cc6d00; }
.countdown { font-size: 12px; color: var(--orange); margin-top: 4px; font-weight: 500; }

.footnote { text-align: center; font-size: 11px; color: var(--text-3); margin-top: 20px; line-height: 1.9; }
.footnote a { color: var(--primary); }

.spinner {
  width: 18px; height: 18px; border: 2px solid #ffffff66; border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }
