/* ==========================================================================
   夜市商户问卷系统 · 统一样式
   ========================================================================== */

:root {
  --brand: #f97316;
  --brand-600: #ea580c;
  --brand-700: #c2410c;
  --brand-50: #fff7ed;
  --brand-100: #ffedd5;
  --ink: #101828;
  --ink-2: #344054;
  --ink-3: #475467;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #eaecf0;
  --line-2: #d0d5dd;
  --bg: #f7f8fa;
  --card: #ffffff;
  --ok: #12b76a;
  --ok-bg: #ecfdf3;
  --warn: #f79009;
  --warn-bg: #fffaeb;
  --danger: #f04438;
  --danger-bg: #fef3f2;
  --info: #2e90fa;
  --info-bg: #eff8ff;
  --sidebar: #14161c;
  --sidebar-2: #1d2027;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 2px 4px -2px rgba(16, 24, 40, 0.06), 0 12px 28px -12px rgba(16, 24, 40, 0.14);
  --shadow-lg: 0 24px 48px -24px rgba(16, 24, 40, 0.28);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.6;
}

a {
  color: var(--brand-600);
}

button {
  font-family: inherit;
}

/* ---------- 通用组件 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  background: #fff;
  color: var(--ink-2);
  border-color: var(--line-2);
  white-space: nowrap;
  user-select: none;
}

.btn:hover {
  background: #f9fafb;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(180deg, #fb8b3c, var(--brand));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px -8px rgba(249, 115, 22, 0.8);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #f97f27, var(--brand-600));
  box-shadow: 0 8px 20px -8px rgba(249, 115, 22, 0.9);
}

.btn-dark {
  background: var(--ink);
  color: #fff;
  border-color: transparent;
}

.btn-dark:hover {
  background: #1d2939;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-3);
}

.btn-ghost:hover {
  background: rgba(16, 24, 40, 0.05);
}

.btn-danger {
  background: #fff;
  color: var(--danger);
  border-color: #fda29b;
}

.btn-danger:hover {
  background: var(--danger-bg);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-lg {
  padding: 14px 30px;
  font-size: 16px;
  border-radius: 12px;
}

.btn-block {
  width: 100%;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12);
}

.textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.7;
}

.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.field {
  margin-bottom: 16px;
}

.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--line);
  color: var(--ink-3);
  line-height: 1.7;
  white-space: nowrap;
}

.badge-ok {
  background: var(--ok-bg);
  color: #027a48;
}

.badge-warn {
  background: var(--warn-bg);
  color: #b54708;
}

.badge-danger {
  background: var(--danger-bg);
  color: #b42318;
}

.badge-info {
  background: var(--info-bg);
  color: #175cd3;
}

.badge-brand {
  background: var(--brand-50);
  color: var(--brand-700);
}

/* 提示条 */
.toast-wrap {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(16, 24, 40, 0.94);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.22s ease;
  max-width: 88vw;
}

.toast-ok {
  background: #065f46;
}

.toast-err {
  background: #9f1239;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   商户端
   ========================================================================== */

.portal {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.portal-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #1c1917 0%, #292524 45%, #3f2314 100%);
  color: #fff;
  padding: 44px 20px 64px;
}

.portal-hero::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -160px;
  top: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.5), transparent 68%);
  pointer-events: none;
}

.portal-hero::before {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  left: -140px;
  bottom: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.28), transparent 68%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  z-index: 1;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.72);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero-logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(140deg, #fbbf24, #f97316);
  display: grid;
  place-items: center;
  font-size: 16px;
  box-shadow: 0 6px 14px -6px rgba(249, 115, 22, 0.9);
}

.hero-title {
  font-size: 30px;
  line-height: 1.3;
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.hero-sub {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
}

.portal-body {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: -40px auto 0;
  padding: 0 20px 48px;
  position: relative;
  z-index: 2;
}

.panel {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 26px 24px;
  margin-bottom: 18px;
}

.panel-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
}

.panel-desc {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 20px;
  line-height: 1.7;
}

.stall-input-wrap {
  position: relative;
}

.stall-input {
  padding: 15px 16px;
  font-size: 16px;
  border-radius: 12px;
}

.suggest-box {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 40;
  overflow: hidden;
  display: none;
  max-height: 260px;
  overflow-y: auto;
}

.suggest-box.show {
  display: block;
}

.suggest-item {
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.suggest-item:hover,
.suggest-item.active {
  background: var(--brand-50);
}

.suggest-item .tip {
  font-size: 12px;
  color: var(--faint);
}

.notice-box {
  display: flex;
  gap: 10px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: #9a3412;
  line-height: 1.7;
  margin-bottom: 18px;
}

.status-banner {
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.7;
  margin-bottom: 18px;
  border: 1px solid;
}

.status-banner.ok {
  background: var(--ok-bg);
  border-color: #a6f4c5;
  color: #05603a;
}

.status-banner.warn {
  background: var(--warn-bg);
  border-color: #fedf89;
  color: #93370d;
}

.portal-footer {
  text-align: center;
  font-size: 12.5px;
  color: var(--faint);
  padding: 8px 20px 34px;
  line-height: 1.9;
}

/* ICP 备案号链接（合规展示） */
.portal-footer .icp-link {
  color: var(--faint);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.portal-footer .icp-link:hover {
  color: var(--brand);
}

.survey-footer {
  padding: 26px 16px 34px;
}

/* ---------- 答题页 ---------- */

.progress-bar-wrap {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.progress-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 20px 10px;
}

.progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.progress-top strong {
  color: var(--brand-600);
}

.progress-track {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #fbbf24, var(--brand));
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.survey-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 22px 20px 140px;
}

.survey-head {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.survey-head h1 {
  font-size: 21px;
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.survey-intro {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.85;
  margin: 0;
  white-space: pre-wrap;
}

.section-block {
  margin-bottom: 26px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.section-heading::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: linear-gradient(180deg, #fbbf24, var(--brand));
}

.q-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  scroll-margin-top: 90px;
}

.q-card.answered {
  border-color: #d6f5e3;
}

.q-card.has-error {
  border-color: #fda29b;
  box-shadow: 0 0 0 4px rgba(240, 68, 56, 0.08);
}

.q-title {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.65;
  margin: 0 0 4px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.q-index {
  color: var(--faint);
  font-weight: 700;
  font-feature-settings: "tnum";
  flex-shrink: 0;
  min-width: 22px;
}

.q-req {
  color: var(--danger);
  margin-left: 2px;
  font-weight: 700;
}

.q-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 12px 30px;
}

.q-opts {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 12px;
}

.opt {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #fff;
  user-select: none;
}

.opt:hover {
  border-color: #fdba74;
  background: #fffbf7;
}

.opt.selected {
  border-color: var(--brand);
  background: var(--brand-50);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.opt-marker {
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  margin-top: 1px;
  border: 1.8px solid var(--line-2);
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
  background: #fff;
}

.opt-marker.radio {
  border-radius: 50%;
}

.opt-marker.check {
  border-radius: 5px;
}

.opt.selected .opt-marker {
  border-color: var(--brand);
  background: var(--brand);
}

.opt-marker.radio::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: opacity 0.15s;
}

.opt.selected .opt-marker.radio::after {
  opacity: 1;
}

.opt-marker.check::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  opacity: 0;
  transition: opacity 0.15s;
}

.opt.selected .opt-marker.check::after {
  opacity: 1;
}

.opt-label {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
  flex: 1;
}

.opt.selected .opt-label {
  color: var(--brand-700);
  font-weight: 600;
}

.other-input {
  margin-top: 10px;
  display: none;
}

.other-input.show {
  display: block;
}

.survey-actions {
  position: sticky;
  bottom: 0;
  margin-top: 6px;
  padding: 14px 0;
  background: linear-gradient(180deg, rgba(247, 248, 250, 0), var(--bg) 34%);
}

.submit-hint {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 10px;
}

/* ---------- 完成页 ---------- */

.done-hero {
  text-align: center;
  padding: 52px 20px 18px;
}

.done-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--ok-bg);
  display: grid;
  place-items: center;
  animation: pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.done-icon svg {
  width: 38px;
  height: 38px;
  stroke: var(--ok);
}

.answer-list {
  margin-top: 6px;
}

.answer-item {
  padding: 13px 0;
  border-bottom: 1px dashed var(--line);
}

.answer-item:last-child {
  border-bottom: none;
}

.answer-q {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 5px;
  line-height: 1.6;
}

.answer-a {
  font-size: 14.5px;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.7;
}

.answer-a.empty {
  color: var(--faint);
  font-weight: 400;
}

/* ==========================================================================
   管理后台
   ========================================================================== */

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-side {
  width: 224px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
}

.admin-side-head {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-side-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.admin-side-sub {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.42);
  margin-top: 5px;
  letter-spacing: 0.04em;
}

.admin-nav {
  padding: 12px 10px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.66);
  cursor: pointer;
  margin-bottom: 2px;
  transition: all 0.15s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.22), rgba(249, 115, 22, 0.06));
  color: #fff;
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--brand);
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.9;
}

.admin-side-foot {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.admin-main {
  flex: 1;
  margin-left: 224px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
  flex-wrap: wrap;
}

/* 自动刷新指示点 */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #12b76a;
  margin-right: 7px;
  vertical-align: middle;
  animation: livePulse 1.6s infinite;
}
.live-dot.off {
  background: #98a2b3;
  animation: none;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(18, 183, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0); }
}

.admin-page-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.admin-page-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin: 2px 0 0;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-content {
  padding: 22px 26px 60px;
  flex: 1;
}

.grid {
  display: grid;
  gap: 16px;
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.12), transparent 70%);
}

.kpi-label {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
  line-height: 1.15;
}

.kpi-value small {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 3px;
}

.kpi-foot {
  font-size: 12px;
  color: var(--faint);
  margin-top: 6px;
}

.panel-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  overflow: hidden;
}

.panel-box-head {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.panel-box-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-box-title .idx {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--brand-50);
  color: var(--brand-600);
  font-size: 11.5px;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.panel-box-body {
  padding: 18px 20px;
}

.panel-box-body.flush {
  padding: 0;
}

/* 表格 */
.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.data th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 12.5px;
  padding: 11px 14px;
  background: #fcfcfd;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

table.data td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: middle;
}

table.data tbody tr:hover {
  background: #fcfcfd;
}

table.data tbody tr:last-child td {
  border-bottom: none;
}

table.data td.num,
table.data th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cell-strong {
  font-weight: 600;
  color: var(--ink);
}

.link-cell {
  color: var(--brand-600);
  cursor: pointer;
  font-weight: 600;
}

.link-cell:hover {
  text-decoration: underline;
}

/* 带百分比的条形 */
.bar-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.bar-track {
  flex: 1;
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  min-width: 60px;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #fbbf24, var(--brand));
  transition: width 0.4s ease;
}

.bar-fill.alt {
  background: linear-gradient(90deg, #7dd3fc, #2e90fa);
}

.bar-pct {
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  min-width: 48px;
  text-align: right;
}

/* 图表容器 */
.chart {
  width: 100%;
  height: 300px;
}

.chart-sm {
  height: 240px;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 18px;
}

/* 分析题目卡 */
.qn-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.qn-title {
  font-size: 14.5px;
  font-weight: 700;
  margin: 0;
  line-height: 1.6;
  flex: 1;
}

.qn-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.analysis-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 1080px) {
  .analysis-cols {
    grid-template-columns: 1fr;
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
}

.insight-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.insight {
  display: flex;
  gap: 10px;
  background: #fcfcfd;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
}

.insight b {
  color: var(--brand-600);
}

.insight-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--brand-50);
  color: var(--brand-600);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  margin-top: 1px;
}

/* 文本列表 */
.text-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 420px;
  overflow-y: auto;
}

.text-item {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 13px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
  background: #fcfcfd;
}

.text-item .meta {
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 6px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 空状态 */
.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--muted);
}

.empty-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--line);
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--faint);
}

.empty p {
  margin: 6px 0 0;
  font-size: 13.5px;
}

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.pager-btns {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* 登录页 */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, #2a2118 0%, #14161c 55%, #0c0d11 100%);
}

.login-card {
  width: 100%;
  max-width: 384px;
  background: #fff;
  border-radius: 20px;
  padding: 34px 30px 30px;
  box-shadow: 0 32px 64px -32px rgba(0, 0, 0, 0.6);
}

.login-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(140deg, #fbbf24, #f97316);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  font-size: 22px;
  box-shadow: 0 10px 22px -10px rgba(249, 115, 22, 0.9);
}

.login-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 6px;
}

.login-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 22px;
}

/* 抽屉 / 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.5);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.18s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.22s cubic-bezier(0.34, 1.3, 0.64, 1);
}

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

.modal.modal-wide {
  max-width: 820px;
}

.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.icon-btn {
  border: none;
  background: transparent;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.icon-btn:hover {
  background: var(--line);
  color: var(--ink);
}

/* 开关 */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink-2);
  user-select: none;
}

.switch input {
  display: none;
}

.switch-track {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--line-2);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.switch-track::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .switch-track {
  background: var(--brand);
}

.switch input:checked + .switch-track::after {
  transform: translateX(16px);
}

/* 交叉分析热力表 */
table.cross {
  border-collapse: collapse;
  font-size: 13px;
  min-width: 100%;
}

table.cross th,
table.cross td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: center;
  white-space: nowrap;
}

table.cross th {
  background: #fcfcfd;
  font-weight: 600;
  color: var(--ink-2);
  font-size: 12.5px;
}

table.cross th.rowhead,
table.cross td.rowhead {
  text-align: left;
  background: #fcfcfd;
  font-weight: 600;
  color: var(--ink-2);
  position: sticky;
  left: 0;
  z-index: 1;
  max-width: 220px;
  white-space: normal;
}

table.cross td {
  font-variant-numeric: tabular-nums;
}

table.cross td .c-n {
  font-weight: 700;
  color: var(--ink);
}

table.cross td .c-p {
  font-size: 11.5px;
  color: var(--muted);
  display: block;
}

/* 题目编辑器 */
.qedit-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fcfcfd;
}

.qedit-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.qedit-no {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--brand-50);
  color: var(--brand-600);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.opt-edit-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 7px;
}

.opt-edit-row .code {
  width: 46px;
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
  padding: 9px 4px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12.5px;
}

.mt-0 {
  margin-top: 0;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mb-16 {
  margin-bottom: 16px;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.row > .col {
  flex: 1;
  min-width: 200px;
}

.spacer {
  flex: 1;
}

.loading {
  text-align: center;
  padding: 50px 20px;
  color: var(--muted);
  font-size: 13.5px;
}

.spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto 12px;
  border: 2.5px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 移动端 */
@media (max-width: 900px) {
  .admin-side {
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
  }
  .admin-side.open {
    transform: none;
  }
  .admin-main {
    margin-left: 0;
  }
  .admin-content {
    padding: 16px 14px 50px;
  }
  .admin-topbar {
    padding: 12px 14px;
  }
  .menu-toggle {
    display: inline-flex !important;
  }
}

.menu-toggle {
  display: none;
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 23px;
  }
  .portal-hero {
    padding: 32px 18px 54px;
  }
  .panel {
    padding: 20px 17px;
  }
  .q-card {
    padding: 16px 15px;
  }
  .survey-wrap {
    padding: 16px 14px 130px;
  }
  .progress-inner {
    padding: 10px 14px 8px;
  }
  .kpi-value {
    font-size: 23px;
  }
}

@media print {
  .admin-side,
  .admin-topbar,
  .btn {
    display: none !important;
  }
  .admin-main {
    margin-left: 0;
  }
}
