/**
 * 火彩商城 - 全局样式
 * Apple Store 风格设计系统
 */

/* ===== CSS 变量定义 ===== */
:root {
  /* 品牌颜色 */
  --color-primary: #0066CC;
  --color-primary-dark: #0052A3;
  --color-primary-light: #007AFF;
  --color-primary-gradient: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);

  /* 背景颜色 */
  --color-bg: #F5F5F7;
  --color-bg-white: #FFFFFF;
  --color-bg-secondary: #FAFAFA;

  /* 文字颜色 */
  --color-text-primary: #1D1D1F;
  --color-text-secondary: #424245;
  --color-text-muted: #6E6E73;
  --color-text-light: #86868B;

  /* 边框颜色 */
  --color-border: rgba(0, 0, 0, 0.08);
  --color-border-light: rgba(0, 0, 0, 0.05);
  --color-border-medium: rgba(0, 0, 0, 0.12);

  /* 功能颜色 */
  --color-success: #34C759;
  --color-success-bg: #D1E7DD;
  --color-warning: #FF9500;
  --color-warning-bg: #FFF3CD;
  --color-error: #FF3B30;
  --color-error-bg: #F8D7DA;
  --color-info: #5AC8FA;
  --color-info-bg: #CFE2FF;

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.16);

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* 间距 */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 20px;
  --spacing-2xl: 24px;
  --spacing-3xl: 32px;
  --spacing-4xl: 40px;

  /* 导航高度 */
  --nav-height: 56px;
  --nav-height-desktop: 56px;
  --notice-height: 44px;
  --status-height: 42px;

  /* 字体 */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  --font-size-xs: 11px;
  --font-size-sm: 13px;
  --font-size-base: 15px;
  --font-size-md: 17px;
  --font-size-lg: 20px;
  --font-size-xl: 24px;
  --font-size-2xl: 32px;
  --font-size-3xl: 40px;
}

/* ===== 全局重置 ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* ===== 链接样式 ===== */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
  cursor: pointer;
}

a:hover {
  color: var(--color-primary-dark);
}

a:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===== 标题样式 ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--spacing-md) 0;
  color: var(--color-text-primary);
}

h1 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
}

h2 {
  font-size: var(--font-size-xl);
}

h3 {
  font-size: var(--font-size-lg);
}

h4 {
  font-size: var(--font-size-md);
}

h5 {
  font-size: var(--font-size-base);
}

h6 {
  font-size: var(--font-size-sm);
}

/* ===== 段落和文本 ===== */
p {
  margin: 0 0 var(--spacing-md) 0;
  line-height: 1.6;
}

/* 次要文本 */
.text-muted {
  color: var(--color-text-muted);
}

.text-secondary {
  color: var(--color-text-secondary);
}

.text-light {
  color: var(--color-text-light);
}

/* ===== 图片 ===== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== 容器 ===== */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.container-narrow {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.container-wide {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* ===== 页面布局容器 ===== */
.layout-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 网站头部 */
.site-header {
  width: 100%;
  flex-shrink: 0;
}

/* 主内容区 */
.site-main {
  flex: 1;
  width: 100%;
  padding-top: var(--nav-height);
}

.content-container {
  width: 100%;
  max-width: var(--container-2xl);
  margin: 0 auto;
  padding: var(--space-6);
}

/* 有侧边栏时的布局 */
.layout-content.has-sidebar-first,
.layout-content.has-sidebar-second {
  max-width: calc(100% - 280px);
}

.layout-sidebar-first,
.layout-sidebar-second {
  width: 260px;
  flex-shrink: 0;
}

/* 页脚 */
.site-footer {
  width: 100%;
  flex-shrink: 0;
  margin-top: auto;
  padding: var(--space-12) 0 var(--space-8);
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
}

/* 底部版权和语言选择 */
.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-6);
  overflow: hidden;
}

.footer-copyright {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.footer-copyright-bottom {
  margin-top: var(--space-4);
  margin-bottom: 0;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.footer-legal a {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  text-decoration: none;
  white-space: nowrap;
}

.footer-legal a:hover {
  color: var(--color-primary);
}

.footer-legal span {
  color: var(--color-text-light);
}

/* 语言选择器 */
.language-selector {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  margin-bottom: var(--space-3);
}

.language-button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all var(--transition-base) var(--ease-out);
  white-space: nowrap;
}

.language-button:hover {
  border-color: var(--color-text-muted);
}

.language-button:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.language-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.language-dropdown {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: var(--space-2);
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  z-index: var(--z-dropdown);
  width: max-content;
  max-width: 300px;
}

.language-dropdown.show {
  display: block;
}

.language-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-primary);
  text-decoration: none;
  transition: background-color var(--transition-base) var(--ease-out);
}

.language-option:first-child {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.language-option:last-child {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.language-option:hover {
  background: var(--color-bg-tertiary);
}

.language-option.active {
  background: var(--color-bg-secondary);
  color: var(--color-primary);
  font-weight: 500;
  pointer-events: none;
  cursor: default;
}

.language-option:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
  z-index: 1;
}

.language-flag {
  font-size: 16px;
  line-height: 1;
}

/* 备案信息和营业执照 */
.footer-filing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.filing-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition-base) var(--ease-out);
}

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

.filing-divider {
  color: var(--color-text-light);
}

.beian-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.license-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* 移动端语言选择器优化 */
@media (max-width: 767px) {
  .language-dropdown {
    position: fixed;
    bottom: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 48px);
    max-width: 320px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  }

  .footer-filing {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .filing-divider {
    display: none;
  }
}

/* 移动端底部导航 */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--color-border);
  z-index: var(--z-sticky, 100);
  padding: var(--space-3) var(--space-4);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-decoration: none;
  color: var(--color-text-secondary);
  transition: color var(--transition-base) var(--ease-out);
  position: relative;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.bottom-nav-item:hover,
.bottom-nav-item:focus {
  color: var(--color-primary);
}

.bottom-nav-item:focus {
  outline: none;
}

.bottom-nav-item.active {
  color: var(--color-primary);
}

.bottom-nav-icon {
  width: 24px;
  height: 24px;
  margin-bottom: var(--space-1);
  flex-shrink: 0;
}

.bottom-nav-label {
  font-size: 10px;
  line-height: 1.2;
  font-weight: var(--font-normal);
}

.bottom-nav-item-cart {
  position: relative;
}

.bottom-nav-badge,
.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #FF9900;
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 当数量为0时隐藏徽章 */
.bottom-nav-badge:empty,
.cart-badge:empty {
  display: none;
}

/* 底部导航栏徽章特殊样式 - 向左移动更靠近图标 */
.bottom-nav-item-cart .bottom-nav-badge,
.bottom-nav-item-cart .cart-badge {
  transform: translate(-14px, -5px);
}

/* 底部留白 */
.bottom-nav-spacer {
  display: none;
  height: 56px;
}

/* ===== 底部导航动画效果 ===== */

/* 图片样式支持 */
.bottom-nav-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* 脉冲动画 - 图标轻微放大缩小 */
@keyframes bottom-nav-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

.bottom-nav-icon--pulse,
.bottom-nav-item--pulse .bottom-nav-icon {
  animation: bottom-nav-pulse 2s ease-in-out infinite;
}

/* 弹跳动画 - 图标上下弹跳 */
@keyframes bottom-nav-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.bottom-nav-icon--bounce,
.bottom-nav-item--bounce .bottom-nav-icon {
  animation: bottom-nav-bounce 1.5s ease-in-out infinite;
}

/* 旋转动画 - 图标旋转 */
@keyframes bottom-nav-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.bottom-nav-icon--rotate,
.bottom-nav-item--rotate .bottom-nav-icon {
  animation: bottom-nav-rotate 3s linear infinite;
}

/* 摇晃动画 - 图标左右摇晃 */
@keyframes bottom-nav-shake {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-10deg);
  }
  75% {
    transform: rotate(10deg);
  }
}

.bottom-nav-icon--shake,
.bottom-nav-item--shake .bottom-nav-icon {
  animation: bottom-nav-shake 0.8s ease-in-out infinite;
}

/* 闪烁动画 - 图标透明度变化 */
@keyframes bottom-nav-blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.bottom-nav-icon--blink,
.bottom-nav-item--blink .bottom-nav-icon {
  animation: bottom-nav-blink 1.2s ease-in-out infinite;
}

/* 呼吸动画 - 图标类似呼吸效果 */
@keyframes bottom-nav-breath {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.bottom-nav-icon--breath,
.bottom-nav-item--breath .bottom-nav-icon {
  animation: bottom-nav-breath 2.5s ease-in-out infinite;
}

/* 波浪动画 - 图标波浪式移动 */
@keyframes bottom-nav-wave {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-3px) rotate(-5deg);
  }
  50% {
    transform: translateY(-5px) rotate(0deg);
  }
  75% {
    transform: translateY(-3px) rotate(5deg);
  }
}

.bottom-nav-icon--wave,
.bottom-nav-item--wave .bottom-nav-icon {
  animation: bottom-nav-wave 2s ease-in-out infinite;
}

/* 弹簧动画 - 图标弹性跳动 */
@keyframes bottom-nav-spring {
  0%, 100% {
    transform: scale(1) translateY(0);
  }
  10% {
    transform: scale(1.1) translateY(-2px);
  }
  30% {
    transform: scale(0.95) translateY(1px);
  }
  50% {
    transform: scale(1.05) translateY(-1px);
  }
  70% {
    transform: scale(0.98) translateY(0.5px);
  }
  90% {
    transform: scale(1.02) translateY(-0.5px);
  }
}

.bottom-nav-icon--spring,
.bottom-nav-item--spring .bottom-nav-icon {
  animation: bottom-nav-spring 1.8s ease-in-out infinite;
}

/* 发光动画 - 图标发光效果 */
@keyframes bottom-nav-glow {
  0%, 100% {
    filter: drop-shadow(0 0 2px rgba(0, 102, 204, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 8px rgba(0, 102, 204, 0.9));
  }
}

.bottom-nav-icon--glow,
.bottom-nav-item--glow .bottom-nav-icon {
  animation: bottom-nav-glow 2s ease-in-out infinite;
}

/* 悬浮动画 - 图标轻微上下浮动 */
@keyframes bottom-nav-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.bottom-nav-icon--float,
.bottom-nav-item--float .bottom-nav-icon {
  animation: bottom-nav-float 3s ease-in-out infinite;
}

/* 组合动画 - 悬浮+发光 */
@keyframes bottom-nav-magic {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 0 3px rgba(0, 102, 204, 0.6));
  }
  50% {
    transform: translateY(-5px) scale(1.08);
    filter: drop-shadow(0 0 10px rgba(0, 102, 204, 1));
  }
}

.bottom-nav-icon--magic,
.bottom-nav-item--magic .bottom-nav-icon {
  animation: bottom-nav-magic 2.5s ease-in-out infinite;
}

/* 激活状态下的动画增强 */
.bottom-nav-item.active .bottom-nav-icon {
  animation-duration: 1.5s;
}

/* 悬停状态下的动画增强（桌面端） */
@media (hover: hover) {
  .bottom-nav-item:hover .bottom-nav-icon {
    animation-duration: 0.8s;
  }
}

/* 减少动画效果 - 尊重用户偏好 */
@media (prefers-reduced-motion: reduce) {
  .bottom-nav-icon,
  .bottom-nav-item .bottom-nav-icon {
    animation: none !important;
  }
}

/* 移动端显示底部导航 */
@media (max-width: 767px) {
  .bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
  }

  .bottom-nav-spacer {
    display: block;
  }

  /* 调整页面底部内边距，避免内容被底部导航遮挡 */
  body {
    padding-bottom: 56px;
  }

  /* 当购物车模态框打开时，隐藏底部导航栏 */
  body.cart-modal-open .bottom-nav {
    display: none !important;
  }

  body.cart-modal-open .bottom-nav-spacer {
    display: none !important;
  }

  body.cart-modal-open {
    padding-bottom: 0 !important;
  }
}

/* 面包屑区域 */
.breadcrumb-container {
  width: 100%;
  padding: var(--space-4) 0;
  background: var(--color-bg-white);
  border-bottom: 1px solid var(--color-border);
}

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

/* 高亮区域 */
.highlighted-wrapper {
  width: 100%;
  padding: var(--space-4) 0;
}

.highlighted-wrapper .container {
  padding: 0 var(--space-6);
}

/* 帮助区域 */
.help-wrapper {
  width: 100%;
  padding: var(--space-4) 0;
  background: var(--color-info-bg);
}

.help-wrapper .container {
  padding: 0 var(--space-6);
}

/* 内容布局 */
.layout-content {
  width: 100%;
  flex: 1;
}

.content-container {
  display: flex;
  gap: var(--space-8);
  align-items: flex-start;
}

/* 侧边栏 */
.sidebar-content {
  padding: var(--space-6);
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* 跳转到主内容链接 */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  z-index: 9999;
}

.skip-to-content:focus {
  top: 0;
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base) var(--ease-out);
  box-shadow: var(--shadow-md);
  z-index: var(--z-back-to-top);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
  color: var(--color-text-primary);
  transition: color var(--transition-base);
}

.back-to-top:hover svg {
  color: white;
}

/* 当底部导航栏显示时，返回顶部按钮向上移动 */
@media (max-width: 767px) {
  .back-to-top {
    bottom: calc(var(--space-6) + 60px); /* 24px + 底部导航栏高度 */
  }
}

/* ===== 布局工具 ===== */
.content-wrapper {
  padding-top: calc(var(--nav-height) + var(--spacing-lg));
  min-height: 100vh;
}

/* 当有通知栏时 */
body.has-notice .content-wrapper {
  padding-top: calc(var(--nav-height) + var(--notice-height) + var(--spacing-lg));
}

body.has-notice.has-status .content-wrapper {
  padding-top: calc(var(--nav-height) + var(--notice-height) + var(--status-height) + var(--spacing-lg));
}

/* ===== 卡片样式 ===== */
.card {
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: scale(1.01);
}

.card-clickable {
  cursor: pointer;
}

.card-clickable:hover {
  box-shadow: var(--shadow-lg);
  transform: scale(1.02);
}

/* ===== 按钮样式 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 10px 20px;
  font-size: var(--font-size-base);
  font-weight: 500;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg);
  border-color: var(--color-border-medium);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
}

.btn-ghost:hover {
  background: rgba(0, 102, 204, 0.08);
}

.btn-large {
  padding: 14px 32px;
  font-size: var(--font-size-md);
}

.btn-small {
  padding: 6px 16px;
  font-size: var(--font-size-sm);
}

/* ===== 表单元素 ===== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  color: var(--color-text-primary);
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-light);
}

/* ===== 工具类 ===== */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hidden {
  display: none !important;
}

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

/* ===== 分隔线 ===== */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--spacing-xl) 0;
}

/* ===== 徽章 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: var(--font-size-xs);
  font-weight: 500;
  border-radius: var(--radius-full);
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

.badge-primary {
  background: var(--color-primary);
  color: white;
}

.badge-success {
  background: var(--color-success);
  color: white;
}

.badge-warning {
  background: var(--color-warning);
  color: white;
}

.badge-error {
  background: var(--color-error);
  color: white;
}

/* ===== 响应式间距 ===== */
@media (min-width: 768px) {
  :root {
    --spacing-md: 16px;
    --spacing-lg: 20px;
    --spacing-xl: 24px;
    --spacing-2xl: 32px;
    --spacing-3xl: 40px;
    --spacing-4xl: 48px;
  }

  .container {
    padding: 0 var(--spacing-lg);
  }

  h1 {
    font-size: 40px;
  }

  h2 {
    font-size: 32px;
  }

  h3 {
    font-size: 24px;
  }

  .content-wrapper {
    padding-top: calc(var(--nav-height-desktop) + var(--spacing-xl));
  }

  body.has-notice .content-wrapper {
    padding-top: calc(var(--nav-height-desktop) + var(--notice-height) + var(--spacing-xl));
  }

  body.has-notice.has-status .content-wrapper {
    padding-top: calc(var(--nav-height-desktop) + var(--notice-height) + var(--status-height) + var(--spacing-xl));
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--spacing-xl);
  }
}

/* ===== 无障碍优化 ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 跳转到主内容链接 */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: 8px 16px;
  z-index: 10000;
  transition: top 0.3s;
}

.skip-to-content:focus {
  top: 0;
}


/* ===== 模态框样式（与登录模态框统一）===== */
.huocaimall-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.huocaimall-modal.modal-open {
  display: block;
  opacity: 1;
}

.modal-container {
  background: white;
  border-radius: 0 0 20px 20px;
  max-width: 450px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.huocaimall-modal.modal-open .modal-container {
  transform: translateY(0);
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #F5F5F7;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.modal-back-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #F5F5F7;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.modal-back-btn:hover {
  background: #E8E8ED;
}

.modal-back-btn svg {
  width: 20px;
  height: 20px;
}

.modal-title {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  color: #1D1D1F;
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  color: #6E6E73;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.modal-close:hover {
  background: #F5F5F7;
  color: #1D1D1F;
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  color: #1D1D1F;
  line-height: 1.6;
}

/* 模态框内容样式 */
.modal-content p {
  margin: 0 0 12px 0;
}

.modal-content p:last-child {
  margin-bottom: 0;
}

.modal-content ul,
.modal-content ol {
  margin: 0 0 12px 0;
  padding-left: 24px;
}

.modal-content li {
  margin-bottom: 4px;
}

.modal-content a {
  color: #0066CC;
  text-decoration: none;
}

.modal-content a:hover {
  text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 640px) {
  .modal-container {
    max-width: 100%;
  }

  .modal-header,
  .modal-content {
    padding: 16px;
  }

  .modal-title {
    font-size: 16px;
  }
}

/* 动画减少 */
@media (prefers-reduced-motion: reduce) {
  .huocaimall-modal,
  .modal-container {
    transition: none;
  }
}

/* ===== 导航菜单模态框 ===== */
.huocaimall-menu-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.huocaimall-menu-modal.modal-open {
  display: block;
  opacity: 1;
}

.huocaimall-menu-modal .modal-container {
  background: white;
  border-radius: 0 0 20px 20px;
  max-width: 450px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.huocaimall-menu-modal.modal-open .modal-container {
  transform: translateY(0);
}

/* ===== 导航菜单列表 ===== */
.menu-navigation {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  color: #1D1D1F;
  text-decoration: none;
  border-bottom: 1px solid #F5F5F7;
  transition: background 0.2s ease;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:hover,
.menu-item:focus {
  background: #F5F5F7;
  outline: none;
}

.menu-item:focus {
  background: #E8E8ED;
}

.menu-item-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1D1D1F;
}

.menu-item-icon svg {
  width: 24px;
  height: 24px;
}

.menu-item-label {
  flex: 1;
  font-size: 17px;
  font-weight: 500;
}

.menu-item-arrow {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6E6E73;
}

.menu-item-arrow svg {
  width: 20px;
  height: 20px;
}

/* 响应式设计 */
@media (max-width: 640px) {
  .huocaimall-menu-modal .modal-container {
    max-width: 100%;
  }

  .menu-item {
    padding: 14px 16px;
  }

  .menu-item-label {
    font-size: 16px;
  }
}

/* ===== 底部导航图片占满模式 ===== */

/* 图片占满时隐藏标签 */
.bottom-nav-item--image-only .bottom-nav-label {
  display: none;
}

/* 大图片样式 */
.bottom-nav-icon--large {
  width: 36px !important;
  height: 36px !important;
}

/* 图片占满模式的布局调整 */
.bottom-nav-item--image-only {
  padding: 10px;
  justify-content: center;
}

.bottom-nav-item--image-only .bottom-nav-icon {
  margin: 0;
}

/* 图片占满模式下的动画应用到大图片 */
.bottom-nav-item--image-only .bottom-nav-icon--large {
  animation-duration: 2s;
}
