/* ============ KRossBu 复刻样式 ============ */
:root {
  --background: 3 7 18;
  --surface: 15 23 42;
  --surface-highlight: 30 41 59;
  --foreground: 248 250 252;
  --muted: 148 163 184;
  --border: 51 65 85;
  --primary-400: 129 140 248;
  --primary-500: 99 102 241;
  --primary-600: 79 70 229;
  --secondary-400: 34 211 238;
  --secondary-500: 6 182 212;
  --accent-500: 236 72 153;
}
[data-theme="light"] {
  --background: 242 244 247;
  --surface: 255 255 255;
  --surface-highlight: 249 250 251;
  --foreground: 31 41 55;
  --muted: 107 114 128;
  --border: 229 231 235;
  --primary-400: 99 102 241;
  --primary-500: 79 70 229;
  --primary-600: 67 56 202;
  --secondary-400: 6 182 212;
  --secondary-500: 8 145 178;
  --accent-500: 219 39 119;
}

body {
  background: rgb(var(--background));
  color: rgb(var(--foreground));
  font-family: 'Inter', sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 自定义滚动条 */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgb(var(--border));
  border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #6366f1;
}

/* 隐藏滚动条 */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 玻璃拟态 */
.glass {
  background: rgba(var(--surface), 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(var(--border), 0.1);
}

/* 品牌渐变文字 */
.text-gradient-brand {
  background: linear-gradient(135deg, rgb(var(--secondary-400)) 0%, rgb(var(--primary-400)) 50%, rgb(var(--accent-500)) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.animate-float {
  animation: float 6s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* 618 促销按钮 */
@keyframes star-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes shine {
  0% { left: -150%; }
  50%, 100% { left: 150%; }
}

.promo-618-btn {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 16px;
  border-radius: 32px;
  color: #FFE6A3;
  background: linear-gradient(135deg, #e62117 0%, #8c0c07 100%);
  border: 1px solid rgba(255, 230, 163, 0.5);
  box-shadow: 0 2px 8px rgba(230, 33, 23, 0.2), 0 0 10px rgba(255, 230, 163, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  letter-spacing: 0.5px;
  cursor: pointer;
  white-space: nowrap;
}

.promo-618-btn .star-icon {
  width: 12px;
  height: 12px;
  margin-right: 5px;
  fill: #FFE6A3;
  filter: drop-shadow(0 0 10px rgba(255, 230, 163, 0.8));
  animation: star-rotate 3s linear infinite;
}

.promo-618-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-25deg);
  animation: shine 3s ease-in-out infinite;
}

.promo-618-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #f02d25 0%, #a1110b 100%);
  color: #FFFFFF;
  border-color: rgba(255, 230, 163, 0.9);
  box-shadow: 0 4px 15px rgba(230, 33, 23, 0.35), 0 0 15px rgba(255, 230, 163, 0.45);
}

.promo-618-btn:hover .star-icon {
  fill: #FFFFFF;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.9));
}

.promo-618-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(230, 33, 23, 0.2), 0 0 8px rgba(255, 230, 163, 0.2);
}

/* 指标卡 */
.metric-card {
  background: rgb(var(--surface));
  border: 1px solid rgba(var(--border), 0.6);
  border-radius: 16px;
  padding: 16px;
  transition: all 0.3s ease;
}
.metric-card:hover {
  border-color: rgba(var(--primary-500), 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
}

/* 表格 */
.kr-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}
.kr-table thead th {
  background: rgba(var(--surface-highlight), 0.5);
  color: rgb(var(--muted));
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(var(--border), 0.6);
  white-space: nowrap;
}
.kr-table tbody td {
  padding: 12px;
  border-bottom: 1px solid rgba(var(--border), 0.4);
  white-space: nowrap;
}
.kr-table tbody tr:hover {
  background: rgba(var(--surface-highlight), 0.4);
}

/* 侧边栏菜单项 */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: rgb(var(--muted));
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.nav-item:hover {
  color: rgb(var(--foreground));
  background: rgba(var(--surface-highlight), 0.6);
}
.nav-item.active {
  color: rgb(var(--primary-400));
  background: rgba(var(--primary-500), 0.12);
  font-weight: 600;
}
.nav-group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--muted));
  opacity: 0.7;
  padding: 16px 12px 6px;
}

/* 按钮 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgb(var(--primary-600));
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 10px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}
.btn-primary:hover {
  background: rgb(var(--primary-500));
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgb(var(--surface-highlight));
  color: rgb(var(--foreground));
  font-weight: 500;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(var(--border), 0.8);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-ghost:hover {
  border-color: rgb(var(--primary-500));
  color: rgb(var(--primary-400));
}

/* 输入框 */
.kr-input {
  width: 100%;
  background: rgb(var(--surface-highlight));
  border: 1px solid rgba(var(--border), 0.8);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: rgb(var(--foreground));
  outline: none;
  transition: all 0.2s ease;
}
.kr-input::placeholder {
  color: rgb(var(--muted));
  opacity: 0.7;
}
.kr-input:focus {
  border-color: rgb(var(--primary-500));
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-red { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-gray { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.badge-purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }

/* 标签页 */
.kr-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: rgb(var(--muted));
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.kr-tab:hover {
  color: rgb(var(--foreground));
}
.kr-tab.active {
  color: rgb(var(--primary-400));
  background: rgba(var(--primary-500), 0.12);
  border-color: rgba(var(--primary-500), 0.3);
}

/* 模态 */
.kr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

/* 状态小圆点 */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}
.dot-green { background: #34d399; }
.dot-red { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2); }
.dot-amber { background: #fbbf24; }
.dot-gray { background: #64748b; }

/* 页面容器 */
.page-container {
  padding: 24px;
  max-width: 1440px;
  margin: 0 auto;
}

/* 卡片标题 */
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: rgb(var(--foreground));
}
.card-subtitle {
  font-size: 12px;
  color: rgb(var(--muted));
}

/* tooltip */
.kr-tooltip {
  position: relative;
}
.kr-tooltip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f1f5f9;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  margin-bottom: 6px;
}
