:root {
  --brand: #2f6df6;
  --brand-2: #5b8def;
  --brand-d: #1f53c9;
  --bg: #eef1f8;
  --card: #ffffff;
  --text: #1f2733;
  --muted: #8a93a6;
  --line: #e6e9f0;
  --ok: #1fab63;
  --no: #e5484d;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1200px 400px at 50% -120px, rgba(47,109,246,.18), transparent 60%),
    var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.app { max-width: 480px; margin: 0 auto; padding: 0 14px 40px; }

.topbar { padding: 30px 6px 16px; text-align: center; }
.brand {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 1px;
  color: var(--brand); background: #e8f0ff; padding: 4px 12px; border-radius: 999px; margin-bottom: 10px;
}
.topbar h1 {
  margin: 0; font-size: 22px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(90deg, var(--brand-d), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.topbar .sub { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 18px 18px 20px;
  box-shadow: 0 12px 34px rgba(31, 39, 51, .10);
  border: 1px solid rgba(255,255,255,.6);
}
.field { display: block; margin: 16px 0; }
.field > span { display: block; font-size: 14px; color: #4a5468; margin-bottom: 7px; font-weight: 600; }
.field input, .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 13px 14px; font-size: 16px; background: #fbfcff; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus {
  border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 4px rgba(47,109,246,.12);
}
.field textarea { resize: vertical; min-height: 88px; }
.field select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 13px 14px; font-size: 16px; background: #fbfcff; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a93a6' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.field select:focus { border-color: var(--brand); background-color: #fff; box-shadow: 0 0 0 4px rgba(47,109,246,.12); }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 .field { margin: 16px 0; }
/* 日期输入框与其他输入框对齐 */
.field input[type="date"] {
  min-height: 50px;
  -webkit-appearance: none; appearance: none;
  line-height: 1.3;
  padding: 13px 14px;
}
@media (max-width: 400px) {
  .row2 { grid-template-columns: 1fr; gap: 0; }
}

.days-row {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  margin: 16px 0; padding: 13px 14px; background: linear-gradient(90deg, #eef3ff, #f5f8ff);
  border: 1px solid #e1e9ff; border-radius: 12px;
}
.days-row > span { font-size: 14px; font-weight: 600; color: #4a5468; }
.days-row b { font-size: 24px; color: var(--brand); font-weight: 800; }
.days-row em { font-style: normal; color: #4a5468; font-size: 14px; }
.days-row i { font-style: normal; color: var(--muted); font-size: 12px; flex-basis: 100%; }

.sig-box { position: relative; }
.sig-canvas {
  width: 100%; height: 160px; border: 1.5px dashed #c4ccdb; border-radius: 12px;
  background: #fbfcff; touch-action: none; display: block;
}
.clear-btn { margin-top: 8px; }
.sig-tip { color: var(--muted); font-size: 12px; margin: 6px 2px 0; }
.field-hint { color: var(--muted); font-size: 12px; margin: 6px 2px 0; }
.hint { color: var(--muted); font-size: 12px; margin: 4px 2px 0; }
.hint-warn { color: #e07b1a; font-size: 12px; margin: 4px 2px 0; font-weight: 600; }
.hint-ok { color: var(--ok); font-size: 12px; margin: 4px 2px 0; font-weight: 600; }

/* ---------- 查询进度卡片 ---------- */
.query-card { margin-bottom: 14px; padding: 14px 16px; }
.query-title { font-size: 14px; font-weight: 700; color: #4a5468; margin-bottom: 10px; }
.query-row { display: flex; gap: 8px; }
.query-input {
  flex: 1; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; background: #fbfcff; outline: none;
}
.query-input:focus { border-color: var(--brand); }
.query-btn { flex: none; padding: 10px 16px; font-size: 14px; }
.query-result { margin-top: 10px; font-size: 13px; }
.qr-msg, .qr-loading { color: var(--muted); font-size: 13px; }
.qr-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.qr-head b { font-size: 15px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.b-approved { background: #e3f7ec; color: var(--ok); }
.b-rejected { background: #fde8e8; color: var(--no); }
.b-pending { background: #eef1f8; color: #6b7688; }
.qr-row { display: flex; gap: 8px; padding: 3px 0; }
.qr-row span { color: var(--muted); width: 40px; flex: none; }
.qr-steps { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.qr-step { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.qr-step-name { flex: 1; color: #4a5468; }
.qr-step-by { color: var(--muted); font-size: 11px; }
.st-ok { color: var(--ok); font-weight: 600; }
.st-no { color: var(--no); font-weight: 600; }
.st-pending { color: #6b7688; }

/* ---------- 申请编号预览 ---------- */
.id-preview {
  display: flex; justify-content: space-between; align-items: center;
  margin: 16px 2px 0; padding: 10px 14px;
  background: #f0f4ff; border: 1px solid #dbe5ff; border-radius: 10px;
}
.id-preview span { font-size: 13px; color: #4a5468; }
.id-preview b { font-size: 15px; color: var(--brand); font-weight: 800; letter-spacing: .5px; }

/* ---------- 附件预览 ---------- */
.att-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.att-preview-item { position: relative; width: 76px; height: 76px; }
.att-preview-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.att-del {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
  border-radius: 50%; border: none; background: var(--no); color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* ---------- 结果卡片二维码 ---------- */
.btn-row { margin: 4px 0; }
.copy-lg { padding: 10px 16px; font-size: 14px; }
.qr-box { margin: 8px 0; }
.qr-box img, .qr-box canvas { border: 1px solid var(--line); border-radius: 8px; }
.flow-text { margin: 4px 0; color: #4a5468; }

.promise {
  display: flex; gap: 10px; align-items: flex-start; margin: 18px 2px 4px;
  padding: 12px 14px; background: #f7f9fc; border-radius: 12px; cursor: pointer;
}
.promise input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.promise span { font-size: 13px; color: #4a5468; line-height: 1.5; }

.primary {
  width: 100%; margin-top: 14px; border: none; border-radius: 14px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff;
  font-size: 17px; font-weight: 800; letter-spacing: 1px; padding: 15px; cursor: pointer;
  box-shadow: 0 8px 20px rgba(47,109,246,.30); transition: transform .08s, box-shadow .15s;
}
.primary:active { transform: translateY(1px); box-shadow: 0 4px 12px rgba(47,109,246,.28); }
.primary:disabled { background: #b9c4dc; box-shadow: none; cursor: not-allowed; }

.msg { margin: 14px 4px 0; font-size: 14px; min-height: 18px; color: var(--no); font-weight: 600; }
.msg.ok { color: var(--ok); }

.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* ---------- 提交成功结果卡片 ---------- */
.result { margin-top: 14px; }
.result.hidden { display: none; }
.ok-banner { text-align: center; color: var(--ok); font-weight: 800; font-size: 18px; margin-bottom: 14px; }
.result .kv { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.result .kv > span { width: 96px; color: var(--muted); flex: none; }
.result .kv > b { font-weight: 600; }
.result .kv.col { flex-direction: column; gap: 4px; }
.link-url {
  font-size: 12px; color: var(--muted); word-break: break-all; margin: 8px 0 10px; line-height: 1.45;
  background: #f7f9fc; padding: 8px 10px; border-radius: 8px;
}
