/**
 * 访客需求书弹窗样式（新版）
 */

/* ---- 旧版兼容占位（保留选择器避免报错） ---- */
.visitor-request-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.visitor-request-modal.is-open {
  opacity: 1;
  visibility: visible;
}

/* 遮罩层 */
.visitor-request-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

/* 对话框 */
.visitor-request-dialog {
  position: relative;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
}

.visitor-request-modal.is-open .visitor-request-dialog {
  transform: translateY(0) scale(1);
}

/* 关闭按钮 */
.visitor-request-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: background 0.2s, color 0.2s;
  z-index: 1;
}

.visitor-request-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #333;
}

/* 头部 */
.visitor-request-header {
  padding: 32px 32px 0;
  text-align: center;
}

.visitor-request-title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
  color: #1a1a1a;
}

.visitor-request-subtitle {
  margin: 0;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

/* 表单 */
.visitor-request-form {
  padding: 24px 32px 32px;
}

.visitor-request-field {
  margin-bottom: 20px;
}

.visitor-request-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.visitor-request-label .required {
  color: #e53935;
}

.visitor-request-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  color: #333;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.visitor-request-input:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.visitor-request-input::placeholder {
  color: #999;
}

/* 验证码行 */
.visitor-request-code-row {
  display: flex;
  gap: 12px;
}

.visitor-request-code-input {
  flex: 1;
}

.visitor-request-code-btn {
  flex-shrink: 0;
  width: 140px;
  height: 48px;
  border: 1px solid #1976d2;
  background: transparent;
  color: #1976d2;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.visitor-request-code-btn:hover:not(:disabled) {
  background: #1976d2;
  color: #fff;
}

.visitor-request-code-btn:disabled {
  border-color: #bdbdbd;
  color: #9e9e9e;
  cursor: not-allowed;
}

/* 错误提示 */
.visitor-request-error {
  display: none;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 8px;
  color: #c62828;
  font-size: 14px;
  line-height: 1.5;
}

/* 匹配提示 */
.visitor-request-match {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #E8F5E9;
  border: 1px solid #A5D6A7;
  border-radius: 8px;
  color: #2E7D32;
  font-size: 14px;
  line-height: 1.5;
}

.visitor-request-match svg {
  flex-shrink: 0;
}

/* 提交按钮 */
.visitor-request-actions {
  margin-top: 24px;
}

.visitor-request-submit {
  width: 100%;
  height: 52px;
  border: none;
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.visitor-request-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(25, 118, 210, 0.4);
}

.visitor-request-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.visitor-request-submit .btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.visitor-request-submit .spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 响应式 */
@media (max-width: 540px) {
  .visitor-request-dialog {
    width: 95%;
    max-height: 95vh;
    border-radius: 12px;
  }

  .visitor-request-header {
    padding: 24px 20px 0;
  }

  .visitor-request-title {
    font-size: 20px;
  }

  .visitor-request-form {
    padding: 20px;
  }

  .visitor-request-code-row {
    flex-direction: column;
  }

  .visitor-request-code-btn {
    width: 100%;
  }

  .visitor-request-close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }
}

/* ============================================================
   新版需求书弹窗 (.vr-*)
   ============================================================ */
.vr-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.vr-modal.is-open {
  opacity: 1;
  visibility: visible;
}
.vr-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}
.vr-dialog {
  position: relative;
  width: 90%;
  max-width: 440px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.22);
  overflow: hidden;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.vr-modal.is-open .vr-dialog {
  transform: translateY(0) scale(1);
}

/* 关闭按钮 */
.vr-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0,0,0,0.06);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0,0,0,0.4);
  z-index: 10;
  transition: background 0.15s, color 0.15s;
}
.vr-close:hover { background: rgba(0,0,0,0.1); color: #111; }

/* 面板 */
.vr-panel { padding: 32px 28px 28px; }
.vr-panel--hidden { display: none; }

/* 头部 */
.vr-header { margin-bottom: 20px; }
.vr-header--center { text-align: center; padding: 20px 0; }
.vr-icon {
  width: 48px; height: 48px;
  background: #f4f4f4;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  color: #111;
}
.vr-title {
  font-size: 20px;
  font-weight: 700;
  color: #111;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.vr-subtitle {
  font-size: 13px;
  color: rgba(0,0,0,0.45);
  margin: 0;
  line-height: 1.5;
}

/* 返回按钮 */
.vr-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: none;
  padding: 0;
  font-size: 13px;
  color: rgba(0,0,0,0.4);
  cursor: pointer;
  margin-bottom: 14px;
  font-family: inherit;
  transition: color 0.15s;
}
.vr-back:hover { color: #111; }

/* 选择按钮 */
.vr-choices { display: flex; flex-direction: column; gap: 10px; }
.vr-choice-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border: 1.5px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.vr-choice-btn:hover {
  border-color: #111;
  background: #fafafa;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.vr-choice-icon {
  width: 40px; height: 40px;
  background: #f4f4f4;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #111;
  transition: background 0.15s;
}
.vr-choice-btn:hover .vr-choice-icon { background: #111; color: #fff; }
.vr-choice-text { flex: 1; }
.vr-choice-title { display: block; font-size: 14px; font-weight: 600; color: #111; margin-bottom: 2px; }
.vr-choice-desc  { display: block; font-size: 12px; color: rgba(0,0,0,0.45); }
.vr-choice-arrow { color: rgba(0,0,0,0.25); flex-shrink: 0; transition: color 0.15s, transform 0.15s; }
.vr-choice-btn:hover .vr-choice-arrow { color: #111; transform: translateX(3px); }

/* 加载旋转 */
.vr-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(0,0,0,0.1);
  border-top-color: #111;
  border-radius: 50%;
  animation: vrSpin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes vrSpin { to { transform: rotate(360deg); } }

/* 表单 */
.vr-form { display: flex; flex-direction: column; gap: 0; }
.vr-field { margin-bottom: 16px; }
.vr-label { display: block; font-size: 13px; font-weight: 500; color: #333; margin-bottom: 7px; }
.vr-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  font-size: 14px;
  color: #111;
  background: #fff;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.vr-input:focus {
  outline: none;
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
.vr-input::placeholder { color: rgba(0,0,0,0.3); }
.vr-code-row { display: flex; gap: 10px; }
.vr-code-input { flex: 1; }
.vr-code-btn {
  flex-shrink: 0;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #111;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.vr-code-btn:hover:not(:disabled) { background: #f4f4f4; border-color: #111; }
.vr-code-btn:disabled { color: rgba(0,0,0,0.3); cursor: not-allowed; }

/* 错误 */
.vr-error {
  display: none;
  font-size: 13px;
  color: #c62828;
  background: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* 提交按钮 */
.vr-submit {
  width: 100%;
  height: 48px;
  border: none;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.15s;
}
.vr-submit:hover:not(:disabled) { opacity: 0.85; }
.vr-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* 需求书列表 */
.vr-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.vr-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1.5px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.vr-list-item:hover { border-color: #111; background: #fafafa; }
.vr-list-item__main { display: flex; flex-direction: column; gap: 3px; }
.vr-list-item__code { font-size: 11px; color: rgba(0,0,0,0.35); font-weight: 500; }
.vr-list-item__name { font-size: 14px; font-weight: 600; color: #111; }
.vr-list-item__meta { display: flex; align-items: center; gap: 8px; color: rgba(0,0,0,0.3); font-size: 12px; }
.vr-empty { text-align: center; padding: 32px 0; font-size: 13px; color: rgba(0,0,0,0.35); }

/* 响应式 */
@media (max-width: 480px) {
  .vr-dialog { width: 95%; border-radius: 16px; }
  .vr-panel { padding: 24px 20px 20px; }
  .vr-code-row { flex-direction: column; }
  .vr-code-btn { width: 100%; }
}
