/* 设计 token 对齐 lib/utils/design.dart */
:root {
  --primary: #6366F1;
  --primary-light: #818CF8;
  --primary-dark: #4F46E5;
  --accent: #06B6D4;
  --text: #0F172A;
  --text-secondary: #475569;
  --text-tertiary: #94A3B8;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --error: #EF4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --error-border: rgba(239, 68, 68, 0.3);
  --radius-card: 14px;
  --radius-input: 10px;
  --radius-button: 10px;
  --radius-card-lg: 20px;
  --shadow-card: 0 4px 12px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-card-lg: 0 8px 24px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.03);
  --shadow-glow: 0 4px 16px rgba(99, 102, 241, 0.3);
  --gradient-primary: linear-gradient(135deg, #6366F1, #8B5CF6);
  --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Roboto, Arial, sans-serif;
  --content-max: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-stack);
  color: var(--text);
  background: linear-gradient(180deg, #EEF2FF, #E0E7FF 45%, #F0F9FF);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── aurora 动态背景(复刻 app splash) ── */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.aurora { position: absolute; inset: 0; }
.aurora::before,
.aurora::after {
  content: '';
  position: absolute;
  width: 60vw;
  height: 60vw;
  max-width: 700px;
  max-height: 700px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}
.aurora::before {
  background: radial-gradient(circle, #6366F1 0%, transparent 70%);
  top: 20%;
  left: 25%;
  animation: auroraMoveA 8s ease-in-out infinite;
}
.aurora::after {
  background: radial-gradient(circle, #06B6D4 0%, transparent 70%);
  bottom: 20%;
  right: 25%;
  animation: auroraMoveB 10s ease-in-out infinite;
}
.aurora-3 {
  position: absolute;
  width: 50vw;
  height: 50vw;
  max-width: 600px;
  max-height: 600px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #EC4899 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: auroraMoveC 9s ease-in-out infinite;
}
@keyframes auroraMoveA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20vw, 15vh) scale(1.15); }
  66% { transform: translate(-15vw, 25vh) scale(0.9); }
}
@keyframes auroraMoveB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-20vw, -15vh) scale(1.1); }
  66% { transform: translate(15vw, -25vh) scale(0.95); }
}
@keyframes auroraMoveC {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  33% { transform: translate(-30%, -65%) scale(1.2); }
  66% { transform: translate(-70%, -35%) scale(0.9); }
}

/* ── 顶部导航 ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}
.brand-logo svg { width: 18px; height: 18px; }
.brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--primary); }
.site-nav .nav-login {
  padding: 8px 20px;
  border-radius: var(--radius-button);
  background: var(--gradient-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.site-nav .nav-login:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* ── Hero 区 ── */
.hero { padding: 72px 0 80px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 64px;
  align-items: center;
}
.hero-title {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 16px;
}
.hero-subtitle {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
}
.hero-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 520px;
  margin-bottom: 32px;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-button);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: #fff; }
.btn-block { width: 100%; padding: 14px; font-size: 16px; }

/* ── 登录卡片(玻璃拟态) ── */
.login-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-card-lg);
  box-shadow: var(--shadow-card-lg);
  padding: 36px 32px;
}
.login-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}
.login-logo svg { width: 30px; height: 30px; }
.login-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.1px;
}
.login-subtitle {
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
  margin: 6px 0 26px;
}

.field { margin-bottom: 14px; }
.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.field-control { position: relative; }
.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  pointer-events: none;
}
.field-control input {
  width: 100%;
  padding: 12px 42px 12px 42px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-control input::placeholder { color: var(--text-tertiary); }
.field-control input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.field.invalid input { border-color: var(--error); }
.field.invalid input:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }
.field-error {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--error);
}
.pwd-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}
.pwd-toggle:hover { color: var(--text-secondary); }
.pwd-toggle svg { width: 18px; height: 18px; }
.pwd-toggle.active { color: var(--primary); }

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 18px;
}
.remember {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.remember input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}
.forgot-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }

/* 错误提示条:图标+文字+关闭,不单纯依赖颜色(色弱友好) */
.error-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 16px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 8px;
  color: var(--error);
  font-size: 13px;
  font-weight: 500;
}
.error-bar[hidden] { display: none; }
.error-bar > svg { width: 16px; height: 16px; flex-shrink: 0; }
.error-bar-text { flex: 1; }
.error-bar-close {
  border: none;
  background: transparent;
  color: var(--error);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  border-radius: 4px;
}
.error-bar-close svg { width: 14px; height: 14px; }

/* 登录按钮加载态 */
.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn.loading .btn-spinner { display: inline-block; }
.btn.loading { opacity: 0.85; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.agreement {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  line-height: 1.6;
}
.agreement a { color: var(--primary); text-decoration: none; }
.agreement a:hover { text-decoration: underline; }

/* ── 功能板块 ── */
.features { padding: 40px 0 80px; }
/* 锚点跳转时为吸顶导航预留偏移,避免标题被遮挡 */
section[id], [id="login"] { scroll-margin-top: 76px; }
.section-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.3px;
}
.section-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
  margin: 10px 0 40px;
}
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.bento-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 28px 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.bento-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-lg);
}
.bento-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.bento-icon svg { width: 22px; height: 22px; }
.bento-icon-primary { background: #EEF2FF; color: var(--primary); }
.bento-icon-cyan { background: #ECFEFF; color: var(--accent); }
.bento-icon-pink { background: #FDF2F8; color: #EC4899; }
.bento-icon-amber { background: #FFFBEB; color: #F59E0B; }
.bento-icon-emerald { background: #ECFDF5; color: #10B981; }
.bento-icon-rose { background: #FFF1F2; color: #F43F5E; }
.bento-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.bento-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* ── 关于板块 ── */
.about { padding: 20px 0 90px; }
.about-inner { max-width: 800px; }
.about-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.9;
  text-align: center;
  margin: 14px auto 32px;
  max-width: 640px;
}
.about-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.about-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px;
}
.about-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.about-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }
.contact-email { color: var(--primary); font-weight: 500; }

/* ── 页脚 ── */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 24px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: 24px; }
.footer-links a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
}
.footer-links a:hover { color: var(--primary); }
.copyright { font-size: 13px; color: var(--text-tertiary); }

/* ── 滚动渐入 ── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── 响应式:平板(≤900px) ── */
@media (max-width: 900px) {
  .hero { padding: 48px 0 64px; }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 560px;
  }
  .hero-title { font-size: 34px; }
  .hero-desc { max-width: none; }
  .login-card { max-width: 420px; margin: 0 auto; width: 100%; }
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── 响应式:手机(≤600px) ── */
@media (max-width: 600px) {
  .site-nav { gap: 18px; }
  .site-nav a { font-size: 13px; }
  .site-nav .nav-login { padding: 7px 16px; }
  .hero { padding: 36px 0 56px; }
  .hero-grid { gap: 32px; }
  .hero-title { font-size: 28px; letter-spacing: -0.5px; }
  .hero-subtitle { font-size: 17px; }
  .hero-desc { font-size: 14px; margin-bottom: 24px; }
  .hero-cta .btn { flex: 1; padding: 12px 16px; }
  .login-card { padding: 28px 22px; }
  .bento-grid { grid-template-columns: 1fr; gap: 14px; }
  .about-cards { grid-template-columns: 1fr; }
  .section-title { font-size: 22px; }
  .footer-inner { justify-content: center; text-align: center; }
}

/* ── 协议弹窗 ── */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-mask[hidden] { display: none; }
.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card-lg);
  padding: 24px;
}
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.modal-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  white-space: pre-line;
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 20px;
}

/* ── 减弱动画偏好 ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aurora::before, .aurora::after, .aurora-3 { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .bento-card { transition: none; }
}
