/**
 * AI调酒师 - 用户端样式表
 * 全面重构版本 - 2025
 * 模块化组织，优化性能，提升可维护性
 */

/* ==================== CSS变量 ==================== */
:root {
  /* 樱花洛丽塔配色方案 */
  --bg: #F9FAFB;
  --card: #FFFFFF;
  --muted: #6B7280;
  --text: #1F2937;
  --brand: #F472B6;
  --accent: #84CC16;
  --chip: #FEF3C7;
  --chip-border: #FACC15;
  --success: #84CC16;
  --warning: #FACC15;
  
  /* 间距 */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;
  
  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(244, 114, 182, 0.1);
  --shadow-md: 0 8px 24px rgba(244, 114, 182, 0.2);
  --shadow-lg: 0 15px 45px rgba(244, 114, 182, 0.3);
  --shadow-xl: 0 20px 55px rgba(244, 114, 182, 0.4);
}

/* ==================== 全局样式 ==================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  width: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: none;
  -ms-text-size-adjust: none;
  text-size-adjust: none;
  font-size: 16px;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 
               "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
}

/* ==================== 辅助类 ==================== */
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ==================== 布局容器 ==================== */
.s3-stage {
  position: fixed;
  inset: 0;
  background: #000;
  display: grid;
  place-items: center;
  z-index: 998;
  overflow: hidden;
  overflow-x: hidden;
  max-width: 100vw;
}

.s3-stage.home {
  background: #f7f7fc;
  z-index: 0;
  overflow: hidden;
  overflow-x: hidden;
}

.s3-frame {
  width: min(100vw, calc(100vh * 9 / 16));
  height: min(100vh, calc(100vw * 16 / 9));
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  overflow: hidden;
  overflow-x: hidden;
  position: relative;
  max-width: 100vw;
}

.s-home-frame {
  background: #f7f7fc;
  box-shadow: none;
  border: 1px solid #e6e8f5;
  overflow: hidden;
  overflow-x: hidden;
}

.screen-home {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  overflow-x: hidden;
  max-width: 100%;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

.screen-home .app {
  min-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-x: hidden;
}

.main {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  flex: 1 0 auto;
  overflow: hidden;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 20px;
  position: relative;
  max-width: 100%;
}

.screen-home .main {
  flex: 1 0 auto;
  height: auto;
  overflow: visible;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex !important;
  flex-direction: column !important;
  gap: var(--spacing-md) !important;
  padding-bottom: 150px !important;
  min-height: auto !important;
  max-width: 100%;
}

/* ==================== 3D浮动背景 ==================== */
.app::before,
.app::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  /* 移动端禁用动画和blur，提升性能 */
  animation: none;
  filter: none;
}

.app::before {
  top: -20%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(244,114,182,0.08) 0%, transparent 70%);
}

.app::after {
  bottom: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(132,204,22,0.06) 0%, transparent 70%);
}

/* 桌面端启用动画和blur */
@media (hover: hover) and (pointer: fine) {
  .app::before {
    background: radial-gradient(circle, rgba(244,114,182,0.15) 0%, transparent 70%);
    animation: float-orb-1 20s ease-in-out infinite;
    filter: blur(60px);
  }

  .app::after {
  background: radial-gradient(circle, rgba(132,204,22,0.12) 0%, transparent 70%);
  animation: float-orb-2 25s ease-in-out infinite;
  filter: blur(70px);
  }
}

@keyframes float-orb-1 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.6;
  }
  33% {
    transform: translate(30px, -30px) scale(1.1);
    opacity: 0.8;
  }
  66% {
    transform: translate(-30px, 30px) scale(0.9);
    opacity: 0.7;
  }
}

@keyframes float-orb-2 {
  0%, 100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 0.5;
  }
  33% {
    transform: translate(-40px, 40px) scale(1.15) rotate(120deg);
    opacity: 0.7;
  }
  66% {
    transform: translate(40px, -40px) scale(0.95) rotate(240deg);
    opacity: 0.6;
  }
}

/* ==================== 头部 ==================== */
.header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--spacing-sm);
  position: relative;
  perspective: 1000px;
}

.header.center {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  margin-bottom: 0;
  padding: var(--spacing-sm) 0 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: clamp(20px, 4vw, 34px);
  font-weight: 900;
  letter-spacing: 0.3px;
  transform: translateZ(30px);
  /* 移动端禁用持续动画 */
  animation: none;
  filter: drop-shadow(0 6px 20px rgba(244, 114, 182, 0.4));
}

@keyframes float-brand {
  0%, 100% { transform: translateY(0px) translateZ(30px); }
  50% { transform: translateY(-5px) translateZ(30px); }
}

.brand-logo {
  width: clamp(24px, 4vw, 32px);
  height: clamp(24px, 4vw, 32px);
  flex-shrink: 0;
  filter: drop-shadow(0 6px 12px rgba(244, 114, 182, 0.5));
  /* 移动端禁用持续动画 */
  animation: none;
}

@keyframes logo-pulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.08) rotate(8deg); }
}

/* 桌面端启用动画 */
@media (hover: hover) and (pointer: fine) {
  .brand {
    animation: float-brand 3s ease-in-out infinite;
  }
  
  .brand-logo {
    animation: logo-pulse 2s ease-in-out infinite;
  }
}

.title {
  display: inline-flex;
  gap: var(--spacing-sm);
  align-items: baseline;
  font-size: clamp(20px, 4vw, 34px);
  line-height: 1.2;
}

.title-black {
  color: #000;
  font-weight: 900;
  text-shadow: 3px 3px 6px rgba(0,0,0,0.08), 0 0 20px rgba(244,114,182,0.1);
}

.gradient-text {
  background: linear-gradient(135deg, #F472B6 0%, #EC4899 50%, #84CC16 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-shift 3s ease infinite;
  background-size: 200% 200%;
  filter: drop-shadow(0 0 8px rgba(244,114,182,0.3));
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-avatar {
  width: clamp(80px, 15vw, 110px);
  height: clamp(80px, 15vw, 110px);
  flex-shrink: 0;
  border-radius: 50%;
  padding: 6px;
  background: linear-gradient(135deg, rgba(255, 179, 102, 0.4), rgba(255, 193, 7, 0.3));
  display: grid;
  place-items: center;
  margin-top: 4px;
  position: relative;
  /* 移动端禁用持续动画 */
  animation: none;
  box-shadow: 
    0 15px 40px rgba(244,114,182,0.45),
    0 8px 25px rgba(132,204,22,0.3),
    inset 0 -2px 6px rgba(255,255,255,0.4),
    0 0 0 3px rgba(244,114,182,0.15);
  transform: translateZ(40px);
}

/* 桌面端启用动画 */
@media (hover: hover) and (pointer: fine) {
  .hero-avatar {
    animation: hero-float 4s ease-in-out infinite;
  }
}

@keyframes hero-float {
  0%, 100% {
    transform: translateY(0) translateZ(40px);
    box-shadow: 
      0 15px 40px rgba(244,114,182,0.45),
      0 8px 25px rgba(132,204,22,0.3),
      inset 0 -2px 6px rgba(255,255,255,0.4),
      0 0 0 3px rgba(244,114,182,0.15);
  }
  50% {
    transform: translateY(-8px) translateZ(40px);
    box-shadow: 
      0 20px 50px rgba(244,114,182,0.55),
      0 12px 35px rgba(132,204,22,0.4),
      inset 0 -2px 6px rgba(255,255,255,0.5),
      0 0 0 3px rgba(244,114,182,0.25);
  }
}

.hero-avatar::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFB366, #FFC107);
  opacity: 0.4;
  /* 移动端移除blur和动画 */
  filter: none;
  z-index: -1;
  animation: none;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

/* 桌面端启用glow动画 */
@media (hover: hover) and (pointer: fine) {
  .hero-avatar::before {
    opacity: 0.5;
    filter: blur(25px);
    animation: glow-pulse 2s ease-in-out infinite;
  }
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid rgba(255,255,255,0.9);
  box-shadow: 
    0 8px 24px rgba(0,0,0,0.15),
    inset 0 2px 8px rgba(255,255,255,0.6);
}

.subtitle {
  grid-column: 1 / -1;
  color: var(--muted);
  margin-top: 4px;
  margin-bottom: 0;
  font-size: clamp(12px, 2.5vw, 15px);
  letter-spacing: 0.3px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.06);
  line-height: 1.4;
}

.header.center .subtitle {
  color: #44495a;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* ==================== 灵感标题 ==================== */
.inspiration-title {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #EC4899;
  margin: 0 0 var(--spacing-md) 0;
  padding: 0 20px;
  line-height: 1.5;
  text-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
  order: 0;
  flex-shrink: 0;
  z-index: 10;
}

/* ==================== 跑马灯 ==================== */
.marquee {
  display: grid;
  gap: 0;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  overflow: visible !important;
  overflow-x: clip;
  overflow-y: visible !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  width: 100vw;
  max-width: 100vw;
  padding: var(--spacing-sm) 0 !important;
  padding-bottom: 0 !important;
  perspective: 1200px;
  position: static !important;
  flex-shrink: 0;
  order: 1 !important;
  z-index: 1;
}

.marquee::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    rgba(249,250,251,1) 0%, 
    rgba(249,250,251,0) 5%, 
    rgba(249,250,251,0) 95%, 
    rgba(249,250,251,1) 100%);
  pointer-events: none;
  z-index: 2;
}

.marquee-row {
  position: relative;
  overflow: visible;
  overflow-x: clip;
  height: clamp(46px, 7vh, 60px);
  min-height: clamp(46px, 7vh, 60px);
  margin: 1px 0;
  padding: 0;
  transform-style: preserve-3d;
  overflow-y: visible;
}

.marquee-row .track {
  display: inline-flex;
  gap: 14px;
  padding: 6px 0;
  animation: scroll-left 20s linear infinite;
  white-space: nowrap;
  overflow: visible;
  /* 性能优化 */
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  perspective: 1000px;
  -webkit-perspective: 1000px;
}

.marquee-row.row2 .track {
  animation-name: scroll-right;
  animation-duration: 18s;
}

@keyframes scroll-left {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

@keyframes scroll-right {
  from { transform: translate3d(-50%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}

.pill {
  background: linear-gradient(145deg, 
    rgba(255,255,255,1) 0%, 
    rgba(254,248,252,0.98) 50%,
    rgba(255,255,255,0.95) 100%);
  backdrop-filter: blur(15px) saturate(180%);
  -webkit-backdrop-filter: blur(15px) saturate(180%);
  border: 2px solid rgba(244,114,182,0.4);
  color: #1F2937;
  padding: clamp(8px, 1.5vw, 12px) clamp(14px, 3vw, 22px);
  border-radius: var(--radius-full);
  white-space: nowrap;
  font-weight: 700;
  box-shadow: 
    0 10px 30px rgba(244,114,182,0.35),
    0 5px 15px rgba(132,204,22,0.15),
    inset 0 -3px 8px rgba(244,114,182,0.12),
    inset 0 2px 6px rgba(255,255,255,0.9),
    0 0 0 1px rgba(255,255,255,0.5);
  cursor: pointer;
  letter-spacing: 0.3px;
  font-size: clamp(13px, 2.5vw, 16px);
  line-height: 1.3;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
  transform: translateZ(20px) translateY(-2px);
  text-shadow: 0 1px 2px rgba(255,255,255,0.8);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  /* 性能优化 */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.pill::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255,255,255,0.6) 50%,
    transparent 100%);
  /* 移动端禁用持续动画，减少性能消耗 */
  animation: none;
  transition: all 0.3s ease;
}

@keyframes pill-shimmer {
  0%, 100% { left: -100%; }
  50% { left: 100%; }
}

/* 桌面端启用shimmer动画 */
@media (hover: hover) and (pointer: fine) {
  .pill::before {
    animation: pill-shimmer 3s ease-in-out infinite;
  }
}

.pill:hover {
  transform: translateZ(25px) translateY(-4px) scale(1.03);
  border-color: rgba(244,114,182,0.6);
  box-shadow: 
    0 15px 40px rgba(244,114,182,0.45),
    0 8px 20px rgba(132,204,22,0.25),
    inset 0 -3px 8px rgba(244,114,182,0.15),
    inset 0 2px 6px rgba(255,255,255,0.95),
    0 0 0 1px rgba(255,255,255,0.7);
}

.pill:active {
  transform: translateZ(15px) translateY(0) scale(0.96);
  box-shadow: 
    0 6px 20px rgba(244,114,182,0.4),
    0 3px 10px rgba(132,204,22,0.2),
    inset 0 -2px 6px rgba(244,114,182,0.15),
    inset 0 1px 4px rgba(255,255,255,0.8);
  transition: all 0.1s ease;
}

/* 移动端触摸反馈 */
@media (hover: none) and (pointer: coarse) {
  .pill:active {
    animation: pill-tap 0.3s ease;
  }
}

@keyframes pill-tap {
  0% { transform: translateZ(20px) translateY(-2px) scale(1); }
  50% { transform: translateZ(15px) translateY(0) scale(0.94); }
  100% { transform: translateZ(20px) translateY(-2px) scale(1); }
}

/* Pill点击状态（使用类而非内联样式，性能更好） */
.pill.pill-clicked {
  transform: translateZ(15px) translateY(0) scale(0.94);
  border-color: rgba(244,114,182,0.8);
  box-shadow: 
    0 6px 20px rgba(244,114,182,0.4),
    0 3px 10px rgba(132,204,22,0.2),
    inset 0 -2px 6px rgba(244,114,182,0.15),
    inset 0 1px 4px rgba(255,255,255,0.8);
}

/* 按钮点击状态 */
.cta-button.btn-clicked,
.bottom-action-btn.btn-clicked {
  transform: scale(0.95);
  opacity: 0.9;
}

.cta-button.btn-clicked {
  transform: translateZ(20px) translateY(0) scale(0.94);
}

/* ==================== 输入区域 ==================== */
.composer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: center;
  margin: 0 !important;
  padding: 0 var(--spacing-sm) !important;
  flex-shrink: 0;
  order: 2 !important;
  position: static !important;
  z-index: 2;
  min-height: clamp(200px, 30vh, 320px);
}

.composer-input {
  background: linear-gradient(135deg, 
    rgba(255,255,255,0.98) 0%, 
    rgba(254,250,253,0.95) 100%);
  backdrop-filter: blur(25px) saturate(190%);
  -webkit-backdrop-filter: blur(25px) saturate(190%);
  border: 2.5px solid rgba(244,114,182,0.45);
  border-radius: 25px;
  padding: 5px;
  margin: 0 auto;
  max-width: 860px;
  width: 100%;
  box-shadow: 
    0 20px 50px rgba(244,114,182,0.35),
    0 10px 25px rgba(132,204,22,0.15),
    inset 0 2px 4px rgba(255,255,255,0.9),
    inset 0 -3px 8px rgba(244,114,182,0.12),
    0 0 0 1px rgba(255,255,255,0.6);
  transition: border-color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  box-sizing: border-box;
  min-width: 0;
  position: relative;
  transform: translateZ(25px) translateY(-3px);
  min-height: clamp(80px, 12vh, 120px);
  /* 性能优化 */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.composer-input::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 28px;
  background: linear-gradient(135deg, #F472B6, #84CC16);
  opacity: 0.25;
  filter: blur(20px);
  z-index: -1;
  /* 移动端禁用持续动画 */
  animation: none;
}

@keyframes input-glow-pulse {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.05); }
}

/* 桌面端启用动画 */
@media (hover: hover) and (pointer: fine) {
  .composer-input::before {
    animation: input-glow-pulse 3s ease-in-out infinite;
  }
}

.input-container {
  position: relative;
  display: flex;
  align-items: flex-start;
}

.composer-input textarea {
  width: 100%;
  min-height: clamp(60px, 10vh, 90px);
  height: auto;
  resize: none;
  background: linear-gradient(140deg, 
    rgba(255,255,255,0.98) 0%, 
    rgba(254,251,253,0.96) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #1F2937;
  border: 2px solid rgba(244,114,182,0.25);
  border-radius: 20px;
  padding: 18px 54px 18px 18px;
  font-size: clamp(14px, 2.5vw, 16px);
  font-weight: 600;
  line-height: 1.5;
  box-shadow: 
    inset 0 3px 10px rgba(244,114,182,0.1),
    inset 0 -1px 3px rgba(255,255,255,0.6),
    0 2px 8px rgba(244,114,182,0.08);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  font-family: 'SF Pro Display', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  user-select: text;
  -webkit-user-select: text;
  /* 性能优化 */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.composer-input textarea:focus {
  outline: none;
  border-color: #F472B6;
  background: rgba(255,255,255,0.99);
  box-shadow: 
    0 0 0 3px rgba(244,114,182,0.2),
    inset 0 3px 12px rgba(244,114,182,0.15),
    inset 0 -2px 5px rgba(255,255,255,0.8),
    0 4px 12px rgba(244,114,182,0.15);
  transform: scale(1.005);
}

.composer-input textarea::placeholder {
  color: rgba(244,114,182,0.65);
  font-weight: 600;
}

.clear-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 36px;
  height: 36px;
  border: 2px solid rgba(244,114,182,0.3);
  background: linear-gradient(135deg, 
    rgba(255,255,255,0.95) 0%, 
    rgba(255,255,255,0.85) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #F472B6;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 10;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 
    0 4px 12px rgba(244,114,182,0.2),
    inset 0 1px 2px rgba(255,255,255,0.8);
  transform-style: preserve-3d;
}

.clear-btn:hover {
  background: linear-gradient(135deg, #F472B6, #EC4899);
  color: white;
  transform: scale(1.15) rotate(90deg);
  box-shadow: 
    0 8px 24px rgba(244,114,182,0.4),
    inset 0 1px 2px rgba(255,255,255,0.3);
  border-color: transparent;
}

.clear-btn:active {
  transform: scale(0.9) rotate(90deg);
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-top: 4px;
  padding-left: var(--spacing-sm);
}

.hint {
  font-size: clamp(12px, 2vw, 14px);
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

/* ==================== CTA区域 ==================== */
.cta {
  display: grid !important;
  gap: var(--spacing-sm);
  justify-items: center;
  margin-top: 0 !important;
  padding: var(--spacing-md) var(--spacing-sm) !important;
  perspective: 1200px;
  flex-shrink: 0;
  order: 3;
  position: fixed !important;
  bottom: 20px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  max-width: 450px !important;
  width: calc(100% - 64px) !important;
  z-index: 100 !important;
  box-sizing: border-box !important;
  background: rgba(249, 250, 251, 0.98) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  min-height: clamp(100px, 15vh, 140px);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.3s ease;
}

.cta.hidden {
  opacity: 0 !important;
  transform: translateX(-50%) translateY(20px) !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.alcohol-card {
  background: linear-gradient(135deg, 
    rgba(255,255,255,0.98) 0%, 
    rgba(254,250,253,0.95) 100%);
  backdrop-filter: blur(15px) saturate(180%);
  -webkit-backdrop-filter: blur(15px) saturate(180%);
  border: 2.5px solid rgba(244,114,182,0.4);
  border-radius: var(--radius-lg);
  padding: clamp(12px, 2vh, 20px);
  box-shadow: 
    0 15px 45px rgba(244,114,182,0.35),
    0 8px 22px rgba(132,204,22,0.15),
    inset 0 2px 4px rgba(255,255,255,0.9),
    inset 0 -3px 8px rgba(244,114,182,0.12);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateZ(20px) translateY(-2px);
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: clamp(80px, 12vh, 120px);
}

.alcohol-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.alcohol-title {
  font-weight: 800;
  color: #1F2937;
  font-size: clamp(14px, 2.5vw, 17px);
  line-height: 1.3;
}

.alcohol-input {
  width: 70px;
  padding: 6px 12px;
  border: 2px solid rgba(244,114,182,0.3);
  border-radius: var(--radius-md);
  font-size: clamp(14px, 2.5vw, 16px);
  font-weight: 700;
  text-align: center;
  color: #F472B6;
  background: rgba(255,255,255,0.8);
  transition: all 0.3s ease;
  line-height: 1.3;
}

.alcohol-input:focus {
  outline: none;
  border-color: #F472B6;
  box-shadow: 0 0 0 3px rgba(244,114,182,0.2);
}

.alcohol-slider-container {
  position: relative;
}

.alcohol-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, 
    rgba(132,204,22,0.2) 0%, 
    rgba(244,114,182,0.2) 50%,
    rgba(249,115,22,0.2) 100%);
  outline: none;
  -webkit-appearance: none;
  margin: var(--spacing-sm) 0;
}

.alcohol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F472B6, #EC4899);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(244,114,182,0.4);
  transition: all 0.3s ease;
}

.alcohol-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 16px rgba(244,114,182,0.6);
}

.alcohol-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F472B6, #EC4899);
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 12px rgba(244,114,182,0.4);
  transition: all 0.3s ease;
}

.alcohol-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 16px rgba(244,114,182,0.6);
}

.alcohol-labels {
  display: flex;
  justify-content: space-between;
  font-size: clamp(11px, 2vw, 13px);
  color: #9CA3AF;
  margin-top: 4px;
  line-height: 1.2;
}

.cta-button {
  background: linear-gradient(140deg, 
    #F472B6 0%, 
    #EC4899 45%, 
    #F97316 100%);
  color: #fff;
  padding: clamp(10px, 1.5vh, 14px) clamp(20px, 3vw, 28px);
  border-radius: var(--radius-xl);
  font-weight: 900;
  font-size: clamp(14px, 2.5vw, 17px);
  border: none;
  cursor: pointer;
  box-shadow: 
    0 20px 55px rgba(244, 114, 182, 0.5),
    0 10px 28px rgba(249, 115, 22, 0.3),
    inset 0 2px 0 rgba(255,255,255,0.35),
    inset 0 -2px 0 rgba(0,0,0,0.12),
    0 0 0 1px rgba(255,255,255,0.2);
  max-width: calc(860px * 0.92);
  width: 100%;
  max-width: 100%;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease, box-shadow 0.3s ease;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transform: translateZ(30px) translateY(-3px);
  min-height: clamp(42px, 6vh, 56px);
  height: auto;
  line-height: 1.3;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  opacity: 1;
  /* 性能优化 */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.cta-button.hidden {
  display: flex !important;
  opacity: 0;
  transform: translateZ(30px) translateY(10px) scale(0.95);
  pointer-events: none;
}

.cta-button::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -100%;
  width: 80%;
  height: 200%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255,255,255,0.5) 50%,
    transparent 100%);
  transform: rotate(25deg);
  /* 移动端禁用，桌面端启用 */
  animation: none;
}

@keyframes button-shimmer {
  0%, 100% { left: -100%; }
  50% { left: 120%; }
}

.cta-button::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 28px;
  background: linear-gradient(135deg, #F472B6, #F97316);
  opacity: 0.4;
  filter: blur(25px);
  z-index: -1;
  /* 移动端禁用，桌面端启用 */
  animation: none;
}

@keyframes button-glow-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.08); }
}

/* 桌面端启用持续动画 */
@media (hover: hover) and (pointer: fine) {
  .cta-button::before {
    animation: button-shimmer 3s ease-in-out infinite;
  }
  
  .cta-button::after {
    animation: button-glow-pulse 2.5s ease-in-out infinite;
  }
}

.cta-button:hover {
  transform: translateZ(35px) translateY(-5px) scale(1.02);
  box-shadow: 
    0 25px 65px rgba(244, 114, 182, 0.6),
    0 15px 35px rgba(249, 115, 22, 0.4),
    inset 0 2px 0 rgba(255,255,255,0.4),
    inset 0 -2px 0 rgba(0,0,0,0.15),
    0 0 0 1px rgba(255,255,255,0.3);
}

.cta-button:active {
  transform: translateZ(20px) translateY(0) scale(0.96);
  box-shadow: 
    0 12px 35px rgba(244, 114, 182, 0.55),
    0 6px 18px rgba(249, 115, 22, 0.35),
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 -1px 0 rgba(0,0,0,0.15);
  transition: all 0.1s ease;
}

.cta-button.animate {
  animation: button-strong-pulse 2s ease-in-out infinite;
}

@keyframes button-strong-pulse {
  0%, 100% {
    transform: translateZ(30px) translateY(-3px) scale(1);
  }
  50% {
    transform: translateZ(30px) translateY(-5px) scale(1.02);
  }
}

/* 移动端按钮触摸反馈 */
@media (hover: none) and (pointer: coarse) {
  .cta-button:active {
    animation: button-tap 0.3s ease;
  }
}

@keyframes button-tap {
  0% { transform: translateZ(30px) translateY(-3px) scale(1); }
  50% { transform: translateZ(20px) translateY(0) scale(0.94); }
  100% { transform: translateZ(30px) translateY(-3px) scale(1); }
}

/* ==================== 页脚 ==================== */
.footer {
  margin: var(--spacing-md) 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding-bottom: 0;
  flex-shrink: 0;
}

/* ==================== 全屏加载界面 ==================== */
.fullscreen-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease-in-out;
}

.fullscreen-loader.hidden {
  display: none;
}

.loader-backdrop {
  flex: 3;
  background: rgba(244, 114, 182, 0.1);
  backdrop-filter: blur(3px) saturate(80%);
  -webkit-backdrop-filter: blur(3px) saturate(80%);
  position: relative;
  overflow: hidden;
}

.loader-backdrop::before {
  content: '';
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(244,114,182,0.02), transparent 70%);
  border-radius: 50%;
  animation: pulse 3s ease-in-out infinite;
}

.loader-content {
  flex: 2;
  background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
  border-radius: 36px 36px 0 0;
  box-shadow: 0 -12px 48px rgba(0,0,0,0.1);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  animation: slideUp 0.5s ease-out;
}

.loader-icon-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.glass-icon {
  font-size: 56px;
  animation: shake 1.5s ease-in-out infinite;
  display: inline-block;
  filter: drop-shadow(0 4px 12px rgba(244,114,182,0.3));
}

@keyframes shake {
  0%, 100% { 
    transform: rotate(0deg) scale(1); 
    filter: drop-shadow(0 4px 12px rgba(244,114,182,0.3));
  }
  25% { 
    transform: rotate(-8deg) scale(1.05); 
    filter: drop-shadow(0 6px 16px rgba(244,114,182,0.4));
  }
  50% {
    transform: rotate(0deg) scale(1.08);
    filter: drop-shadow(0 8px 20px rgba(244,114,182,0.5));
  }
  75% { 
    transform: rotate(8deg) scale(1.05); 
    filter: drop-shadow(0 6px 16px rgba(244,114,182,0.4));
  }
}

.loader-title {
  font-size: clamp(16px, 3vw, 20px);
  font-weight: 700;
  color: #1F2937;
  text-align: center;
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.loader-subtitle {
  font-size: clamp(12px, 2.5vw, 14px);
  color: #6B7280;
  text-align: center;
  margin-top: -10px;
  line-height: 1.4;
}

.loader-steps {
  width: 100%;
  max-width: 500px;
  min-height: 60px;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--spacing-md);
  background: linear-gradient(135deg, rgba(244,114,182,0.08), rgba(132,204,22,0.05));
  border-radius: var(--radius-md);
  border: 1px solid rgba(244,114,182,0.25);
  font-size: 13px;
  color: #1F2937;
  line-height: 1.8;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
  box-shadow: inset 0 2px 8px rgba(244,114,182,0.08);
  text-align: left;
  scroll-behavior: smooth;
}

.loader-steps::-webkit-scrollbar {
  width: 6px;
}

.loader-steps::-webkit-scrollbar-track {
  background: rgba(244,114,182,0.08);
  border-radius: 3px;
}

.loader-steps::-webkit-scrollbar-thumb {
  background: rgba(244,114,182,0.3);
  border-radius: 3px;
}

.loader-steps::-webkit-scrollbar-thumb:hover {
  background: rgba(244,114,182,0.5);
}

.loader-progressbar-container {
  width: 100%;
  max-width: 600px;
  margin: var(--spacing-sm) auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  padding: 0 20px;
  box-sizing: border-box;
}

.loader-progressbar {
  width: 380px;
  max-width: 380px;
  flex-shrink: 0;
}

.loader-progressbar-track {
  width: 100%;
  height: 6px;
  background: rgba(244,114,182,0.15);
  border-radius: 3px;
  overflow: hidden;
}

.loader-progressbar-fill {
  height: 100%;
  background: linear-gradient(90deg, #F472B6, #84CC16);
  border-radius: 3px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(244,114,182,0.5);
}

.loader-percentage {
  color: #F472B6;
  font-size: clamp(13px, 2.5vw, 16px);
  font-weight: 700;
  min-width: 48px;
  text-align: left;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  text-shadow: 0 2px 8px rgba(244,114,182,0.3);
  flex-shrink: 0;
  line-height: 1.2;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.4;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translateX(-50%) scale(1.1);
  }
}

/* ==================== 固定底部操作模块 ==================== */
.fixed-bottom-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  border-top: none;
  padding: var(--spacing-md) 20px;
  padding-bottom: calc(var(--spacing-md) + env(safe-area-inset-bottom));
  box-shadow: none;
}

.bottom-actions-container {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.bottom-action-btn {
  width: 100%;
  padding: var(--spacing-md) 20px;
  border: none;
  border-radius: var(--spacing-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.share-btn {
  background: linear-gradient(135deg, #F472B6, #EC4899);
  color: white;
  box-shadow: 0 8px 24px rgba(244, 114, 182, 0.3);
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(244, 114, 182, 0.4);
}

.share-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 16px rgba(244, 114, 182, 0.3);
}

.another-btn {
  background: #FFB366;
  color: #000;
  border: none;
  box-shadow: 0 4px 16px rgba(255, 179, 102, 0.4);
}

.another-btn:hover {
  background: #FFA347;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 179, 102, 0.5);
}

.another-btn:active {
  transform: translateY(0);
  background: #FF9933;
}

/* 移动端底部按钮触摸反馈 */
@media (hover: none) and (pointer: coarse) {
  .bottom-action-btn:active {
    animation: bottom-btn-tap 0.25s ease;
  }
  
  .share-btn:active {
    transform: scale(0.97);
  }
  
  .another-btn:active {
    transform: scale(0.97);
  }
}

@keyframes bottom-btn-tap {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* ==================== 结果页面 - 第三界面 ==================== */
.result.result-v3 { 
  background: #000; 
  padding: 0; 
}

.screen3 {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  color: #fff;
  background: #000;
  background-image: var(--s3-bg);
  background-size: cover;
  background-position: center;
}

.s3-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, 
    rgba(0,0,0,.86) 0%, 
    rgba(0,0,0,.6) 36%, 
    rgba(0,0,0,.2) 64%, 
    rgba(0,0,0,.05) 90%);
}

.s3-header {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 20px;
}

.s3-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: rgba(0, 0, 0, 0.4);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
}

.s3-brand-text {
  color: #fff;
  font-size: clamp(12px, 2.5vw, 16px);
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.s3-logo-icon {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,.3));
}

.s3-qr {
  width: 80px;
  height: 80px;
}

.s3-qr-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  background: rgba(255,255,255,0.95);
  padding: var(--spacing-sm);
  box-sizing: border-box;
}

.s3-slogan {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%) rotate(-8deg);
  z-index: 10;
  text-align: left;
  white-space: nowrap;
}

.s3-safe {
  position: relative;
  height: 100%;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 140px 32px 120px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.s3-left {
  max-width: 420px;
  width: 100%;
  min-width: 300px;
  padding-right: var(--spacing-lg);
  max-height: 100%;
  overflow-y: visible;
}

.s3-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) 14px;
  border-radius: var(--radius-xl);
  border: 1.5px solid rgba(244,114,182,.3);
  background: rgba(244,114,182,.12);
  color: #ffb366;
  font-weight: 700;
  font-size: clamp(11px, 2vw, 13px);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(244,114,182,.15);
  margin-top: -60px;
  margin-bottom: var(--spacing-md);
  line-height: 1.3;
}

.s3-title {
  margin: 2px 0 2px;
  font-size: clamp(20px, 4vw, 32px);
  font-weight: 900;
  color: #ffb366;
  letter-spacing: .6px;
  line-height: 1.2;
  text-shadow: 0 2px 20px rgba(255,179,102,.4);
}

.s3-subtitle {
  margin: 2px 0 80px;
  color: #ffb366;
  font-size: clamp(12px, 2.5vw, 15px);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: .3px;
}

.s3-story-title {
  margin: 4px 0 2px;
  color: #ffb366;
  font-size: clamp(12px, 2.5vw, 15px);
  font-weight: 800;
  letter-spacing: .3px;
}

.s3-story {
  color: #e8e8f0;
  line-height: 1.5;
  margin: 2px 0 6px;
  font-size: clamp(12px, 2.5vw, 14px);
  word-wrap: break-word;
  font-weight: 400;
  max-width: 11em;
  word-break: break-all;
  max-height: 100px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 179, 102, 0.3) transparent;
}

.s3-story::-webkit-scrollbar {
  width: 4px;
}

.s3-story::-webkit-scrollbar-track {
  background: transparent;
}

.s3-story::-webkit-scrollbar-thumb {
  background: rgba(255, 179, 102, 0.3);
  border-radius: 2px;
}

.s3-story::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 179, 102, 0.5);
}

.s3-section {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 2px 0;
  margin-top: 2px;
  max-width: 100%;
  box-sizing: border-box;
}

.s3-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

.s3-left > .s3-section:last-child .s3-text {
  margin-bottom: 0;
}

.s3-label {
  font-weight: 800;
  color: #ffb366;
  margin-bottom: 2px;
  font-size: clamp(11px, 2vw, 13px);
  letter-spacing: .3px;
  line-height: 1.2;
}

.s3-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1px;
}

.s3-ingredient {
  color: #f5f5f5;
  font-size: clamp(12px, 2.5vw, 14px);
  font-weight: 500;
  line-height: 1.4;
  padding-left: 4px;
}

.s3-ingredient::before {
  content: '•';
  color: #ffb366;
  margin-right: var(--spacing-sm);
  font-size: 15px;
  font-weight: 700;
}

.s3-ml {
  color: #ffb366;
  margin-left: var(--spacing-sm);
  font-size: 12.5px;
  font-weight: 600;
}

.s3-text {
  margin: 0;
  color: #e8e8f0;
  line-height: 1.5;
  font-size: clamp(12px, 2.5vw, 14px);
  word-wrap: break-word;
  font-weight: 400;
  max-width: 14em;
  word-break: break-all;
  max-height: 120px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 179, 102, 0.3) transparent;
}

.s3-text::-webkit-scrollbar {
  width: 4px;
}

.s3-text::-webkit-scrollbar-track {
  background: transparent;
}

.s3-text::-webkit-scrollbar-thumb {
  background: rgba(255, 179, 102, 0.3);
  border-radius: 2px;
}

.s3-text::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 179, 102, 0.5);
}

.s3-hint-bottom {
  position: absolute;
  bottom: 80px;
  right: 32px;
  color: #d4d4e0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  text-align: right;
  z-index: 10;
}

.s3-footer {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  z-index: 10;
  white-space: nowrap;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 600px) {
  html, body {
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
  }

  .s3-stage.home {
    background: var(--bg);
    padding: 0 !important;
    display: block !important;
    place-items: unset !important;
    overflow-x: hidden;
  }

  .s3-frame,
  .s-home-frame {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    aspect-ratio: unset !important;
    position: static !important;
    overflow-x: hidden !important;
  }

  .screen-home {
    border-radius: 0 !important;
    position: static !important;
    inset: unset !important;
    overflow-x: hidden !important;
  }

  .app {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
  }

  .app > * {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
    max-width: 100%;
  }

  .marquee {
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    position: relative;
    left: 0 !important;
    transform: none !important;
    margin-left: -16px;
    margin-right: -16px;
    gap: 0px !important;
    margin-bottom: 0px !important;
    overflow: visible !important;
    overflow-x: clip !important;
  }
  
  /* 移动端跑马灯标签放大 */
  .pill {
    font-size: 14px !important;
    padding: 9px 16px !important;
    min-height: 38px;
  }
  
  .marquee-row {
    height: clamp(50px, 8vh, 64px);
    min-height: 50px;
  }

  .cta {
    bottom: 16px !important;
    width: calc(100% - 48px) !important;
    padding: 10px var(--spacing-sm) !important;
    border-radius: 16px !important;
    display: grid !important;
    z-index: 100 !important;
    position: fixed !important;
  }
  
  /* 移动端CTA隐藏状态 */
  .cta.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  
  .alcohol-card {
    min-height: 100px;
  }
  
  .cta-button {
    min-height: 48px;
    font-size: clamp(13px, 3vw, 16px);
  }

  .bottom-actions-container {
    gap: 10px;
  }

  .bottom-action-btn {
    padding: 14px 18px;
    font-size: 15px;
    border-radius: 12px;
  }
  
  .composer-input {
    min-height: 90px;
  }
  
  .composer-input textarea {
    min-height: 70px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .brand {
    font-size: clamp(18px, 5vw, 28px);
  }

  .subtitle {
    font-size: clamp(11px, 3vw, 14px);
  }

  .pill {
    font-size: 14px !important;
    padding: 9px 15px !important;
    min-height: 36px;
  }
  
  .marquee-row {
    height: clamp(48px, 7.5vh, 60px);
    min-height: 48px;
  }

  .bottom-action-btn {
    padding: 12px 16px;
    font-size: 14px;
  }

  .cta {
    bottom: 12px !important;
    width: calc(100% - 32px) !important;
    padding: var(--spacing-sm) 6px !important;
  }
  
  .hero-avatar {
    width: clamp(70px, 12vw, 90px);
    height: clamp(70px, 12vw, 90px);
  }
  
  .inspiration-title {
    font-size: 13px;
    padding: 0 12px;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .pill {
    padding: 10px 18px !important;
    font-size: 15px !important;
    min-height: 40px;
  }
  
  .marquee-row {
    height: clamp(52px, 8vh, 64px);
    min-height: 52px;
  }
  
  .composer-input textarea {
    font-size: 16px; /* 防止iOS自动缩放 */
  }
  
  .cta-button {
    min-height: 50px;
    padding: 14px 24px;
  }
  
  .bottom-action-btn {
    min-height: 48px;
  }
  
  /* 移动端简化blur效果（性能优化） */
  .composer-input,
  .alcohol-card,
  .pill {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  
  .composer-input::before,
  .cta-button::after {
    filter: none !important;
    display: none;
  }
  
  /* 简化阴影效果（减少渲染负担） */
  .pill {
    box-shadow: 0 8px 20px rgba(244,114,182,0.25) !important;
  }
  
  .pill::before {
    display: none; /* 移除shimmer伪元素 */
  }
  
  .composer-input {
    box-shadow: 0 12px 30px rgba(244,114,182,0.25) !important;
  }
  
  .cta-button {
    box-shadow: 0 15px 40px rgba(244, 114, 182, 0.35) !important;
  }
  
  .cta-button::before {
    display: none; /* 移除shimmer伪元素 */
  }
  
  /* 移动端优化动画性能 */
  * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(244, 114, 182, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(45deg, #F472B6, #84CC16);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(45deg, #EC4899, #65A30D);
}

/* ==================== 性能优化 ==================== */
/* CSS Containment - 隔离渲染范围，提升性能 */
.pill {
  contain: layout style paint;
  content-visibility: auto; /* 浏览器自动管理渲染 */
}

.composer-input {
  contain: layout;
  isolation: isolate; /* 创建独立的层叠上下文 */
}

.alcohol-card {
  contain: layout style;
  isolation: isolate;
}

.cta-button {
  contain: layout style;
}

.marquee-row {
  contain: layout style;
  content-visibility: auto;
}

/* 减少不必要的will-change（低端设备上会增加内存消耗） */
.pill:hover,
.cta-button:hover {
  will-change: transform;
}

/* 只在动画播放时使用will-change */
.pill.pill-clicked,
.cta-button.btn-clicked {
  will-change: transform;
}

.composer-input textarea:focus {
  will-change: transform, border-color;
}

/* 移除静态元素的will-change */
.hero-avatar,
.brand {
  /* 不使用will-change，减少内存占用 */
}

/* 优化层叠上下文 */
.cta {
  isolation: isolate;
  contain: layout style;
}

/* ==================== 入场动画 ==================== */
.header {
  animation: fadeInDown 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.inspiration-title {
  animation: fadeIn 1s ease 0.3s backwards;
}

.marquee {
  animation: fadeIn 1s ease 0.5s backwards;
}

.composer {
  animation: fadeInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.7s backwards;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ==================== 移动端键盘自适应 ==================== */
/* 键盘弹起时的布局优化 */
body.keyboard-visible {
  height: 100vh;
  overflow: hidden;
  position: relative;
}

body.keyboard-visible .s3-frame,
body.keyboard-visible .screen-home {
  height: 100vh;
  overflow: visible;
}

/* 压缩头部 */
.header.keyboard-compact {
  transform: scale(0.35) translateY(-50%);
  opacity: 0.4;
  max-height: 32px;
  overflow: hidden;
  margin-bottom: -35px;
  pointer-events: none;
  transition: all 0.3s ease;
}

.header.keyboard-compact .hero-avatar {
  display: none;
}

.header.keyboard-compact .subtitle {
  display: none;
}

.header.keyboard-compact .brand {
  font-size: 12px;
}

.header.keyboard-compact .brand-logo {
  width: 18px;
  height: 18px;
}

/* 压缩跑马灯和标题 */
.inspiration-title.keyboard-hidden {
  font-size: 12px !important;
  margin: 3px 0 !important;
  padding: 0 12px !important;
  transition: all 0.3s ease;
}

.marquee.keyboard-hidden {
  height: auto !important;
  overflow: hidden;
  overflow-x: clip;
  transition: all 0.3s ease;
  padding: 3px 0 !important;
  margin-bottom: 6px !important;
}

.marquee.keyboard-hidden .marquee-row {
  height: 38px !important;
  min-height: 38px !important;
  margin: 2px 0 !important;
}

.marquee.keyboard-hidden .pill {
  font-size: 13px !important;
  padding: 7px 14px !important;
  line-height: 1.3;
}

/* 键盘模式下的主容器 */
.main.keyboard-mode {
  padding-top: 5px !important;
  padding-bottom: 0 !important;
  height: 100%;
  max-height: 100vh;
  overflow-y: visible;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 4px !important;
}

/* 键盘模式下的输入框 */
body.keyboard-visible .composer {
  flex-shrink: 0;
  margin-top: 4px !important;
  margin-bottom: 6px !important;
  padding: 0 var(--spacing-sm) !important;
}

body.keyboard-visible .composer-input {
  min-height: 68px !important;
  padding: 4px !important;
}

body.keyboard-visible .composer-input textarea {
  min-height: 52px !important;
  padding: 10px 45px 10px 12px !important;
  font-size: 15px;
}

/* 键盘模式下的CTA区域 */
body.keyboard-visible .cta {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 8px 12px 8px 12px !important;
  background: linear-gradient(180deg, rgba(249, 250, 251, 0.95) 0%, rgba(249, 250, 251, 0.98) 100%) !important;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  min-height: auto !important;
  flex-shrink: 0;
  border-radius: 0 !important;
  gap: 4px !important;
}

body.keyboard-visible .cta.hidden {
  display: none !important;
}

body.keyboard-visible .alcohol-card {
  min-height: 70px !important;
  padding: 6px 10px !important;
  border-width: 1.5px !important;
  margin-bottom: 4px !important;
}

body.keyboard-visible .alcohol-header {
  margin-bottom: 4px !important;
}

body.keyboard-visible .alcohol-title {
  font-size: 13px !important;
}

body.keyboard-visible .alcohol-input {
  width: 52px !important;
  padding: 3px 6px !important;
  font-size: 13px !important;
}

body.keyboard-visible .alcohol-slider {
  height: 6px !important;
  margin: 3px 0 !important;
}

body.keyboard-visible .alcohol-slider::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
}

body.keyboard-visible .alcohol-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
}

body.keyboard-visible .alcohol-labels {
  font-size: 11px !important;
  margin-top: 2px !important;
}

body.keyboard-visible .cta-button {
  min-height: 42px !important;
  padding: 9px 14px !important;
  font-size: 13px !important;
  margin-top: 2px;
}

body.keyboard-visible .footer {
  display: none !important;
}

/* 键盘模式性能优化 */
body.keyboard-visible * {
  animation-play-state: paused !important; /* 暂停所有持续动画 */
}

body.keyboard-visible .marquee-row .track {
  animation-play-state: running !important; /* 跑马灯继续滚动 */
}

/* 键盘模式下简化过渡效果 */
body.keyboard-visible .header,
body.keyboard-visible .marquee,
body.keyboard-visible .inspiration-title {
  transition: all 0.2s ease !important; /* 加快过渡速度 */
}

/* 移动端专属优化 */
@media (max-width: 600px) {
  body.keyboard-visible .main.keyboard-mode {
    gap: 5px !important;
  }
  
  body.keyboard-visible .composer {
    order: 1;
  }
  
  body.keyboard-visible .cta {
    order: 2;
  }
}
