/* ============================================================
 * 智慧双桥文旅平台 - 共享设计系统
 * 提供统一的动效、组件、质感样式
 * ============================================================ */

/* ===== 字体与基础 ===== */
:root {
  --sqc-primary: #3B82F6;
  --sqc-primary-dark: #2563EB;
  --sqc-success: #22C55E;
  --sqc-warning: #F59E0B;
  --sqc-danger: #EF4444;
  --sqc-info: #0EA5E9;
  --sqc-radius: 12px;
  --sqc-shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
  --sqc-shadow-md: 0 4px 6px -1px rgba(0,0,0,.06), 0 2px 4px -2px rgba(0,0,0,.04);
  --sqc-shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --sqc-shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.04);
  /* ========== Adding new components, 2026-07-10 ========== */
  --sqc-easing: cubic-bezier(.4,0,.2,1);
  --sqc-z-toast: 9999;
  --sqc-msg-user-bg: linear-gradient(135deg, #3B82F6, #2563EB);
  --sqc-msg-ai-bg: #F0F9FF;
  --sqc-msg-ai-text: #1F2937;
}
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; }

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== 渐变背景 ===== */
.sqc-gradient-primary { background: linear-gradient(135deg, #3B82F6 0%, #6366F1 100%); }
.sqc-gradient-gold { background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%); }
.sqc-gradient-green { background: linear-gradient(135deg, #10B981 0%, #059669 100%); }
.sqc-gradient-purple { background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%); }
.sqc-gradient-dark { background: linear-gradient(135deg, #1F2937 0%, #111827 100%); }
.sqc-gradient-glass { background: rgba(255,255,255,0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* ===== 卡片质感 ===== */
.sqc-card {
  background: #fff;
  border-radius: var(--sqc-radius);
  box-shadow: var(--sqc-shadow-sm);
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
.sqc-card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--sqc-shadow-lg);
}
.sqc-card-flat { background: #fff; border-radius: var(--sqc-radius); border: 1px solid #F3F4F6; }

/* ===== 按钮质感 ===== */
.sqc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: 10px; font-weight: 600; font-size: 14px;
  transition: all .2s ease; cursor: pointer; border: none; outline: none;
  position: relative; overflow: hidden;
}
.sqc-btn-primary { background: var(--sqc-primary); color: #fff; box-shadow: 0 4px 12px rgba(59,130,246,.3); }
.sqc-btn-primary:hover { background: var(--sqc-primary-dark); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(59,130,246,.4); }
.sqc-btn-primary:active { transform: translateY(0); }
.sqc-btn-success { background: var(--sqc-success); color: #fff; box-shadow: 0 4px 12px rgba(34,197,94,.3); }
.sqc-btn-warning { background: var(--sqc-warning); color: #fff; box-shadow: 0 4px 12px rgba(245,158,11,.3); }
.sqc-btn-danger { background: var(--sqc-danger); color: #fff; box-shadow: 0 4px 12px rgba(239,68,68,.3); }
.sqc-btn-ghost { background: #F3F4F6; color: #374151; }
.sqc-btn-ghost:hover { background: #E5E7EB; }
.sqc-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* 按钮波纹效果 */
.sqc-btn::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 0; height: 0; border-radius: 50%; background: rgba(255,255,255,.3);
  transform: translate(-50%,-50%); transition: width .5s, height .5s;
}
.sqc-btn:active::after { width: 300px; height: 300px; }

/* ===== 标签/徽章 ===== */
.sqc-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600;
}
.sqc-badge-success { background: #DCFCE7; color: #166534; }
.sqc-badge-warning { background: #FEF3C7; color: #92400E; }
.sqc-badge-danger { background: #FEE2E2; color: #991B1B; }
.sqc-badge-info { background: #DBEAFE; color: #1E40AF; }
.sqc-badge-default { background: #F3F4F6; color: #374151; }
.sqc-badge-purple { background: #EDE9FE; color: #5B21B6; }

/* ===== 状态点（呼吸灯） ===== */
.sqc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; position: relative; }
.sqc-dot-success { background: var(--sqc-success); }
.sqc-dot-warning { background: var(--sqc-warning); }
.sqc-dot-danger { background: var(--sqc-danger); }
.sqc-dot-info { background: var(--sqc-info); }
.sqc-dot-gray { background: #9CA3AF; }
.sqc-dot::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  background: inherit; opacity: .4; animation: sqc-pulse 2s infinite;
}
@keyframes sqc-pulse {
  0% { transform: scale(.8); opacity: .5; }
  70% { transform: scale(2); opacity: 0; }
  100% { transform: scale(0); opacity: 0; }
}

/* ===== 进度条 ===== */
.sqc-progress { height: 6px; background: #F3F4F6; border-radius: 3px; overflow: hidden; }
.sqc-progress-bar { height: 100%; border-radius: 3px; transition: width 1s cubic-bezier(.4,0,.2,1); position: relative; }
.sqc-progress-bar::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  animation: sqc-shimmer 1.5s infinite;
}
@keyframes sqc-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ===== 骨架屏 ===== */
.sqc-skeleton {
  background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
  background-size: 200% 100%;
  animation: sqc-skeleton 1.5s infinite;
  border-radius: 6px;
}
@keyframes sqc-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== 入场动画 ===== */
@keyframes sqc-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sqc-fade-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sqc-scale-in { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
@keyframes sqc-slide-right { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes sqc-bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.sqc-animate-fade-in { animation: sqc-fade-in .4s ease; }
.sqc-animate-fade-up { animation: sqc-fade-up .5s cubic-bezier(.4,0,.2,1); }
.sqc-animate-scale-in { animation: sqc-scale-in .3s cubic-bezier(.4,0,.2,1); }
.sqc-animate-slide-right { animation: sqc-slide-right .3s cubic-bezier(.4,0,.2,1); }
.sqc-animate-bounce { animation: sqc-bounce 2s infinite; }

/* 列表逐项入场 */
.sqc-stagger > * { opacity: 0; animation: sqc-fade-up .5s cubic-bezier(.4,0,.2,1) forwards; }
.sqc-stagger > *:nth-child(1) { animation-delay: .05s; }
.sqc-stagger > *:nth-child(2) { animation-delay: .1s; }
.sqc-stagger > *:nth-child(3) { animation-delay: .15s; }
.sqc-stagger > *:nth-child(4) { animation-delay: .2s; }
.sqc-stagger > *:nth-child(5) { animation-delay: .25s; }
.sqc-stagger > *:nth-child(6) { animation-delay: .3s; }
.sqc-stagger > *:nth-child(7) { animation-delay: .35s; }
.sqc-stagger > *:nth-child(8) { animation-delay: .4s; }
.sqc-stagger > *:nth-child(9) { animation-delay: .45s; }
.sqc-stagger > *:nth-child(10) { animation-delay: .5s; }

/* ===== 星级评分 ===== */
.sqc-stars { display: inline-flex; gap: 2px; }
.sqc-star { color: #FBBF24; font-size: 14px; }
.sqc-star-empty { color: #E5E7EB; font-size: 14px; }

/* ===== 大屏专用 ===== */
.sqc-screen {
  background: #0F172A; color: #E2E8F0;
  font-family: 'Microsoft YaHei', sans-serif;
}
.sqc-screen-glow { text-shadow: 0 0 10px currentColor; }
.sqc-screen-panel {
  background: rgba(30,41,59,.7);
  border: 1px solid rgba(59,130,246,.3);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}
.sqc-screen-grid {
  background-image:
    linear-gradient(rgba(59,130,246,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,.08) 1px, transparent 1px);
  background-size: 40px 40px;
}
@keyframes sqc-blink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.sqc-blink { animation: sqc-blink 1s infinite; }

/* ===== 环形进度 ===== */
.sqc-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.sqc-ring svg { transform: rotate(-90deg); }
.sqc-ring-bg { stroke: #F3F4F6; }
.sqc-ring-fg { stroke: var(--sqc-primary); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.4,0,.2,1); }

/* ===== 标签页 ===== */
.sqc-tabs { display: flex; gap: 4px; border-bottom: 2px solid #F3F4F6; }
.sqc-tab {
  padding: 10px 16px; font-size: 14px; font-weight: 500; color: #6B7280;
  cursor: pointer; position: relative; transition: color .2s;
}
.sqc-tab:hover { color: #3B82F6; }
.sqc-tab-active { color: #3B82F6; }
.sqc-tab-active::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px; background: #3B82F6; border-radius: 1px;
}

/* ===== 表格增强 ===== */
.sqc-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.sqc-table thead th {
  background: #F9FAFB; color: #6B7280; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 12px 16px; text-align: left; border-bottom: 1px solid #E5E7EB;
}
.sqc-table tbody td { padding: 12px 16px; border-bottom: 1px solid #F3F4F6; font-size: 14px; }
.sqc-table tbody tr { transition: background .15s; }
.sqc-table tbody tr:hover { background: #F9FAFB; }
.sqc-table tbody tr:nth-child(even) { background: #FCFCFD; }
.sqc-table tbody tr:nth-child(even):hover { background: #F9FAFB; }

/* ===== 图标按钮 ===== */
.sqc-icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #F3F4F6; color: #6B7280; cursor: pointer; transition: all .2s;
  font-size: 16px;
}
.sqc-icon-btn:hover { background: #E5E7EB; color: #374151; }
.sqc-icon-btn-primary { background: #DBEAFE; color: #2563EB; }
.sqc-icon-btn-primary:hover { background: #BFDBFE; }
.sqc-icon-btn-danger { background: #FEE2E2; color: #DC2626; }
.sqc-icon-btn-danger:hover { background: #FECACA; }

/* ===== 空状态 ===== */
.sqc-empty {
  text-align: center; padding: 48px 24px; color: #9CA3AF;
}
.sqc-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .5; }

/* ===== 分割线 ===== */
.sqc-divider { height: 1px; background: linear-gradient(90deg, transparent, #E5E7EB, transparent); margin: 16px 0; }

/* ===== 浮动操作按钮（FAB） ===== */
.sqc-fab {
  position: fixed; bottom: 90px; right: 20px;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--sqc-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(59,130,246,.4);
  cursor: pointer; z-index: 40; font-size: 20px;
  transition: all .3s;
}
.sqc-fab:hover { transform: scale(1.1); box-shadow: 0 8px 20px rgba(59,130,246,.5); }

/* ===== Tooltip ===== */
.sqc-tooltip { position: relative; }
.sqc-tooltip::before {
  content: attr(data-tip); position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: #1F2937; color: #fff; padding: 4px 10px; border-radius: 6px;
  font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .2s; z-index: 50;
}
.sqc-tooltip:hover::before { opacity: 1; }

/* ===== 数字滚动动画 ===== */
.sqc-number { font-variant-numeric: tabular-nums; transition: color .3s; }

/* ===== H5 顶部栏 ===== */
.sqc-h5-header {
  background: rgba(255,255,255,.95); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,.04);
}

/* ===== H5 底部 Tab ===== */
.sqc-h5-tabbar {
  background: rgba(255,255,255,.95); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0,0,0,.04);
}

/* ===== 侧边栏 ===== */
.sqc-sidebar { transition: width .3s cubic-bezier(.4,0,.2,1); }
.sqc-sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; font-size: 14px; color: rgba(255,255,255,.7);
  cursor: pointer; transition: all .2s; position: relative;
}
.sqc-sidebar-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.sqc-sidebar-item-active { background: var(--sqc-primary); color: #fff; }
.sqc-sidebar-item-active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: #fff; border-radius: 0 2px 2px 0;
}

/* ===== 暗色主题适配 ===== */
.sqc-dark-card {
  background: rgba(30,41,59,.7); border: 1px solid rgba(59,130,246,.2);
  border-radius: 8px; backdrop-filter: blur(8px);
}

/* ===== 热力图格子 ===== */
.sqc-heat-cell {
  border-radius: 3px; transition: all .3s; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: rgba(255,255,255,.8);
}
.sqc-heat-cell:hover { transform: scale(1.15); z-index: 1; }

/* ===== 微交互：点击反馈 ===== */
.sqc-clickable { cursor: pointer; transition: transform .1s; }
.sqc-clickable:active { transform: scale(.97); }

/* ===== 旋转加载 ===== */
@keyframes sqc-spin { to { transform: rotate(360deg); } }
.sqc-spin { animation: sqc-spin 1s linear infinite; }

/* ===== 渐入数字（用于统计卡） ===== */
.sqc-stat-card {
  background: #fff; border-radius: 12px; padding: 20px;
  box-shadow: var(--sqc-shadow-sm); transition: all .3s;
  position: relative; overflow: hidden;
}
.sqc-stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--sqc-primary); opacity: 0; transition: opacity .3s;
}
.sqc-stat-card:hover { transform: translateY(-2px); box-shadow: var(--sqc-shadow-md); }
.sqc-stat-card:hover::before { opacity: 1; }

/* ========== Adding new components, 2026-07-10 ========== */

/* 扫码取景框（默认 200px；.sqc-scan-lg=240 / .sqc-scan-md=180） */
.sqc-scan-viewfinder { position: relative; display: inline-block; width: 200px; height: 200px; box-sizing: border-box; border-radius: 24px; border: 2px solid var(--sqc-success); background: rgba(0,0,0,.85); overflow: hidden; }
.sqc-scan-lg { width: 240px; height: 240px; }
.sqc-scan-md { width: 180px; height: 180px; }
.sqc-scan-viewfinder::before, .sqc-scan-viewfinder::after,
.sqc-scan-corners::before, .sqc-scan-corners::after {
  content: ''; position: absolute; width: 24px; height: 24px; border: 3px solid var(--sqc-success);
  border-radius: 4px; pointer-events: none;
}
.sqc-scan-viewfinder::before { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.sqc-scan-viewfinder::after  { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.sqc-scan-corners { position: absolute; inset: 0; pointer-events: none; }
.sqc-scan-corners::before { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.sqc-scan-corners::after  { bottom: -2px; right: -2px; border-left: none; border-top: none; }
@keyframes sqc-scan-sweep { 0% { transform: translateY(0); } 50% { transform: translateY(calc(100% - 1px)); } 100% { transform: translateY(0); } }
.sqc-scan-line { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--sqc-success), transparent); box-shadow: 0 0 8px var(--sqc-success); animation: sqc-scan-sweep 1.5s ease-in-out infinite; pointer-events: none; }
@keyframes sqc-scan-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.04); } 100% { transform: scale(1); } }
.sqc-scan-success { border-color: #4ADE80 !important; animation: sqc-scan-pulse .5s var(--sqc-easing); }
.sqc-scan-success .sqc-scan-line { animation: none; opacity: 0; }
.sqc-scan-success::after { content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--sqc-success); font-size: 60px; font-weight: 700; text-shadow: 0 0 16px rgba(34,197,94,.5); }

/* 聊天消息气泡 */
.sqc-msg { display: inline-block; max-width: 75%; padding: 12px 16px; margin: 8px 0; border-radius: 20px; font-size: 14px; line-height: 1.5; word-wrap: break-word; position: relative; }
.sqc-msg-user { background: var(--sqc-msg-user-bg); color: #fff; float: right; clear: both; border-bottom-right-radius: 4px; }
.sqc-msg-ai   { background: var(--sqc-msg-ai-bg); color: var(--sqc-msg-ai-text); float: left; clear: both; border-bottom-left-radius: 4px; display: flex; align-items: flex-start; gap: 8px; }
.sqc-msg-system { display: block; width: 100%; clear: both; text-align: center; font-style: italic; color: #9CA3AF; font-size: 12px; background: transparent; padding: 4px 12px; }
.sqc-msg-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #8B5CF6, #EC4899); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
@keyframes sqc-typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
.sqc-typing { display: inline-flex; align-items: center; gap: 4px; padding: 12px 16px; background: var(--sqc-msg-ai-bg); border-radius: 20px; border-bottom-left-radius: 4px; float: left; clear: both; margin: 8px 0; }
.sqc-typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sqc-primary); animation: sqc-typing-bounce 1.4s infinite; }
.sqc-typing-dot:nth-child(2) { animation-delay: 150ms; }
.sqc-typing-dot:nth-child(3) { animation-delay: 300ms; }

/* stagger 入场动画扩展（11-20 子元素） */
.sqc-stagger > *:nth-child(11) { animation-delay: .55s; }
.sqc-stagger > *:nth-child(12) { animation-delay: .6s; }
.sqc-stagger > *:nth-child(13) { animation-delay: .65s; }
.sqc-stagger > *:nth-child(14) { animation-delay: .7s; }
.sqc-stagger > *:nth-child(15) { animation-delay: .75s; }
.sqc-stagger > *:nth-child(16) { animation-delay: .8s; }
.sqc-stagger > *:nth-child(17) { animation-delay: .85s; }
.sqc-stagger > *:nth-child(18) { animation-delay: .9s; }
.sqc-stagger > *:nth-child(19) { animation-delay: .95s; }
.sqc-stagger > *:nth-child(20) { animation-delay: 1s; }

/* Toast 队列堆叠（中央容器，多条时向上推） */
.sqc-toast-stack { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: var(--sqc-z-toast); pointer-events: none; max-width: 90vw; }
.sqc-toast-item { pointer-events: auto; display: flex; align-items: center; gap: 8px; background: #fff; color: #1F2937; padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.12); border-left: 3px solid var(--sqc-primary); max-width: 300px; transition: transform .3s var(--sqc-easing), opacity .3s var(--sqc-easing); animation: sqc-toast-in .3s var(--sqc-easing); }
.sqc-toast-item-success { border-left-color: var(--sqc-success); }
.sqc-toast-item-error   { border-left-color: var(--sqc-danger); }
.sqc-toast-item-warning { border-left-color: var(--sqc-warning); }
.sqc-toast-item-info    { border-left-color: var(--sqc-info); }
.sqc-toast-fade-out { opacity: 0; transform: translateY(-20px); }
@keyframes sqc-toast-in { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

/* Haptic 视觉反馈（按下脉冲） */
.sqc-haptic-target { position: relative; cursor: pointer; transition: transform .15s var(--sqc-easing); user-select: none; -webkit-tap-highlight-color: transparent; }
.sqc-haptic-target:active { animation: sqc-haptic-pulse .3s var(--sqc-easing); }
@keyframes sqc-haptic-pulse { 0% { transform: scale(1); } 50% { transform: scale(.95); } 100% { transform: scale(1); } }