﻿/* 浮层：注册弹窗、toast */

/* ---------------------------------------------------------------- 弹窗 */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(43, 31, 22, 0.34);
  backdrop-filter: blur(3px);
}

.modal[hidden] {
  display: none;
}

.dialog {
  width: min(380px, 100%);
  padding: 26px 24px 22px;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 10px;
  border-radius: 20px;
  background: #eef3e2;
}

.dialog-avatar {
  width: 46px;
  height: 52px;
}

.dialog h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.dialog .sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
}

.dialog input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 13px;
  background: #fffdf7;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
}

.dialog input:focus {
  border-color: var(--accent);
}

.dialog input::placeholder {
  color: #b9ab93;
}

.dialog .hint:empty {
  display: none;
}

.dialog .hint.error {
  color: var(--bad);
}

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 12px);
  padding: 10px 18px;
  border-radius: 13px;
  background: rgba(43, 31, 22, 0.92);
  color: #fff6e8;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 60;
  max-width: 80vw;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}



/* 弹窗里的主按钮 */

button.primary {
  width: 100%;
  margin-top: 12px;
  padding: 11px 14px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--accent-ink);
  transition: transform 0.08s ease, filter 0.15s ease;
}

button.primary:hover {
  filter: brightness(1.05);
}

button.primary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--accent-ink);
}

button.primary:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* 登录 / 注册 切换 */
.tabs {
  display: flex;
  gap: 5px;
  margin: 0 0 14px;
  padding: 4px;
  border-radius: 13px;
  background: #f2ead9;
}

.tab {
  flex: 1;
  padding: 8px 6px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab.on {
  background: #fffaf0;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(75, 58, 44, 0.14);
}

.dialog input[hidden] {
  display: none;
}

.dialog .tabs + input {
  margin-top: 0;
}

.dialog input + input,
.dialog input + button {
  margin-top: 10px;
}
