/* 基础变量 - 商业简约风 */
:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --accent: #0f172a;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  
  --text: #111827;
  --text-light: #334155;
  --text-muted: #64748b;
  
  --bg: #eef4fb;
  --bg-card: rgba(255,255,255,0.96);
  --bg-input: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 8px 24px rgba(15,23,42,0.06);
  --shadow-lg: 0 20px 48px rgba(15,23,42,0.10);
  
  --gradient-1: linear-gradient(135deg, #111827 0%, #2563eb 100%);
  --gradient-2: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  --gradient-3: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
  
  --radius: 18px;
  --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 暗黑主题 */
[data-theme="dark"] {
  --text: #e5e7eb;
  --text-light: #94a3b8;
  --text-muted: #64748b;
  
  --bg: #0b1120;
  --bg-card: #111827;
  --bg-input: #0f172a;
  --border: #1f2937;
  --shadow: 0 8px 24px rgba(0,0,0,0.28);
  --shadow-lg: 0 20px 48px rgba(0,0,0,0.38);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html.theme-animating *,
html.theme-animating *::before,
html.theme-animating *::after {
  transition: background-color .35s ease, color .35s ease, border-color .35s ease, box-shadow .35s ease, fill .35s ease, stroke .35s ease !important;
}

body {
  font-family: 'PingFang SC', 'HarmonyOS Sans SC', 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  line-height: 1.6;
  transition: var(--transition);
}

/* 背景画布 */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
}

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(60px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.fade-in { animation: fadeIn 0.6s ease-out forwards; }
.slide-up { animation: slideUp 0.5s ease-out forwards; }

/* 主题切换按钮 */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  background: transparent;
  border: none;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: var(--transition);
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  transition: transform .28s ease, opacity .2s ease, color .2s ease;
}

.theme-toggle:hover {
  color: var(--text);
  transform: rotate(10deg);
}

/* Logo图片 */
.logo-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  text-decoration: none;
}

.logo-img {
  max-height: 60px;
  width: auto;
  transition: var(--transition);
}

.logo-link:hover .logo-img {
  transform: scale(1.05);
}

/* 登录页面 */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  z-index: 1;
  background: radial-gradient(circle at top, rgba(37,99,235,0.08), transparent 32%), linear-gradient(180deg, #eef2f6 0%, #e8edf4 100%);
}

[data-theme="dark"] .login-page {
  background: radial-gradient(circle at top, rgba(59,130,246,0.12), transparent 30%), linear-gradient(180deg, #0b1120 0%, #111827 100%);
}

.login-container { width: 100%; max-width: 420px; }

.login-box {
  background: rgba(255,255,255,0.95);
  border-radius: var(--radius);
  padding: 48px;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.6s ease-out;
  backdrop-filter: blur(20px);
}

[data-theme="dark"] .login-box {
  background: rgba(26, 26, 46, 0.95);
}

.login-header {
  text-align: center;
  margin-bottom: 36px;
}

.login-header .logo-img { height: 50px; margin-bottom: 16px; }

.login-header p {
  color: var(--text-light);
  font-size: 1rem;
}

.login-hint {
  text-align: center;
  color: var(--text-light);
  font-size: 0.875rem;
  margin-top: 24px;
}

/* 表单 */
.form-group { margin-bottom: 24px; }

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 15px 18px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 14px;
  font-size: 0.98rem;
  transition: border-color .22s ease, box-shadow .22s ease, background-color .22s ease, transform .22s ease;
  background: var(--bg-input);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
  border-color: rgba(59, 130, 246, 0.32);
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.07);
  background: color-mix(in srgb, var(--bg-input) 94%, #ffffff 6%);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.14), 0 14px 30px rgba(59, 130, 246, 0.08);
  transform: translateY(-1px);
}

.form-group textarea { resize: vertical; min-height: 100px; }

.form-group textarea.auto-expand {
  resize: none;
  min-height: 40px;
  max-height: 132px;
  overflow-y: auto;
  overflow-x: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.55;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  display: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.18);
  background: #1d4ed8;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 8px 16px; font-size: 0.875rem; }

/* 管理后台布局 */
.admin-layout { display: flex; min-height: 100vh; }
body.admin-page .theme-toggle {
  top: 18px;
  right: 18px;
}

.theme-toggle-inline {
  position: static;
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  margin-top: 4px;
}

.theme-toggle-inline:hover {
  color: var(--text);
  transform: rotate(10deg);
}

.sidebar {
  width: 260px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.sidebar-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  text-align: center;
}

.sidebar-header .logo-img { height: 40px; margin: 0 auto; }
.sidebar-header p { color: var(--text-light); font-size: 0.875rem; margin-top: 8px; text-align: center; }

.sidebar-nav { flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 4px;
  transition: var(--transition);
  cursor: pointer;
  font-weight: 500;
}

.nav-item:hover { background: var(--bg); transform: translateX(4px); }

.nav-item.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
}

.nav-item.active * {
  color: #ffffff !important;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
  background: var(--bg);
  position: relative;
  z-index: 1;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.page-header h1 { font-size: 1.875rem; font-weight: 700; }

.submission-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.submission-filter-bar select {
  min-width: 170px;
}

.filter-summary {
  margin: -12px 0 16px;
  color: var(--text-light);
  font-size: 0.92rem;
}

/* 卡片 */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-title { font-size: 1.25rem; font-weight: 600; }

.submissions-cards {
  display: none;
}

.mobile-submission-card {
  margin-bottom: 12px;
}

.mobile-submission-head,
.mobile-submission-meta,
.mobile-submission-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mobile-submission-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.mobile-submission-title {
  font-weight: 700;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.mobile-submission-meta,
.mobile-submission-time {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.mobile-submission-actions {
  margin-top: 12px;
}

/* 状态标签 */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-active {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(129, 199, 132, 0.15));
  color: var(--success);
}

.status-inactive {
  background: rgba(160, 174, 192, 0.15);
  color: var(--text-muted);
}

.status-danger {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}

.status-orange {
  background: rgba(249, 115, 22, 0.13);
  color: #ea580c;
}

.status-warning {
  background: rgba(234, 179, 8, 0.16);
  color: #ca8a04;
}

.status-blue {
  background: rgba(37, 99, 235, 0.13);
  color: #2563eb;
}

/* 问卷编辑器 */
.question-editor {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,250,252,0.96));
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  transition: var(--transition);
}

[data-theme="dark"] .question-editor {
  background: linear-gradient(180deg, rgba(17,24,39,0.96), rgba(15,23,42,0.98));
}

.question-editor:hover {
  border-color: rgba(59,130,246,0.35);
  box-shadow: 0 14px 34px rgba(37,99,235,0.10);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.question-number {
  color: var(--primary);
  min-width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(37,99,235,0.10);
}

.question-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(255,255,255,0.72);
}

[data-theme="dark"] .option-item {
  background: rgba(15, 23, 42, 0.72);
}

.option-item input { flex: 1; }

.page-logic-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.42);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 88%, #ffffff 12%);
}

.page-logic-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.page-logic-title {
  font-size: 0.92rem;
  font-weight: 700;
}

.page-logic-help,
.page-logic-empty {
  color: var(--text-light);
  font-size: 0.82rem;
  line-height: 1.6;
}

.page-logic-empty {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.10);
}

.page-logic-rule {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 130px 110px auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.page-logic-rule select,
.page-logic-rule input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.30);
  background: var(--bg-input);
  color: var(--text);
}

/* 问卷填写页面 */
.survey-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px;
  position: relative;
  z-index: 1;
}

.survey-header {
  text-align: left;
  margin-bottom: 40px;
  animation: fadeIn 0.8s ease-out;
  padding-left: 0;
}

.survey-header .logo-img {
  height: 52px;
  margin: 0 0 14px -16px;
  filter: none;
  display: block;
  object-fit: cover;
  object-position: center;
  clip-path: inset(0 18px 0 18px);
}

.survey-header h1 {
  font-size: 2rem;
  margin-bottom: 12px;
  color: var(--text);
  letter-spacing: 0;
  text-align: left;
}

.survey-header p {
  color: var(--text-light);
  text-align: left;
  text-indent: 2em;
  line-height: 1.95;
}

.survey-form {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(10px);
}

.question-block {
  margin-bottom: 28px;
  animation: slideUp 0.5s ease-out forwards;
  opacity: 0;
  padding: 24px 24px 20px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: color-mix(in srgb, var(--bg-card) 94%, #ffffff 6%);
  transition: background-color .22s ease, border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}

.question-block:hover {
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}

.question-error-flash {
  animation: questionFlash 1.2s ease-in-out 2;
}

.question-error-strong {
  border-color: rgba(220, 38, 38, 0.55) !important;
  box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.16), 0 18px 36px rgba(220, 38, 38, 0.12) !important;
  background: rgba(254, 242, 242, 0.88) !important;
}

.input-error {
  border-color: rgba(220, 38, 38, 0.58) !important;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12) !important;
  background: rgba(254, 242, 242, 0.92) !important;
}

.field-error {
  margin: 10px 0 0 32px;
  min-height: 22px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--danger);
  font-weight: 600;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .18s ease, transform .18s ease;
}

.field-error.active {
  opacity: 1;
  transform: translateY(0);
}

@keyframes questionFlash {
  0%, 100% {
    border-color: rgba(239, 68, 68, 0.16);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    background: color-mix(in srgb, var(--bg-card) 94%, #ffffff 6%);
  }
  35% {
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.14), 0 16px 32px rgba(239, 68, 68, 0.08);
    background: rgba(239, 68, 68, 0.06);
  }
}

.question-title {
  font-size: 1.04rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  column-gap: 10px;
  letter-spacing: 0;
  line-height: 1.68;
}

.q-num-wrap {
  position: relative;
  width: 28px;
  min-width: 28px;
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.question-title .q-num {
  color: var(--text-light);
  width: 22px;
  min-width: 22px;
  display: block;
  font-size: 0.94rem;
  line-height: 1.68;
  font-weight: 700;
  text-align: left;
  flex-shrink: 0;
}

.question-required {
  color: var(--danger);
  position: absolute;
  top: -4px;
  right: 2px;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
}

.question-hint {
  font-size: 0.865rem;
  color: var(--text-light);
  margin: 0 0 14px 32px;
  line-height: 1.72;
}

.question-block > .form-group,
.question-block > .options-list,
.question-block > .file-upload,
.question-block > .file-preview,
.question-block > .sort-container,
.question-block > div[style*="overflow-x:auto"],
.question-block > div[style*="display:flex;gap:8px"],
.question-block > div[style*="display:flex;gap:4px"] {
  margin-left: 32px;
}

.survey-section-note {
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.52), rgba(226, 232, 240, 0.34));
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  margin-bottom: 24px;
  white-space: pre-wrap;
  line-height: 1.85;
  color: var(--text);
}


.multiline-center-text {
  white-space: pre-line;
  text-align: center;
  line-height: 1.85;
}

/* 选项样式 */
.options-list { display: flex; flex-direction: column; gap: 12px; }

.option-label {
  display: flex;
  align-items: flex-start;
  padding: 16px 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color .22s ease, box-shadow .22s ease, background-color .22s ease, transform .22s ease;
  background: var(--bg-input);
  min-height: 52px;
}

.option-label input { margin-right: 12px; margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--primary); }

.option-label span {
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  flex: 1;
  min-width: 0;
  line-height: 1.65;
}

.option-label:hover {
  border-color: rgba(96, 165, 250, 0.46);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.08);
  background: color-mix(in srgb, var(--bg-input) 92%, #ffffff 8%);
}

.option-label.selected {
  border-color: rgba(59, 130, 246, 0.42);
  background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.08);
}

.option-label-compact {
  padding: 12px 16px;
}

.btype-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btype-item {
  padding: 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 82%, #ffffff 18%);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.btype-subtitle {
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text);
}

/* 文件上传 */
.file-upload {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-input);
}

.file-upload:hover {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

.file-upload-icon {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 10px;
  color: var(--primary);
  font-weight: 300;
}
.file-upload-text { color: var(--text-light); }

.file-preview { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

.file-preview-item {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
}

.file-preview-item img { width: 100%; height: 100%; object-fit: cover; }

.file-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 14px;
}

/* 进度条 */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 24px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-1);
  border-radius: 3px;
  transition: width 0.4s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

/* 成功页面 */
.success-page { text-align: center; padding: 60px 20px; }

.success-icon {
  font-size: 5rem;
  margin-bottom: 24px;
  animation: pulse 1s ease-out;
}

.avatar-success-icon {
  width: 132px;
  height: 132px;
  margin: 0 auto 24px;
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 16px 36px rgba(59,130,246,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}

.avatar-success-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.success-page h2 { font-size: 1.875rem; margin-bottom: 16px; }
.success-page p { color: var(--text-light); margin-bottom: 24px; }

/* 首页 */
.index-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  background: radial-gradient(circle at top, rgba(37,99,235,0.08), transparent 32%), linear-gradient(180deg, #eef2f6 0%, #e8edf4 100%);
}

[data-theme="dark"] .index-page {
  background: radial-gradient(circle at top, rgba(59,130,246,0.12), transparent 30%), linear-gradient(180deg, #0b1120 0%, #111827 100%);
}

.index-container { text-align: center; padding: 40px; }

.index-logo img {
  height: 80px;
  margin-bottom: 20px;
  animation: none;
  filter: none;
}

.index-container h1 {
  font-size: 2.5rem;
  margin-bottom: 8px;
  color: var(--text);
}

.index-container > p {
  color: var(--text-light);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.index-container a {
  display: inline-block;
  padding: 16px 40px;
  background: #2563eb;
  color: #ffffff;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
}

.index-container a:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 14px 32px rgba(15,23,42,0.18);
}

/* 页数快捷跳转 */
.page-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.page-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-input);
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-dot:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.page-dot.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

@media (max-width: 480px) {
  .page-dot { width: 32px; height: 32px; font-size: 0.8rem; }
  .page-dots { gap: 6px; }
}

/* 响应式 */
@media (max-width: 768px) {
  .sidebar { 
    transform: translateX(-100%);
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 76px 14px 18px; }
  .survey-form { padding: 20px; }
  .login-box { padding: 28px; }
  
  .theme-toggle { top: 10px; right: 10px; width: 44px; height: 44px; }
  .btn { padding: 12px 20px; font-size: 0.95rem; }
  .card { padding: 16px; border-radius: 14px; }
  
  .page-header { flex-direction: column; gap: 12px; align-items: stretch; margin-bottom: 20px; }
  .page-header h1 { font-size: 1.5rem; }
  .submission-filter-bar { justify-content: stretch; }
  .submission-filter-bar select,
  .submission-filter-bar .btn { width: 100%; }
  .filter-summary { margin-top: -4px; }
  
  /* 手机端侧边栏切换按钮 */
  .menu-toggle {
    display: flex !important;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 150;
    background: var(--bg-card);
    border: none;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow);
  }
  
  /* 侧边栏遮罩 */
  .sidebar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
  }
  .sidebar-overlay.active { opacity: 1; visibility: visible; }
  
  /* 模态框适配 */
  .modal { width: 95%; padding: 16px; max-height: 95vh; }
  .modal form { flex-direction: column; }
  .modal form > div:first-child { width: 100%; border-right: none; border-bottom: 2px solid var(--border); padding: 12px; }
  
  /* 表格横向滚动 */
  .card > div { overflow-x: auto; }
  table { min-width: 600px; }
  
  /* 选项按钮适配 */
  .question-type-btn { padding: 10px 6px; font-size: 0.7rem; }
  .question-type-btn .icon { font-size: 1.2rem; }
  
  /* 卡片内按钮换行 */
  .card .btn { margin-bottom: 6px; }
  
  /* 分页按钮 */
  #pagination .btn { padding: 8px 12px; font-size: 0.8rem; }

  .submissions-table-card {
    display: none;
  }

  .submissions-cards {
    display: block;
  }

  .question-header {
    flex-direction: column;
  }

  .question-actions {
    justify-content: flex-start;
  }

  .editor-save-bar {
    left: 0;
    right: 0;
    margin-left: -14px;
    margin-right: -14px;
    padding: 14px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.08);
  }
}

/* 默认隐藏菜单按钮 */
.menu-toggle { display: none; }

/* 手机端表单优化 */
@media (max-width: 480px) {
  .survey-container { padding: 16px; }
  .survey-header h1 { font-size: 1.3rem; }
  .survey-header .logo-img { height: 50px; }
  .question-block { margin-bottom: 24px; }
  .option-label { padding: 12px 14px; font-size: 0.95rem; }
  .btn-primary { padding: 14px 20px; }
  
  .login-box { padding: 24px 20px; margin: 0 10px; }
  .form-group input, .form-group textarea { padding: 12px 14px; }
}

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  backdrop-filter: blur(5px);
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: var(--transition);
  border: 1px solid var(--border);
}

.modal-overlay.active .modal { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  transition: var(--transition);
}

.modal-close:hover { color: var(--danger); transform: rotate(90deg); }

#submissionDetail,
#submissionDetail a,
.question-editor,
.question-editor input,
.question-editor textarea,
.question-editor select {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* 问卷编辑布局 */
.survey-editor-layout {
  flex: 1;
  overflow: hidden;
  display: flex;
  gap: 0;
  min-height: 0;
}

.question-type-panel {
  width: 240px;
  padding: 18px 16px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(37,99,235,0.04), rgba(255,255,255,0.72));
}

[data-theme="dark"] .question-type-panel {
  background: linear-gradient(180deg, rgba(59,130,246,0.08), rgba(15,23,42,0.92));
}

.question-type-title {
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.question-type-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 14px;
}

.survey-editor-main {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  min-width: 0;
}

.survey-editor-main-full {
  width: 100%;
}

.survey-editor-page {
  max-width: 1180px;
  margin: 0 auto;
}

.editor-page-header {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

.survey-editor-page-layout {
  display: block;
  overflow: visible;
  min-height: 0;
}

.survey-editor-page-layout .survey-editor-main {
  padding: 0;
  overflow: visible;
}

.editor-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.editor-field-wide {
  grid-column: 1 / -1;
}

.editor-toolbar {
  padding: 18px 0 12px;
  margin: 8px 0 0;
}

.survey-editor-page .questions-container {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.editor-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding: 14px 0 2px;
  background: linear-gradient(180deg, transparent, var(--bg) 26%);
}

.editor-active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 500;
}

.question-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 12px;
  flex-wrap: wrap;
}

.questions-container {
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 4px;
}

.question-picker-modal {
  max-width: 860px;
}

.question-picker-subtitle {
  margin-top: 6px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.question-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

/* 题型按钮 */
.question-types {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.question-type-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .question-type-btn {
  background: rgba(17, 24, 39, 0.9);
}

.question-type-btn:hover {
  border-color: rgba(37,99,235,0.45);
  background: rgba(37,99,235,0.08);
  transform: translateX(4px);
  box-shadow: 0 10px 24px rgba(37,99,235,0.12);
}

.question-type-btn .icon {
  width: 36px;
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(37,99,235,0.14), rgba(96,165,250,0.18));
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 700;
}

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty-state-icon { font-size: 4rem; margin-bottom: 16px; }

/* 加载 */
.loading {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) {
  .survey-editor-layout {
    flex-direction: column;
  }

  .question-type-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 240px;
  }

  .questions-container {
    max-height: none;
  }

  .editor-field-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }
}

@media (max-width: 600px) {
  .question-title {
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: 8px;
  }

  .q-num-wrap {
    width: 24px;
    min-width: 24px;
  }

  .question-block > .form-group,
  .question-block > .options-list,
  .question-block > .file-upload,
  .question-block > .file-preview,
  .question-block > .sort-container,
  .question-block > div[style*="overflow-x:auto"],
  .question-block > div[style*="display:flex;gap:8px"],
  .question-block > div[style*="display:flex;gap:4px"],
  .question-hint {
    margin-left: 0;
  }

  .file-upload {
    padding: 28px 16px;
  }

  .page-indicator {
    width: 100%;
    justify-content: center;
    order: -1;
  }

  .page-logic-rule,
  .page-logic-row {
    grid-template-columns: 1fr !important;
  }

  .page-logic-head {
    flex-direction: column;
  }
}
