* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --pink: #ff6b9d;
  --orange: #ff9f43;
  --teal: #00c6a9;
  --violet: #7c5cff;
  --blue: #4facfe;
  --danger: #ff5b5b;
  --text: #333;
  --muted: #8a8a8a;
  --bg: #f6f8ff;
  --card: #fff;
  --radius: 16px;
}
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 68px;
  min-height: 100vh;
  overflow-x: hidden;
}
.hidden { display: none !important; }

/* ============ 顶部 Hero ============ */
#hero {
  position: relative;
  background: linear-gradient(135deg, #4facfe 0%, #00c6a9 50%, #7c5cff 100%);
  color: #fff;
  padding: 0;
  text-align: center;
  overflow: hidden;
}
#heroKv { display: none; width: 100%; height: auto; }
#hero.no-kv { min-height: 168px; }
#hero h1, #hero #activitySubtitle, #hero #activityDesc { display: none; }
#hero h1 { font-size: 26px; letter-spacing: 2px; text-shadow: 0 2px 8px rgba(0,0,0,.15); }
#hero #activitySubtitle {
  display: inline-block; margin-top: 10px; font-size: 13px;
  background: rgba(255,255,255,.22); padding: 4px 16px; border-radius: 20px; backdrop-filter: blur(4px);
}
#hero #activityDesc { margin-top: 12px; font-size: 13px; line-height: 1.7; opacity: .92; max-width: 90%; margin-left: auto; margin-right: auto; }
.hero-badges { position: absolute; top: 14px; right: 14px; display: none; gap: 6px; }
.hero-wave { display: none; }
.badge { font-size: 11px; padding: 3px 10px; border-radius: 12px; background: rgba(255,255,255,.25); }
.hero-wave {
  position: absolute; left: -10%; right: -10%; bottom: -40px; height: 70px;
  background: radial-gradient(circle at 20% 100%, transparent 0, transparent 10px, var(--bg) 10px, var(--bg) 11px, transparent 11px) 0 0/22px 22px,
              radial-gradient(circle at 70% 100%, transparent 0, transparent 10px, var(--bg) 10px, var(--bg) 11px, transparent 11px) 0 0/22px 22px;
  opacity: .6;
}

/* ============ 布局 ============ */
main { padding: 8px 14px; }
.page { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.section-title {
  font-size: 17px; font-weight: 700; margin: 22px 2px 12px; position: relative; padding-left: 12px;
}
.section-title::before {
  content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 5px; border-radius: 3px;
  background: linear-gradient(180deg, var(--pink), var(--orange));
}
.notice {
  margin-top: 18px; background: #fff7e8; border: 1px solid #ffe0a8; color: #b06a00;
  padding: 12px 14px; border-radius: var(--radius); font-size: 13px; line-height: 1.8;
}
.intro-text { background: var(--card); border-radius: var(--radius); padding: 16px; font-size: 14px; line-height: 1.9; box-shadow: 0 4px 16px rgba(80,120,255,.08); }

/* ============ 阶段圆形流程（横向） ============ */
.phase-list {
  position: relative; display: flex; justify-content: space-between;
  padding: 6px 2px 10px; margin-top: 6px;
}
.ct-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; z-index: 1; position: relative;
}
.ct-item::before, .ct-item::after {
  content: ""; position: absolute; top: 35px; transform: translateY(-50%);
  height: 3px; background: #dfe3f0; border-radius: 2px; pointer-events: none;
}
.ct-item:not(:first-child)::before { left: 0; width: calc(50% - 29px); }
.ct-item:not(:last-child)::after { left: calc(50% + 29px); width: calc(50% - 29px); }
.ct-node {
  width: 58px; height: 58px; border-radius: 50%;
  border: 3px solid var(--blue); color: var(--blue); background: transparent;
  font-weight: 800; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: transform .15s;
}
.ct-item:active .ct-node { transform: scale(.9); }
.ct-node-inner { display: flex; align-items: center; justify-content: center; font-size: inherit; }
.ct-item.ph1 .ct-node { border-color: #4facfe; color: #4facfe; }
.ct-item.ph2 .ct-node { border-color: #ff9f43; color: #ff9f43; }
.ct-item.ph3 .ct-node { border-color: #7c5cff; color: #7c5cff; }
.ct-node.locked { border-color: #b6bcc9; color: #9aa0b4; }
.ct-node.running { animation: nodePulse 2s infinite; }
@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 0 7px rgba(79,172,254,.16); }
  50% { box-shadow: 0 0 0 11px rgba(79,172,254,.08); }
}
.ct-info { text-align: center; width: 100%; padding: 0 4px; }
.ct-title { font-size: 13px; font-weight: 700; line-height: 1.35; min-height: 34px; display: flex; align-items: center; justify-content: center; }
.ct-status { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 12px; display: inline-block; margin-top: 6px; }
.ct-time { font-size: 11px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.st-open { background: #e6f9f0; color: #0a8f5c; }
.st-upcoming { background: #eef1ff; color: #5b6cff; }
.st-ended { background: #f1f1f3; color: #999; }
.st-locked { background: #f1f1f3; color: #999; }

/* ============ 阶段横幅 ============ */
.phase-banner {
  border-radius: var(--radius); padding: 18px; margin-top: 16px; text-align: center;
  background: var(--card); box-shadow: 0 6px 20px rgba(80,120,255,.1);
  border: 2px solid var(--blue); border-top-width: 5px;
}
.phase-banner h2 { font-size: 18px; margin-bottom: 6px; color: var(--text); }
.phase-banner p { font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.ph1 { border-color: #4facfe; } .ph1 h2 { color: #2f8fff; }
.ph2 { border-color: #ff9f43; } .ph2 h2 { color: #ff7b2f; }
.ph3 { border-color: #7c5cff; } .ph3 h2 { color: #a45cff; }
/* H5 各阶段页不再展示阶段横幅 */
.phase-banner { display: none; }
.status-tip { margin: 12px 0; font-size: 13px; color: var(--muted); display: none; }
.survey-tip { display: none; }
/* 保证问卷/相册页内容能滚到底，按钮不被底部导航遮挡 */
#page-survey, #page-gallery { padding-bottom: 96px; }
#page-survey #surveyCard, #page-gallery { overflow: visible; }

/* ============ 图文列表 ============ */
.article-list { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.article {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 6px 20px rgba(80,120,255,.1);
}
.article img { width: 100%; max-height: 220px; object-fit: cover; display: block; }
.article .a-body { padding: 14px 16px; }
.article h3 { font-size: 16px; margin-bottom: 8px; color: #2a3b6e; }
.article p { font-size: 14px; line-height: 1.9; color: #555; white-space: pre-wrap; }
.empty-tip { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0; }

/* ============ 相册 ============ */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.photo-cell { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: #eee; }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.photo-cell:active img { transform: scale(1.06); }
.photo-cell .pc-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 8px 6px; color: #fff; font-size: 11px;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.photo-tag { position: absolute; top: 6px; left: 6px; font-size: 10px; padding: 2px 8px; border-radius: 10px; color: #fff; }
.tag-approved { background: #0a8f5c; } .tag-pending { background: #ff9f43; } .tag-rejected { background: var(--danger); }
.photo-cell.pending-cell { display: flex; align-items: center; justify-content: center; background: #f0f3ff; border: 2px dashed #c3d0ff; border-radius: 12px; color: var(--blue); font-size: 26px; cursor: pointer; }

/* ============ 问卷 ============ */
.q-item {
  background: var(--card); border-radius: var(--radius); padding: 16px; margin-top: 14px;
  box-shadow: 0 6px 20px rgba(80,120,255,.1);
}
.q-item .q-title { font-size: 15px; font-weight: 600; line-height: 1.6; margin-bottom: 10px; }
.q-item .q-required { color: var(--danger); margin-left: 2px; }
.q-opts { display: flex; flex-direction: column; gap: 8px; }
.q-opt {
  border: 1.5px solid #e3e8ff; border-radius: 12px; padding: 11px 14px; font-size: 14px;
  display: flex; align-items: center; gap: 8px; cursor: pointer; transition: all .15s;
}
.q-opt .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #c9d2ff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.q-opt .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.q-opt.sel { border-color: var(--blue); background: #eef6ff; }
.q-opt.sel .dot { border-color: var(--blue); }
.q-opt.sel .dot::after { background: var(--blue); }
.q-opt .cb { width: 18px; height: 18px; border-radius: 5px; border: 2px solid #c9d2ff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; }
.q-opt.sel-multi { border-color: var(--teal); background: #e9fbf6; }
.q-opt.sel-multi .cb { background: var(--teal); border-color: var(--teal); }
.q-textarea {
  width: 100%; border: 1.5px solid #e3e8ff; border-radius: 12px; padding: 12px; font-size: 14px;
  font-family: inherit; resize: vertical; min-height: 90px; outline: none;
}
.q-textarea:focus { border-color: var(--violet); }
.survey-tip { font-size: 13px; color: var(--muted); margin: 14px 4px 0; }
.q-item.blank { padding: 15px 16px 12px; }
.q-stem {
  display: flex; align-items: flex-start; gap: 2px;
  font-size: 15px; font-weight: 600; line-height: 1.8; color: var(--text);
}
.q-no { flex-shrink: 0; font-weight: 800; color: var(--violet); }
.q-stem-text { flex: 1; word-break: break-word; }
.q-item .q-required { color: var(--danger); font-style: normal; flex-shrink: 0; }
.q-blank {
  display: block; width: 100%; box-sizing: border-box; margin: 10px 0 2px; padding: 7px 4px 8px;
  border: none; border-bottom: 1.75px solid #c6ceea; border-radius: 0;
  background: transparent; font-size: 15px; font-family: inherit; color: #2a3350;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.q-blank::placeholder { color: #b6bdd9; }
.q-blank:focus { border-bottom-color: var(--violet); box-shadow: 0 1px 0 var(--violet); }
.q-blank:read-only, .q-blank:disabled { color: #4a5572; border-bottom-color: #dfe4f4; }
.q-blank:disabled { cursor: default; }
/* 一道题内多个空位（内联填空） */
.q-sent { display: block; font-size: 15px; font-weight: 600; line-height: 2.2; color: var(--text); word-break: break-word; }
.q-sent .q-no { color: var(--violet); font-weight: 800; margin-right: 2px; }
.q-frag { white-space: pre-wrap; }
.q-inline {
  display: inline-block; width: 9em; max-width: 55%; margin: 0 2px; padding: 0 4px;
  border: none; border-bottom: 1.75px solid #c6ceea; border-radius: 0;
  background: transparent; font: inherit; text-align: center; color: #2a3350;
  outline: none; vertical-align: baseline; transition: border-color .15s, box-shadow .15s;
}
.q-inline::placeholder { color: #b9c0dc; font-weight: 400; }
.q-inline:focus { border-bottom-color: var(--violet); box-shadow: 0 1px 0 var(--violet); }
.q-inline:read-only, .q-inline:disabled { color: #4a5572; border-bottom-color: #dfe4f4; }
.q-inline:disabled { cursor: default; }
#questionList.readonly .q-item { background: transparent; }
/* 回看：填空答案完整展示 */
.q-ans-box {
  margin-top: 8px; padding: 8px 2px; border-bottom: 1.75px solid #dfe4f4;
  font-size: 15px; line-height: 1.8; color: #2a3350; white-space: pre-wrap; word-break: break-word;
}
.q-fill {
  display: inline-block; max-width: 100%; margin: 0 2px; padding: 0 6px;
  border-bottom: 1.75px solid #dfe4f4; color: #2a3350; font-weight: 600;
  vertical-align: baseline; overflow-wrap: anywhere; word-break: break-word;
}
.q-fill-ph { color: #b6bdd9; font-weight: 400; border-bottom-style: dashed; }
.q-ph { color: #b6bdd9; }
/* 第三阶段答题卡：填空 / 图片 / 反馈 集中在同一卡片内 */
.sf-card {
  background: var(--card); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(80,120,255,.12);
  padding: 4px 16px 16px; margin-top: 14px;
}
.sf-card .sf-part-t {
  font-size: 15px; font-weight: 700; color: var(--text); padding: 12px 0 2px;
  display: flex; align-items: baseline; flex-wrap: wrap;
}
.sf-sub { font-size: 13px; color: var(--muted); padding-bottom: 2px; line-height: 1.6; }
.sf-card .sf-part-t .q-required { color: var(--danger); font-style: normal; margin: 0 2px 0 4px; }
.sf-opt { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.sf-card .sf-hr { border: 0; border-top: 1px dashed #e6eaf6; margin: 6px 0 2px; }
.sf-card .q-item {
  background: transparent; box-shadow: none; border-radius: 0;
  padding: 12px 0 10px; margin: 0;
}
.sf-card .q-item + .q-item { border-top: 1px dashed #eef0f8; }
.sf-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.sf-cell {
  position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1;
  background: #f0f3ff; border: 1px solid #e3e8ff;
}
.sf-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sf-cell .sf-del {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 14px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.sf-add {
  border: 1.5px dashed #c3d0ff; display: flex; align-items: center; justify-content: center;
  color: var(--blue); font-size: 24px; cursor: pointer; background: #f4f7ff;
}
.sf-add:active { opacity: .7; }
.sf-none { font-size: 13px; color: var(--muted); margin-top: 10px; }
#sfFeedback {
  width: 100%; border: 1.5px solid #e3e8ff; border-radius: 12px; padding: 12px; font-size: 14px;
  font-family: inherit; resize: vertical; outline: none; margin-top: 4px; background: #fff;
  box-sizing: border-box; transition: border-color .15s, box-shadow .15s;
}
#sfFeedback:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124,92,255,.12); }
#sfFeedback:disabled { background: #f4f6fb; color: #777f9a; }
.sf-count { text-align: right; font-size: 12px; color: var(--muted); margin-top: 6px; }
.form-tip { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; }

/* 第一阶段：单选/多选自测 */
.iq-card {
  background: #fff; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(80,120,255,.12);
  padding: 16px 16px 14px; margin-top: 14px;
}
.iq-head { font-size: 15px; font-weight: 700; color: var(--text); padding: 2px 0 4px; }
.iq-card .q-item { box-shadow: 0 3px 10px rgba(80,120,255,.07); margin-top: 12px; }
/* 单选/多选题的“其他”自定义答案行 */
.q-opt.iq-other .iq-other-lbl { flex-shrink: 0; font-weight: 600; }
.q-opt.iq-other .iq-other-in {
  flex: 1; min-width: 0; margin-left: 6px; padding: 2px 2px;
  border: none; border-bottom: 1.5px dashed #c3cbe8; border-radius: 0;
  background: transparent; font: inherit; color: #2a3350; outline: none;
}
.q-opt.iq-other .iq-other-in:focus { border-bottom-color: var(--violet); }
.q-opt.iq-other .iq-other-in::placeholder { color: #b6bdd9; font-weight: 400; }
.q-opt.iq-other .iq-other-in:read-only { color: #6b7591; }

/* ============ 按钮 ============ */
.btn {
  border: none; border-radius: 12px; padding: 12px 22px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: transform .1s, opacity .2s; font-family: inherit;
}
.btn:active { transform: scale(.97); }
.btn-block { width: 100%; margin-top: 16px; }
.btn-primary { background: linear-gradient(135deg, #4facfe, #00c6a9); color: #fff; box-shadow: 0 6px 16px rgba(0,198,169,.3); }
.btn-danger { background: #fff; color: var(--danger); border: 1.5px solid #ffd4d4; }
.btn-ghost { background: #f0f2f6; color: #666; }
.btn:disabled { opacity: .5; }

/* ============ 底部导航 ============ */
#tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto;
  background: #fff; display: flex; box-shadow: 0 -4px 20px rgba(0,0,0,.06);
  border-radius: 18px 18px 0 0; z-index: 50; padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0; color: #9aa0b4; font-size: 11px; cursor: pointer; transition: color .2s; }
.tab .icon { width: 22px; height: 22px; fill: currentColor; }
.tab.active { color: var(--blue); font-weight: 700; }
.tab { position: relative; }
.tab-lock {
  position: absolute; top: 2px; right: 18%; width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  box-shadow: 0 0 0 2px #fff;
}

/* ============ 弹窗 ============ */
.modal {
  position: fixed; inset: 0; background: rgba(20,24,40,.5); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px; backdrop-filter: blur(3px);
}
.modal-box {
  background: #fff; border-radius: 20px; padding: 22px; width: 100%; max-width: 380px;
  animation: popIn .25s ease; max-height: 86vh; overflow-y: auto;
}
@keyframes popIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
.modal-box h3 { text-align: center; margin-bottom: 16px; font-size: 18px; color: #2a3b6e; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; margin: 0; }
.drop-zone {
  border: 2px dashed #c3d0ff; border-radius: 14px; padding: 26px; text-align: center; color: var(--blue);
  font-size: 14px; cursor: pointer; background: #f6f9ff;
}
#previewWrap { margin-top: 10px; border-radius: 12px; overflow: hidden; }
#previewWrap img { width: 100%; max-height: 220px; object-fit: cover; display: block; }
.modal-box input[type=text], .modal-box input[type=password], .modal-box input[type=number] {
  width: 100%; border: 1.5px solid #e3e8ff; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-top: 12px; outline: none; font-family: inherit;
}
.modal-box input:focus { border-color: var(--blue); }

.auth-tabs { display: flex; background: #f1f3ff; border-radius: 12px; padding: 4px; margin-bottom: 6px; }
.atab { flex: 1; text-align: center; padding: 9px; border-radius: 9px; font-size: 14px; color: #777; cursor: pointer; font-weight: 600; }
.atab.active { background: #fff; color: var(--blue); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
#authMsg { color: var(--danger); min-height: 18px; margin-top: 10px; }

/* ============ 我的 ============ */
.mine-hero {
  text-align: center; background: var(--card); border-radius: var(--radius); padding: 26px 16px; margin-top: 16px;
  box-shadow: 0 6px 20px rgba(80,120,255,.1);
}
.avatar {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px;
  background: linear-gradient(135deg, var(--pink), var(--orange)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700;
}
.mine-hero h3 { font-size: 18px; }
.mine-hero p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stat-row { display: flex; gap: 12px; margin-top: 12px; }
.stat { flex: 1; background: var(--card); border-radius: 14px; padding: 14px; text-align: center; box-shadow: 0 4px 14px rgba(80,120,255,.08); }
.stat b { display: block; font-size: 20px; color: var(--blue); }
.stat span { font-size: 12px; color: var(--muted); }

.cert-card {
  background: var(--card); border-radius: var(--radius); padding: 16px; margin-top: 12px;
  box-shadow: 0 6px 20px rgba(80,120,255,.1); display: flex; align-items: center; gap: 14px;
}
.cert-card .c-ico {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ffd54f, #ffb300); color: #fff; font-size: 22px;
}
.cert-card h4 { font-size: 15px; margin-bottom: 4px; }
.cert-card p { font-size: 12px; color: var(--muted); }
.cert-card a { margin-left: auto; font-size: 13px; color: var(--blue); text-decoration: none; font-weight: 600; }

/* ============ Toast ============ */
#toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: rgba(30,34,50,.92); color: #fff; padding: 10px 22px; border-radius: 30px; font-size: 14px;
  max-width: 86%; text-align: center; animation: fadeIn .2s;
}

/* ============ 图片查看 ============ */
#viewer {
  position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 150; display: flex; align-items: center; justify-content: center;
}
#viewer img { max-width: 94%; max-height: 92%; border-radius: 8px; }

@media (max-width: 380px) {
  #hero h1 { font-size: 22px; }
  .phase-card .pc-desc { font-size: 12px; }
}
