/* === 认证系统 === */
.auth-area {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeInUp 1.2s cubic-bezier(0.4, 0, 0.2, 1) 1s both;
}
.auth-btn {
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.06));
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-family: 'Noto Serif SC', serif;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03), inset 0 1px 0 rgba(255,255,255,0.06);
}
.auth-btn:hover {
  border-color: var(--accent-dim);
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.1));
  transform: translateY(-1px);
}
.auth-btn:active {
  transform: scale(0.97);
}
.auth-btn-small {
  padding: 4px 12px;
  font-size: 0.7rem;
}
.auth-nickname {
  color: var(--text-secondary);
  font-family: 'Noto Serif SC', serif;
  font-size: 0.75rem;
  margin-right: 4px;
  letter-spacing: 0.05em;
}

/* 弹窗遮罩 */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.auth-modal-content {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 36px 28px;
  width: 320px;
  max-width: 90vw;
  position: relative;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-ghost);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.3s;
}
.auth-modal-close:hover {
  color: var(--text-secondary);
}
.auth-title {
  color: var(--text-primary);
  font-family: 'LXGW WenKai', serif;
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 24px;
  font-weight: 400;
  letter-spacing: 0.15em;
}
.auth-input {
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: 'Noto Serif SC', serif;
  font-size: 0.9rem;
  margin-bottom: 12px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
.auth-input:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 20px rgba(140, 160, 200, 0.08);
}
.auth-input::placeholder {
  color: var(--text-ghost);
}
.auth-submit {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  background: linear-gradient(135deg, var(--glass-bg), rgba(255,255,255,0.08));
  border: 1px solid var(--accent-dim);
  color: var(--text-primary);
  font-family: 'Noto Serif SC', serif;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.1);
}
.auth-submit:hover {
  background: linear-gradient(135deg, var(--accent-dim), rgba(255,255,255,0.06));
  border-color: var(--accent);
  box-shadow: 0 4px 20px var(--accent-dim);
  transform: translateY(-2px);
}
.auth-submit:active {
  transform: scale(0.97) translateY(0);
}
.auth-switch {
  text-align: center;
  color: var(--text-ghost);
  font-family: 'Noto Serif SC', serif;
  font-size: 0.75rem;
  margin-top: 16px;
  letter-spacing: 0.05em;
}
.auth-switch span {
  color: var(--accent);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s;
}
.auth-switch span:hover {
  opacity: 1;
}
.auth-error {
  color: #e57373;
  font-size: 0.75rem;
  text-align: center;
  margin-top: 8px;
  min-height: 16px;
}
.auth-success {
  color: #81c784;
  font-size: 0.75rem;
  text-align: center;
  margin-top: 8px;
  min-height: 16px;
}
.auth-hint {
  color: var(--text-ghost);
  font-size: 0.75rem;
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

/* === 信箱 === */
.mailbox-header {
  padding: 20px 20px 12px;
  position: relative;
}
.mailbox-title {
  text-align: center;
  color: var(--text-primary);
  font-family: 'LXGW WenKai', serif;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  margin-top: 8px;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.mailbox-info {
  text-align: center;
  color: var(--text-ghost);
  font-size: 0.7rem;
  margin-top: 6px;
  letter-spacing: 0.05em;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
}
.mailbox-list {
  padding: 0 16px 80px;
  overflow-y: auto;
  max-height: calc(100vh - 120px);
}
.mailbox-loading {
  text-align: center;
  color: var(--text-ghost);
  font-family: 'Noto Serif SC', serif;
  padding: 40px;
  letter-spacing: 0.1em;
}
.mailbox-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.mailbox-item:nth-child(1) { animation-delay: 0.05s; }
.mailbox-item:nth-child(2) { animation-delay: 0.1s; }
.mailbox-item:nth-child(3) { animation-delay: 0.15s; }
.mailbox-item:nth-child(4) { animation-delay: 0.2s; }
.mailbox-item:nth-child(5) { animation-delay: 0.25s; }
.mailbox-item:hover {
  border-color: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.mailbox-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.mailbox-item-type {
  color: var(--accent);
  font-size: 0.7rem;
  font-family: 'Noto Serif SC', serif;
  padding: 3px 10px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: 12px;
  letter-spacing: 0.05em;
}
.mailbox-item-date {
  color: var(--text-ghost);
  font-size: 0.7rem;
}
.mailbox-item-preview {
  color: var(--text-secondary);
  font-family: 'Noto Serif SC', serif;
  font-size: 0.85rem;
  line-height: 1.6;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.mailbox-item-full {
  display: none;
  color: var(--text-primary);
  font-family: 'Noto Serif SC', serif;
  font-size: 0.85rem;
  line-height: 1.8;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--glass-border);
  white-space: pre-wrap;
}
.mailbox-item.expanded .mailbox-item-preview {
  display: none;
}
.mailbox-item.expanded .mailbox-item-full {
  display: block;
}
.mailbox-empty {
  text-align: center;
  padding: 60px 20px;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.mailbox-empty-text {
  color: var(--text-secondary);
  font-family: 'LXGW WenKai', serif;
  font-size: 1rem;
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}
.mailbox-empty-hint {
  color: var(--text-ghost);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}
.mailbox-footer {
  position: fixed;
  bottom: 28px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 16px;
  z-index: 10;
}

/* 信箱详情还原视图 */
.mailbox-detail {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.mailbox-detail-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 20px;
  overflow-y: auto;
}
.mailbox-detail-footer {
  padding: 20px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

/* === 设置页 === */
.settings-box {
  width: 340px;
  max-width: 90vw;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.settings-title {
  color: var(--text-primary);
  font-family: 'LXGW WenKai', serif;
  font-size: 1.2rem;
  text-align: center;
  letter-spacing: 0.15em;
  margin-bottom: 28px;
}
.settings-section {
  margin-bottom: 20px;
}
.settings-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  display: block;
}
.settings-row {
  display: flex;
  align-items: center;
}
.settings-hint {
  color: var(--text-ghost);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  margin-top: 6px;
}
.settings-footer {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}
/* === 泡沫来信 认证弹窗美化 === */
/* 心愿点数显示 */
.auth-credits {
  color: var(--text-ghost, #8a8a8a);
  font-family: "Noto Serif SC", serif;
  font-size: 0.7rem;
  margin-right: 6px;
  opacity: 0.7;
}
.instant-credits {
  font-size: 0.65rem;
  color: var(--text-ghost, #8a8a8a);
  margin-left: 4px;
  opacity: 0.6;
}
/* 此文件由阿文维护，师傅请勿修改 */

/* --- 亮色主题 --- */
[data-theme="light"] .auth-modal-content,
:root .auth-modal-content {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(140, 170, 220, 0.12),
              inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: visible;
  isolation: isolate;
}
[data-theme="light"] .auth-input,
:root .auth-input {
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  box-shadow: inset 0 1px 2px rgba(140, 170, 220, 0.06);
}
[data-theme="light"] .auth-input:focus,
:root .auth-input:focus {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(140, 170, 220, 0.4);
  box-shadow: 0 0 16px rgba(140, 170, 220, 0.12);
}
[data-theme="light"] .auth-input::placeholder,
:root .auth-input::placeholder {
  color: rgba(80, 100, 140, 0.35);
}
[data-theme="light"] .auth-submit,
:root .auth-submit {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(140, 170, 220, 0.25);
  box-shadow: 0 2px 8px rgba(140, 170, 220, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
[data-theme="light"] .auth-submit:hover,
:root .auth-submit:hover {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(140, 170, 220, 0.35);
  box-shadow: 0 4px 20px rgba(140, 170, 220, 0.15);
}
[data-theme="light"] .auth-switch span,
:root .auth-switch span {
  color: rgba(100, 130, 190, 0.8);
}
[data-theme="light"] .auth-modal,
:root .auth-modal {
  background: rgba(230, 235, 245, 0.3);
}
[data-theme="light"] .auth-title,
:root .auth-title {
  color: rgba(50, 60, 80, 0.8);
}
[data-theme="light"] .auth-modal-content::before,
:root .auth-modal-content::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 25px;
  z-index: -1;
  background: linear-gradient(135deg,
    rgba(240, 190, 210, 0.15), rgba(190, 210, 240, 0.15),
    rgba(200, 235, 215, 0.12), rgba(235, 215, 195, 0.13),
    rgba(210, 200, 235, 0.15), rgba(195, 225, 240, 0.12),
    rgba(240, 190, 210, 0.15));
  background-size: 300% 300%;
  -webkit-filter: blur(3px); filter: blur(3px);
  -webkit-animation: bubbleDrift 10s ease-in-out infinite;
  animation: bubbleDrift 10s ease-in-out infinite;
}
[data-theme="light"] .auth-modal-content::after,
:root .auth-modal-content::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  z-index: -1;
  background: rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
@-webkit-keyframes bubbleDrift {
  0%   { background-position: 0% 50%; opacity: 0.8; }
  25%  { background-position: 100% 25%; opacity: 1; }
  50%  { background-position: 50% 100%; opacity: 0.7; }
  75%  { background-position: 25% 0%; opacity: 1; }
  100% { background-position: 0% 50%; opacity: 0.8; }
}
@keyframes bubbleDrift {
  0%   { background-position: 0% 50%; opacity: 0.8; }
  25%  { background-position: 100% 25%; opacity: 1; }
  50%  { background-position: 50% 100%; opacity: 0.7; }
  75%  { background-position: 25% 0%; opacity: 1; }
  100% { background-position: 0% 50%; opacity: 0.8; }
}

/* --- 暗色主题 --- */
[data-theme="dark"] .auth-modal-content {
  background: linear-gradient(135deg, rgba(10, 50, 90, 0.45), rgba(20, 60, 100, 0.35));
  border: none;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.08),
              inset 0 0 40px rgba(6, 88, 140, 0.06);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  overflow: visible; isolation: isolate;
}
[data-theme="dark"] .auth-input {
  background: rgba(15, 55, 95, 0.3);
  border: 1px solid rgba(140, 180, 220, 0.12);
}
[data-theme="dark"] .auth-input:focus {
  background: rgba(15, 55, 95, 0.4);
  border-color: rgba(100, 160, 220, 0.4);
  box-shadow: 0 0 20px rgba(6, 88, 140, 0.15);
}
[data-theme="dark"] .auth-submit {
  background: linear-gradient(135deg, rgba(10, 55, 100, 0.4), rgba(20, 65, 110, 0.3));
  border: 1px solid rgba(140, 180, 220, 0.2);
}
[data-theme="dark"] .auth-submit:hover {
  background: linear-gradient(135deg, rgba(6, 88, 140, 0.35), rgba(20, 70, 120, 0.3));
  border-color: rgba(100, 160, 220, 0.35);
  box-shadow: 0 4px 24px rgba(6, 88, 140, 0.2);
}
[data-theme="dark"] .auth-switch span { color: rgba(100, 160, 220, 0.8); }
[data-theme="dark"] .mailbox-item {
  background: linear-gradient(135deg, rgba(10, 50, 90, 0.3), rgba(15, 55, 95, 0.2));
  border: 1px solid rgba(140, 180, 220, 0.08);
}
[data-theme="dark"] .mailbox-item:hover {
  border-color: rgba(100, 160, 220, 0.2);
  box-shadow: 0 4px 20px rgba(6, 88, 140, 0.1);
}
[data-theme="dark"] .mailbox-item-type {
  color: rgba(100, 160, 220, 0.9);
  background: rgba(6, 88, 140, 0.15);
  border-color: rgba(100, 160, 220, 0.2);
}
[data-theme="dark"] .auth-modal-content::before {
  content: "";
  position: absolute; inset: -1px; border-radius: 25px; z-index: -1;
  background: linear-gradient(135deg,
    rgba(80, 120, 180, 0.1), rgba(110, 90, 150, 0.08),
    rgba(80, 140, 130, 0.06), rgba(110, 130, 170, 0.08),
    rgba(90, 110, 160, 0.1), rgba(80, 130, 160, 0.08),
    rgba(80, 120, 180, 0.1));
  background-size: 300% 300%;
  -webkit-filter: blur(4px); filter: blur(4px);
  -webkit-animation: bubbleDrift 14s ease-in-out infinite;
  animation: bubbleDrift 14s ease-in-out infinite;
}
[data-theme="dark"] .auth-modal-content::after {
  content: "";
  position: absolute; inset: 0; border-radius: 24px; z-index: -1;
  background: rgba(8, 40, 75, 0.72);
  -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px);
}

/* === 左上角用户信息 === */
.auth-area-left {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeInUp 1.2s cubic-bezier(0.4, 0, 0.2, 1) 1s both;
}
.auth-area-left .auth-nickname {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.auth-area-left .auth-credits {
  font-size: 0.7rem;
  padding: 2px 8px;
}
