/*
 * 诅咒之岛交易平台 - 全局样式
 * 基于紫色渐变现代设计风格
 * 版本: 3.0
 */

/* CSS变量定义 */
:root {
  /* 主色板 */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.1);
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  
  /* 功能色 */
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.1);
  --info: #3b82f6;
  --info-light: rgba(59, 130, 246, 0.1);
  
  /* 中性色 */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* 背景和文字 */
  --bg: #f5f5f7;
  --white: #ffffff;
  --text: #1f2937;
  --text-secondary: #6b7280;
  
  /* 圆角 */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  
  /* 底部导航高度 */
  --nav-height: 70px;
}

/* 重置和基础 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: var(--nav-height);
}

/* 页面过渡动画 */

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

/* 导航栏 */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  margin-right: 10px;
  background: var(--primary-gradient);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  overflow: hidden;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
}

.nav-links a {
  margin-right: 16px;
  color: var(--gray-600);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:last-child {
  margin-right: 0;
}

.nav-links a:hover {
  color: var(--primary);
}

/* 主容器 */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
}

/* 卡片组件 */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

.card-title::before {
  content: '';
  width: 4px;
  height: 18px;
  margin-right: 8px;
  background: var(--primary-gradient);
  border-radius: 2px;
}

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn svg,
.btn i {
  margin-right: 6px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

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

.btn-outline:hover:not(:disabled) {
  background: var(--primary-light);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* 表单组件 */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  transition: all 0.2s;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}

/* 标签组件 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}

.tag-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.tag-success {
  background: var(--success-light);
  color: var(--success);
}

.tag-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.tag-danger {
  background: var(--danger-light);
  color: var(--danger);
}

.tag-info {
  background: var(--info-light);
  color: var(--info);
}

/* 提示组件 */
.alert {
  display: flex;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 14px;
}

.alert svg {
  margin-right: 10px;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.alert-info {
  background: var(--info-light);
  color: #1e40af;
}

.alert-success {
  background: var(--success-light);
  color: #065f46;
}

.alert-warning {
  background: var(--warning-light);
  color: #92400e;
}

.alert-danger {
  background: var(--danger-light);
  color: #991b1b;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  background: var(--gray-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
}

.empty-icon svg {
  width: 40px;
  height: 40px;
}

.empty-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 4px;
}

.empty-subtext {
  font-size: 14px;
  color: var(--gray-500);
}

/* 加载动画 */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-container {
  text-align: center;
  padding: 40px 20px;
}

.loading-text {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 12px;
}

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.skeleton-title {
  height: 20px;
  width: 70%;
  margin-bottom: 12px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-image {
  height: 160px;
  margin-bottom: 16px;
  border-radius: var(--radius);
}

/* 筛选标签 */
.filter-bar {
  display: flex;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-tag {
  flex-shrink: 0;
  margin-right: 8px;
}

.filter-tag:last-child {
  margin-right: 0;
}
  -webkit-overflow-scrolling: touch;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-tag {
  padding: 8px 16px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--gray-600);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-tag.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: var(--nav-height);
  max-width: 800px;
  margin: 0 auto;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  color: var(--gray-500);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s;
  min-width: 56px;
}

.bottom-nav-item svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
  margin-bottom: 4px;
}

.bottom-nav-item span {
  margin-top: 0;
}

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

.bottom-nav-item.active svg {
  stroke: url(#nav-gradient);
}

/* 步骤条 */
.steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 40px;
  right: 40px;
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-bottom: 6px;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  transition: all 0.3s;
}

.step.active .step-circle {
  background: var(--primary);
  color: white;
}

.step.completed .step-circle {
  background: var(--success);
  color: white;
}

.step-text {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
}

.step.active .step-text {
  color: var(--primary);
}

/* 进度条 */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* 统计网格 */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.admin-stat {
  background: var(--white);
  padding: 16px 12px;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--gray-100);
}

.admin-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.admin-stat-label {
  font-size: 12px;
  color: var(--gray-500);
}

/* 响应式 */
@media (max-width: 640px) {
  .container {
    padding: 12px;
  }
  
  .card {
    padding: 16px;
    border-radius: var(--radius);
  }
  
  .admin-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  
  .admin-stat {
    padding: 12px 8px;
  }
  
  .admin-stat-value {
    font-size: 16px;
  }
  
  .admin-stat-label {
    font-size: 11px;
  }
}

/* 隐藏类 */
.hidden {
  display: none !important;
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-secondary { color: var(--text-secondary); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

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

/* 渐变文字 */
.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 渐变SVG定义 */
.nav-gradient-def {
  position: absolute;
  width: 0;
  height: 0;
}

/* 支付方式选择 */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-method {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.payment-method:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.payment-method.active,
.payment-method.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.payment-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  flex-shrink: 0;
}

.payment-icon.alipay {
  background: #1677ff;
  color: white;
}

.payment-icon.balance {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  color: white;
}

.payment-info {
  flex: 1;
}

.payment-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.payment-desc {
  font-size: 13px;
  color: var(--gray-500);
}

.payment-check {
  width: 24px;
  height: 24px;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.payment-method.active .payment-check,
.payment-method.selected .payment-check {
  background: var(--primary);
  border-color: var(--primary);
}

.payment-method.active .payment-check::after,
.payment-method.selected .payment-check::after {
  content: '✓';
  color: white;
  font-size: 14px;
  font-weight: 600;
}

/* 支付金额显示 */
.pay-amount {
  text-align: center;
  padding: 24px 0;
  margin-bottom: 20px;
}

.pay-amount-label {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.pay-amount-value {
  font-size: 36px;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}


/* SVG 图标大小修复 */
.menu-icon {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  overflow: hidden !important;
}

.menu-icon svg {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
}

.menu-arrow {
  width: 20px !important;
  height: 20px !important;
}

.bottom-nav svg, .nav-item svg {
  width: 24px !important;
  height: 24px !important;
}

/* 菜单项布局修复 */
.menu-item {
  display: flex !important;
  width: 100% !important;
  box-sizing: border-box !important;
}


/* 底部导航强制固定 */
.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9999 !important;
}



/* 底部导航最终修复 */
body {
  padding-bottom: 80px !important;
}

.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
  background: white !important;
  border-top: 1px solid #e5e7eb !important;
}
