/* ============================================================
   花灵网页版 · 公共样式库（与小程序 UI 同构）
   rpx → 换算基准：750 设计稿；网页用 rem+clamp 自适应
   主色：#10b981（翠绿）/ 微信绿 #07c160 / 文字 #0f172a
   ============================================================ */

:root {
  --green: #10b981;
  --wx-green: #07c160;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e2e8f0;
  --bg-input: #f1f5f9;
  --card: #ffffff;
  --red: #ef4444;
  --amber: #d97706;
  --purple: #7c5cff;
  --radius-btn: 10px;
  --radius-card: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #f3f4f6;
  -webkit-font-smoothing: antialiased;
}

/* 移动优先：内容列最大宽 480px 居中（桌面不拉宽） */
.page {
  position: relative;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: linear-gradient(135deg, #f8fafc 0%, #ecfdf5 35%, #eff6ff 65%, #f8fafc 100%);
  overflow-x: hidden;
}

/* ============ 晨雾极光背景（登录系页面）============ */
.page-aurora {
  position: relative;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background:
    linear-gradient(135deg, #f8fafc 0%, #ecfdf5 35%, #eff6ff 65%, #f8fafc 100%);
  overflow: hidden;
}

/* ============ 品牌 IP 区 ============ */
.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 70px;
  animation: brand-float 4s ease-in-out infinite;
}
@keyframes brand-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
.brand-ip-wrap {
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 16px rgba(15, 23, 42, 0.10));
}
.brand-ip { width: 100%; height: 100%; }
.brand-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 2px;
  line-height: 1.1;
}
.brand-slogan-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.slogan-divider {
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, rgba(100,116,139,0) 0%, rgba(100,116,139,0.4) 50%, rgba(100,116,139,0) 100%);
}
.slogan-text {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 1.5px;
  white-space: nowrap;
}

/* ============ 表单 ============ */
.form-section {
  padding: 0 28px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 24px 20px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: content-fade-in 480ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes content-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.input {
  width: 100%;
  height: 46px;
  background: var(--bg-input);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--ink);
  border: 1.5px solid transparent;
  outline: none;
  transition: border-color 200ms ease;
}
.input:focus { border-color: var(--green); background: #fff; }
.input::placeholder { color: var(--ink-3); }

/* ============ 主按钮 ============ */
.primary-btn {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-btn);
  background: var(--wx-green);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(7, 193, 96, 0.30);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms ease;
  cursor: pointer;
  user-select: none;
  border: none;
}
.primary-btn:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(7, 193, 96, 0.25);
}
.primary-btn:disabled { opacity: 0.7; pointer-events: none; }
.primary-btn-text {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 1px;
  line-height: 1;
}
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.30);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spinner-rotate 800ms linear infinite;
}
@keyframes spinner-rotate { to { transform: rotate(360deg); } }

/* 次级按钮（描边） */
.ghost-btn {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-btn);
  background: transparent;
  border: 1.5px solid var(--green);
  color: var(--green);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 200ms ease;
}
.ghost-btn:active { opacity: 0.7; }

/* ============ Toast（仿 wx.showToast）============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 25%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 10px;
  max-width: 76vw;
  text-align: center;
  z-index: 999;
  animation: toast-in 200ms ease forwards;
  pointer-events: none;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============ 模态弹窗（仿 wx.showModal）============ */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: content-fade-in 200ms ease forwards;
  padding: 24px;
}
.modal {
  width: 100%;
  max-width: 320px;
  background: #fff;
  border-radius: 14px;
  padding: 24px 22px 18px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  letter-spacing: 1px;
}
.modal-content {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.65;
  text-align: center;
  white-space: pre-line;
}
.modal-btns {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.modal-btn {
  flex: 1;
  height: 42px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}
.modal-btn-cancel { background: #f1f5f9; color: var(--ink-2); }
.modal-btn-confirm { background: var(--wx-green); color: #fff; }

/* ============ 通用工具 ============ */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.link-green { color: var(--green); cursor: pointer; font-size: 13px; }
.hint-text { font-size: 12px; color: var(--ink-3); line-height: 1.7; }

/* 桌面端微调：整体不超过 480px 列宽已有；背景铺满 */
@media (min-width: 520px) {
  body { background: #eef2f5; }
  .page-aurora, .page { box-shadow: 0 0 40px rgba(15, 23, 42, 0.06); }
}
