/* ========== common.css ========== */
/* 人格岛屿 · 全局公用样式 */
/* 包含：毛玻璃基础、Toast提示、登录/注册弹窗 */

/* ---------- 1. 毛玻璃基础类 ---------- */
.glass {
  background: rgba(255, 255, 245, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.02), inset 0 1px 3px rgba(255, 255, 255, 0.9);
  border-radius: 48px;
}

/* ---------- 2. Toast 提示 ---------- */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 28px;
  border-radius: 60px;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  z-index: 1000;
  animation: toastIn 0.3s ease-out;
  transition: opacity 0.3s;
  max-width: 90vw;
  text-align: center;
  pointer-events: none;
  /* 默认深色毛玻璃 */
  background: rgba(30, 40, 40, 0.9);
  backdrop-filter: blur(10px);
  color: #FAF7F2;
}

/* 不同状态的颜色 */
.toast.info {
  background: rgba(155, 176, 160, 0.9);
  color: #1E2A2C;
}
.toast.success {
  background: rgba(201, 124, 93, 0.9);
  color: #FAF7F2;
}
.toast.error {
  background: rgba(200, 80, 80, 0.9);
  color: #FAF7F2;
}

/* 进入动画 */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* 消失动画 */
.toast.fade-out {
  opacity: 0;
}

/* ---------- 3. 登录/注册/设置弹窗 ---------- */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-card {
  position: relative; /* 为绝对定位的关闭按钮提供参考 */
  background: rgba(255, 255, 245, 0.75);
  backdrop-filter: blur(12px);
  border-radius: 48px;
  padding: 36px 32px;
  width: 400px;
  max-width: 90%;
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.7) inset;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transform: scale(0.9);
  animation: cardZoomIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes cardZoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* 弹窗标题 */
.auth-card h3 {
  margin: 0 0 24px 0;
  font-size: 1.8rem;
  font-weight: 500;
  color: #2E3A3C;
  text-align: center;
  font-family: 'Playfair Display', serif;
  border-bottom: 1px dashed rgba(155, 176, 160, 0.3);
  padding-bottom: 12px;
}

/* 输入框、下拉框、文本域 */
.auth-card input,
.auth-card select,
.auth-card textarea {
  width: 100%;
  margin: 12px 0;
  padding: 14px 20px;
  border: 1px solid rgba(155, 176, 160, 0.4);
  border-radius: 40px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.8);
  transition: all 0.2s;
  outline: none;
  color: #2E3A3C;
}

.auth-card input:focus,
.auth-card select:focus,
.auth-card textarea:focus {
  border-color: #C97C5D;
  background: white;
  box-shadow: 0 0 0 4px rgba(201, 124, 93, 0.15);
}

/* 按钮 */
.auth-card button {
  margin: 8px 0 4px;
  padding: 14px 20px;
  border: none;
  border-radius: 40px;
  background: #9BB0A0;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  letter-spacing: 0.5px;
}

.auth-card button:hover {
  background: #C97C5D;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(201, 124, 93, 0.3);
}

.auth-card button:active {
  transform: translateY(0);
}

/* 关闭按钮（右上角 ×） */
.auth-card .close-btn {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 2rem;
  cursor: pointer;
  color: #4A5A5C;
  line-height: 1;
  transition: all 0.2s;
  width: auto;
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.auth-card .close-btn:hover {
  color: #C97C5D;
  transform: rotate(90deg);
  background: transparent;
  box-shadow: none;
}

/* 头像列表（用于首次设置弹窗） */
#avatarList {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 16px 0;
}

#avatarList img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  object-fit: cover;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#avatarList img:hover {
  transform: scale(1.1);
  border-color: #9BB0A0;
}

#avatarList img.selected {
  border-color: #C97C5D;
  box-shadow: 0 0 0 3px rgba(201, 124, 93, 0.3);
}

/* 弹窗内的提示消息 */
#setupMessage,
#authMessage {
  color: #C97C5D;
  font-size: 0.9rem;
  margin-top: 12px;
  text-align: center;
}

/* ---------- 4. 辅助类 ---------- */
.hidden {
  display: none !important;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* ---------- 5. 移动端适配 ---------- */
@media (max-width: 600px) {
  .auth-card {
    padding: 28px 20px;
  }
  .auth-card h3 {
    font-size: 1.5rem;
  }
  .toast {
    font-size: 0.9rem;
    padding: 10px 20px;
    bottom: 20px;
  }
  #avatarList img {
    width: 60px;
    height: 60px;
  }
}