/* ============ 设计系统 ============ */
:root {
  --bg: #f4f5fa;
  --panel: #ffffff;
  --text: #1b2333;
  --muted: #6b7385;
  --muted-2: #9aa1b3;
  --line: #e6e8f1;
  --line-strong: #d8dbe8;
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-soft: #eef0ff;
  --green: #0b8a4b;
  --green-soft: #e6f6ee;
  --amber: #b26a00;
  --amber-soft: #fff3e0;
  --red: #d93025;
  --red-soft: #fdecea;
  --blue: #1a73e8;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 26, 45, 0.04), 0 10px 30px rgba(20, 26, 45, 0.05);
  --shadow-lg: 0 24px 60px rgba(20, 26, 45, 0.16);
  --font: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}
p {
  margin: 0;
}
input,
textarea,
select,
button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
::selection {
  background: rgba(79, 70, 229, 0.18);
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: #cfd3e0;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #b6bbcd;
  background-clip: content-box;
}

/* ============ 通用控件 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  font-weight: 500;
  font-size: 13.5px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
  white-space: nowrap;
  user-select: none;
}
.btn:hover {
  background: #f7f8fc;
  border-color: #c9cddd;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.btn-primary {
  background: linear-gradient(180deg, #5b52ea, var(--accent));
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #4f46e5, var(--accent-strong));
  border-color: var(--accent-strong);
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
}
.btn-ghost:hover {
  background: #f1f2f8;
  border-color: transparent;
}
.btn-soft {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-strong);
}
.btn-soft:hover {
  background: #e3e5ff;
  border-color: transparent;
}
.btn-danger {
  background: #fff;
  border-color: #f0c9c6;
  color: var(--red);
}
.btn-danger:hover {
  background: var(--red-soft);
  border-color: #e8b3ae;
}
.btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 8px;
}
.btn-lg {
  height: 44px;
  padding: 0 24px;
  font-size: 15px;
  border-radius: 12px;
}
.btn-block {
  width: 100%;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover {
  background: #eef0f6;
  color: var(--text);
}
.icon-btn.danger:hover {
  background: var(--red-soft);
  color: var(--red);
}

.input,
.textarea,
.select {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
  min-height: 84px;
  line-height: 1.55;
}
.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7385' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.field {
  margin-bottom: 16px;
}
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #3c4459;
  margin-bottom: 6px;
}
.field-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.req {
  color: var(--red);
  margin-left: 2px;
}

/* 开关 */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--muted);
}
.switch input {
  display: none;
}
.switch .track {
  width: 36px;
  height: 20px;
  border-radius: 20px;
  background: #d9dcea;
  position: relative;
  transition: background 0.18s;
  flex: none;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s;
}
.switch input:checked + .track {
  background: var(--accent);
}
.switch input:checked + .track::after {
  transform: translateX(16px);
}

/* 徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-green {
  background: var(--green-soft);
  color: var(--green);
}
.badge-amber {
  background: var(--amber-soft);
  color: var(--amber);
}
.badge-red {
  background: var(--red-soft);
  color: var(--red);
}
.badge-gray {
  background: #eff1f6;
  color: var(--muted);
}
.badge-blue {
  background: #e8f1fe;
  color: var(--blue);
}
.badge-purple {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* 卡片 */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad {
  padding: 22px 24px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 {
  font-size: 15px;
}
.card-body {
  padding: 20px 24px;
}
.card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============ 应用外壳 ============ */
#app {
  min-height: 100vh;
}
.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 20px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.35);
  flex: none;
}
.brand small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted-2);
  letter-spacing: 0.02em;
}
.nav-group {
  margin-bottom: 6px;
}
.nav-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  padding: 12px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border-radius: 9px;
  color: #454d63;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item:hover {
  background: #f4f5fa;
  text-decoration: none;
}
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.nav-item.active svg {
  color: var(--accent);
}
.nav-item svg {
  color: var(--muted-2);
  flex: none;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
}
.side-user:hover {
  background: #f4f5fa;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a5b4fc, #818cf8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex: none;
}
.side-user .meta {
  min-width: 0;
  flex: 1;
}
.side-user .name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-user .role {
  font-size: 11.5px;
  color: var(--muted-2);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 62px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  background: rgba(244, 245, 250, 0.82);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar .page-title {
  font-size: 16px;
  font-weight: 600;
}
.topbar .spacer {
  flex: 1;
}
.topbar .top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.menu-toggle {
  display: none;
}
.page {
  padding: 8px 28px 40px;
  max-width: 1320px;
  width: 100%;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 6px 0 18px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-size: 22px;
  letter-spacing: -0.02em;
}
.page-head .sub {
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
}
.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ============ 统计卡片 ============ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat-card .label {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-card .value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.stat-card .value small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-2);
  letter-spacing: 0;
}
.stat-card .foot {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.stat-card.accent {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-color: transparent;
  color: #fff;
}
.stat-card.accent .label,
.stat-card.accent .foot,
.stat-card.accent .value small {
  color: rgba(255, 255, 255, 0.78);
}
.stat-card .ico {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f2f3fa;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-card.accent .ico {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* 进度 */
.progress {
  height: 7px;
  border-radius: 99px;
  background: #eceef6;
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width 0.3s;
}

/* ============ 模板库 ============ */
.template-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.tabs {
  display: inline-flex;
  background: #eceef6;
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
}
.tab {
  height: 30px;
  padding: 0 14px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(20, 26, 45, 0.12);
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.tpl-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.tpl-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(20, 26, 45, 0.1);
  border-color: #dcdff0;
}
.tpl-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.tpl-title {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.4;
}
.tpl-desc {
  color: var(--muted);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}
.tpl-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted-2);
  font-size: 12px;
}
.tpl-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.price {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.price.free {
  color: var(--green);
}
.price small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-2);
}
.cat-chip {
  font-size: 11.5px;
  color: var(--muted);
  background: #f3f4fa;
  padding: 2px 8px;
  border-radius: 6px;
}

/* ============ 我的问卷 ============ */
.q-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.q-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.q-row:hover {
  border-color: #d8dcf0;
}
.q-row-main {
  min-width: 0;
  flex: 1;
}
.q-row-title {
  font-weight: 600;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.q-row-sub {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 3px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.q-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.q-count {
  text-align: center;
  min-width: 64px;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}
.q-count b {
  display: block;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.q-count span {
  font-size: 11.5px;
  color: var(--muted-2);
}

/* ============ 编辑器 ============ */
.builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
.builder-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.builder-side {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bld-meta {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-top: 5px solid var(--accent);
  padding: 22px 26px;
  box-shadow: var(--shadow);
}
.bld-title {
  width: 100%;
  border: none;
  outline: none;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 0;
  background: transparent;
}
.bld-title::placeholder {
  color: #c3c7d6;
}
.bld-desc {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  padding: 0;
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--muted);
  background: transparent;
  min-height: 22px;
  line-height: 1.6;
}
.bld-desc::placeholder {
  color: var(--muted-2);
}
.q-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 12px;
  box-shadow: var(--shadow);
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.q-card:hover {
  border-color: #d3d7ea;
}
.q-card.focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1), var(--shadow);
}
.q-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.q-index {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin-top: 4px;
}
.q-title-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-weight: 600;
  padding: 2px 0;
  background: transparent;
  min-width: 0;
}
.q-title-input::placeholder {
  color: #c3c7d6;
}
.q-desc-input {
  width: calc(100% - 34px);
  margin-left: 34px;
  border: none;
  outline: none;
  font-size: 12.5px;
  color: var(--muted);
  padding: 2px 0;
  background: transparent;
}
.q-body {
  margin: 10px 0 6px 34px;
}
.q-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  margin-left: 34px;
  border-top: 1px dashed var(--line);
  flex-wrap: wrap;
}
.q-foot .q-type {
  height: 30px;
  font-size: 12.5px;
  border-color: var(--line);
  background-color: #fafbfe;
  width: auto;
  min-width: 110px;
}
.q-foot .q-actions {
  margin-left: auto;
  display: flex;
  gap: 2px;
}
.opt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.opt-marker {
  width: 18px;
  height: 18px;
  border: 2px solid #c8ccdc;
  flex: none;
}
.opt-marker.radio {
  border-radius: 50%;
}
.opt-marker.check {
  border-radius: 5px;
}
.opt-input {
  flex: 1;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 6px 8px;
  outline: none;
  font-size: 13.5px;
  background: #f7f8fc;
}
.opt-input:hover {
  border-color: var(--line-strong);
}
.opt-input:focus {
  border-color: var(--accent);
  background: #fff;
}
.add-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  padding: 4px 4px;
  border-radius: 6px;
}
.add-opt:hover {
  background: var(--accent-soft);
}
.q-sample {
  color: var(--muted-2);
  font-size: 13px;
  padding: 8px 0;
}
.q-sample .fake-input {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfe;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--muted-2);
  font-size: 13px;
}
.q-sample .fake-textarea {
  height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfe;
  padding: 10px 12px;
  color: var(--muted-2);
  font-size: 13px;
}
.rating-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #d4a017;
  font-size: 20px;
}
.add-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.add-panel-head {
  padding: 14px 18px;
  font-weight: 600;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}
.add-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px;
}
.add-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfbfe;
  font-size: 12px;
  color: #4a5168;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.add-btn:hover {
  background: var(--accent-soft);
  border-color: #cfd2f5;
  color: var(--accent-strong);
  transform: translateY(-1px);
}
.add-btn svg {
  color: var(--accent);
}
.side-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.side-card h4 {
  font-size: 13px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #333a4f;
}
.side-field {
  margin-bottom: 12px;
}
.side-field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}
.side-field .input,
.side-field .select {
  height: 34px;
  font-size: 13px;
}
.side-note {
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.55;
  margin-top: 4px;
}
.builder-tip {
  background: #f7f8fd;
  border: 1px dashed #d9dcf0;
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.builder-tip b {
  color: #414861;
}

/* ============ 表格 ============ */
.table-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  background: #fafbfe;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.02em;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f1f7;
  vertical-align: middle;
  color: #333a4f;
}
table.data tbody tr:last-child td {
  border-bottom: none;
}
table.data tbody tr:hover {
  background: #fafbff;
}
table.data td.wrap {
  max-width: 340px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.text-muted {
  color: var(--muted);
}
.text-strong {
  font-weight: 600;
}
.nowrap {
  white-space: nowrap;
}
.right {
  text-align: right;
}
.center {
  text-align: center;
}

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--muted);
}

/* 空状态 */
.empty {
  padding: 54px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .empty-ico {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #f1f2f9;
  color: var(--muted-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.empty h4 {
  color: var(--text);
  font-size: 15px;
  margin-bottom: 4px;
}
.empty p {
  font-size: 13px;
  margin-bottom: 16px;
}

/* ============ 登录页 ============ */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
}
.auth-brand {
  position: relative;
  overflow: hidden;
  background: radial-gradient(120% 120% at 10% 0%, #6366f1 0%, #4f46e5 40%, #3730a3 75%, #2b2480 100%);
  color: #fff;
  padding: 54px 58px;
  display: flex;
  flex-direction: column;
}
.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
}
.auth-brand::before {
  width: 420px;
  height: 420px;
  right: -140px;
  top: -120px;
}
.auth-brand::after {
  width: 300px;
  height: 300px;
  left: -110px;
  bottom: -110px;
  background: rgba(255, 255, 255, 0.06);
}
.auth-brand .brand {
  padding: 0;
  color: #fff;
  font-size: 17px;
  position: relative;
  z-index: 1;
}
.auth-brand .brand-mark {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: none;
  backdrop-filter: blur(4px);
}
.auth-brand .brand small {
  color: rgba(255, 255, 255, 0.6);
}
.auth-hero {
  margin: auto 0;
  position: relative;
  z-index: 1;
  max-width: 440px;
}
.auth-hero h1 {
  font-size: 34px;
  line-height: 1.28;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.auth-hero p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14.5px;
  line-height: 1.8;
}
.auth-features {
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-feature {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.auth-feature .fi {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.13);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.auth-feature b {
  display: block;
  font-size: 13.5px;
  margin-bottom: 1px;
}
.auth-feature span {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.62);
}
.auth-foot {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}
.auth-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
}
.auth-form {
  width: 100%;
  max-width: 360px;
}
.auth-form h2 {
  font-size: 24px;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.auth-form .auth-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 26px;
}
.auth-form .field {
  margin-bottom: 16px;
}
.auth-form .input {
  height: 42px;
}
.auth-switch {
  margin-top: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.auth-hint {
  margin-top: 18px;
  background: #f7f8fd;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.auth-hint code {
  background: #eceef8;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11.5px;
}
.auth-error {
  background: var(--red-soft);
  color: var(--red);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
  display: none;
}
.auth-error.show {
  display: block;
}
.link-btn {
  border: none;
  background: none;
  color: var(--accent);
  padding: 0;
  font-size: inherit;
}
.link-btn:hover {
  text-decoration: underline;
}

/* ============ 模态框 ============ */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 40, 0.46);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  animation: popIn 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal.wide {
  max-width: 760px;
}
.modal.xwide {
  max-width: 980px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 0;
}
.modal-head h3 {
  font-size: 17px;
  letter-spacing: -0.01em;
}
.modal-body {
  padding: 16px 24px;
  overflow: auto;
}
.modal-foot {
  padding: 0 24px 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
}
@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

/* ============ Toast ============ */
#toast-root {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #21263a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(20, 24, 40, 0.3);
  animation: toastIn 0.22s ease;
  max-width: 560px;
}
.toast.success svg {
  color: #6ee7a8;
}
.toast.error svg {
  color: #ff8a80;
}
.toast.info svg {
  color: #8ab4ff;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* ============ 死链 / 加载 ============ */
.loading-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}
.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid #e4e6f1;
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.skeleton {
  background: linear-gradient(90deg, #eef0f7 25%, #f6f7fb 37%, #eef0f7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  from {
    background-position: 100% 50%;
  }
  to {
    background-position: 0 50%;
  }
}

/* 提示条 */
.callout {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.6;
  background: #f2f4fd;
  color: #444c66;
  border: 1px solid #e2e5f5;
}
.callout.warn {
  background: var(--amber-soft);
  border-color: #f5e2c0;
  color: #7a5100;
}
.callout svg {
  flex: none;
  margin-top: 1px;
}

/* 详情问答 */
.qa-list {
  display: flex;
  flex-direction: column;
}
.qa-item {
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.qa-item:last-child {
  border-bottom: none;
}
.qa-q {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 3px;
}
.qa-a {
  font-size: 13.5px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.qa-a.empty-answer {
  color: var(--muted-2);
}

/* 分享框 */
.share-box {
  display: flex;
  gap: 8px;
}
.share-box .input {
  font-size: 12.5px;
  background: #f8f9fd;
}

/* 钱包 */
.wallet-hero {
  background: linear-gradient(135deg, #312e81, #4f46e5 55%, #7c3aed);
  border-radius: 18px;
  padding: 26px 28px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.28);
  margin-bottom: 20px;
}
.wallet-hero .wl {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.66);
}
.wallet-hero .wv {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 2px;
}
.wallet-hero .wv small {
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin-right: 4px;
}
.wallet-quota {
  min-width: 220px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px 16px;
}
.wallet-quota .q-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 8px;
}
.wallet-quota .progress {
  background: rgba(255, 255, 255, 0.2);
}
.wallet-quota .progress > i {
  background: #fff;
}
.wallet-quota .q-foot {
  margin-top: 7px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.62);
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

/* 状态筛选条 */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .input,
.filter-bar .select {
  width: auto;
  min-width: 190px;
}

/* 填写页（Microsoft 365 Forms 风格） */
.fill-body {
  background: #f3f2f1;
  min-height: 100vh;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #242424;
}
/* 有封面图时：整页铺该图 + 半透明白色蒙版，题目卡融入背景 */
.fill-body.has-bg {
  background-image: var(--fill-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-color: #1c1c1c;
}
.fill-body.has-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  z-index: 0;
  pointer-events: none;
}
.fill-body.has-bg #fillRoot {
  position: relative;
  z-index: 1;
}
.fill-body.has-bg .msf-banner,
.fill-body.has-bg .msf-banner-plain {
  background: transparent;
  color: #1e1e1e;
}
.fill-body.has-bg .msf-banner-plain h1 {
  color: #1e1e1e;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
}
.fill-body.has-bg .msf-intro {
  color: #4a4a4a;
}
.fill-body.has-bg .fill-q:not(.section),
.fill-body.has-bg .fill-card {
  background: transparent;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: none;
}
.fill-body.has-bg .fill-q.section {
  background: transparent;
  box-shadow: none;
}
.fill-body.has-bg .fill-q .input,
.fill-body.has-bg .fill-q .textarea,
.fill-body.has-bg .fill-q .select {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.18);
}
.fill-body.has-bg .choice:hover {
  background: rgba(255, 255, 255, 0.45);
}
.msf-banner {
  background: var(--msf-theme, #4f46e5);
  color: #fff;
  padding: 40px 0 26px;
}
.msf-in {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}
.msf-banner h1 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  word-break: break-word;
}
.msf-banner .msf-desc {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
  white-space: pre-wrap;
  word-break: break-word;
}
.msf-banner .msf-note {
  margin-top: 14px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.85);
}

/* 说明与必答提示（横幅下方白底区，与 Microsoft Forms 题目页一致） */
.msf-intro {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 20px 8px;
  color: #616161;
  font-size: 13px;
  line-height: 1.6;
}
.msf-intro-desc {
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}
.msf-intro-note {
  color: #a4262c;
  font-weight: 600;
  font-size: 12.5px;
}
/* 封面页（背景图 + 标题 + 说明 + 立即开始） */
.msf-cover {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-color: #1c1c1c;
  position: relative;
}
.msf-cover.has-img::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.54), rgba(0, 0, 0, 0.22));
}
.msf-cover-in {
  position: relative;
  max-width: 720px;
  width: 100%;
  padding: 40px 20px;
  color: #fff;
}
.msf-cover-in h1 {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 16px;
  word-break: break-word;
}
.msf-cover-desc {
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.96);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 24px;
}
.msf-start {
  background: #fff;
  color: #242424;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  padding: 9px 28px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
  transition: background 0.12s, box-shadow 0.12s;
}
.msf-start:hover {
  background: #f3f2f1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}
.msf-banner.has-img {
  padding: 32px 0 24px;
}
.msf-group {
  animation: msf-fade 0.18s ease;
}
@keyframes msf-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.msf-group-title {
  font-size: 16px;
  font-weight: 600;
  color: #242424;
  margin: 4px 0 12px;
  padding-left: 2px;
  word-break: break-word;
}
.msf-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px 64px;
}
.fill-wrap {
  max-width: none;
  padding: 0;
}
/* 预览弹窗中的标题卡 */
.fill-card {
  background: #fff;
  border: 1px solid #e1dfdd;
  border-radius: 4px;
  padding: 22px 24px;
  margin-bottom: 12px;
}
.fill-card h1 {
  font-size: 23px;
  line-height: 1.35;
  margin-bottom: 6px;
  color: #242424;
}
.fill-card .f-desc {
  color: #616161;
  font-size: 13.5px;
  white-space: pre-wrap;
}
.fill-q {
  background: #fff;
  border: 1px solid #e1dfdd;
  border-radius: 4px;
  padding: 18px 20px 20px;
  margin-bottom: 12px;
  transition: border-color 0.12s, box-shadow 0.12s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.035);
}
.fill-q .q-t {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.45;
  color: #242424;
  word-break: break-word;
}
.fill-q .q-d {
  font-size: 13px;
  color: #616161;
  margin-bottom: 12px;
  line-height: 1.6;
}
.fill-q .q-t .star {
  color: #a4262c;
  margin-left: 4px;
  font-weight: 600;
}
/* 题目附带的图片 / 视频 */
.q-media {
  margin: 12px 0 4px;
}
.q-media img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #e1dfdd;
}
.q-media video {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  border-radius: 8px;
  border: 1px solid #e1dfdd;
  background: #000;
}
/* 分节标题（多页问卷的页分隔，不收集回答） */
.fill-q.section {
  background: #fff;
  border: 1px solid #e1dfdd;
  border-top: 3px solid var(--msf-theme, #4f46e5);
  border-radius: 4px;
  padding: 15px 20px 16px;
  margin-bottom: 12px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.035);
}
.fill-q.section .sec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.fill-q.section .sec-no {
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--msf-theme, #4f46e5);
  color: transparent;
  font-size: 0;
  flex-shrink: 0;
}
.fill-q.section .sec-title {
  font-size: 16px;
  font-weight: 600;
  color: #242424;
  letter-spacing: 0.1px;
}
.fill-q.invalid {
  border-color: #a4262c;
}
.fill-q .q-err {
  color: #a4262c;
  font-size: 12.5px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fill-q .input,
.fill-q .textarea,
.fill-q .select {
  border: 1px solid #c8c6c4;
  border-radius: 4px;
  background: #fff;
  color: #242424;
  padding: 8px 12px;
  font-size: 14px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.fill-q .input:hover,
.fill-q .textarea:hover,
.fill-q .select:hover {
  border-color: #8a8886;
}
.fill-q .input:focus,
.fill-q .textarea:focus,
.fill-q .select:focus {
  outline: none;
  border-color: var(--msf-theme, #4f46e5);
  box-shadow: 0 0 0 1px var(--msf-theme, #4f46e5);
}
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s;
}
.choice:hover {
  background: #f3f2f1;
}
.choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--msf-theme, #4f46e5);
  flex: none;
  margin: 0;
}
.choice span {
  font-size: 14px;
  color: #242424;
  line-height: 1.5;
}
.rating-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.rate-star {
  border: none;
  background: transparent;
  font-size: 30px;
  line-height: 1;
  color: #d7dae5;
  padding: 0 3px;
  transition: color 0.12s, transform 0.1s;
}
.rate-star:hover {
  transform: scale(1.12);
}
.rate-star.on {
  color: #f5b301;
}
.rate-pill {
  min-width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 8px;
}
.rate-pill.on {
  background: var(--msf-theme, #4f46e5);
  border-color: var(--msf-theme, #4f46e5);
  color: #fff;
}
.msf-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 18px;
}
.msf-submit {
  background: var(--msf-theme, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 30px;
  font-size: 14px;
  font-weight: 600;
  min-width: 92px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: background 0.12s, filter 0.12s, box-shadow 0.12s;
}
.msf-submit:hover {
  filter: brightness(0.92);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.16);
}
.msf-submit:disabled {
  opacity: 0.65;
  cursor: default;
  box-shadow: none;
}
.msf-footer {
  margin-top: 42px;
  text-align: center;
  color: #9b9b9b;
  font-size: 12px;
}
.msf-footer b {
  color: #6f6f6f;
  font-weight: 600;
}
.msf-result {
  background: #fff;
  border: 1px solid #e1dfdd;
  border-radius: 4px;
  padding: 46px 30px;
  text-align: center;
}
.msf-result .result-ico {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.msf-result .result-ico.muted {
  background: #f3f2f1;
  color: #8a8886;
}
.msf-result h2 {
  font-size: 22px;
  color: #242424;
  margin-bottom: 8px;
}
.msf-result p {
  color: #616161;
  font-size: 14px;
  line-height: 1.7;
  margin: 0 auto;
  max-width: 460px;
}
.fill-error {
  background: var(--red-soft);
  color: var(--red);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.fill-error.show {
  display: block;
}
.fill-error ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

/* 关键词、代码块 */
.code-box {
  background: #1e2233;
  color: #c9d1f0;
  border-radius: 10px;
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  overflow: auto;
  max-height: 340px;
  white-space: pre;
}
.kbd {
  display: inline-block;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 5px;
  font-size: 11px;
  color: var(--muted);
  background: #fafbfe;
}
.empty-hint {
  font-size: 12.5px;
  color: var(--muted-2);
  padding: 10px 0;
}
.inline-flex {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mt-0 {
  margin-top: 0;
}
.mt-8 {
  margin-top: 8px;
}
.mt-12 {
  margin-top: 12px;
}
.mt-16 {
  margin-top: 16px;
}
.mt-20 {
  margin-top: 20px;
}
.mb-12 {
  margin-bottom: 12px;
}
.mb-16 {
  margin-bottom: 16px;
}
.mb-20 {
  margin-bottom: 20px;
}
.grow {
  flex: 1;
}
.flex {
  display: flex;
  align-items: center;
  gap: 10px;
}
.flex-wrap {
  flex-wrap: wrap;
}
.items-start {
  align-items: flex-start;
}
.hidden {
  display: none !important;
}

/* 响应式 */
@media (max-width: 1080px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .builder {
    grid-template-columns: 1fr;
  }
  .builder-side {
    position: static;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .menu-toggle {
    display: inline-flex;
  }
  .page {
    padding: 4px 16px 32px;
  }
  .topbar {
    padding: 0 16px;
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-brand {
    display: none;
  }
  .q-row {
    flex-wrap: wrap;
  }
  .q-count {
    border-left: none;
    padding-left: 0;
  }
}
@media (max-width: 560px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .msf-banner {
    padding: 30px 0 22px;
  }
  .msf-banner h1 {
    font-size: 23px;
  }
  .msf-in,
  .msf-page {
    padding-left: 16px;
    padding-right: 16px;
  }
  .fill-q {
    padding: 16px 16px 18px;
  }
}

/* ---------- 一键复制面板 ---------- */
.copy-tabs {
  display: inline-flex;
  background: #eceef6;
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.copy-tab {
  height: 30px;
  padding: 0 14px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
}
.copy-tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(20, 26, 45, 0.12);
}
.tab-panel {
  display: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fbfbfd;
}
.tab-panel.active {
  display: block;
}
.copy-text {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  resize: vertical;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}
.copy-bar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.btn-sm {
  height: 30px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 8px;
}

/* ---------- 条件逻辑 ---------- */
.q-logic-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}
.q-logic-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.q-logic-btn.on {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(79, 70, 229, 0.07);
  font-weight: 600;
}
.lg-tip {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  margin-bottom: 16px;
  background: var(--brand-soft, #eef0ff);
  color: #4a4f6a;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.6;
}
.lg-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  background: #fbfbfd;
}
.lg-block-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 10px;
}
.lg-block-head b {
  font-size: 13.5px;
}
.lg-block-head span {
  font-size: 12px;
  color: var(--muted);
}
.lg-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.lg-row .select,
.lg-row .input {
  height: 34px;
  flex: 1 1 140px;
  min-width: 120px;
}
.lg-row [data-role="q"] {
  flex: 1 1 200px;
}
.lg-row [data-role="op"] {
  flex: 0 1 150px;
}
.lg-val {
  flex: 1 1 140px;
  min-width: 120px;
}
.lg-prefix {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.lg-noval {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 编辑器：背景图 / 题目媒体 ---------- */
.bg-preview {
  margin-top: 6px;
}
.bg-thumb {
  width: 100%;
  height: 92px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.bg-thumb.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12.5px;
  background: repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 8px, #eceef1 8px, #eceef1 16px);
}
.media-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.q-media-edit {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.media-chip {
  position: relative;
  display: inline-block;
  margin-right: 10px;
  margin-bottom: 4px;
  vertical-align: top;
}
.media-chip img,
.media-chip video {
  display: block;
  height: 84px;
  max-width: 200px;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #000;
}
.media-chip .media-rm {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #ef4444;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  padding: 0;
}
.media-chip .media-rm:hover {
  background: #dc2626;
}
.q-card .q-media-edit .media-actions {
  margin-top: 6px;
}

/* ---------- 简历生成：字段映射 ---------- */
.mapping-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mapping-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
.mapping-row .select {
  flex: 1;
  min-width: 0;
}
.mapping-key {
  flex: 0 0 auto;
  min-width: 96px;
}
.mapping-key code {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--brand-soft, #eef0ff);
  color: var(--brand, #4f46e5);
  font-size: 12px;
  font-family: ui-monospace, Consolas, monospace;
}
.resume-preview {
  background: #e9ebf3;
  border-radius: 10px;
  padding: 10px;
}
@media (max-width: 920px) {
  .mapping-row {
    flex-wrap: wrap;
  }
  .mapping-key {
    min-width: 100%;
  }
}

/* ---------- 图片上传题 ---------- */
.img-upload {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.img-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 22px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
  background: #fbfbfd;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.img-drop:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(79, 70, 229, 0.04);
}
.img-drop.uploading {
  opacity: 0.6;
  pointer-events: none;
}
.img-drop [data-drop-text] {
  font-size: 13.5px;
  font-weight: 500;
}
.img-drop-hint {
  font-size: 12px;
  color: var(--muted-2, #9aa0b4);
}
.img-preview:empty {
  display: none;
}
.img-thumb {
  position: relative;
  display: inline-block;
}
.img-thumb img {
  max-width: 220px;
  max-height: 220px;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
}
.img-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 8px;
  border: none;
  border-radius: 7px;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}
.img-remove:hover {
  background: #dc2626;
}
.qa-img {
  max-width: 220px;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
  margin-top: 4px;
}
.fake-upload {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 模板封面 ---------- */
.tpl-cover {
  margin: -20px -20px 4px;
  height: 132px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
}
.tpl-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tpl-cover.no-img {
  background: linear-gradient(135deg, var(--cover, #4f46e5), rgba(17, 24, 39, 0.55));
}
.tpl-cover.no-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 28% 30%, rgba(255, 255, 255, 0.28), transparent 55%),
    radial-gradient(circle at 78% 72%, rgba(255, 255, 255, 0.16), transparent 50%);
}
.tpl-thumb {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--cover, #4f46e5), #7c3aed);
  border: 1px solid var(--line);
}
.tpl-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tpl-thumb.no-img {
  background: linear-gradient(135deg, var(--cover, #4f46e5), rgba(17, 24, 39, 0.5));
}


/* ===== 对话型（chat）填写模式 ===== */
.fill-body.chat-mode { overflow: hidden; background: #f7f8fa; }
.fill-body.chat-mode .fill-wrap { max-width: none; margin: 0; padding: 0; }
.chat-shell { height: 100vh; height: 100dvh; max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; background: #fff; box-shadow: 0 0 0 1px #eef1f5; }
.chat-head { flex: none; display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid #eceff3; background: #fff; }
.chat-head-title { flex: 1; min-width: 0; font-weight: 600; font-size: 16px; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head-prog { display: flex; align-items: center; gap: 10px; }
.chat-bar { width: 150px; height: 6px; border-radius: 6px; background: #eef2f7; overflow: hidden; }
.chat-bar > span { display: block; height: 100%; width: 0; background: var(--msf-theme, #4f46e5); transition: width .3s ease; }
.chat-pct { font-size: 12px; color: #6b7280; min-width: 36px; text-align: right; }
.chat-body { flex: 1 1 auto; overflow-y: auto; padding: 20px 16px 12px; background: #f7f8fa; }
.chat-msg { display: flex; gap: 10px; margin-bottom: 16px; align-items: flex-start; }
.chat-msg.user { justify-content: flex-end; }
.chat-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--msf-theme, #4f46e5); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.chat-bubble { max-width: 78%; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.6; word-break: break-word; }
.chat-msg.bot .chat-bubble { background: #fff; border: 1px solid #eceff3; border-top-left-radius: 4px; color: #1f2937; }
.chat-msg.user .chat-bubble { background: var(--msf-theme, #4f46e5); color: #fff; border-top-right-radius: 4px; }
.chat-qtext { font-size: 15px; font-weight: 500; }
.chat-qdesc, .chat-sec-desc { color: #6b7280; font-size: 13px; margin-top: 4px; }
.chat-req { color: #ef4444; margin-left: 2px; }
.chat-sec { border-left: 3px solid var(--msf-theme, #4f46e5); padding-left: 10px; }
.chat-foot { flex: none; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #eceff3; background: #fff; }
.chat-input-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-input { flex: 1 1 auto; width: 100%; border: 1px solid #d6dbe3; border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: none; font-family: inherit; color: #111827; background: #fff; }
.chat-input:focus { border-color: var(--msf-theme, #4f46e5); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.chat-textarea { resize: vertical; min-height: 44px; max-height: 140px; }
.chat-send { flex: none; border: 0; background: var(--msf-theme, #4f46e5); color: #fff; border-radius: 10px; padding: 10px 16px; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chat-send:disabled { opacity: .6; cursor: default; }
.chat-skip { background: none; border: 0; color: #6b7280; font-size: 13px; cursor: pointer; margin-top: 8px; padding: 2px 0; }
.chat-skip:hover { color: #374151; }
.chat-options { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-opt { border: 1px solid #d6dbe3; background: #fff; border-radius: 20px; padding: 8px 16px; font-size: 14px; cursor: pointer; color: #374151; transition: all .15s; }
.chat-opt:hover { border-color: var(--msf-theme, #4f46e5); }
.chat-opt.on { border-color: var(--msf-theme, #4f46e5); color: var(--msf-theme, #4f46e5); background: #eef2ff; }
.chat-rating { display: flex; gap: 6px; }
.chat-star { background: none; border: 0; padding: 0; font-size: 26px; line-height: 1; cursor: pointer; color: #d1d5db; }
.chat-star:hover, .chat-star.on { color: #f59e0b; }
.chat-confirm { margin-top: 0; }
.chat-done { display: flex; align-items: center; gap: 8px; color: #16a34a; }
.chat-submit { width: 100%; justify-content: center; padding: 12px; }
@media (max-width: 640px) {
  .chat-bar { width: 90px; }
  .chat-bubble { max-width: 84%; }
}
