/**
 * 文件名: theme.css
 * 功能: ReelHub 设计令牌 (Playful Geometric + ReelHub Brand)
 *
 * 主要导出 (CSS Variables):
 * - 色板 / 字体 / 圆角 / 边框 / Pop Shadow / 间距 / 缓动
 *
 * 依赖: Google Fonts (Outfit, Plus Jakarta Sans), Tailwind CDN
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* 色板 */
  --bg:           #FFFDF5;
  --fg:           #1E293B;
  --muted:        #F1F5F9;
  --muted-fg:     #64748B;
  --accent:       #8B5CF6;
  --accent-fg:    #FFFFFF;
  --secondary:    #F472B6;
  --tertiary:     #FBBF24;
  --quaternary:   #34D399;
  --border:       #E2E8F0;
  --border-strong:#1E293B;
  --card:         #FFFFFF;
  --ring:         #8B5CF6;

  /* ReelHub 品牌色 (Pornhub 风格 logo 用) */
  --brand-orange:    #FFA726;
  --brand-orange-fg: #0B0B0B;

  /* 字体 */
  --font-display: "Outfit", system-ui, -apple-system, sans-serif;
  --font-body:    "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;

  /* 圆角 */
  --r-sm:   8px;
  --r-md:   16px;
  --r-lg:   24px;
  --r-full: 9999px;

  /* 边框 */
  --bw: 2px;

  /* Pop Shadow */
  --pop-2: 2px 2px 0 0 var(--border-strong);
  --pop-4: 4px 4px 0 0 var(--border-strong);
  --pop-6: 6px 6px 0 0 var(--border-strong);
  --pop-8: 8px 8px 0 0 var(--border-strong);
  --pop-soft: 8px 8px 0 0 var(--border);
  --pop-pink: 8px 8px 0 0 var(--secondary);
  --pop-yellow: 8px 8px 0 0 var(--tertiary);

  /* 缓动 */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* 选中态 */
  --selection-bg: var(--tertiary);
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--selection-bg); color: var(--fg); }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--fg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* 滚动容器保留交互但隐藏原生滚动条 */
html,
body,
.pix-drawer-body,
.overflow-auto {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.pix-drawer-body::-webkit-scrollbar,
.overflow-auto::-webkit-scrollbar {
  display: none;
}

/* ========== 通用组件 ========== */

.pix-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  min-height: 48px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--accent);
  color: var(--accent-fg);
  border: var(--bw) solid var(--border-strong);
  border-radius: var(--r-full);
  box-shadow: var(--pop-4);
  cursor: pointer;
  transition: transform 0.2s var(--ease-bounce), box-shadow 0.2s var(--ease-bounce);
  user-select: none;
  white-space: nowrap;
}
.pix-btn:hover { transform: translate(-2px, -2px); box-shadow: var(--pop-6); }
.pix-btn:active { transform: translate(2px, 2px); box-shadow: var(--pop-2); }
.pix-btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: var(--pop-2); }

.pix-btn-secondary {
  background: transparent;
  color: var(--fg);
  box-shadow: none;
}
.pix-btn-secondary:hover { background: var(--tertiary); transform: none; box-shadow: none; }
.pix-btn-secondary:active { transform: scale(0.97); }

.pix-btn-pink { background: var(--secondary); }
.pix-btn-yellow { background: var(--tertiary); color: var(--fg); }
.pix-btn-mint { background: var(--quaternary); color: var(--fg); }
.pix-btn-ghost { background: var(--card); color: var(--fg); }

.pix-btn-sm { padding: 0.5rem 1rem; min-height: 36px; font-size: 0.85rem; box-shadow: var(--pop-2); }
.pix-btn-sm:hover { box-shadow: 4px 4px 0 0 var(--border-strong); }

/* Card */
.pix-card {
  background: var(--card);
  border: var(--bw) solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--pop-soft);
  transition: transform 0.3s var(--ease-bounce), box-shadow 0.3s var(--ease-bounce);
}
.pix-card-hover:hover {
  transform: rotate(-0.6deg) scale(1.01);
  box-shadow: var(--pop-pink);
}

.pix-card-feature {
  background: var(--card);
  border: var(--bw) solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--pop-yellow);
}

/* Input */
.pix-input {
  width: 100%;
  padding: 0.85rem 1.1rem;
  min-height: 48px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--fg);
  background: var(--card);
  border: var(--bw) solid #CBD5E1;
  border-radius: var(--r-md);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s var(--ease-bounce);
}
.pix-input:focus {
  border-color: var(--accent);
  box-shadow: 4px 4px 0 0 var(--accent);
}
.pix-input::placeholder { color: var(--muted-fg); }

.pix-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

/* Badge */
.pix-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--tertiary);
  color: var(--fg);
  border: var(--bw) solid var(--border-strong);
  border-radius: var(--r-full);
}
.pix-badge-violet  { background: var(--accent); color: var(--accent-fg); }
.pix-badge-pink    { background: var(--secondary); color: var(--accent-fg); }
.pix-badge-mint    { background: var(--quaternary); color: var(--fg); }

/* Chip / Toggle */
.pix-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  background: var(--card);
  border: var(--bw) solid var(--border-strong);
  border-radius: var(--r-full);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--fg);
  cursor: pointer;
  transition: all 0.2s var(--ease-bounce);
  user-select: none;
}
.pix-chip:hover { transform: translate(-1px, -1px); box-shadow: var(--pop-2); }
.pix-chip.is-active {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: var(--pop-2);
}

/* Modal */
.pix-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 41, 59, 0.55);
  backdrop-filter: blur(6px);
  z-index: 100;
}
.pix-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 101;
  padding: 1rem;
}
.pix-modal-panel {
  background: var(--card);
  border: var(--bw) solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: 12px 12px 0 0 var(--border-strong);
  max-width: 480px;
  width: 100%;
  padding: 1.75rem;
  position: relative;
}

/* 装饰: 圆点底纹 */
.pix-dots {
  background-image: radial-gradient(rgba(30, 41, 59, 0.12) 1.2px, transparent 1.5px);
  background-size: 18px 18px;
}

/* 装饰: 几何 blob */
.pix-blob-1 { border-radius: 60% 40% 50% 70% / 50% 60% 40% 50%; }
.pix-blob-2 { border-radius: 40% 60% 70% 30% / 60% 40% 50% 50%; }

.pix-stamp { display: inline-block; transform: rotate(-6deg); }

/* 标题波浪下划 */
.pix-squiggle { position: relative; }
.pix-squiggle::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -10px;
  height: 8px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 8' preserveAspectRatio='none'><path d='M0 4 Q 10 0, 20 4 T 40 4 T 60 4 T 80 4' fill='none' stroke='%238B5CF6' stroke-width='2.5' stroke-linecap='round'/></svg>") repeat-x;
  background-size: 80px 8px;
}

/* 弹跳入场 */
@keyframes pix-pop-in {
  0%   { opacity: 0; transform: scale(0.6); }
  60%  { opacity: 1; transform: scale(1.06); }
  100% { transform: scale(1); }
}
.pix-pop-in { animation: pix-pop-in 0.45s var(--ease-bounce) both; }

/* 摇摆 */
@keyframes pix-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(3deg); }
  75%      { transform: rotate(-3deg); }
}
.pix-wiggle:hover { animation: pix-wiggle 0.5s ease-in-out; }

/* Loading dots */
@keyframes pix-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-12px); }
}
.pix-loader { display: inline-flex; gap: 6px; align-items: center; }
.pix-loader span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  animation: pix-bounce 1.2s var(--ease-bounce) infinite;
}
.pix-loader span:nth-child(2) { background: var(--secondary); animation-delay: 0.15s; }
.pix-loader span:nth-child(3) { background: var(--tertiary); animation-delay: 0.3s; }

/* Toast */
.pix-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  opacity: 0;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 700;
  padding: 0.75rem 1.4rem;
  border-radius: var(--r-full);
  box-shadow: var(--pop-4);
  z-index: 9999;
  pointer-events: none;
  transition: transform 0.4s var(--ease-bounce), opacity 0.3s;
}
.pix-toast.is-show { opacity: 1; transform: translateX(-50%) scale(1); }
.pix-toast.is-success { background: var(--quaternary); color: var(--fg); }
.pix-toast.is-error   { background: var(--secondary); color: var(--accent-fg); }
.pix-toast.is-info    { background: var(--accent); color: var(--accent-fg); }

/* 响应式 */
@media (max-width: 640px) {
  .pix-btn { padding: 0.65rem 1.2rem; }
  :root {
    --pop-4: 2px 2px 0 0 var(--border-strong);
    --pop-6: 4px 4px 0 0 var(--border-strong);
    --pop-soft: 4px 4px 0 0 var(--border);
    --pop-pink: 4px 4px 0 0 var(--secondary);
    --pop-yellow: 4px 4px 0 0 var(--tertiary);
  }
  .pix-decor-hide { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
