/* ===== 基础设置 - 智趣迎新 · 乐玩元旦主题 ===== */
:root {
  --bg: #0a0a1a;
  --card-bg: rgba(20, 15, 35, 0.96);
  --accent: #ff6b9d;
  --accent-secondary: #ffd93d;
  --accent-soft: rgba(255, 107, 157, 0.2);
  --accent-gold: #ffd700;
  --text: #f5f5f5;
  --muted: #b8b8c8;
  --border-subtle: rgba(255, 107, 157, 0.3);
  --shadow-soft: 0 22px 45px rgba(20, 15, 35, 0.9);
  --shadow-glow: 0 0 30px rgba(255, 107, 157, 0.4);
  --radius-lg: 20px;
  --radius-pill: 999px;
  --transition-fast: 0.2s ease-out;
  --transition-med: 0.3s ease;
  --transition-slow: 0.5s ease;
  --spacing: 16px;
  --max-width: 1080px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: 
    radial-gradient(circle at 20% 30%, rgba(255, 107, 157, 0.15) 0, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 217, 61, 0.12) 0, transparent 50%),
    radial-gradient(circle at top, #1a0f2e 0, #0a0a1a 45%, #050510 100%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow-x: hidden;
}

/* 背景动态光点效果 */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20% 30%, rgba(255, 107, 157, 0.3), transparent),
    radial-gradient(2px 2px at 60% 70%, rgba(255, 217, 61, 0.3), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.2), transparent);
  background-size: 200% 200%;
  animation: sparkle 20s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes sparkle {
  0%, 100% { background-position: 0% 0%, 100% 100%, 50% 50%; }
  50% { background-position: 100% 100%, 0% 0%, 50% 50%; }
}

/* ===== 返回主页 ===== */
.back_home_box {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 20;
}

.back_home_box a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(156, 163, 175, 0.35);
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast), transform var(--transition-fast);
}

.back_home_box a::before {
  content: "←";
  font-size: 14px;
}

.back_home_box a:hover {
  color: #e5e7eb;
  border-color: var(--accent);
  background: rgba(15, 23, 42, 0.98);
  transform: translateY(-1px);
}

/* ===== 总卡片布局 ===== */
.card {
  width: 100%;
  max-width: var(--max-width);
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft), var(--shadow-glow);
  padding: 28px 26px 22px;
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1.2fr);
  gap: 28px;
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 1;
  animation: cardFadeIn 0.6s ease-out;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 卡片边框光晕动画 */
.card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-lg);
  padding: 2px;
  background: linear-gradient(135deg, 
    rgba(255, 107, 157, 0.5), 
    rgba(255, 217, 61, 0.5), 
    rgba(255, 107, 157, 0.5));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.6;
  animation: borderGlow 3s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes borderGlow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* 响应式：中小屏改为上下布局 */
@media (max-width: 768px) {
  .card {
    grid-template-columns: 1fr;
    padding: 20px 18px 16px;
    gap: 22px;
  }
}

/* ===== 左侧内容 ===== */
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(22px, 3vw, 26px);
  line-height: 1.35;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #ff6b9d, #ffd93d, #ff6b9d);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.lead {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

/* 特性 chips */
.features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.chip {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 107, 157, 0.6);
  background: linear-gradient(
    135deg,
    rgba(255, 107, 157, 0.2),
    rgba(255, 217, 61, 0.15)
  );
  color: #ffe5f0;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.chip::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.chip:hover {
  border-color: rgba(255, 107, 157, 0.9);
  background: linear-gradient(
    135deg,
    rgba(255, 107, 157, 0.3),
    rgba(255, 217, 61, 0.25)
  );
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
}

.chip:hover::before {
  left: 100%;
}

/* 玩法介绍 */
.rules {
  padding: 14px 16px;
  border-radius: 14px;
  background: radial-gradient(circle at top left, rgba(30, 20, 45, 0.9) 0, rgba(15, 10, 25, 0.95) 70%);
  border: 1px solid rgba(255, 107, 157, 0.25);
  font-size: 13px;
  color: var(--muted);
  position: relative;
  overflow: hidden;
}

.rules::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 107, 157, 0.6), 
    rgba(255, 217, 61, 0.6), 
    rgba(255, 107, 157, 0.6), 
    transparent);
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

.rules strong {
  color: #e5e7eb;
}

.rules ol {
  margin: 6px 0 0 18px;
  padding: 0;
}

.rules li {
  margin-bottom: 4px;
}

/* ===== 右侧边栏 ===== */
.side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

#emojiPreview.preview,
.preview {
  width: 120px;
  height: 120px;
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 58px;
  background: radial-gradient(circle at 30% 20%, #ff6b9d 0, #ffd93d 50%, #ff6b9d 100%);
  box-shadow:
    0 18px 35px rgba(255, 107, 157, 0.5),
    0 0 20px rgba(255, 217, 61, 0.3),
    inset 0 0 0 3px rgba(20, 15, 35, 0.6);
  transform: translateY(0) scale(1);
  transition: transform var(--transition-med), box-shadow var(--transition-med);
  animation: previewPulse 2s ease-in-out infinite;
  position: relative;
}

@keyframes previewPulse {
  0%, 100% { 
    box-shadow:
      0 18px 35px rgba(255, 107, 157, 0.5),
      0 0 20px rgba(255, 217, 61, 0.3),
      inset 0 0 0 3px rgba(20, 15, 35, 0.6);
  }
  50% { 
    box-shadow:
      0 18px 35px rgba(255, 107, 157, 0.7),
      0 0 30px rgba(255, 217, 61, 0.5),
      inset 0 0 0 3px rgba(20, 15, 35, 0.7);
  }
}

.side:hover .preview {
  transform: translateY(-6px) scale(1.05);
  box-shadow:
    0 24px 45px rgba(255, 107, 157, 0.7),
    0 0 35px rgba(255, 217, 61, 0.5),
    inset 0 0 0 3px rgba(20, 15, 35, 0.8);
  animation: none;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 28px;
  border-radius: 999px;
  border: none;
  outline: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  color: #1a0f2e;
  background: linear-gradient(135deg, #ff6b9d, #ffd93d, #ff6b9d);
  background-size: 200% 200%;
  box-shadow: 
    0 16px 30px rgba(255, 107, 157, 0.5),
    0 0 20px rgba(255, 217, 61, 0.3);
  transform: translateY(0);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast),
    background-position var(--transition-med);
  animation: buttonGradient 3s ease infinite;
  position: relative;
  overflow: hidden;
}

@keyframes buttonGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 22px 40px rgba(255, 107, 157, 0.6),
    0 0 30px rgba(255, 217, 61, 0.4);
  filter: brightness(1.1);
}

.btn:hover::before {
  left: 100%;
}

.btn:active {
  transform: translateY(-1px);
  box-shadow: 
    0 14px 25px rgba(255, 107, 157, 0.5),
    0 0 15px rgba(255, 217, 61, 0.3);
  filter: brightness(0.95);
}

/* 小提示文字 */
.small {
  font-size: 12px;
  color: var(--muted);
  max-width: 240px;
}

/* ===== 页脚 ===== */
footer {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed rgba(75, 85, 99, 0.6);
  font-size: 11px;
  text-align: right;
  color: rgba(148, 163, 184, 0.9);
}

/* ===== 小屏适配 ===== */
@media (max-width: 480px) {
  .hero h1 {
    font-size: 20px;
  }
  .preview {
    width: 96px;
    height: 96px;
    font-size: 46px;
  }
  .btn {
    width: 100%;
  }
}

/* ========== 全局移动端兼容增强 ========== */
html, body {
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
input, textarea, select {
  font-size: 1rem;
  border-radius: 0.5rem;
  touch-action: manipulation;
  outline: none;
}
button, .btn, a.btn {
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  font-size: 1rem;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  user-select: none;
}
button:active, .btn:active, a.btn:active {
  opacity: 0.85;
  transform: scale(0.97);
}
img, video {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
  border-radius: 10px;
}
@media (max-width: 480px) {
  body, html {
    font-size: 15px;
    padding: 0 2px;
  }
}