/* ==========================================================================
   问卷调查 · 移动端
   商务简约：深海军蓝 + 金铜点缀 + 白色卡片
   ========================================================================== */

:root {
  --ink: #0f1e30;
  --ink-2: #33455c;
  --muted: #7a8899;
  --line: #e6eaf0;
  --line-strong: #d3dae4;
  --navy: #123a63;
  --navy-2: #1b5488;
  --navy-soft: #eef3f9;
  --gold: #c8a86a;
  --gold-soft: #f6efe0;
  --danger: #b5462f;
  --radius-l: 20px;
  --radius-m: 14px;
  --radius-s: 10px;
  --shadow-card: 0 1px 2px rgba(12, 28, 48, .04), 0 10px 30px rgba(12, 28, 48, .08);
  --bg-image: url("bg.svg");
  --bg-photo: none;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background-color: #0b1a2c;
  background-image:
    linear-gradient(180deg, rgba(8, 20, 34, .34) 0%, rgba(8, 20, 34, .12) 28%, rgba(8, 20, 34, .42) 100%),
    var(--bg-photo),
    var(--bg-image);
  background-repeat: no-repeat;
  background-position: center top, center top, center top;
  background-size: cover, cover, cover;
  background-attachment: scroll, fixed, fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; }

.page {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 26px 18px calc(132px + env(safe-area-inset-bottom));
}

/* ---------------------------------------------------------------- 顶部品牌区 */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #0e2138;
  background: linear-gradient(135deg, #f0dcb4, #c8a86a);
  box-shadow: 0 4px 14px rgba(200, 168, 106, .35);
  flex: 0 0 auto;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .08em;
  color: #fff;
  text-transform: uppercase;
}
.brand-tag {
  font-size: 11px;
  letter-spacing: .18em;
  color: rgba(255, 255, 255, .62);
}

.hero { margin-bottom: 20px; }

.hero-eyebrow {
  display: inline-block;
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--gold);
  border: 1px solid rgba(200, 168, 106, .45);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 26px;
  line-height: 1.35;
  letter-spacing: -.01em;
  color: #fff;
  font-weight: 700;
}

.hero-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: rgba(255, 255, 255, .74);
}

.progress-wrap { margin: 22px 0 18px; }

.progress-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #e6cf9d, #c8a86a);
  transition: width .45s cubic-bezier(.4, 0, .2, 1);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11.5px;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .66);
}

/* ---------------------------------------------------------------- 题目卡片 */
.q-card {
  background: #fff;
  border-radius: var(--radius-l);
  padding: 20px 18px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, .6);
  animation: cardIn .5s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.q-card.is-invalid { border-color: rgba(181, 70, 47, .45); box-shadow: 0 0 0 3px rgba(181, 70, 47, .08); }

.q-head { display: flex; gap: 12px; align-items: flex-start; }

.q-index {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  background: var(--navy-soft);
}

.q-main { flex: 1 1 auto; min-width: 0; }

.q-title {
  margin: 3px 0 0;
  font-size: 15.5px;
  line-height: 1.55;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.q-title .req { color: var(--gold); margin-left: 3px; font-weight: 700; }

.q-type {
  display: inline-block;
  margin-top: 9px;
  font-size: 10.5px;
  letter-spacing: .1em;
  color: var(--muted);
  background: #f4f6fa;
  border-radius: 999px;
  padding: 3px 9px;
}

.q-type.is-req { color: #8a6a2c; background: var(--gold-soft); }

.q-body { margin-top: 14px; }

/* 选项 */
.opt {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: #fff;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .12s;
  margin-bottom: 9px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-2);
  user-select: none;
}

.opt:last-child { margin-bottom: 0; }

.opt:active { transform: scale(.995); }

.opt:hover { border-color: var(--line-strong); }

.opt input { position: absolute; opacity: 0; pointer-events: none; }

.opt .ind {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  border: 1.5px solid #c3cddb;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: border-color .2s, background .2s;
  position: relative;
}

.opt .ind::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform .18s cubic-bezier(.2, .8, .3, 1.4);
}

.opt.is-checkbox .ind { border-radius: 6px; }
.opt.is-checkbox .ind::after {
  width: 10px;
  height: 6px;
  border-radius: 0;
  background: transparent;
  border-left: 1.8px solid #fff;
  border-bottom: 1.8px solid #fff;
  transform: rotate(-45deg) scale(0);
  margin-top: -2px;
}

.opt.checked {
  border-color: var(--navy);
  background: linear-gradient(0deg, rgba(18, 58, 99, .045), rgba(18, 58, 99, .045)), #fff;
  box-shadow: 0 0 0 1px rgba(18, 58, 99, .35) inset;
}

.opt.checked .ind {
  border-color: var(--navy);
  background: var(--navy);
}

.opt.checked .ind::after { transform: scale(1); }
.opt.is-checkbox.checked .ind::after { transform: rotate(-45deg) scale(1); }
.opt.checked .opt-label { color: var(--ink); font-weight: 500; }

.opt-label { flex: 1 1 auto; word-break: break-word; }

/* 问答 */
textarea.q-text {
  width: 100%;
  min-height: 96px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: #fbfcfe;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

textarea.q-text::placeholder { color: #a9b4c2; }

textarea.q-text:focus {
  border-color: var(--navy-2);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(27, 84, 136, .1);
}

.q-counter {
  margin-top: 7px;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.q-error {
  display: none;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--danger);
}

.q-card.is-invalid .q-error { display: block; }

/* ---------------------------------------------------------------- 底部提交 */
.footer-note {
  margin: 20px 2px 0;
  font-size: 11.5px;
  line-height: 1.8;
  color: rgba(255, 255, 255, .5);
  text-align: center;
}

.submit-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid rgba(15, 30, 48, .07);
  box-shadow: 0 -10px 28px rgba(12, 28, 48, .08);
  z-index: 20;
}

.submit-inner { max-width: 520px; margin: 0 auto; }

.submit-hint {
  margin: 0 auto 2px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.5;
  color: #8a6a2c;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .25s, opacity .25s, margin .25s;
}

.submit-hint.show {
  max-height: 22px;
  margin-bottom: 6px;
  opacity: 1;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 15px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #fff;
  background: linear-gradient(135deg, #16406e, #0f2f52);
  box-shadow: 0 8px 22px rgba(15, 47, 82, .28);
  cursor: pointer;
  transition: transform .12s, box-shadow .2s, opacity .2s;
}

.btn:active { transform: translateY(1px); box-shadow: 0 4px 14px rgba(15, 47, 82, .24); }
.btn[disabled] { opacity: .62; box-shadow: none; cursor: default; }

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: spin .7s linear infinite;
}

.btn.loading .btn-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- 成功页 */
.done-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.done-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 24px;
  padding: 38px 26px 30px;
  text-align: center;
  box-shadow: 0 16px 50px rgba(8, 20, 34, .28);
  animation: cardIn .55s cubic-bezier(.2, .8, .3, 1) both;
}

.done-badge {
  width: 66px;
  height: 66px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #16406e, #0f2f52);
  box-shadow: 0 10px 24px rgba(15, 47, 82, .26);
  animation: pop .6s cubic-bezier(.2, .8, .3, 1.4) both .1s;
}

@keyframes pop {
  from { transform: scale(.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.done-badge svg { width: 30px; height: 30px; }

.done-card h2 {
  margin: 0 0 10px;
  font-size: 21px;
  color: var(--ink);
  letter-spacing: -.01em;
}

.done-card p {
  margin: 0 0 22px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--muted);
}

.done-meta {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.done-meta b { color: var(--ink-2); font-weight: 600; }

.link-again {
  display: inline-block;
  margin-top: 18px;
  font-size: 13px;
  color: var(--navy-2);
  text-decoration: none;
  border-bottom: 1px solid rgba(27, 84, 136, .3);
  padding-bottom: 2px;
}

/* ---------------------------------------------------------------- 通用：骨架与提示 */
.skeleton-card {
  background: #fff;
  border-radius: var(--radius-l);
  padding: 22px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}

.sk-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef1f6, #f7f9fc, #eef1f6);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  margin-bottom: 10px;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.toast {
  position: fixed;
  left: 50%;
  top: 24px;
  transform: translate(-50%, -16px);
  max-width: 84vw;
  padding: 11px 18px;
  border-radius: 12px;
  background: rgba(15, 30, 48, .94);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 10px 30px rgba(8, 20, 34, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 60;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: rgba(148, 46, 30, .95); }

/* 大屏微调 */
@media (min-width: 560px) {
  .page { padding-top: 44px; }
  .hero h1 { font-size: 30px; }
}
