@import url('./styles/tokens-2026.css');

/* ============================================================
   DESIGN 2026 — 前卫现代设计升级
   NOTE: tokens imported once; components via app-shell.css on shell pages
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ── 流体排版 ── */
:root {
  --fluid-xs: clamp(0.65rem, 0.6rem + 0.2vw, 0.75rem);
  --fluid-sm: clamp(0.75rem, 0.7rem + 0.3vw, 0.875rem);
  --fluid-base: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --fluid-md: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  --fluid-lg: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  --fluid-xl: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
  --fluid-2xl: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
}

body {
  font-size: var(--fluid-base);
  line-height: 1.7;
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fluid-2xl); line-height: 1.1; }
h2 { font-size: var(--fluid-xl); line-height: 1.2; }
h3 { font-size: var(--fluid-lg); line-height: 1.3; }

/* ── 焦点环 ── */
:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── 微按钮脉冲反馈 ── */
@keyframes cz-press {
  0% { transform: scale(1); }
  50% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

button:active,
.fb-filter-btn:active,
.lottery-ai-btn:active {
  animation: cz-press 0.15s ease-out;
}

/* ── 卡片悬停光效 ── */
.fb-match,
.lottery-card,
.topic-hero-card,
.manager-card {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s ease;
}

.fb-match:hover,
.lottery-card:hover,
.topic-hero-card:hover,
.manager-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--border-glow);
}

/* ── 页面入场动画 ── */
@keyframes cz-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

body.app-shell > .container,
body.app-shell > main,
body > .container {
  animation: cz-fade-up 0.4s var(--shell-ease, cubic-bezier(0.16, 1, 0.3, 1)) both;
}

/* ── 滚动条美化 ── */
@supports (scrollbar-width: thin) {
  * {
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 158, 11, 0.3) transparent;
  }
}

/* ── 骨架屏 shimmer（确保全局可用） ── */
.cz-skeleton {
  background: linear-gradient(90deg, var(--surface-3, #181b2a) 25%, var(--surface-4, #1f2336) 50%, var(--surface-3, #181b2a) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm, 8px);
  animation: cz-skeleton-shimmer 1.5s infinite;
}

@keyframes cz-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.light-theme .cz-skeleton {
  background: linear-gradient(90deg, #e8e8ed 25%, #f5f5f7 50%, #e8e8ed 75%);
  background-size: 200% 100%;
}

/* ── 平滑主题切换（全局 transition） ── */
@media (prefers-reduced-motion: no-preference) {
  body, .fb-match, .app-sidebar, .lottery-card, .manager-card, .topic-hero-card, .cz-skeleton-card {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.25s ease;
  }
}

/* ── 现代无边框输入框 ── */
input[type="text"],
input[type="password"],
textarea,
select {
  background: var(--surface-3, #181b2a);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: var(--fluid-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

/* ── 容器查询支持（允许组件级响应式） ── */
@container (max-width: 600px) {
  .fb-match-responsive { grid-template-columns: 1fr; gap: 8px; }
  .fb-match-responsive .fb-pane { border-right: none; border-bottom: 1px solid var(--border-subtle); }
}

/* ── 加载骨架变体 ── */
.cz-skeleton-btn {
  width: 80px;
  height: 32px;
}

.cz-skeleton-text {
  height: 1em;
  margin: 0.3em 0;
  border-radius: 4px;
}

.cz-skeleton-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

/* ── 暗色模式增强（vs 浅色对比更强） ── */
body:not(.light-theme) {
  --app-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

body.light-theme {
  --app-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
