/* ========================================= */
/* 文件：modal.css                            */
/* 功能：所有弹窗的通用骨架 —— 居中确认弹窗、  */
/*       底部滑出面板、水晶玻璃按钮样式、      */
/*       弹入/淡入动画，都在这一份文件里       */
/* ========================================= */

/* --- 通用弹窗遮罩 --- */
.modal {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(8px);
  display: flex; justify-content: center; align-items: center;
  padding: 20px; animation: fadeIn 0.2s ease-out;

  /* 全局防穿透：遮罩层没收所有拉扯权限 */
  overscroll-behavior: none;
  touch-action: none;
}

/* --- 弹窗卡片盒子 --- */
.modal-content {
  width: 100%; max-width: 340px; height: auto; max-height: 70vh;
  background: rgba(20, 22, 31, 0.95); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px; box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  display: flex; flex-direction: column; animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- 弹窗标题栏 --- */
.modal-header { padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05); }
.modal-title { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: 0.5px; }
.modal-close {
  font-size: 18px; color: rgba(255,255,255,0.4); width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,0.05); cursor: pointer; transition: all 0.2s;
}
.modal-close:active { background: rgba(255,255,255,0.15); color: #fff; }

/* --- 弹窗内容区 --- */
.modal-body {
  flex: 1; padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px;

  /* 减震海绵 + 垂直滑动特权 */
  overscroll-behavior-y: none;
  touch-action: pan-y;
}
.modal-body label { font-size: 13px; color: #ffb37a; margin-bottom: -8px; font-weight: 600; margin-left: 4px; }
.modal-body input, .modal-body textarea {
  background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
  padding: 14px; color: #fff; font-family: inherit; font-size: 15px; outline: none; transition: all 0.3s;
}
.modal-body input:focus, .modal-body textarea:focus { border-color: rgba(255, 179, 122, 0.5); background: rgba(0,0,0,0.4); }
.modal-body textarea { min-height: 120px; resize: none; line-height: 1.6; }

/* --- 弹窗按钮栏 --- */
.modal-footer { padding: 20px 24px; display: flex; justify-content: space-between; gap: 15px; }

/* --- 取消按钮 --- */
.btn-delete {
  color: rgba(255, 107, 107, 0.8); background: rgba(255, 107, 107, 0.1);
  border: none; font-size: 14px; padding: 12px 20px; border-radius: 12px; font-weight: 600;
}

/* --- 确认按钮 --- */
.btn-save {
  flex: 1; background: linear-gradient(135deg, #ffb37a, #ff9f43);
  color: #271910; border: none; border-radius: 12px; padding: 12px 24px;
  font-weight: 700; font-size: 15px; box-shadow: 0 4px 15px rgba(255, 159, 67, 0.25);
}
.btn-save:active { transform: scale(0.98); }

/* --- 弹入动画（弹窗出现时用） --- */
@keyframes popIn { 0% { opacity: 0; transform: scale(0.9) translateY(20px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }

/* --- 水晶玻璃确认弹窗 --- */

/* 全屏遮罩：极低存在感，不模糊 */
#global-confirm-modal {
  background: rgba(0, 0, 0, 0.2) !important;
  backdrop-filter: none !important;
}

/* 弹窗盒子：高通透玻璃 */
#global-confirm-modal .modal-content {
  background: rgba(20, 22, 30, 0.6) !important;
  backdrop-filter: blur(15px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  animation: popInSmall 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 按钮基础：加玻璃质感 */
#global-confirm-modal button {
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
  border-radius: 12px;
  letter-spacing: 1px;
}

/* 取消按钮：冰霜玻璃 */
#global-confirm-modal .btn-delete {
  background: rgba(255, 255, 255, 0.03) !important;
  color: rgba(255, 255, 255, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.02);
}

/* 确认按钮：琥珀玻璃 */
#global-confirm-modal .btn-save {
  background: rgba(255, 179, 122, 0.15) !important;
  color: #ffb37a !important;
  border: 1px solid rgba(255, 179, 122, 0.3);
  box-shadow: 0 0 15px rgba(255, 179, 122, 0.1), inset 0 0 15px rgba(255, 179, 122, 0.05) !important;
}

/* 取消按钮按下反馈 */
#global-confirm-modal .btn-delete:active {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255,255,255,0.2);
}

/* 确认按钮按下反馈 */
#global-confirm-modal .btn-save:active {
  background: rgba(255, 179, 122, 0.25) !important;
  border-color: rgba(255, 179, 122, 0.6);
  box-shadow: 0 0 25px rgba(255, 179, 122, 0.3) !important;
  transform: scale(0.98);
}

/* --- 底部滑出面板 --- */

/* 弹窗遮罩：默认透明，激活后半透明 */
.bottom-sheet-modal {
display: flex; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 2000; align-items: flex-end;
  background: rgba(0,0,0,0); backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px);
  visibility: hidden; opacity: 0; transition: all 0.3s ease;

  /* 防弹玻璃：遮罩层禁止穿透 */
  overscroll-behavior: none;
  touch-action: none;
}

/* 激活状态：背景变暗 */
.bottom-sheet-modal.show {
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  visibility: visible;
  opacity: 1;
}

/* --- 面板内容容器 --- */
.bottom-sheet-content {
  width: 100%; background: rgba(20, 20, 20, 0.75);
  backdrop-filter: blur(25px) saturate(180%); -webkit-backdrop-filter: blur(25px) saturate(180%);
  border-radius: 24px 24px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6); padding: 25px 25px 45px 25px;
  transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1);

  /* 面板本身禁止拉扯 */
  overscroll-behavior: none;
  touch-action: none;
}

/* --- 面板可滚动区域 --- */
.sheet-body {
  overflow-y: auto;
  max-height: 62vh;
  overscroll-behavior-y: none;
  touch-action: pan-y;
}

/* 激活状态：面板从底部滑上来 */
.bottom-sheet-modal.show .bottom-sheet-content {
  transform: translateY(0);
}

/* --- 面板标题栏 --- */
.sheet-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 25px; padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.sheet-title { font-size: 17px; font-weight: 600; color: rgba(255, 255, 255, 0.95); letter-spacing: 0.5px; flex: 1; text-align: center; }
.sheet-close {
  font-size: 24px; color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.1); width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding-bottom: 4px; cursor: pointer;
}

/* --- 淡入动画（弹窗遮罩出现时用） --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
