/**
 * IPC 临时功能样式
 * 后期移除步骤：删除此文件 + 删除 index.html 中的 ipc-temp-layer 容器 + 删除 js/ipc-temp.js 引用
 */

/* ---------- 操作按钮区 ---------- */
.ipc-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.ipc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.ipc-btn-primary {
  background: var(--accent, #ff8c38);
  color: #fff;
}

.ipc-btn-primary:hover {
  background: var(--primary-mid, #e86c28);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255,140,56,.35);
}

.ipc-btn-secondary {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.2);
}

.ipc-btn-secondary:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}

.ipc-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.ipc-btn-block {
  width: 100%;
  justify-content: center;
}

/* ---------- 弹窗 ---------- */
.ipc-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
}

.ipc-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ipc-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
}

.ipc-modal-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 450px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
  animation: ipcModalIn 0.3s ease;
}

.ipc-modal-large {
  max-width: 600px;
}

@keyframes ipcModalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.ipc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

.ipc-modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text, #2a1506);
}

.ipc-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f5f5f5;
  border-radius: 6px;
  cursor: pointer;
  font-size: 20px;
  color: #666;
  transition: all 0.2s;
}

.ipc-modal-close:hover {
  background: #e0e0e0;
  color: #333;
}

.ipc-modal-body {
  padding: 24px;
}

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

.ipc-form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.ipc-required {
  color: #ff4444;
}

.ipc-form-input,
.ipc-form-select,
.ipc-form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
  font-family: inherit;
}

.ipc-form-input:focus,
.ipc-form-select:focus,
.ipc-form-textarea:focus {
  outline: none;
  border-color: var(--accent, #ff8c38);
  box-shadow: 0 0 0 3px rgba(255,140,56,0.1);
}

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

.ipc-form-file {
  display: block;
  width: 100%;
  padding: 8px 0;
  font-size: 14px;
}

.ipc-form-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #999;
}

.ipc-form-error {
  min-height: 20px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #ff4444;
}

.ipc-form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ---------- Toast 提示 ---------- */
.ipc-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  border-left: 4px solid #52c41a;
  transform: translateX(140%);
  transition: transform 0.3s ease;
}

.ipc-toast.show {
  transform: translateX(0);
}

.ipc-toast-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #52c41a;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
}

.ipc-toast-message {
  font-size: 14px;
  color: #333;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .ipc-actions {
    gap: 8px;
  }

  .ipc-btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  .ipc-modal-content {
    width: 95%;
    margin: 10px;
  }

  .ipc-modal-header {
    padding: 16px 20px;
  }

  .ipc-modal-body {
    padding: 20px;
  }

  .ipc-form-actions {
    flex-direction: column;
  }

  .ipc-form-actions .ipc-btn {
    width: 100%;
  }
}
