/* 精致极简风格：云白底 + 靛蓝主色，柔和阴影与微渐变 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --line: #e7eaf1;
  --line-strong: #d5dae6;
  --text: #1a1d29;
  --text-2: #646b7d;
  --text-3: #a0a7b8;
  --accent: #2b5ff2;
  --accent-deep: #1e46c0;
  --accent-2: #6d5ef0;
  --accent-bg: #eef2ff;
  --danger: #e11d48;
  --ok: #10b981;
  --amber: #f59e0b;
  --radius: 16px;
  --shadow-xs: 0 1px 2px rgba(20,24,40,.05);
  --shadow-sm: 0 2px 8px -2px rgba(20,24,40,.08), 0 1px 2px rgba(20,24,40,.04);
  --shadow-md: 0 12px 32px -12px rgba(20,24,40,.14), 0 2px 6px rgba(20,24,40,.05);
  --shadow-accent: 0 10px 24px -10px rgba(43,95,242,.45);
}
body {
  background: var(--bg);
  background-image: radial-gradient(900px 380px at 50% -90px, rgba(96,132,255,.16), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65; -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(43,95,242,.18); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d3d9e6; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
.wrap { max-width: 620px; margin: 0 auto; padding: 28px 16px 80px; }

/* 页头：渐隐分割线 */
.page-head { position: relative; padding: 10px 0 20px; margin-bottom: 24px; }
.page-head::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 38%, rgba(109,94,240,0) 78%); opacity: .55; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.35; }
.page-head .sub { color: var(--text-2); font-size: 13.5px; margin-top: 6px; }

h1 { font-size: 24px; letter-spacing: -0.3px; }
h2 { display: flex; align-items: center; gap: 9px; font-size: 15.5px; margin: 30px 0 14px; font-weight: 700; letter-spacing: -0.1px; }
h2::before { content: ''; width: 4px; height: 16px; border-radius: 2px; flex: none;
  background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.sub { color: var(--text-2); font-size: 13px; }

/* 卡片：柔和双层阴影 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin-bottom: 16px; box-shadow: var(--shadow-xs); }
.card.stat-card { transition: box-shadow .25s ease, border-color .25s ease; }
.card.stat-card:hover { box-shadow: var(--shadow-sm); border-color: #dfe4f0; }

label.field { display: block; font-size: 13px; color: var(--text-2); margin: 16px 0 7px; font-weight: 500; }
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 11px; font-size: 15px;
  background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
::placeholder { color: var(--text-3); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(43,95,242,.12); }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

.btn { display: inline-block; border: none; border-radius: 11px; padding: 11px 22px; font-size: 14.5px; font-weight: 600;
  cursor: pointer; color: #fff; font-family: inherit;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow-accent);
  transition: transform .12s ease, box-shadow .2s ease, opacity .12s, filter .15s; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 14px 28px -10px rgba(43,95,242,.5); }
.btn:active { transform: translateY(0) scale(.985); opacity: .92; }
.btn.ghost { background: #fff; border: 1px solid var(--line-strong); color: var(--text); box-shadow: none; }
.btn.ghost:hover { border-color: #c3cbdc; background: #f7f9fc; box-shadow: var(--shadow-xs); }
.btn.danger { background: linear-gradient(135deg, #f43f5e, #e11d48); box-shadow: 0 8px 20px -8px rgba(225,29,72,.45); }
.btn.danger:hover { box-shadow: 0 12px 24px -8px rgba(225,29,72,.5); }
.btn.small { padding: 6px 13px; font-size: 13px; border-radius: 9px; font-weight: 500; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- 填写页 ---------- */
.form-wrap { }
.qbox { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px;
  margin-bottom: 14px; box-shadow: var(--shadow-xs); transition: border-color .2s, box-shadow .25s; }
.qbox:hover { border-color: #dde3ef; box-shadow: var(--shadow-sm); }
.qhead { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.qhead select { width: 108px; flex: none; padding: 6px 8px; font-size: 13px; }
.qhead input { flex: 1; }
.qopts { margin: 8px 0 0 4px; }
.qopts .opt { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.qopts .opt input { flex: 1; }
.qmeta { display: flex; align-items: center; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.qmeta label { margin: 0; display: flex; align-items: center; gap: 5px; cursor: pointer; }

/* 题目标题：序号徽章 + 类型角标 */
.q-title { display: flex; align-items: center; gap: 10px; font-size: 15.5px; font-weight: 650; margin-bottom: 15px; line-height: 1.5; }
.q-title > span:first-of-type { } 
.q-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 27px; height: 23px; padding: 0 7px;
  border-radius: 8px; background: var(--accent-bg); color: var(--accent); font-size: 11.5px; font-weight: 800;
  font-variant-numeric: tabular-nums; flex: none; letter-spacing: .2px; }
.q-required { color: var(--danger); font-weight: 700; }
.q-desc { font-size: 13px; color: var(--text-2); margin: 4px 0 8px; white-space: pre-wrap; }
.q-chip { margin-left: auto; flex: none; background: #f1f3f8; color: var(--text-2); font-size: 11px; font-weight: 500;
  padding: 3px 9px; border-radius: 999px; letter-spacing: .3px; }

/* 选项卡片：悬浮微抬 + 选中描边光晕 */
.opt-card { position: relative; display: flex; align-items: center; gap: 11px; padding: 13px 15px;
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 9px; cursor: pointer; background: #fff;
  transition: border-color .15s, background .15s, box-shadow .18s, transform .15s; user-select: none; }
.opt-card:hover { border-color: #c6d2ee; transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.opt-card:has(input:checked) { border-color: var(--accent); background: linear-gradient(180deg, #f6f9ff, #eef3ff);
  box-shadow: 0 0 0 3px rgba(43,95,242,.10); }
.opt-card input { position: absolute; opacity: 0; pointer-events: none; }
.dot { width: 18px; height: 18px; flex: none; border: 1.5px solid #c9d0de; border-radius: 50%; background: #fff;
  transition: all .15s; position: relative; }
.opt-card:hover .dot { border-color: var(--accent); }
.opt-card input:checked + .dot { border-color: var(--accent); }
.opt-card input:checked + .dot::after { content: ''; position: absolute; inset: 3.5px; background: var(--accent);
  border-radius: 50%; animation: pop .2s cubic-bezier(.34,1.56,.64,1); }
.dot.square { border-radius: 6px; }
.opt-card input:checked + .dot.square { background: var(--accent); border-color: var(--accent); }
.opt-card input:checked + .dot.square::after { content: '✓'; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 800; border-radius: 5px; background: none; animation: pop .2s cubic-bezier(.34,1.56,.64,1); }
.opt-text { font-size: 15px; color: var(--text); }
.opt-card input:checked ~ .opt-text { font-weight: 600; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* 「其他」自填输入框 */
.other-input { animation: fadeIn .2s ease; }
.other-input input { border-left: 3px solid var(--accent); border-radius: 0 11px 11px 11px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* 评分题：星星 */
.rate-row { display: flex; flex-direction: row-reverse; justify-content: center; gap: 7px; margin-top: 2px; }
.star { position: relative; flex: 1; max-width: 74px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 4px 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff;
  transition: border-color .15s, background .15s, box-shadow .18s, transform .15s; user-select: none; }
.star:hover { border-color: #f0c96a; transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.star input { position: absolute; opacity: 0; pointer-events: none; }
.star-glyph { font-size: 27px; line-height: 1; color: #d4d9e6; transition: color .14s, transform .18s, filter .14s; }
.star-num { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.star:hover .star-glyph, .star:hover ~ .star .star-glyph { color: #fbbf24; transform: scale(1.14); }
.star:has(input:checked) { border-color: #f0b429; background: linear-gradient(180deg, #fffdf3, #fff8e6); box-shadow: 0 0 0 3px rgba(245,158,11,.12); }
.star:has(input:checked) .star-glyph, .star:has(input:checked) ~ .star .star-glyph { color: #f59e0b; }
.star:has(input:checked) .star-num { color: #b45309; font-weight: 700; }

/* 数值题：居中大输入 + 单位说明 */
.num-row { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.num-input { width: 170px; text-align: center; font-size: 21px; font-weight: 700; padding: 11px 10px; }
.num-unit { font-size: 13px; color: var(--text-2); }

textarea { border-radius: 12px; resize: vertical; min-height: 58px; }

/* 状态卡：成功 / 重复 / 出错 */
.state-card { text-align: center; padding: 52px 24px 44px; }
.state-emoji { width: 78px; height: 78px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 38px; margin: 0 auto 18px; }
.state-emoji.ok { background: #ecfdf5; border: 1px solid #c8f2df; box-shadow: 0 10px 26px -12px rgba(16,185,129,.4); }
.state-emoji.dup { background: var(--accent-bg); border: 1px solid #d3e0ff; box-shadow: 0 10px 26px -12px rgba(43,95,242,.4); }
.state-emoji.err { background: #fff1f3; border: 1px solid #ffdbe3; box-shadow: 0 10px 26px -12px rgba(225,29,72,.4); }
.state-card h2 { justify-content: center; margin: 0 0 6px; }
.state-card h2::before { display: none; }
.state-card .sub { margin-bottom: 22px; font-size: 13.5px; }
#submitBtn { width: 100%; padding: 14px; font-size: 15.5px; border-radius: 13px; letter-spacing: 1px; }

/* ---------- 结果卡片库 ---------- */
/* 回收概览 */
.ov-num { font-size: 32px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; line-height: 1.1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.trend-row { display: flex; align-items: flex-end; gap: 9px; height: 68px; margin-top: 16px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; height: 100%; }
.trend-bar { width: 100%; max-width: 36px; margin-top: auto; min-height: 3px;
  background: linear-gradient(180deg, #6d8bff, var(--accent)); border-radius: 99px 99px 3px 3px; opacity: .92;
  animation: rise .6s cubic-bezier(.22,.9,.35,1) both; }
.trend-bar.today { opacity: 1; background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 4px 12px -4px rgba(109,94,240,.55); }
.trend-day { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
@keyframes rise { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }

/* 分布条：轨道 + 渐变填充动画 */
.stat-row { display: flex; align-items: center; gap: 11px; margin: 9px 0; font-size: 14px; }
.stat-row > div { position: relative; flex: 1; height: 12px; background: #edf0f6; border-radius: 99px; overflow: hidden; }
.stat-bar { height: 100%; min-width: 3px; border-radius: 99px; background: linear-gradient(90deg, #6d8bff, var(--accent));
  animation: barIn .75s cubic-bezier(.22,.9,.35,1) both; transform-origin: left center; }
@keyframes barIn { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.stat-label { width: 150px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.stat-num { color: var(--text-2); font-size: 12.5px; width: 88px; flex: none; text-align: right; font-variant-numeric: tabular-nums; }

/* KPI 数字卡 */
.kpi-row { display: flex; gap: 10px; margin-bottom: 18px; }
.kpi { flex: 1; text-align: center; padding: 15px 6px 13px; border-radius: 14px;
  background: linear-gradient(180deg, #fafbfe, #f3f5fa); border: 1px solid var(--line); }
.kpi .num { font-size: 26px; font-weight: 800; letter-spacing: -0.8px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .lbl { font-size: 11.5px; color: var(--text-2); margin-top: 4px; letter-spacing: .3px; }
.kpi.hl { background: linear-gradient(180deg, #eef3ff, #e5edff); border-color: #c9d8ff; }
.kpi.hl .num { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* 占比环 */
.donut-wrap { display: flex; align-items: center; gap: 24px; padding: 6px 0 2px; }
.donut { width: 126px; height: 126px; border-radius: 50%; position: relative; flex: none;
  filter: drop-shadow(0 6px 14px rgba(20,24,40,.10)); animation: fadeUp .5s ease both; }
.donut::after { content: ''; position: absolute; inset: 21px; background: #fff; border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1; }
.donut-center .n { font-size: 23px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.donut-center .t { font-size: 11px; color: var(--text-2); }
.donut-legend { flex: 1; min-width: 0; }
.legend-row { display: flex; align-items: center; gap: 9px; padding: 6px 8px; margin: 0 -8px; border-radius: 9px; font-size: 13.5px;
  transition: background .15s; animation: fadeUp .5s ease both; }
.legend-row:hover { background: #f5f7fb; }
.legend-dot { width: 11px; height: 11px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.legend-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-num { color: var(--text-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* 排行榜：金银铜奖牌 */
.lb-item { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px dashed #edf0f6; }
.lb-item:last-of-type { border-bottom: none; }
.lb-rank { width: 26px; height: 26px; border-radius: 50%; background: #eef0f5; color: var(--text-2); font-size: 12.5px;
  font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; font-variant-numeric: tabular-nums; }
.lb-item:nth-child(1) .lb-rank { background: linear-gradient(135deg, #ffdf7e, #f5a623); color: #7a4a00;
  box-shadow: 0 4px 10px -3px rgba(245,166,35,.55); }
.lb-item:nth-child(2) .lb-rank { background: linear-gradient(135deg, #eef1f7, #ccd4e2); color: #57607074; color: #576070; }
.lb-item:nth-child(3) .lb-rank { background: linear-gradient(135deg, #f4cba0, #dd9a5f); color: #7c4a12;
  box-shadow: 0 4px 10px -3px rgba(221,154,95,.45); }
.lb-name { flex: 1; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-item:nth-child(1) .lb-name { font-weight: 700; }
.lb-count { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.lb-more { padding: 9px 2px 2px; font-size: 13px; color: var(--text-2); }

/* 留言墙：引用气泡 */
.msg { position: relative; background: #f7f9fc; border: 1px solid #eef1f7; border-left: 3px solid var(--accent);
  border-radius: 3px 13px 13px 13px; padding: 11px 15px; margin-bottom: 10px; font-size: 14px; line-height: 1.75;
  animation: fadeUp .45s ease both; }
.msg:last-child { margin-bottom: 0; }
.msg .idx { display: inline-block; background: var(--accent-bg); color: var(--accent); border-radius: 7px;
  padding: 1px 8px; font-size: 11px; font-weight: 800; margin-right: 9px; vertical-align: 1.5px; font-variant-numeric: tabular-nums; }
.msg.empty { background: none; border: none; padding: 8px 0; margin: 0; color: var(--text-2); font-size: 13.5px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 原始答卷 */
.answer { display: flex; gap: 9px; padding: 7.5px 0; border-bottom: 1px dashed #eef0f6; font-size: 14px; }
.answer:last-child { border-bottom: none; }
.answer .q { flex: none; color: var(--text-2); font-size: 12.5px; padding-top: 2px; max-width: 40%; }
.answer .a { font-weight: 600; overflow-wrap: anywhere; }

.linkbox { background: linear-gradient(135deg, #eef4ff, #f3efff); border: 1px solid #d6e2ff; border-radius: 14px;
  padding: 15px; margin-top: 16px; font-size: 14px; overflow-wrap: anywhere; box-shadow: var(--shadow-xs); }
.opt-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.note { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.err { color: var(--danger); font-size: 13px; margin-top: 10px; font-weight: 500; }
.ok { color: var(--ok); font-size: 13px; margin-top: 6px; }

@media (max-width: 480px) {
  .wrap { padding: 20px 12px 64px; }
  .card { padding: 17px; }
  .qbox { padding: 15px 13px; }
  .stat-label { width: 105px; }
  .stat-num { width: 66px; }
  .kpi .num { font-size: 21px; }
  .donut { width: 106px; height: 106px; }
  .donut::after { inset: 17px; }
  .donut-wrap { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
