/* ================================================================
 *  DuskSocial — style.css
 *  各页面专属样式
 *  晚霜工作室 (DuskFrost Studio)
 *
 *  v1.2 — 新增一键登录按钮样式、Logo图片样式、设置弹窗样式、开关组件样式
 * ================================================================ */

/* ---------- 登录页 / 注册页 ---------- */
.auth-page {
  justify-content: center;
  align-items: center;
  padding: 32px 24px;
}

.auth-logo {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--nebula));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(196, 122, 90, 0.25);
  overflow: hidden;
}

/* Logo 图片样式 */
.auth-logo img {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  object-fit: cover;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 300;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.auth-form {
  width: 100%;
  max-width: 320px;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.auth-switch a {
  color: var(--accent);
  font-weight: 500;
}

/* ---------- 一键登录区域（MobTech 秒验） ---------- */

/* 分隔线（带文字） */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.divider-text {
  position: relative;
  padding: 0 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  background: var(--bg-deep);
}

/* 快速登录区域 */
.quick-login-section {
  margin-bottom: 4px;
}

/* 一键登录按钮 */
.btn-quick-login {
  width: 100%;
  height: 50px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--nebula), #5a4fd4);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(107, 92, 231, 0.25);
  transition: opacity 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.btn-quick-login:active {
  opacity: 0.85;
  transform: scale(0.98);
}

.btn-quick-login:disabled,
.btn-quick-login.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* 一键登录按钮加载动画 */
.btn-quick-login.loading {
  pointer-events: none;
}

.btn-quick-login.loading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: quick-login-progress 1.5s ease-in-out infinite;
}

@keyframes quick-login-progress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* 一键登录图标 */
.quick-login-icon {
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 一键登录提示文字 */
.quick-login-tip {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 8px;
  transition: color 0.3s;
}

.quick-login-tip.ready {
  color: var(--aurora);
}

.quick-login-tip.error {
  color: var(--rose);
}

/* ---------- 好友列表页 ---------- */
.friends-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.friends-header .search-box {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 0.82rem;
  margin-right: 10px;
}

.friends-header .search-box::placeholder { color: var(--text-muted); }

.friends-header .add-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.friend-item .unread-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rose);
  margin-left: 6px;
}

/* 添加好友弹窗 */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(6, 6, 14, 0.7);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-width: 400px;
  background: var(--bg-mid);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 20px;
  padding-bottom: calc(24px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-overlay.show .modal-content {
  transform: translateY(0);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 16px;
  text-align: center;
}

/* ---------- 聊天页 ---------- */
.chat-info-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(6, 6, 14, 0.5);
}

.chat-info-bar .chat-target-name {
  font-size: 0.88rem;
  font-weight: 500;
}

.chat-info-bar .chat-target-status {
  font-size: 0.68rem;
  color: var(--aurora);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 80%;
}

.msg-row.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-row .msg-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--nebula));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  color: #fff;
  overflow: hidden;
}

.msg-row .msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.5;
  word-break: break-word;
}

.msg-row.received .msg-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg-row.sent .msg-bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-time {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.msg-row.sent .msg-time { text-align: right; }

/* 时间分隔 */
.msg-divider {
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 6px 0;
}

/* 输入栏 */
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  padding-bottom: calc(10px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: rgba(6, 6, 14, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.chat-input-bar .msg-input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 0.86rem;
}

.chat-input-bar .msg-input::placeholder { color: var(--text-muted); }

.chat-input-bar .msg-input:focus {
  border-color: rgba(196, 122, 90, 0.3);
}

.chat-input-bar .send-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.chat-input-bar .send-btn:active { transform: scale(0.92); }

/* ---------- 搜索结果列表 ---------- */
.search-result-list {
  margin-top: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.search-result-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--nebula));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.search-result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
}

.search-result-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.search-result-empty {
  text-align: center;
  padding: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---------- 在线状态指示器 ---------- */
.online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--aurora);
  border: 2px solid var(--bg-deep);
}

/* ---------- 好友操作菜单 ---------- */
.action-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background 0.15s;
}

.action-item:active {
  background: var(--bg-hover);
}

.action-item .action-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--glass);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.action-item.danger .action-icon,
.action-item.danger span {
  color: var(--rose);
}

.action-item span {
  font-size: 0.88rem;
  color: var(--text-primary);
}

/* ---------- 个人中心页 ---------- */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 20px;
}

.profile-header .profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--nebula));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 12px;
  box-shadow: 0 6px 24px rgba(196, 122, 90, 0.2);
  overflow: hidden;
}

/* 个人中心头像图片 */
.profile-header .profile-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-header .profile-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.profile-header .profile-email {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 16px 0;
  margin: 0 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.profile-stat {
  text-align: center;
}

.profile-stat .stat-num {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--star);
}

.profile-stat .stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* 菜单列表 */
.menu-section {
  margin-top: 16px;
}

.menu-section .section-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 16px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.menu-item:active { background: var(--bg-hover); }

.menu-item .menu-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.menu-item .menu-label { flex: 1; font-size: 0.88rem; }

.menu-item .menu-arrow {
  color: var(--text-muted);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
}

.menu-item.danger .menu-label { color: var(--rose); }

/* ---------- 设置弹窗中的设置项 ---------- */
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.settings-item:last-of-type {
  border-bottom: none;
}

.settings-label {
  font-size: 0.88rem;
  color: var(--text-primary);
}

/* ---------- 星空背景粒子（轻量） ---------- */
.starfield-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
