/* ==========================================================================
   花漾培训系统 2.0 - 采访中心（核心人员端）样式
   与 css/style.css 的 Apple Design System 保持一致（BEM + CSS 变量）
   依赖 style.css 中的 :root CSS 变量，暗色模式自动适配
   ========================================================================== */

/* --------------------------------------------------------------------------
   页面骨架
   -------------------------------------------------------------------------- */
.iv-page {
  max-width: 860px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg) var(--space-3xl);
}

.iv-page__header {
  margin-bottom: var(--space-lg);
}

.iv-back-link {
  display: inline-block;
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  text-decoration: none;
  margin-bottom: var(--space-sm);
  transition: color 0.2s var(--ease);
}

.iv-back-link:hover {
  color: var(--accent);
}

.iv-page__title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.iv-page__subtitle {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
}

/* --------------------------------------------------------------------------
   加载 / 空态 / 错误
   -------------------------------------------------------------------------- */
.iv-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-3xl) 0;
  color: var(--text-tertiary);
  font-size: var(--fs-base);
}

.iv-empty {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
}

.iv-empty__icon {
  font-size: 52px;
  margin-bottom: var(--space-md);
}

.iv-empty__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.iv-empty__desc {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.iv-empty .btn {
  margin: 0 var(--space-xs);
}

/* --------------------------------------------------------------------------
   批次卡片列表
   -------------------------------------------------------------------------- */
.iv-batch-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.iv-batch-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.iv-batch-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.iv-batch-card__header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.iv-batch-card__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--accent-bg);
  border-radius: var(--radius-md);
}

.iv-batch-card__info {
  flex: 1;
  min-width: 0;
}

.iv-batch-card__title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text);
  margin-bottom: 4px;
  word-break: break-word;
}

.iv-batch-card__desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-md);
  word-break: break-word;
}

.iv-batch-card__status {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  line-height: 1.6;
}

.iv-batch-card__status--published {
  background: var(--success-bg);
  color: var(--success);
}

.iv-batch-card__status--completed {
  background: var(--warning-bg);
  color: var(--warning);
}

.iv-batch-card__status--analyzed {
  background: var(--accent-bg);
  color: var(--accent);
}

.iv-batch-card__progress {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.iv-batch-card__progress .iv-progress {
  flex: 1;
}

.iv-batch-card__progress-text {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
}

.iv-batch-card__actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   进度条
   -------------------------------------------------------------------------- */
.iv-progress {
  height: 8px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.iv-progress--lg {
  height: 10px;
}

.iv-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease);
}

.iv-detail-progress {
  margin-bottom: var(--space-lg);
}

.iv-detail-progress__info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

/* --------------------------------------------------------------------------
   题目导航点
   -------------------------------------------------------------------------- */
.iv-nav-dots {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.iv-nav-dot {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.iv-nav-dot:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.iv-nav-dot--done {
  background: var(--success-bg);
  border-color: transparent;
  color: var(--success);
}

.iv-nav-dot--refused {
  background: var(--danger-bg);
  border-color: transparent;
  color: var(--danger);
}

.iv-nav-dot--current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px var(--accent-bg);
}

/* --------------------------------------------------------------------------
   答题卡片
   -------------------------------------------------------------------------- */
.iv-question-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.35s var(--ease);
}

.iv-q-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.iv-q-num {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-tertiary);
}

.iv-q-type {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.iv-q-type--single { background: var(--accent-bg); color: var(--accent); }
.iv-q-type--multiple { background: var(--warning-bg); color: var(--warning); }
.iv-q-type--rating { background: var(--success-bg); color: var(--success); }
.iv-q-type--open { background: var(--bg-inset); color: var(--text-secondary); }

.iv-q-refused-tag {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--danger);
  background: var(--danger-bg);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.iv-q-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-relaxed);
  color: var(--text);
  margin-bottom: var(--space-lg);
  word-break: break-word;
}

/* --------------------------------------------------------------------------
   回答引导框（💡）
   -------------------------------------------------------------------------- */
.iv-guide {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
}

.iv-guide__label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.iv-guide__body {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  white-space: pre-wrap;
  word-break: break-word;
}

/* --------------------------------------------------------------------------
   已拒绝横幅
   -------------------------------------------------------------------------- */
.iv-refused-banner {
  background: var(--danger-bg);
  border: 1px solid rgba(255, 59, 48, 0.18);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
}

.iv-refused-banner p {
  font-size: var(--fs-sm);
  color: var(--danger);
  margin-bottom: var(--space-xs);
}

.iv-refused-banner__reason {
  color: var(--text-secondary) !important;
  margin-bottom: var(--space-md) !important;
  word-break: break-word;
}

/* --------------------------------------------------------------------------
   选项（radio / checkbox 大点击区）
   -------------------------------------------------------------------------- */
.iv-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.iv-options--rating {
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.iv-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  user-select: none;
}

.iv-option:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.iv-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.iv-option__marker {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  position: relative;
  transition: all 0.2s var(--ease);
}

/* checkbox 选项方角 */
.iv-options:not(.iv-options--rating) .iv-option input[type="checkbox"] + .iv-option__marker {
  border-radius: 6px;
}

.iv-option--selected {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.iv-option--selected .iv-option__marker {
  border-color: var(--accent);
  background: var(--accent);
}

.iv-option--selected .iv-option__marker::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.iv-options:not(.iv-options--rating) .iv-option--selected .iv-option__marker::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  transform: none;
}

.iv-option__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.iv-option__label {
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--text);
  word-break: break-word;
}

.iv-option__hint {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  word-break: break-word;
}

/* rating 按钮组：紧凑横排 */
.iv-options--rating .iv-option {
  flex-direction: column;
  gap: 2px;
  min-width: 56px;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
}

.iv-options--rating .iv-option__marker {
  display: none;
}

.iv-options--rating .iv-option__label {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  text-align: center;
}

/* --------------------------------------------------------------------------
   自定义回答（其他）选项：虚线边框 + 徽标，始终在选项列表末尾
   -------------------------------------------------------------------------- */
.iv-option--custom {
  border-style: dashed;
  border-color: var(--accent);
  background: var(--bg);
}

.iv-option--custom:hover {
  background: var(--accent-bg);
}

.iv-option--custom.iv-option--selected {
  border-style: solid;
}

.iv-custom-badge {
  display: inline-block;
  font-size: 10px;
  line-height: 1;
  padding: 3px 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  vertical-align: 1px;
  letter-spacing: 0.02em;
}

/* rating 组中的自定义选项：独占一行横排 */
.iv-options--rating .iv-option--custom {
  flex-basis: 100%;
  flex-direction: row;
  justify-content: center;
  gap: var(--space-sm);
  min-width: 0;
}

.iv-options--rating .iv-option--custom .iv-option__marker {
  display: block;
}

/* 选择题的自定义内容输入区：选中自定义选项时展开 */
.iv-custom--choice {
  animation: iv-custom-fade-in 0.2s var(--ease);
}

@keyframes iv-custom-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.iv-open-hint {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  background: var(--bg-inset);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
}

/* --------------------------------------------------------------------------
   自定义输入
   -------------------------------------------------------------------------- */
.iv-custom {
  margin-bottom: var(--space-lg);
}

.iv-custom__label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.iv-custom__required {
  color: var(--danger);
  font-weight: var(--fw-bold);
  margin-left: 2px;
}

.iv-custom__required-text {
  font-size: var(--fs-xs);
  color: var(--danger);
  font-weight: var(--fw-medium);
  margin-left: 4px;
}

.iv-custom__textarea {
  width: 100%;
  line-height: var(--lh-relaxed);
}

/* --------------------------------------------------------------------------
   操作按钮区
   -------------------------------------------------------------------------- */
.iv-q-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.iv-refuse-btn {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: var(--fs-xs);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s var(--ease);
  text-decoration: none;
}

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

/* --------------------------------------------------------------------------
   完成页
   -------------------------------------------------------------------------- */
.iv-complete {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.4s var(--ease);
}

.iv-complete__icon {
  font-size: 64px;
  margin-bottom: var(--space-md);
}

.iv-complete__title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--text);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
}

.iv-complete__desc {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.iv-complete__sub {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--space-lg);
}

.iv-complete__actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-lg);
}

/* --------------------------------------------------------------------------
   拒绝回答 modal
   -------------------------------------------------------------------------- */
.iv-refuse-modal {
  z-index: 1200;
}

.iv-refuse-dialog {
  max-width: 460px;
}

.iv-refuse-modal__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--danger);
  margin-bottom: var(--space-sm);
}

.iv-refuse-modal__desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-md);
}

.iv-refuse-textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  line-height: var(--lh-relaxed);
}

.iv-refuse-counter {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  text-align: right;
  margin: var(--space-xs) 0 var(--space-md);
}

.iv-refuse-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}
