/* ============ wrcloud 移动端样式 ============ */
:root {
  --bg: #f2f4f8;
  --card: #ffffff;
  --ink: #17233b;
  --muted: #7a8499;
  --line: #e6eaf1;
  --accent: #2f6bff;
  --accent-weak: #eaf0ff;
  --ok: #0caf6e;
  --warn-bg: #fff7e8;
  --warn-ink: #9a6b16;
  --danger: #e5484d;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(23, 35, 59, 0.07);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10141c;
    --card: #1a2029;
    --ink: #e8ecf3;
    --muted: #8b95a7;
    --line: #2a3240;
    --accent: #5b8cff;
    --accent-weak: #1f2a44;
    --warn-bg: #332a18;
    --warn-ink: #e8b45a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.app { min-height: 100dvh; display: flex; flex-direction: column; }

/* ---- 顶栏 ---- */
.app-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 20px 12px;
  background: linear-gradient(135deg, #2447a8 0%, #2f6bff 100%);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .app-bar { background: linear-gradient(135deg, #1c2f66 0%, #24418f 100%); }
}
.app-bar__title { font-size: 17px; font-weight: 600; letter-spacing: 0.5px; }
.app-bar__link {
  color: rgba(255, 255, 255, 0.92); font-size: 13px; text-decoration: none;
  padding: 5px 12px; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px;
}

/* ---- 页面 ---- */
.page { flex: 1; padding: 14px 16px 0; }
.page--center { display: grid; place-items: center; }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px;
  border: 1px solid var(--line);
}

/* ---- 人员卡 ---- */
.person { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #2f6bff, #6f9bff);
  color: #fff; font-size: 20px; font-weight: 600;
}
.person__meta { flex: 1; min-width: 0; }
.person__name { font-size: 17px; font-weight: 600; }
.person__sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.person__date { font-size: 13px; color: var(--muted); text-align: right; }

/* ---- 提示条 ---- */
.banner {
  border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px;
}
.banner--warn { background: var(--warn-bg); color: var(--warn-ink); }

/* ---- 表单 ---- */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 2px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label {
  display: block; font-size: 13px; color: var(--muted);
  margin-bottom: 6px; font-weight: 500;
}
.field .req { color: var(--danger); }
.field .opt { color: var(--muted); font-weight: 400; font-size: 12px; }

input[type="date"], input[type="time"], input[type="number"], input[type="text"],
select, textarea {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink);
  font-size: 15.5px; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none; -webkit-appearance: none;
}
textarea { height: auto; padding: 12px 14px; resize: none; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 16px; top: 50%;
  width: 9px; height: 9px; pointer-events: none;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
}
select:invalid { color: var(--muted); }

/* ---- 附件 ---- */
.upload-zone {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 64px; border: 1.5px dashed var(--line); border-radius: 12px;
  color: var(--muted); font-size: 14px; cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.upload-zone:active { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }
.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.file-list:empty { display: none; }
.file-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--accent-weak); border-radius: 10px; padding: 9px 12px; font-size: 13px;
}
.file-chip__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip__del {
  flex: none; width: 24px; height: 24px; border: none; border-radius: 50%;
  background: rgba(0, 0, 0, 0.08); color: inherit; font-size: 15px; line-height: 1;
  cursor: pointer;
}
@media (prefers-color-scheme: dark) {
  .file-chip__del { background: rgba(255, 255, 255, 0.12); }
}

/* ---- 提交栏 ---- */
.bottom-space { height: 84px; }
.submit-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: linear-gradient(to top, var(--bg) 65%, transparent);
}
.submit-btn {
  width: 100%; height: 50px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, #2f6bff, #4d84ff);
  color: #fff; font-size: 16.5px; font-weight: 600; font-family: inherit;
  letter-spacing: 4px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(47, 107, 255, 0.35);
  transition: opacity 0.15s, transform 0.1s;
}
.submit-btn:active { transform: scale(0.985); }
.submit-btn[disabled] { opacity: 0.6; pointer-events: none; }

/* ---- 成功浮层 ---- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(13, 18, 28, 0.55); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 24px;
}
.overlay[hidden] { display: none; }
.overlay__panel {
  background: var(--card); border-radius: 20px; padding: 30px 24px 24px;
  width: min(320px, 100%); text-align: center;
  animation: pop 0.28s cubic-bezier(0.2, 1.1, 0.4, 1);
}
@keyframes pop { from { transform: scale(0.85); opacity: 0; } }
.overlay__icon { color: var(--ok); }
.ok-ring { stroke-dasharray: 164; stroke-dashoffset: 164; animation: draw 0.5s 0.05s forwards ease-out; }
.ok-check { stroke-dasharray: 34; stroke-dashoffset: 34; animation: draw 0.35s 0.45s forwards ease-out; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.overlay__title { font-size: 17px; font-weight: 600; margin: 14px 0 20px; }
.overlay__actions { display: flex; flex-direction: column; gap: 10px; }

.btn {
  display: block; height: 44px; line-height: 44px; border-radius: 12px;
  font-size: 15px; text-decoration: none; text-align: center; cursor: pointer;
  border: none; font-family: inherit;
}
.btn--primary { background: var(--accent); color: #fff; font-weight: 600; }
.btn--ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }

/* ---- 记录卡（我的填报） ---- */
.record--today { border-color: var(--accent); box-shadow: 0 4px 20px rgba(47, 107, 255, 0.12); }
.record__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.record__date { font-weight: 600; font-size: 15px; }
.tag {
  font-style: normal; font-size: 11px; color: var(--accent);
  background: var(--accent-weak); border-radius: 6px; padding: 2px 7px; margin-left: 4px;
}
.record__edit { font-size: 13px; color: var(--accent); text-decoration: none; }
.record__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; font-size: 13.5px; }
.record__grid .k { color: var(--muted); margin-right: 8px; }
.record__grid .v { color: var(--ink); }
.record__note {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 13px; color: var(--muted); word-break: break-all;
}

/* ---- 空态 / 错误页 ---- */
.empty { text-align: center; padding: 36px 18px; color: var(--muted); }
.empty .btn { margin-top: 16px; }
.error-card { text-align: center; padding: 40px 24px; max-width: 360px; width: 100%; }
.error-card__icon { color: var(--muted); }
.error-card__title { font-size: 18px; margin: 14px 0 8px; }
.error-card__msg { font-size: 14px; color: var(--muted); }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%);
  background: rgba(23, 28, 40, 0.92); color: #fff; font-size: 14px;
  padding: 10px 18px; border-radius: 10px; z-index: 60;
  animation: toast-in 0.25s ease-out; max-width: 86vw; text-align: center;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---- 页脚备案信息 ---- */
.site-footer {
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  text-align: center; font-size: 12px; color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
