/* ============================================================
   LH Quant Web - Stripe Style
   主色 #635bff / 深蓝 #0a2540 / 背景 #f6f9fc
   ============================================================ */
:root {
  --stripe-purple: #635bff;
  --stripe-light: #7a73ff;
  --ink: #0a2540;
  --bg: #f6f9fc;
  --cyan: #00d4ff;
  --up: #dc2626;    /* A股习惯: 盈利/上涨 = 红 */
  --down: #16a34a;  /* 亏损/下跌 = 绿 */
}

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;
}

/* ---------- Stripe 按钮(Liquid Gradient Focus) ---------- */
.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-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);
}

/* ---------- 卡片 ---------- */
.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;
}

/* ---------- 状态圆点 ---------- */
.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); }

/* ---------- 表格 ---------- */
.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); }

/* ---------- 侧边栏 ---------- */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 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);
}

/* ---------- 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; }

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