/* ── 全局重置 ── */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f0f2f5;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── 登录页 ── */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.login-title {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22,119,255,0.1);
}

.form-error {
  color: #ff4d4f;
  font-size: 14px;
  margin-bottom: 12px;
}

/* ── 按钮 ── */

.btn {
  display: inline-block;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: #1677ff;
  color: #fff;
  border-color: #1677ff;
}

.btn-primary:hover:not(:disabled) {
  background: #4096ff;
}

.btn-outline {
  background: #fff;
  color: #333;
  border-color: #d9d9d9;
}

.btn-outline:hover:not(:disabled) {
  border-color: #1677ff;
  color: #1677ff;
}

.btn-full {
  width: 100%;
}

/* ── 问卷页 ── */

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

.top-bar {
  background: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 10;
}

.top-bar-title {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
}

.main-content {
  flex: 1;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

/* ── 状态消息 ── */

.state-msg {
  text-align: center;
  padding: 60px 20px;
  font-size: 16px;
  color: #999;
}

.state-error {
  color: #ff4d4f;
}

.state-error .btn {
  margin-top: 16px;
}

/* ── 问题卡片 ── */

.question-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  position: relative;
}

.question-header {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.question-index {
  font-weight: 600;
  color: #1677ff;
  flex-shrink: 0;
}

.question-text {
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a;
}

/* ── 选项 ── */

.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.option-item:hover {
  border-color: #1677ff;
  background: #f6f9ff;
}

.option-item.active {
  border-color: #1677ff;
  background: #e6f4ff;
}

.option-item input[type="radio"] {
  accent-color: #1677ff;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.option-label {
  font-size: 15px;
  color: #333;
}

/* ── 自定义输入 ── */

.custom-input input {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.custom-input input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22,119,255,0.1);
}

/* ── 保存指示 ── */

.save-indicator {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 12px;
  color: #999;
}

/* ── 卡片底部 ── */

.card-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.btn-delete {
  padding: 4px 12px;
  font-size: 13px;
  color: #999;
  background: none;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-delete:hover {
  color: #ff4d4f;
  border-color: #ff4d4f;
}

/* ── 分页 ── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 0;
}

.page-info {
  font-size: 14px;
  color: #666;
}

/* ── 分类选择 ── */

.category-select-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0f0f0;
}

.category-label {
  font-size: 14px;
  font-weight: 500;
  color: #555;
  white-space: nowrap;
}

.required {
  color: #ff4d4f;
}

.category-select {
  flex: 1;
  max-width: 280px;
  padding: 8px 12px;
  font-size: 14px;
  color: #333;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  outline: none;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: auto;
  -webkit-appearance: auto;
  -moz-appearance: auto;
}

.category-select:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22,119,255,0.1);
}

.category-select option[value=""][disabled] {
  color: #bfbfbf;
}
