/* ============================================================
   跨境电商融合平台 - Stripe Style（复用 LH Quant 设计语言）
   主色 #635bff / 深蓝 #0a2540 / 背景 #f6f9fc
   ============================================================ */
:root {
  --stripe-purple: #635bff;
  --stripe-light: #7a73ff;
  --ink: #0a2540;
  --bg: #f6f9fc;
  --cyan: #00d4ff;
  --up: #dc2626;    /* 盈利/上涨 = 红 */
  --down: #16a34a;  /* 亏损/下跌 = 绿 */
  --amber: #f59e0b;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.grid-bg {
  background-image:
    linear-gradient(to right, rgba(99, 91, 255, 0.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(99, 91, 255, 0.09) 1px, transparent 1px);
  background-size: 40px 40px;
}
.grid-bg-dark {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
}

.btn-stripe {
  background: var(--stripe-purple); color: #fff; font-weight: 500;
  border-radius: 0.5rem; padding: 0.65rem 1.5rem;
  box-shadow: 0 2px 4px rgba(99, 91, 255, 0.2), 0 4px 8px rgba(99, 91, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 300ms ease-out; cursor: pointer; border: none; font-size: 0.9rem;
}
.btn-stripe:hover { transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(99, 91, 255, 0.3), 0 8px 16px rgba(99, 91, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.btn-stripe:active { transform: translateY(0) scale(0.98);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2); }
.btn-stripe:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-stripe-sm { padding: 0.45rem 1rem; font-size: 0.8rem; }

.btn-ghost {
  background: #fff; color: var(--ink); font-weight: 500;
  border-radius: 0.5rem; padding: 0.65rem 1.5rem;
  border: 1px solid #e6ebf1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 300ms ease-out; cursor: pointer; font-size: 0.9rem;
}
.btn-ghost:hover { transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 16px rgba(0, 0, 0, 0.08); }
.btn-ghost:active { transform: translateY(0) scale(0.98);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1); }
.btn-ghost-sm { padding: 0.45rem 1rem; font-size: 0.8rem; }

.btn-danger { background: #dc2626; color: #fff; font-weight: 500;
  border-radius: 0.5rem; padding: 0.45rem 1rem; border: none; font-size: 0.8rem;
  transition: all 200ms ease-out; cursor: pointer; }
.btn-danger:hover { background: #b91c1c; }

.card {
  background: #fff; border-radius: 0.75rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 16px rgba(0, 0, 0, 0.08);
  transition: all 400ms ease-out;
}
.card-hover:hover { transform: translateY(-4px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06), 0 16px 32px rgba(0, 0, 0, 0.1); }

.input-stripe {
  width: 100%; background: #fff; border: 1px solid #d0d7e2;
  border-radius: 0.5rem; padding: 0.55rem 0.85rem; font-size: 0.9rem; color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); transition: all 200ms ease-out; outline: none;
}
.input-stripe::placeholder { color: #9ca3af; }
.input-stripe:focus { border-color: transparent; box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.3); }

.select-stripe {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23635bff' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center;
  padding-right: 2.2rem;
}

textarea.input-stripe { resize: vertical; min-height: 90px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 9999px; margin-right: 6px; }
.dot-green { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15); }
.dot-red { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15); }
.dot-gray { background: #9ca3af; box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.15); }
.dot-purple { background: var(--stripe-purple); box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.15); }
.dot-amber { background: var(--amber); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15); }

.table-stripe th {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: #6b7280; font-weight: 600; text-align: left; padding: 0.65rem 1rem;
  border-bottom: 1px solid #eef2f6; white-space: nowrap;
}
.table-stripe td { padding: 0.65rem 1rem; font-size: 0.85rem;
  border-bottom: 1px solid #f3f5f8; white-space: nowrap; }
.table-stripe tr:hover td { background: #fafbff; }

.text-up { color: var(--up); }
.text-down { color: var(--down); }
.bg-up { background: var(--up); }
.bg-down { background: var(--down); }

/* ---------- 徽章 ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.7rem; font-weight: 500; padding: 0.15rem 0.55rem;
  border-radius: 9999px; }
.badge-purple { background: rgba(99, 91, 255, 0.12); color: #534ab7; }
.badge-green { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.badge-red { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }
.badge-gray { background: #f3f4f6; color: #6b7280; }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.badge-blue { background: rgba(55, 138, 221, 0.12); color: #185fa5; }

/* ---------- 侧边栏 ---------- */
.sidebar-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 0.9rem; border-radius: 0.5rem;
  font-size: 0.9rem; color: #4b5563; transition: all 200ms ease-out;
}
.sidebar-link:hover { background: #f3f4ff; color: var(--stripe-purple); }
.sidebar-link.active {
  background: var(--stripe-purple); color: #fff;
  box-shadow: 0 2px 4px rgba(99, 91, 255, 0.3), 0 4px 8px rgba(99, 91, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.sidebar-link .nav-icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- 标签页 ---------- */
.tab-item { padding: 0.5rem 1rem; font-size: 0.85rem; color: #6b7280;
  border-radius: 0.5rem; cursor: pointer; transition: all 200ms ease-out; }
.tab-item:hover { background: #f3f4ff; color: var(--stripe-purple); }
.tab-item.active { background: var(--stripe-purple); color: #fff; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(10, 37, 64, 0.45); z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  animation: fade-in 200ms ease-out;
}
.modal-card { background: #fff; border-radius: 0.9rem; width: 100%;
  max-width: 560px; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1), 0 24px 48px rgba(0, 0, 0, 0.2);
  animation: modal-in 250ms ease-out; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- Toast ---------- */
#toast-wrap { position: fixed; top: 1rem; right: 1rem; z-index: 100;
  display: flex; flex-direction: column; gap: 0.5rem; }
.toast { background: #fff; border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 16px rgba(0, 0, 0, 0.12);
  padding: 0.75rem 1.25rem; font-size: 0.85rem; color: var(--ink);
  border-left: 3px solid var(--stripe-purple); animation: toast-in 300ms ease-out; }
.toast.error { border-left-color: #dc2626; }
.toast.success { border-left-color: #16a34a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 空状态 / 加载 ---------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: #9ca3af; font-size: 0.9rem; }
.skeleton { background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 0.5rem; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- KPI 卡片 ---------- */
.kpi-icon { width: 40px; height: 40px; border-radius: 0.75rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
