/* ========================================
   FurryHotel 前端样式 - 手机优先设计
   ======================================== */

/* ---------- CSS 变量 ---------- */
:root {
  --primary: #f59e0b;
  --primary-dark: #d97706;
  --primary-light: #fde68a;
  --bg: #fefce8;
  --card-bg: #ffffff;
  --text: #292524;
  --text-secondary: #78716c;
  --border: #e7e5e4;
  --error: #ef4444;
  --success: #22c55e;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* ---------- 全局重置与安全边距 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: linear-gradient(180deg, #fef3c7 0%, #fefce8 40%, #fff7ed 100%);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
  padding-top: max(env(safe-area-inset-top, 0px), 16px);
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 24px);
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 顶部 Logo 区 ---------- */
.logo-area {
  text-align: center;
  padding: max(calc(28px + env(safe-area-inset-top, 0px)), 36px) 0 24px;
  width: 100%;
}

.logo-icon {
  font-size: 56px;
  display: block;
  margin-bottom: 8px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.logo-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: 1px;
}

.logo-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ---------- 卡片容器 ---------- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  width: 100%;
  max-width: 400px;
  margin-bottom: 20px;
}

.card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
}

.card .subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 24px;
}

/* ---------- 表单 ---------- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 14px;
  font-size: 18px;
  pointer-events: none;
}

.input-wrapper input,
.input-wrapper select {
  width: 100%;
  padding: 14px 14px 14px 42px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  background: #fafaf9;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
  background: #fff;
}

.input-wrapper input::placeholder {
  color: #c4b5a5;
}

.input-wrapper .toggle-pwd {
  position: absolute;
  right: 14px;
  font-size: 18px;
  cursor: pointer;
  user-select: none;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.input-wrapper .toggle-pwd:hover {
  opacity: 0.8;
}

/* ---------- 按钮 ---------- */
.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
  -webkit-appearance: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
  margin-top: 8px;
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: transparent;
  color: var(--primary-dark);
  border: 1.5px solid var(--primary);
  margin-top: 12px;
}

.btn-danger {
  background: #fff;
  color: var(--error);
  border: 1.5px solid #fca5a5;
  margin-top: 12px;
}

/* ---------- 底部链接 ---------- */
.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.form-footer a {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
}

.form-footer a:active {
  opacity: 0.7;
}

/* ---------- Toast 提示 ---------- */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(4px);
}

.toast-error {
  background: #ef4444;
}

.toast-success {
  background: #22c55e;
}

.toast-info {
  background: #3b82f6;
}

/* ---------- 首页 Dashboard ---------- */
.dashboard {
  width: 100%;
  max-width: 400px;
  padding-bottom: 40px;
}

.user-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 12px;
}

.user-card .nickname {
  font-size: 20px;
  font-weight: 700;
}

.user-card .username {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ---------- 首页快捷入口 ---------- */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.menu-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s;
  text-decoration: none;
  color: var(--text);
}

.menu-item:active {
  transform: scale(0.96);
}

.menu-item .menu-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.menu-item .menu-label {
  font-size: 14px;
  font-weight: 600;
}

/* ---------- STAFF 专属板块 ---------- */
.staff-section {
  margin-top: 20px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  border: 1.5px solid #fde68a;
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.staff-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.staff-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
}

.staff-menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.staff-menu-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #fef3c7;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.staff-menu-card:active {
  transform: scale(0.98);
  border-color: #f59e0b;
}

.staff-menu-icon {
  font-size: 24px;
  background: #fffbeb;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fef3c7;
  flex-shrink: 0;
}

.staff-menu-text {
  flex: 1;
  text-align: left;
}

.staff-menu-title {
  font-size: 14px;
  font-weight: 700;
  color: #78350f;
  margin-bottom: 2px;
}

.staff-menu-desc {
  font-size: 11px;
  color: #b45309;
  opacity: 0.85;
}

.staff-menu-arrow {
  font-size: 18px;
  color: #d97706;
  font-weight: bold;
}

/* ---------- 加载动画 ---------- */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- 首页与工作台容器重构 ---------- */
.main-container {
  width: 100%;
  max-width: 440px;
  padding: 24px 0 36px;
  padding-top: max(calc(20px + env(safe-area-inset-top, 0px)), 28px);
}

/* 1. 顶栏 (Top Bar Header) */
.top-bar-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.top-bar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.top-user-info {
  display: flex;
  flex-direction: column;
}

.top-nickname {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.top-username {
  font-size: 12px;
  color: var(--text-secondary);
}

.top-logout-btn {
  background: #fef2f2;
  color: var(--error);
  border: 1px solid #fecaca;
  padding: 7px 13px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.top-logout-btn:active {
  transform: scale(0.95);
  background: #fee2e2;
}

/* 站点 Logo 辅助标题 */
.site-header-info {
  text-align: center;
  margin-bottom: 14px;
}

.site-header-info .logo-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
}

.site-header-info .logo-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Section Card 基础样式 */
.section-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 2. 功能区 */
.function-section .menu-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.function-section .menu-item {
  padding: 14px 6px;
  border: 1.5px solid #fef3c7;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.function-section .menu-item .menu-icon {
  font-size: 26px;
  margin-bottom: 4px;
}

.function-section .menu-item .menu-label {
  font-size: 13px;
}

/* 3. 图片/海报展示区 */
.banner-section {
  padding: 16px 14px;
}

.banner-container {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  background: transparent;
}

.banner-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  /* 保持长图原始长宽比，自适应手机容器宽度垂直延展 */
  object-fit: contain;
}

.banner-placeholder {
  width: 100%;
  min-height: 180px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px dashed #fcd34d;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  text-align: center;
}

.placeholder-icon {
  font-size: 40px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.placeholder-title {
  font-size: 15px;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 4px;
}

.placeholder-desc {
  font-size: 12px;
  color: #d97706;
  opacity: 0.85;
}

/* ---------- 启动检查遮罩 ---------- */
.splash-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background: linear-gradient(180deg, #fef3c7 0%, #fefce8 40%, #fff7ed 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: splash-bounce 1.6s ease-in-out infinite;
}

@keyframes splash-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.05); }
}

.splash-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.splash-status {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.splash-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(217, 119, 6, 0.2);
  border-top-color: var(--primary-dark);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.splash-dots {
  display: inline-flex;
  gap: 4px;
  margin-top: 4px;
}

.splash-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.3;
  animation: splash-dot 1.4s ease-in-out infinite;
}

.splash-dots span:nth-child(2) { animation-delay: 0.2s; }
.splash-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes splash-dot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}

/* 连接失败样式 */
.splash-error-msg {
  font-size: 13px;
  color: var(--error);
  margin-top: 12px;
  text-align: center;
  line-height: 1.5;
  max-width: 280px;
  display: none;
}

.splash-retry-btn {
  margin-top: 16px;
  padding: 10px 28px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
  transition: transform 0.15s;
  display: none;
}

.splash-retry-btn:active {
  transform: scale(0.95);
}

/* ---------- 响应式：稍大屏幕 ---------- */
@media (min-width: 480px) {
  body {
    padding: 0 24px;
  }

  .card {
    padding: 36px 32px;
  }
}

/* ---------- 通用隐藏与模态框状态 ---------- */
.hidden {
  display: none !important;
}

.modal-overlay.hidden {
  display: none !important;
}

