/**
 * 童年物品回忆召唤师 - 全局样式表
 * 路径: /public/assets/css/styles.css
 * 功能: 定义设计Token、组件样式、响应式布局、导航动画
 * 依赖: Font Awesome 6.4 (CDN), Tailwind CDN
 * 优先级: main
 * 
 * 设计特性:
 * - 怀旧复古色彩系统（暖棕/琥珀/深褐）
 * - 移动端优先响应式（360px → 768px → 1024px → 1200px）
 * - 动态导航生成（支持1-8项，自动分组）
 * - 防闪烁动画（opacity+visibility+transform）
 * - 二级菜单悬停桥接技术
 * - 动态高度下拉菜单（CSS Grid策略）
 * - 移动端二级菜单强制垂直排列
 * 
 * 修改记录:
 * - 修改依据: 用户反馈"标签中的颜色不对，文字看不到了"
 * - 修改内容: 1. 新增标签系统专用样式(.tag, .tag--primary, .tag--secondary等)；2. 确保标签文字与背景有足够对比度；3. 在卡片组件中应用标签样式；
 * - 参考文件: 无
 * - 冲突处理: 无
 */

:root {
  /* ===== 系统配置 ===== */
  --sys-type: ai_multimodal;
  --theme-mode: dark;
  --motion-level: slower;

  /* ===== 品牌色 - 怀旧复古色调 ===== */
  --brand-primary: #C4A35A;      /* 温暖琥珀 - 主品牌色 */
  --brand-secondary: #8B7355;    /* 复古棕褐 - 辅助色 */
  --brand-accent: #D4A574;       /* 柔和橙红 - 强调色 */

  /* ===== 语义色彩 ===== */
  --bg-default: #1A1612;         /* 深褐底色 - 老照片暗部 */
  --bg-subtle: color-mix(in srgb, var(--bg-default) 95%, var(--brand-primary));
  --bg-hover: color-mix(in srgb, var(--bg-default) 90%, var(--brand-primary));
  --fg-default: #F5F0E8;         /* 暖白文字 - 老照片高光 */
  --fg-muted: color-mix(in srgb, var(--fg-default) 55%, var(--bg-default));
  --fg-inverse: var(--bg-default);
  --surface-default: color-mix(in srgb, var(--bg-default) 97%, var(--brand-primary));
  --surface-elevated: color-mix(in srgb, var(--bg-default) 92%, #3D3429);
  --surface-overlay: color-mix(in srgb, var(--bg-default) 60%, black);
  --border-default: color-mix(in srgb, var(--brand-secondary) 25%, transparent);
  --border-hover: color-mix(in srgb, var(--brand-primary) 50%, transparent);
  --border-active: var(--brand-primary);
  --status-success: #10B981;
  --status-warning: #F59E0B;
  --status-error: #EF4444;
  --status-info: var(--brand-accent);

  /* ===== 组件色 ===== */
  --color-primary: var(--brand-primary);
  --color-primary-fg: var(--bg-default);
  --color-secondary: var(--surface-elevated);
  --color-secondary-fg: var(--fg-default);
  --color-accent: var(--brand-accent);
  --color-accent-fg: var(--bg-default);
  --color-muted: var(--surface-default);
  --color-muted-fg: var(--fg-muted);
  --color-card: var(--surface-default);
  --color-card-fg: var(--fg-default);
  --color-border: var(--border-default);
  --color-input: var(--border-default);
  --color-ring: var(--brand-accent);
  --color-destructive: var(--status-error);
  --color-destructive-fg: var(--fg-default);

  /* ===== 渐变 - 怀旧胶片质感 ===== */
  --gradient-primary: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
  --gradient-surface: linear-gradient(180deg, var(--surface-elevated) 0%, var(--surface-default) 100%);
  --gradient-mesh:
    radial-gradient(at 0% 0%, color-mix(in srgb, var(--brand-primary) 30%, transparent) 0%, transparent 50%),
    radial-gradient(at 100% 0%, color-mix(in srgb, var(--brand-accent) 20%, transparent) 0%, transparent 50%),
    radial-gradient(at 100% 100%, color-mix(in srgb, var(--brand-secondary) 25%, transparent) 0%, transparent 50%),
    radial-gradient(at 0% 100%, color-mix(in srgb, var(--brand-primary) 15%, transparent) 0%, transparent 50%);

  /* ===== 排版 ===== */
  --font-sans: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --font-display: 'Playfair Display', 'Noto Serif SC', serif; /* 衬线体增强复古感 */
  --font-mono: 'JetBrains Mono', monospace;
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */
  --text-6xl: 3.75rem;     /* 60px */
  --text-hero: clamp(2.25rem, 6vw, 4.5rem);
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-black: 900;
  --leading-tight: 1.2;
  --leading-snug: 1.4;
  --leading-normal: 1.7;
  --leading-relaxed: 1.9;

  /* ===== 空间 - 舒适密度 ===== */
  --density: 1.1;
  --space-0: 0;
  --space-1: calc(0.25rem * var(--density));
  --space-2: calc(0.5rem * var(--density));
  --space-3: calc(0.75rem * var(--density));
  --space-4: calc(1rem * var(--density));
  --space-5: calc(1.25rem * var(--density));
  --space-6: calc(1.5rem * var(--density));
  --space-8: calc(2rem * var(--density));
  --space-10: calc(2.5rem * var(--density));
  --space-12: calc(3rem * var(--density));
  --space-16: calc(4rem * var(--density));
  --space-20: calc(5rem * var(--density));
  --space-24: calc(6rem * var(--density));

  /* ===== 导航栏高度配置 ===== */
  --nav-height-mobile: 3.5rem;   /* 56px */
  --nav-height-tablet: 4rem;     /* 64px */
  --nav-height-desktop: 4.5rem;  /* 72px */
  --nav-height: var(--nav-height-mobile);

  /* 安全顶部间距 */
  --safe-top: calc(var(--nav-height) + var(--space-4));
  --safe-top-tablet: calc(var(--nav-height-tablet) + var(--space-6));
  --safe-top-desktop: calc(var(--nav-height-desktop) + var(--space-8));

  /* ===== 形状 - 柔和有机 ===== */
  --radius-none: 0;
  --radius-sm: 0.375rem;   /* 6px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */
  --radius-3xl: 2rem;      /* 32px */
  --radius-full: 9999px;

  /* ===== 动效 - 舒缓柔和 ===== */
  --duration-instant: 0ms;
  --duration-fast: 200ms;
  --duration-normal: 400ms;
  --duration-slow: 600ms;
  --duration-slower: 1000ms;
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-nostalgic: cubic-bezier(0.25, 0.46, 0.45, 0.94); /* 回忆渐显专用 */

  /* ===== 阴影 - 柔和光晕 ===== */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.2);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.35), 0 4px 6px -4px rgb(0 0 0 / 0.25);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.3);
  --glow-sm: 0 0 20px color-mix(in srgb, var(--brand-primary) 25%, transparent);
  --glow-md: 0 0 40px color-mix(in srgb, var(--brand-primary) 35%, transparent);
  --glow-lg: 0 0 60px color-mix(in srgb, var(--brand-primary) 45%, transparent);

  /* ===== 层级 ===== */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal-backdrop: 300;
  --z-modal: 400;
  --z-popover: 500;
  --z-tooltip: 600;

  /* ===== 动态导航配置 ===== */
  --nav-item-count: 4;
  --nav-stagger-delay: 60ms;
  --nav-link-max-width: 200px;
  --dropdown-max-height: 600px;
}

/* ===== 浅色模式适配（老照片褪色效果）===== */
@media (prefers-color-scheme: light) {
  :root {
    --bg-default: #F5F0E8;         /* 暖白底色 */
    --bg-subtle: color-mix(in srgb, var(--bg-default) 98%, var(--brand-primary));
    --bg-hover: color-mix(in srgb, var(--bg-default) 95%, var(--brand-primary));
    --fg-default: #2D2419;         /* 深褐文字 */
    --fg-muted: color-mix(in srgb, var(--fg-default) 55%, var(--bg-default));
    --surface-default: #FAF7F2;
    --surface-elevated: #FFFFFF;
    --border-default: color-mix(in srgb, var(--brand-secondary) 20%, transparent);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
  }
}

/* ===== 减弱动画 ===== */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0.01ms;
    --duration-normal: 0.01ms;
    --duration-slow: 0.01ms;
    --duration-slower: 0.01ms;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== 基础重置 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--safe-top);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-default);
  color: var(--fg-default);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 菜单打开时锁定背景滚动 */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* ===== 页面容器（防遮挡核心）===== */
.page-wrapper {
  padding-top: var(--nav-height);
  width: 100%;
  min-height: 100vh;
  position: relative;
}

/* ===== 按钮系统 - 复古按键质感 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-3) var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--duration-fast) var(--ease-default);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.96);
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-primary-fg);
  box-shadow: var(--glow-sm), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-md), var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.3);
  filter: brightness(1.08);
}

.btn--secondary {
  background: var(--color-secondary);
  color: var(--color-secondary-fg);
  border-color: var(--color-border);
}

.btn--secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.btn--gradient {
  background: var(--gradient-primary);
  color: var(--color-primary-fg);
  position: relative;
  z-index: 1;
}

.btn--gradient::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-mesh);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  filter: blur(8px);
  transition: opacity var(--duration-normal) var(--ease-default);
}

.btn--gradient:hover::before {
  opacity: 0.5;
}

.btn--ghost {
  background: transparent;
  color: var(--fg-default);
  border-color: var(--color-border);
}

.btn--ghost:hover {
  background: var(--surface-default);
  border-color: var(--border-hover);
}

.btn--nostalgic {
  background: var(--brand-secondary);
  color: var(--fg-default);
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.btn--nostalgic:hover {
  background: color-mix(in srgb, var(--brand-secondary) 90%, var(--brand-primary));
  transform: translateY(-2px);
}

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  filter: none !important;
  box-shadow: none !important;
}

/* ===== 标签系统 - 高对比度设计（修改说明：新增标签组件，确保文字可见）===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-default);
}

/* 主标签 - 琥珀背景 + 深色文字（高对比度） */
.tag--primary {
  background: var(--brand-primary);
  color: var(--bg-default); /* 修改说明：使用深色背景色作为文字色，确保对比度 */
  border: 1px solid transparent;
}

.tag--primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* 次要标签 - 半透明背景 + 浅色文字 */
.tag--secondary {
  background: color-mix(in srgb, var(--brand-secondary) 25%, transparent);
  color: var(--fg-default);
  border: 1px solid color-mix(in srgb, var(--brand-secondary) 40%, transparent);
}

.tag--secondary:hover {
  background: color-mix(in srgb, var(--brand-secondary) 35%, transparent);
  border-color: color-mix(in srgb, var(--brand-secondary) 60%, transparent);
}

/* 强调标签 - 橙红背景 + 深色文字 */
.tag--accent {
  background: var(--brand-accent);
  color: var(--bg-default);
  border: 1px solid transparent;
}

/* 轮廓标签 - 透明背景 + 边框 */
.tag--outline {
  background: transparent;
  color: var(--brand-primary);
  border: 1px solid var(--brand-primary);
}

.tag--outline:hover {
  background: color-mix(in srgb, var(--brand-primary) 15%, transparent);
}

/* 柔和标签 - 低对比度用于次要信息 */
.tag--subtle {
  background: var(--surface-elevated);
  color: var(--fg-muted);
  border: 1px solid var(--border-default);
}

/* 年代标签 - 专用样式 */
.tag--era {
  background: color-mix(in srgb, var(--brand-primary) 20%, var(--surface-default));
  color: var(--brand-primary);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 30%, transparent);
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

/* 类别标签 - 专用样式 */
.tag--category {
  background: color-mix(in srgb, var(--brand-secondary) 20%, var(--surface-default));
  color: var(--brand-secondary);
  border: 1px solid color-mix(in srgb, var(--brand-secondary) 30%, transparent);
}

/* 情感标签 - 专用样式 */
.tag--emotion {
  background: color-mix(in srgb, var(--brand-accent) 20%, var(--surface-default));
  color: var(--brand-accent);
  border: 1px solid color-mix(in srgb, var(--brand-accent) 30%, transparent);
}

/* 标签组 */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ===== 卡片系统 - 老照片边框效果 ===== */
.card {
  background: var(--color-card);
  color: var(--color-card-fg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--duration-slow) var(--ease-nostalgic);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 10%, transparent);
  border-radius: calc(var(--radius-xl) - 4px);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), var(--glow-sm);
  border-color: var(--border-hover);
}

.card--glass {
  background: color-mix(in srgb, var(--color-card) 85%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.card--photo {
  background: linear-gradient(145deg, #F5F0E8 0%, #E8E0D5 100%);
  color: var(--fg-inverse);
  border: 8px solid #FFF;
  border-bottom-width: 24px;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
}

.card--photo::before {
  display: none;
}

.card--interactive {
  cursor: pointer;
}

.card--interactive:hover {
  transform: translateY(-6px) rotateX(2deg);
}

/* ===== 导航栏 - 固定定位磨砂玻璃 ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  height: var(--nav-height);
  background: color-mix(in srgb, var(--bg-default) 90%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
}

.navbar__container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar__brand {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.01em;
  text-decoration: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.navbar__brand-icon {
  font-size: var(--text-2xl);
  color: var(--brand-primary);
  -webkit-text-fill-color: initial;
}

/* 移动端菜单按钮 */
.navbar__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: transparent;
  border: none;
  color: var(--fg-default);
  font-size: var(--text-xl);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-default);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.navbar__toggle:hover {
  background: var(--surface-default);
  color: var(--brand-primary);
}

.navbar__toggle:active {
  transform: scale(0.95);
}

/* ===== 导航菜单容器 - 移动端全屏（防闪烁修复版）===== */
.navbar__nav {
  display: flex;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  min-height: calc(100vh - var(--nav-height));
  max-height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  background: color-mix(in srgb, var(--bg-default) 98%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4);
  flex-direction: column;
  gap: var(--space-2);
  list-style: none;

  /* 动画三要素：opacity + visibility + transform */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);

  transition:
    opacity var(--duration-normal) var(--ease-default),
    visibility var(--duration-normal) var(--ease-default),
    transform var(--duration-normal) var(--ease-out);

  pointer-events: none;
  z-index: var(--z-dropdown);
}

.navbar__nav--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: all;
}

/* ===== 动态导航项（级联入场动画）===== */
.navbar__item {
  width: 100%;
  opacity: 0;
  transform: translateX(-10px);
  transition:
    opacity var(--duration-fast) var(--ease-default) calc(var(--item-index, 0) * var(--nav-stagger-delay)),
    transform var(--duration-fast) var(--ease-default) calc(var(--item-index, 0) * var(--nav-stagger-delay));
}

.navbar__nav--open .navbar__item {
  opacity: 1;
  transform: translateX(0);
}

/* 预定义8个菜单项的索引变量 */
.navbar__item:nth-child(1) { --item-index: 0; }
.navbar__item:nth-child(2) { --item-index: 1; }
.navbar__item:nth-child(3) { --item-index: 2; }
.navbar__item:nth-child(4) { --item-index: 3; }
.navbar__item:nth-child(5) { --item-index: 4; }
.navbar__item:nth-child(6) { --item-index: 5; }
.navbar__item:nth-child(7) { --item-index: 6; }
.navbar__item:nth-child(8) { --item-index: 7; }

/* 导航链接 - 长文字截断处理 */
.navbar__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  color: var(--fg-default);
  text-decoration: none;
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-default);
  min-height: 48px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar__link:hover, .navbar__link--active {
  color: var(--color-primary);
  background: var(--surface-default);
}

.navbar__icon {
  width: 20px;
  text-align: center;
  color: var(--fg-muted);
  transition: color var(--duration-fast) var(--ease-default);
  flex-shrink: 0;
}

.navbar__link:hover .navbar__icon,
.navbar__link--active .navbar__icon {
  color: var(--color-primary);
}

/* CTA按钮容器（移动端底部） */
.navbar__cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity var(--duration-fast) var(--ease-default) calc(var(--nav-item-count) * var(--nav-stagger-delay)),
    transform var(--duration-fast) var(--ease-default) calc(var(--nav-item-count) * var(--nav-stagger-delay));
}

.navbar__nav--open .navbar__cta {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Hero区域 - 怀旧氛围 ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--safe-top) var(--space-4) var(--space-24);
  overflow: hidden;
  background: var(--bg-default);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-mesh);
  opacity: 0.4;
  animation: mesh-shift 30s linear infinite;
}

/* 老照片颗粒感叠加 */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.hero__content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 800px;
  animation: fade-in-up var(--duration-slower) var(--ease-nostalgic) both;
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-6);
  background: linear-gradient(135deg, var(--fg-default) 0%, var(--brand-primary) 50%, var(--brand-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--brand-primary);
  margin-bottom: var(--space-4);
  font-style: italic;
}

.hero__description {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--fg-muted);
  margin-bottom: var(--space-8);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== 输入框 - 复古信纸质感 ===== */
.input {
  width: 100%;
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-default);
  border: 1px solid var(--color-input);
  border-radius: var(--radius-lg);
  color: var(--fg-default);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  outline: none;
  transition: all var(--duration-fast) var(--ease-default);
}

.input::placeholder {
  color: var(--fg-muted);
  font-style: italic;
}

.input:focus {
  border-color: var(--color-ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-ring) 20%, transparent), var(--glow-sm);
  transform: translateY(-1px);
}

.input--nostalgic {
  background: linear-gradient(180deg, #FAF7F2 0%, #F5F0E8 100%);
  color: var(--fg-inverse);
  border-color: var(--brand-secondary);
  font-family: var(--font-display);
}

/* ===== 骨架屏 - 老照片显影效果 ===== */
.skeleton {
  background: linear-gradient(90deg, var(--color-muted) 25%, color-mix(in srgb, var(--brand-primary) 15%, var(--color-muted)) 50%, var(--color-muted) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-md);
  animation: photo-develop var(--duration-slower) ease-in-out infinite;
}

/* ===== 弹窗 ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--surface-overlay);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-default);
}

.modal-backdrop--open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: color-mix(in srgb, var(--color-card) 95%, transparent);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-2xl);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-xl), var(--glow-md);
  padding: var(--space-8);
  max-width: 90%;
  width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: var(--z-modal);
  opacity: 0;
  pointer-events: none;
  transition: all var(--duration-normal) var(--ease-bounce);
}

.modal-backdrop--open .modal {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

/* ===== 页脚 - 复古印章风格 ===== */
.footer {
  position: relative;
  margin-top: auto;
  padding: var(--space-16) var(--space-4) var(--space-8);
  background: var(--surface-default);
  border-top: 1px solid var(--color-border);
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
}

.footer__container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.footer__top {
  display: grid;
  gap: var(--space-8);
  margin-bottom: var(--space-10);
}

.footer__brand {
  max-width: 300px;
}

.footer__logo {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.footer__description {
  color: var(--fg-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.footer__social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.footer__social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--surface-elevated);
  color: var(--fg-muted);
  transition: all var(--duration-fast) var(--ease-default);
  text-decoration: none;
}

.footer__social-link:hover {
  background: var(--brand-primary);
  color: var(--bg-default);
  transform: translateY(-2px);
}

.footer__columns {
  display: grid;
  gap: var(--space-8);
}

.footer__column-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--fg-default);
  margin-bottom: var(--space-4);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__link {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: all var(--duration-fast) var(--ease-default);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.footer__link:hover {
  color: var(--brand-primary);
  transform: translateX(4px);
}

.footer__link-icon {
  font-size: var(--text-xs);
  opacity: 0.6;
}

.footer__bottom {
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
  text-align: center;
}

.footer__copyright {
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

.footer__legal {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
}

.footer__legal-link {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: var(--text-xs);
  transition: color var(--duration-fast) var(--ease-default);
}

.footer__legal-link:hover {
  color: var(--brand-primary);
}

/* ===== 动画关键帧 ===== */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pop-in {
  0% { opacity: 0; transform: scale(0.9); }
  70% { transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes photo-develop {
  0% { background-position: 200% 0; opacity: 0.6; }
  50% { opacity: 1; }
  100% { background-position: -200% 0; opacity: 0.6; }
}

@keyframes mesh-shift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(2%, 2%) scale(1.05); }
  50% { transform: translate(-1%, 3%) scale(1); }
  75% { transform: translate(3%, -2%) scale(1.02); }
}

@keyframes wiggle {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px) rotate(-1deg); }
  75% { transform: translateX(4px) rotate(1deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

/* ===== 工具类 ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* 二级菜单父项定位上下文 */
.navbar__item--has-dropdown {
  position: relative;
}

/* ===== 响应式优化（平板及以上）===== */
@media (min-width: 768px) {
  :root {
    --nav-height: var(--nav-height-tablet);
    --safe-top: var(--safe-top-tablet);
    --nav-link-max-width: 250px;
  }

  /* PC端二级菜单悬停桥接技术 */
  .navbar__item--has-dropdown {
    padding-bottom: 20px;
    margin-bottom: -20px;
  }

  /* PC端二级菜单 - CSS Grid动态高度 */
  .navbar__item--has-dropdown .navbar__dropdown {
    display: grid;
    grid-template-rows: 0fr;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--surface-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition:
      grid-template-rows var(--duration-fast) var(--ease-out),
      opacity var(--duration-fast) var(--ease-out),
      visibility var(--duration-fast) var(--ease-out),
      transform var(--duration-fast) var(--ease-out),
      padding var(--duration-fast) var(--ease-out);
    z-index: var(--z-dropdown);
    pointer-events: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  /* 右侧溢出自动左对齐 */
  .navbar__item--has-dropdown .navbar__dropdown--right {
    left: auto;
    right: 0;
  }

  .navbar__dropdown-inner {
    overflow: hidden;
    min-height: 0;
  }

  /* 悬停桥接伪元素 */
  .navbar__item--has-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
    z-index: var(--z-dropdown);
  }

  /* 悬停展开Grid */
  .navbar__item--has-dropdown:hover .navbar__dropdown,
  .navbar__item--has-dropdown:focus-within .navbar__dropdown {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    padding: var(--space-2);
  }

  /* 二级菜单项 */
  .navbar__dropdown-item {
    display: block;
    padding: var(--space-3) var(--space-4);
    color: var(--fg-default);
    text-decoration: none;
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-default);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
  }

  .navbar__dropdown-item:hover,
  .navbar__dropdown-item:focus {
    background: var(--bg-hover);
    color: var(--color-primary);
  }

  /* 导航栏平板端样式 */
  .navbar {
    padding: 0 var(--space-6);
  }

  .navbar__toggle {
    display: none;
  }

  .navbar__nav {
    display: flex !important;
    position: static;
    flex-direction: row;
    background: transparent;
    backdrop-filter: none;
    border: none;
    padding: 0;
    gap: var(--space-6);
    margin-left: auto;
    margin-right: var(--space-6);
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: all;
    width: auto;
    min-height: auto;
    max-height: none;
    overflow-y: visible;
  }

  .navbar__item {
    width: auto;
    opacity: 1;
    transform: none;
    transition: none;
    --item-index: 0 !important;
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .navbar__link {
    width: auto;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    position: relative;
    min-height: auto;
    max-width: none;
  }

  .navbar__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--duration-normal) var(--ease-default);
  }

  .navbar__link:hover::after,
  .navbar__link--active::after {
    width: 80%;
  }

  .navbar__cta {
    display: flex;
    flex-direction: row;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    opacity: 1;
    transform: none;
    gap: var(--space-3);
  }

  /* 页脚平板端 */
  .footer__top {
    grid-template-columns: 1fr 2fr;
  }

  .footer__columns {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .hero {
    padding: var(--safe-top) var(--space-6) var(--space-24);
  }
}

/* ===== 响应式优化（桌面端）===== */
@media (min-width: 1024px) {
  :root {
    --nav-height: var(--nav-height-desktop);
    --safe-top: var(--safe-top-desktop);
  }

  .navbar {
    padding: 0 var(--space-8);
  }

  .navbar__nav {
    gap: var(--space-8);
  }

  .navbar__dropdown {
    min-width: 240px;
  }

  .footer__top {
    grid-template-columns: 280px 1fr;
    gap: var(--space-12);
  }

  .footer__columns {
    grid-template-columns: repeat(4, 1fr);
  }

  .container {
    padding: 0 var(--space-8);
  }

  .hero {
    padding: var(--safe-top) var(--space-8) var(--space-24);
  }
}

/* ===== 小屏手机优化 ===== */
@media (max-width: 767px) {
  /* 移动端二级菜单 - Grid动画 + 垂直排列 */
  .navbar__item--has-dropdown .navbar__dropdown {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--duration-normal) var(--ease-default);
    margin-left: var(--space-4);
    margin-top: var(--space-2);
  }

  .navbar__item--has-dropdown.expanded .navbar__dropdown {
    grid-template-rows: 1fr;
  }

  .navbar__dropdown-inner {
    overflow: hidden;
    min-height: 0;
  }

  /* 强制垂直排列 */
  .navbar__dropdown-item {
    display: block;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    color: var(--fg-default);
    text-decoration: none;
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
    transition: background var(--duration-fast) var(--ease-default);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .navbar__dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--color-primary);
  }

  /* 移动端分组折叠 */
  .navbar__nav--mobile .navbar__item--group {
    font-weight: var(--font-bold);
    padding: var(--space-4) var(--space-4) var(--space-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .navbar__nav--mobile .navbar__item--group::after {
    content: '▼';
    font-size: var(--text-sm);
    transition: transform var(--duration-fast) var(--ease-default);
  }

  .navbar__nav--mobile .navbar__item--group.expanded::after {
    transform: rotate(180deg);
  }

  .navbar__nav--mobile .navbar__group-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--duration-normal) var(--ease-default);
    margin-left: var(--space-4);
    overflow: hidden;
  }

  .navbar__nav--mobile .navbar__item--group.expanded .navbar__group-content {
    grid-template-rows: 1fr;
  }

  /* 小屏优化 */
  .navbar__item {
    --nav-stagger-delay: 30ms;
  }

  :root {
    --density: calc(1.1 * 0.9);
    --nav-link-max-width: 150px;
  }

  .hero__description {
    font-size: var(--text-base);
  }

  .modal {
    width: 95%;
    padding: var(--space-6);
  }

  .footer__top,
  .footer__columns {
    grid-template-columns: 1fr;
  }
}

/* ===== 导航项过多分组方案 ===== */
@media (min-width: 768px) {
  .navbar__nav:not(.navbar__nav--mobile) > .navbar__item:nth-child(n+7) {
    display: none;
  }

  .navbar__nav:not(.navbar__nav--mobile) .navbar__more-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
    color: var(--fg-default);
    font-size: var(--text-xl);
    background: var(--surface-default);
    margin-left: var(--space-2);
    padding-bottom: 20px;
    margin-bottom: -20px;
  }

  .navbar__more-trigger:hover {
    background: var(--bg-hover);
    box-shadow: var(--shadow-md);
  }

  .navbar__dropdown--more {
    right: 0;
    left: auto;
    min-width: 280px;
    max-width: 320px;
  }

  .navbar__dropdown-group {
    font-weight: var(--font-bold);
    padding: var(--space-2) var(--space-4);
    color: var(--fg-muted);
    font-size: var(--text-xs);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: var(--space-2);
    border-bottom: 1px solid var(--border-default);
    margin-bottom: var(--space-2);
  }

  .navbar__dropdown-group:first-of-type {
    margin-top: 0;
  }
}

/* ===== 搜索功能 ===== */
.navbar__search {
  display: none;
  margin-left: auto;
  margin-right: var(--space-4);
}

@media (min-width: 768px) {
  .navbar__search {
    display: block;
  }
}

.navbar__search-input {
  width: 200px;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-default);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--fg-default);
  font-size: var(--text-sm);
  transition: all var(--duration-fast) var(--ease-default);
}

.navbar__search-input:focus {
  border-color: var(--color-ring);
  box-shadow: var(--glow-sm);
  width: 250px;
}

/* ===== Tooltip 样式 ===== */
.tooltip {
  position: relative;
}

.tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-elevated);
  color: var(--fg-default);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  white-space: nowrap;
  z-index: var(--z-tooltip);
  box-shadow: var(--shadow-md);
  pointer-events: none;
  border: 1px solid var(--border-default);
}

.navbar__link[title] {
  position: relative;
}

/* ===== Max-Height备选方案 ===== */
.navbar__dropdown--maxheight {
  display: block;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-fast) var(--ease-out),
              opacity var(--duration-fast) var(--ease-out),
              visibility var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out),
              padding var(--duration-fast) var(--ease-out);
}

.navbar__item--has-dropdown:hover .navbar__dropdown--maxheight,
.navbar__item--has-dropdown:focus-within .navbar__dropdown--maxheight {
  max-height: var(--dropdown-max-height);
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  padding: var(--space-2);
}

/* ===== 回忆生成相关组件 ===== */
.memory-input {
  position: relative;
  background: var(--surface-elevated);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  border: 1px solid var(--color-border);
}

.memory-input__field {
  width: 100%;
  min-height: 120px;
  background: transparent;
  border: none;
  color: var(--fg-default);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  resize: vertical;
  outline: none;
}

.memory-input__field::placeholder {
  color: var(--fg-muted);
  font-style: italic;
}

.memory-input__hint {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

.memory-input__hint-icon {
  color: var(--brand-primary);
}

/* 风格选择器 - 复古拨盘 */
.style-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .style-selector {
    grid-template-columns: repeat(4, 1fr);
  }
}

.style-option {
  position: relative;
  padding: var(--space-4);
  background: var(--surface-default);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  text-align: center;
}

.style-option:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.style-option--active {
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 10%, var(--surface-default));
}

.style-option__icon {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-2);
  color: var(--brand-primary);
}

.style-option__label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--fg-default);
}

.style-option__desc {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  margin-top: var(--space-1);
}

/* 生成进度 - 老电视调频效果 */
.generating {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: var(--space-8);
}

.generating__screen {
  width: 280px;
  height: 200px;
  background: #0a0a0f;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  border: 4px solid var(--brand-secondary);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.generating__static {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.3;
  animation: static-flicker 0.1s steps(2) infinite;
}

.generating__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--brand-primary);
  transform-origin: left;
  animation: progress-grow 3s var(--ease-nostalgic) forwards;
}

.generating__text {
  margin-top: var(--space-6);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--brand-primary);
  text-align: center;
}

.generating__subtext {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

@keyframes static-flicker {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.4; }
}

@keyframes progress-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* 回忆卡片网格 */
.memory-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .memory-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .memory-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.memory-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface-default);
  border: 1px solid var(--color-border);
  transition: all var(--duration-slow) var(--ease-nostalgic);
}

.memory-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl), var(--glow-sm);
}

.memory-card__image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  filter: sepia(20%) contrast(1.05);
  transition: filter var(--duration-slow) var(--ease-default);
}

.memory-card:hover .memory-card__image {
  filter: sepia(10%) contrast(1.1);
}

.memory-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(26, 22, 18, 0.9) 100%);
  pointer-events: none;
}

.memory-card__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4);
}

.memory-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--fg-default);
  margin-bottom: var(--space-1);
}

/* 修改说明：更新标签样式，使用新的.tag系统确保对比度 */
.memory-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--fg-muted);
  flex-wrap: wrap;
}

/* 修改说明：移除旧的年代标签样式，统一使用.tag系统 */
.memory-card__era {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  background: color-mix(in srgb, var(--brand-primary) 20%, transparent);
  border-radius: var(--radius-full);
  color: var(--brand-primary);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
}

.memory-card__emotion {
  display: flex;
  gap: var(--space-1);
}

.memory-card__emotion-star {
  color: var(--brand-primary);
}

.memory-card__emotion-star--empty {
  color: var(--fg-muted);
  opacity: 0.3;
}

/* 修改说明：在卡片内容区应用标签样式 */
.memory-card .tag {
  margin-right: var(--space-1);
  margin-bottom: var(--space-1);
}