/* 页面层：管理端工作台、创建向导、编辑器三栏、公开填写页、统计页。 */

/* ---------- 顶部通栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--s6);
  padding: 0 var(--s7);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(140%);
}
.brand { display: flex; align-items: center; gap: var(--s3); flex: none; }
.brand__mark {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  background: var(--primary); position: relative; flex: none;
}
.brand__mark::before,
.brand__mark::after { content: ""; position: absolute; background: rgba(255, 255, 255, 0.9); }
.brand__mark::before { left: 8px; top: 8px; width: 12px; height: 2px; box-shadow: 0 5px 0 rgba(255, 255, 255, 0.9); }
.brand__mark::after { left: 8px; top: 19px; width: 7px; height: 2px; }
.brand__name { font-size: var(--fs-md); font-weight: 600; letter-spacing: var(--tracking-tight); white-space: nowrap; }
.brand__divider { width: 1px; height: 16px; background: var(--line-strong); }
.brand__scope { font-size: var(--fs-sm); color: var(--ink-4); white-space: nowrap; }

.flow-steps { display: flex; align-items: center; gap: var(--s2); margin: 0 auto; }
.flow-step {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 6px 10px; border-radius: var(--r-sm);
  font-size: var(--fs-sm); color: var(--ink-4); white-space: nowrap;
  transition: color var(--t-state) var(--ease-out), background var(--t-state) var(--ease-out);
}
.flow-step__node {
  width: 18px; height: 18px; border: 1px solid var(--line-strong); border-radius: 50%;
  display: grid; place-items: center; font-size: 10px; font-weight: 600;
  transition: background var(--t-state) var(--ease-out), border-color var(--t-state) var(--ease-out), color var(--t-state) var(--ease-out);
}
.flow-step.is-active { color: var(--ink); font-weight: 500; }
.flow-step.is-active .flow-step__node { background: var(--primary); border-color: var(--primary); color: #fff; }
.flow-step.is-done .flow-step__node { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-ink); }
.flow-sep { width: 20px; height: 1px; background: var(--line-strong); }
.topbar__right { display: flex; align-items: center; gap: var(--s3); flex: none; }
.admin-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 11px; border: 1px solid var(--line);
  border-radius: var(--r-pill); background: var(--surface-sunken);
  font-size: var(--fs-xs); color: var(--ink-3);
}
.admin-chip__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

/* ---------- 页面骨架 ---------- */
.page { max-width: var(--content-max); margin: 0 auto; padding: var(--s8) var(--s7) var(--s10); }
.page--wide { max-width: 1440px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s6); margin-bottom: var(--s7); }
.page-head__title { font-size: var(--fs-2xl); letter-spacing: -0.03em; }
.page-head__sub { margin-top: 6px; font-size: var(--fs-base); color: var(--ink-3); }
.page-head__actions { display: flex; align-items: center; gap: var(--s2); flex: none; }

/* 指标行：紧凑、可扫读，不是大数字 hero */
.metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-1);
  margin-bottom: var(--s6); overflow: hidden;
}
.metric { padding: var(--s5) var(--s6); border-right: 1px solid var(--line-soft); }
.metric:last-child { border-right: 0; }
.metric__label { font-size: var(--fs-xs); color: var(--ink-4); letter-spacing: 0.03em; }
.metric__value { margin-top: 6px; font-size: 28px; line-height: 1.1; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.metric__foot { margin-top: 4px; font-size: var(--fs-xs); color: var(--ink-4); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); }
.section-head__title { font-size: var(--fs-md); font-weight: 600; }
.section-head__note { font-size: var(--fs-xs); color: var(--ink-4); }

.survey-name { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.survey-name__text { min-width: 0; }
.survey-name__title { font-size: var(--fs-md); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.survey-name__meta { font-size: var(--fs-xs); color: var(--ink-4); margin-top: 2px; }
.row-actions { display: inline-flex; align-items: center; gap: 2px; justify-content: flex-end; }

/* ---------- 登录 ---------- */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: var(--s6); }
.login {
  width: min(400px, 100%); padding: var(--s8);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-2);
}
.login__mark { width: 38px; height: 38px; border-radius: var(--r-md); background: var(--primary); position: relative; margin-bottom: var(--s6); }
.login__mark::before, .login__mark::after { content: ""; position: absolute; background: rgba(255,255,255,.9); }
.login__mark::before { left: 11px; top: 11px; width: 16px; height: 2px; box-shadow: 0 6px 0 rgba(255,255,255,.9); }
.login__mark::after { left: 11px; top: 25px; width: 9px; height: 2px; }
.login__title { font-size: var(--fs-xl); margin-bottom: var(--s2); }
.login__sub { font-size: var(--fs-base); color: var(--ink-3); margin-bottom: var(--s6); }
.login__form { display: flex; flex-direction: column; gap: var(--s4); }

/* ---------- 创建向导：选择器 + 工作区（不是等尺寸卡片墙） ---------- */
.create-layout {
  display: grid; grid-template-columns: 268px minmax(0, 1fr);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-1); overflow: hidden;
  min-height: 520px;
}
.create-ways { background: var(--surface-sunken); border-right: 1px solid var(--line); padding: var(--s5) var(--s3); }
.create-ways__label { padding: 0 var(--s3) var(--s3); }
.create-way {
  display: flex; align-items: flex-start; gap: var(--s3);
  width: 100%; padding: var(--s4) var(--s3); margin-bottom: var(--s1);
  border: 1px solid transparent; border-radius: var(--r-md);
  background: transparent; text-align: left;
  transition: background var(--t-state) var(--ease-out), border-color var(--t-state) var(--ease-out);
}
.create-way:hover { background: var(--ground-2); }
.create-way.is-active { background: var(--surface); border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.create-way__num {
  width: 22px; height: 22px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 50%;
  font-size: var(--fs-xs); color: var(--ink-4);
  transition: background var(--t-state) var(--ease-out), color var(--t-state) var(--ease-out), border-color var(--t-state) var(--ease-out);
}
.create-way.is-active .create-way__num { background: var(--primary); border-color: var(--primary); color: #fff; }
.create-way__title { font-size: var(--fs-base); font-weight: 600; }
.create-way__desc { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 3px; line-height: 1.5; }
.create-pane { padding: var(--s7); }
.create-pane__title { font-size: var(--fs-lg); margin-bottom: var(--s2); }
.create-pane__desc { font-size: var(--fs-base); color: var(--ink-3); margin-bottom: var(--s6); max-width: 62ch; }
.create-pane__body { display: flex; flex-direction: column; gap: var(--s4); max-width: 640px; }
.create-preview {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-sunken);
  padding: var(--s4); max-height: 260px; overflow: auto;
}
.create-preview__item { display: flex; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-sm); }
.create-preview__item:last-child { border-bottom: 0; }
.create-preview__num { color: var(--ink-4); font-variant-numeric: tabular-nums; flex: none; width: 22px; }
.create-preview__type { color: var(--accent-ink); flex: none; }
.template-list { display: flex; flex-direction: column; gap: var(--s2); }
.template-item {
  display: flex; align-items: center; gap: var(--s4); width: 100%;
  padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); text-align: left;
  transition: border-color var(--t-state) var(--ease-out), background var(--t-state) var(--ease-out), box-shadow var(--t-state) var(--ease-out);
}
.template-item:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.template-item.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow-1); }
.template-item__index { font-size: var(--fs-xs); color: var(--ink-4); width: 18px; flex: none; }
.template-item__body { flex: 1; min-width: 0; }
.template-item__name { font-size: var(--fs-base); font-weight: 600; }
.template-item__desc { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 3px; }
.template-item__count { font-size: var(--fs-xs); color: var(--ink-4); flex: none; }

/* ---------- 编辑器 ---------- */
.editor { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.editor-bar {
  height: 60px; flex: none; display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--s5); background: var(--surface); border-bottom: 1px solid var(--line);
}
.editor-bar__title { min-width: 0; max-width: 420px; }
.editor-bar__actions { margin-left: auto; display: flex; align-items: center; gap: var(--s2); flex: none; }
.editor-grid { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--settings-w); flex: 1; min-height: 0; }

.qtypes { background: var(--surface-sunken); border-right: 1px solid var(--line); overflow-y: auto; padding: var(--s5) var(--s3) var(--s8); }
.qtypes__head { padding: 0 var(--s3) var(--s4); }
.qtypes__title { font-size: var(--fs-base); font-weight: 600; }
.qtypes__hint { font-size: var(--fs-xs); color: var(--ink-4); margin-top: 3px; line-height: 1.5; }
.qtypes__group { margin-bottom: var(--s5); }
.qtypes__group-label { padding: 0 var(--s3) var(--s2); font-size: var(--fs-xs); color: var(--ink-4); letter-spacing: 0.06em; }
.qtype {
  display: flex; align-items: center; gap: var(--s3); width: 100%;
  padding: 9px var(--s3); margin-bottom: 2px;
  border: 1px solid transparent; border-radius: var(--r-md);
  background: transparent; text-align: left; cursor: grab;
  transition: background var(--t-state) var(--ease-out), border-color var(--t-state) var(--ease-out);
}
.qtype:hover { background: var(--surface); border-color: var(--line); }
.qtype:active { cursor: grabbing; }
.qtype__icon {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-3);
  transition: transform var(--t-state) var(--ease-out), color var(--t-state) var(--ease-out), border-color var(--t-state) var(--ease-out);
}
.qtype:hover .qtype__icon { transform: translateY(-2px); color: var(--accent-ink); border-color: var(--accent-soft); }
.qtype__label { font-size: var(--fs-base); font-weight: 500; }
.qtype__hint { font-size: var(--fs-xs); color: var(--ink-4); margin-top: 1px; }

.canvas { overflow-y: auto; padding: var(--s7) var(--s6) var(--s10); background: var(--ground); }
.canvas__inner { max-width: 740px; margin: 0 auto; }
.survey-head {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); padding: var(--s7); margin-bottom: var(--s5);
}
.survey-head__title { width: 100%; font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.03em; }
.survey-head__desc { width: 100%; margin-top: var(--s3); font-size: var(--fs-base); color: var(--ink-3); }
.survey-head__meta { display: flex; align-items: center; gap: var(--s4); margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line-soft); font-size: var(--fs-xs); color: var(--ink-4); }

.qcard {
  position: relative; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); padding: var(--s5) var(--s6);
  margin-bottom: var(--s3);
  transition: border-color var(--t-state) var(--ease-out), box-shadow var(--t-state) var(--ease-out), background var(--t-state) var(--ease-out);
}
.qcard:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.qcard.is-selected { border-color: var(--accent); background: #fdfefe; box-shadow: 0 0 0 3px rgba(74, 102, 114, 0.08), var(--shadow-2); }
.qcard.is-dragging { opacity: 0.5; }
.qcard.is-drop-target { border-color: var(--accent); }
.qcard__top { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.qcard__num { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-4); font-variant-numeric: tabular-nums; flex: none; }
.qcard__type { font-size: var(--fs-xs); color: var(--accent-ink); background: var(--accent-soft); padding: 2px 8px; border-radius: var(--r-sm); flex: none; }
.qcard__required { font-size: var(--fs-xs); color: var(--danger); flex: none; }
.qcard__spacer { flex: 1; }
.qcard__handle { cursor: grab; color: var(--ink-4); }
.qcard__title { width: 100%; font-size: var(--fs-lg); font-weight: 500; line-height: 1.45; }
.qcard__desc { width: 100%; margin-top: var(--s2); font-size: var(--fs-sm); color: var(--ink-3); }
.qcard__body { margin-top: var(--s4); }
.qcard__foot { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s5); padding-top: var(--s3); border-top: 1px solid var(--line-soft); }

.option-row { display: flex; align-items: center; gap: var(--s2); margin-bottom: 6px; }
.option-row__grip { color: var(--ink-4); cursor: grab; flex: none; }
.option-row__shape { width: 15px; height: 15px; border: 1.5px solid #b9c1c8; flex: none; }
.option-row__shape--circle { border-radius: 50%; }
.option-row__shape--square { border-radius: 3px; }
.option-row__input { flex: 1; }
.option-row__input .input { min-height: 32px; padding: 5px 9px; font-size: var(--fs-base); }
.option-add { display: inline-flex; align-items: center; gap: 6px; padding: 5px 0; border: 0; background: transparent; color: var(--accent-ink); font-size: var(--fs-sm); font-weight: 500; }
.option-add:hover { color: var(--ink); }

.matrix-preview { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.matrix-preview table { font-size: var(--fs-sm); }
.matrix-preview th, .matrix-preview td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); text-align: center; }
.matrix-preview th:first-child, .matrix-preview td:first-child { text-align: left; }
.matrix-preview thead th { background: var(--surface-sunken); color: var(--ink-3); font-weight: 500; }
.scale-preview { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.scale-preview__item { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--ink-3); }
.scale-preview__label { font-size: var(--fs-xs); color: var(--ink-4); }

.canvas-empty { border: 1px dashed var(--line-strong); border-radius: var(--r-lg); padding: var(--s9) var(--s6); text-align: center; background: var(--surface-sunken); }
.canvas-empty__title { font-size: var(--fs-md); font-weight: 600; margin-bottom: var(--s2); }
.canvas-empty__text { font-size: var(--fs-sm); color: var(--ink-3); }

.settings { background: var(--surface); border-left: 1px solid var(--line); overflow-y: auto; }
.settings__tabs { padding: 0 var(--s4); }
.settings__body { padding: var(--s5) var(--s5) var(--s9); }
.settings__section { margin-bottom: var(--s7); }
.settings__section-title { font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--s2); }
.settings__section-desc { font-size: var(--fs-xs); color: var(--ink-4); margin-bottom: var(--s4); line-height: 1.55; }
.settings__row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line-soft); }
.settings__row:last-child { border-bottom: 0; }
.settings__row-label { font-size: var(--fs-sm); color: var(--ink-2); }
.settings__stack { display: flex; flex-direction: column; gap: var(--s4); }
.logic-rule { padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-sunken); margin-bottom: var(--s2); }
.logic-rule__top { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }

/* 分享面板（发布后揭示） */
.share-hero { text-align: center; padding: var(--s4) 0 var(--s6); }
.share-hero__mark { width: 46px; height: 46px; margin: 0 auto var(--s4); border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; }
.share-hero__title { font-size: var(--fs-lg); font-weight: 600; margin-bottom: var(--s2); }
.share-hero__desc { font-size: var(--fs-sm); color: var(--ink-3); }
.share-link { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s2) var(--s2) var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface-sunken); }
.share-link__url { flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-qr { display: grid; place-items: center; padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.share-qr img { width: 180px; height: 180px; }

/* ---------- 公开填写页 ---------- */
.fill-shell { min-height: 100vh; background: var(--ground); }
.fill-progress { position: sticky; top: 0; z-index: 10; height: 3px; background: var(--ground-3); }
.fill-progress__fill { height: 100%; background: var(--accent); transition: width var(--t-layout) var(--ease-out); }
.fill-wrap { max-width: 720px; margin: 0 auto; padding: var(--s8) var(--s5) var(--s10); }
.fill-head { margin-bottom: var(--s6); }
.fill-head__brand { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-xs); color: var(--ink-4); margin-bottom: var(--s6); }
.fill-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-2); padding: var(--s8); }
.fill-title { font-size: var(--fs-2xl); letter-spacing: -0.03em; }
.fill-desc { margin-top: var(--s3); font-size: var(--fs-base); color: var(--ink-3); line-height: 1.7; white-space: pre-wrap; }
.fill-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--line-soft); font-size: var(--fs-xs); color: var(--ink-4); }
.fill-question { min-height: 190px; }
.fill-q__num { font-size: var(--fs-xs); color: var(--ink-4); letter-spacing: 0.06em; margin-bottom: var(--s3); }
.fill-q__title { font-size: var(--fs-lg); font-weight: 600; line-height: 1.5; margin-bottom: var(--s2); }
.fill-q__req { color: var(--danger); margin-left: 4px; }
.fill-q__desc { font-size: var(--fs-sm); color: var(--ink-3); margin-bottom: var(--s5); }
.fill-q__options { display: flex; flex-direction: column; gap: var(--s2); }
.fill-option {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); background: var(--surface); cursor: pointer;
  font-size: var(--fs-base);
  transition: border-color var(--t-state) var(--ease-out), background var(--t-state) var(--ease-out), box-shadow var(--t-state) var(--ease-out);
}
.fill-option:hover { border-color: #b5bec6; background: var(--surface-hover); }
.fill-option.is-checked { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(74,102,114,.12); }
.fill-option__shape { width: 17px; height: 17px; border: 1.5px solid #b0b9c1; flex: none; }
.fill-option__shape--circle { border-radius: 50%; }
.fill-option__shape--square { border-radius: 3px; }
.fill-option.is-checked .fill-option__shape { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }
.fill-option__label { flex: 1; }
.fill-scale { display: flex; gap: var(--s2); flex-wrap: wrap; }
.fill-scale__item { min-width: 42px; height: 42px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink-2); font-size: var(--fs-base); transition: all var(--t-state) var(--ease-out); }
.fill-scale__item:hover { border-color: var(--accent); }
.fill-scale__item.is-checked { background: var(--accent); border-color: var(--accent); color: #fff; }
.fill-scale__labels { display: flex; justify-content: space-between; margin-top: var(--s2); font-size: var(--fs-xs); color: var(--ink-4); }
.fill-matrix { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.fill-matrix table { min-width: 440px; font-size: var(--fs-sm); }
.fill-matrix th, .fill-matrix td { padding: 10px; border-bottom: 1px solid var(--line-soft); text-align: center; }
.fill-matrix th:first-child, .fill-matrix td:first-child { text-align: left; }
.fill-matrix thead th { background: var(--surface-sunken); color: var(--ink-3); font-weight: 500; }
.fill-matrix input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.fill-rank-item { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r-md); margin-bottom: 6px; background: var(--surface); cursor: grab; }
.fill-rank-item__num { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--ground-2); color: var(--ink-3); font-size: var(--fs-xs); flex: none; }
.fill-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--line-soft); }
.fill-error { margin-top: var(--s3); font-size: var(--fs-sm); color: var(--danger); }
.fill-done { text-align: center; padding: var(--s8) 0; }
.fill-done__mark { width: 60px; height: 60px; margin: 0 auto var(--s5); border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; }
.fill-done__title { font-size: var(--fs-xl); margin-bottom: var(--s2); }
.fill-done__desc { font-size: var(--fs-base); color: var(--ink-3); }

/* ---------- 统计页 ---------- */
.stat-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); margin-bottom: var(--s4); }
.stat-block__head { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s5) var(--s6); border-bottom: 1px solid var(--line-soft); }
.stat-block__num { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--ground-2); color: var(--ink-3); font-size: var(--fs-xs); }
.stat-block__title { font-size: var(--fs-md); font-weight: 600; line-height: 1.4; }
.stat-block__meta { font-size: var(--fs-xs); color: var(--ink-4); margin-top: 3px; }
.stat-block__body { padding: var(--s5) var(--s6); }
.bar-row { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr) 68px; align-items: center; gap: var(--s4); margin-bottom: var(--s3); }
.bar-row:last-child { margin-bottom: 0; }
.bar-row__label { font-size: var(--fs-sm); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: block; height: 8px; background: var(--ground-2); border-radius: var(--r-pill); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: inherit; transform-origin: left center; }
.bar-row__value { text-align: right; font-size: var(--fs-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.trend { display: flex; align-items: flex-end; gap: var(--s3); height: 92px; }
.trend__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.trend__bar { display: block; width: 100%; max-width: 42px; background: var(--accent-soft); border-radius: var(--r-sm) var(--r-sm) 0 0; min-height: 2px; position: relative; }
.trend__bar.is-today { background: var(--accent); }
.trend__label { font-size: var(--fs-xs); color: var(--ink-4); white-space: nowrap; }
.trend__count { font-size: var(--fs-xs); color: var(--ink-3); }
.text-answers { display: flex; flex-direction: column; gap: var(--s2); }
.text-answer { padding: var(--s3) var(--s4); border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--surface-sunken); font-size: var(--fs-sm); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.raw-table { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.raw-table .table th { position: sticky; top: 0; z-index: 1; }
.raw-table .table td { font-size: var(--fs-sm); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .editor-grid { grid-template-columns: 210px minmax(0, 1fr) 268px; }
  .flow-steps { display: none; }
  .page { padding: var(--s7) var(--s5) var(--s9); }
}
@media (max-width: 960px) {
  .editor-grid { grid-template-columns: 200px minmax(0, 1fr); }
  .settings { position: fixed; right: 0; top: 60px; bottom: 0; width: min(320px, 88vw); z-index: 35; box-shadow: var(--shadow-3); transform: translateX(100%); transition: transform var(--t-layout) var(--ease-out); }
  .settings.is-open { transform: translateX(0); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .create-layout { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .topbar { padding: 0 var(--s4); gap: var(--s3); }
  .brand__divider, .brand__scope, .admin-chip { display: none; }
  .page { padding: var(--s6) var(--s4) var(--s9); }
  .page-head { flex-direction: column; align-items: flex-start; gap: var(--s4); margin-bottom: var(--s6); }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1; }
  .create-layout { grid-template-columns: 1fr; }
  .create-ways { border-right: 0; border-bottom: 1px solid var(--line); display: flex; gap: var(--s1); overflow-x: auto; padding: var(--s3); }
  .create-ways__label { display: none; }
  .create-way { min-width: 150px; margin-bottom: 0; }
  .create-way__desc { display: none; }
  .create-pane { padding: var(--s5) var(--s4); }
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .qtypes { display: none; }
  .qtypes.is-open { display: block; position: fixed; left: 0; top: 60px; bottom: 0; width: min(250px, 84vw); z-index: 35; box-shadow: var(--shadow-3); }
  .canvas { padding: var(--s5) var(--s4) var(--s9); }
  .editor-bar { padding: 0 var(--s3); gap: var(--s2); }
  .editor-bar__title { max-width: 150px; }
  .editor-bar__actions .btn span { display: none; }
  .fill-wrap { padding: var(--s5) var(--s3) var(--s9); }
  .fill-card { padding: var(--s5) var(--s4); }
  .bar-row { grid-template-columns: minmax(90px, 130px) minmax(0, 1fr) 54px; gap: var(--s2); }
  .table th, .table td { padding: var(--s3); }
  .table__hide-sm { display: none; }
}

/* 行式选择器里的标题与说明必须是块级，否则两行文字会挤成一行 */
.create-way > span:last-child, .qtype > span:last-child { min-width: 0; flex: 1; }
.create-way__title, .create-way__desc,
.qtype__label, .qtype__hint,
.template-item__name, .template-item__desc { display: block; }
