/* ==================== 全局基础 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: #0f0f1a;
  color: #fff;
  line-height: 1.6;
  /* 优雅字体栈：优先使用系统美观字体 */
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Noto Serif SC', 'Songti SC', Georgia, serif;
}

/* ==================== 布局容器 ==================== */
.container {
  max-width: 1920px;
  margin: 0 auto;
  padding: 20px;
  background: linear-gradient(135deg, #0f0f1a, #1a1a2e);
  min-height: 100vh;
}

/* ==================== 头部 ==================== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 20px 0;
  border-bottom: 1px solid #333;
}
header h1 {
  font-size: 2.8em;
  font-weight: 300;
  letter-spacing: 2px;
}
.update-time {
  color: #00d4ff;
  font-size: 1.2em;
  font-weight: 500;
}

/* ==================== Tab切换 ==================== */
.tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.tab {
  padding: 14px 32px;
  background: #16213e;
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 12px;
  font-size: 1.2em;
  transition: all 0.3s;
}
.tab.active {
  background: #00d4ff;
  color: #000;
  font-weight: bold;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
}

/* ==================== 卡片统计 ==================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 50px;
}
.card {
  background: #16213e;
  padding: 35px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,212,255,0.15);
  border: 1px solid #333;
  transition: transform 0.3s;
}
.card:hover { transform: translateY(-8px); }
.card .num {
  font-size: 4.2em;
  font-weight: bold;
  color: #00d4ff;
  margin-bottom: 10px;
}
.card .label {
  font-size: 1.4em;
  color: #aaa;
}

/* ==================== 图表区域 ==================== */
.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 35px;
  margin-bottom: 50px;
}
.chart-box {
  background: #16213e;
  padding: 25px;
  border-radius: 20px;
}
.chart-box h3 {
  margin-bottom: 20px;
  color: #00d4ff;
  font-size: 1.6em;
  text-align: center;
}

/* ==================== 搜索栏 ==================== */
.search-bar {
  margin: 30px 0;
  text-align: center;
}
.search-bar input {
  padding: 18px 25px;
  width: 70%;
  max-width: 700px;
  border-radius: 50px;
  border: none;
  background: #16213e;
  color: #fff;
  font-size: 1.3em;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}
.search-bar button {
  margin-left: 15px;
  padding: 18px 40px;
  background: #00d4ff;
  color: #000;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.2em;
  transition: all 0.3s;
}
.search-bar button:hover {
  background: #00ff9d;
  transform: scale(1.05);
}

/* ==================== 库存排行榜（核心美化） ==================== */
.ranking-list {
  max-height: 850px;
  overflow-y: auto;
  padding-right: 10px;
}

/* 每行卡片样式 */
.rank-item {
  display: grid;
  grid-template-columns: 80px 220px 1fr 150px 180px;
  padding: 22px 20px;
  background: #16213e;
  margin-bottom: 16px;
  border-radius: 18px;
  align-items: center;
  text-align: center;
  font-size: 18px;
  gap: 15px;
  transition: all 0.4s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* 前三名：橙色文字 + 金色发光描边 + 蓝色渐变底 */
.rank-item.top3 {
  background: linear-gradient(90deg, #00d4ff, #0099ff) !important;
  transform: scale(1.03);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.6) !important;
}

.rank-item.top3 span {
  color: #ff6a00 !important;           /* 亮橙色主色 */
  font-weight: bold !important;
  font-size: 20px !important;
  text-shadow: 
    0 0 10px #ff6a00,
    0 0 20px #ff6a00,
    0 0 30px #ff6a00,
    -1px -1px 0 #fff,
     1px -1px 0 #fff,
    -1px  1px 0 #fff,
     1px  1px 0 #fff;
}

/* 特别强化库存数字 */
.rank-item.top3 .stock {
  font-size: 26px !important;
  color: #ff6a00 !important;
  font-weight: bold;
}

/* 普通排名文字颜色 */
.rank-item:not(.top3) .rank-num {
  color: #00d4ff;
  font-size: 2.2em;
  font-weight: bold;
}
.rank-item:not(.top3) .type {
  color: #00d4ff;
  font-weight: bold;
}
.rank-item:not(.top3) .spec {
  color: #fff;
  font-family: 'Courier New', monospace;
  font-size: 17px;
}
.rank-item:not(.top3) .material {
  color: #88eeff;
}
.rank-item:not(.top3) .stock {
  color: #00ff9d;
  font-weight: bold;
  font-size: 1.4em;
}

/* 低库存警告 */
.rank-item.low-stock {
  border-left: 8px solid #ff4444 !important;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,68,68,0.7); }
  70% { box-shadow: 0 0 0 10px rgba(255,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,68,68,0); }
}

/* ==================== 明细查询表格 ==================== */
table {
  width: 100%;
  border-collapse: collapse;
  background: #16213e;
  border-radius: 15px;
  overflow: hidden;
  margin-top: 20px;
}
th {
  background: #00d4ff;
  color: #000;
  padding: 18px;
  text-align: center;
  font-size: 1.3em;
}
td {
  padding: 16px;
  text-align: center;
  border-bottom: 1px solid #333;
  font-size: 17px;
}
tr:hover { background: #1a1a2e; }
.stock { font-weight: bold; color: #00d4ff; }
.low-stock { background: rgba(255,68,68,0.2) !important; }
.low-stock .stock { color: #ff4444 !important; }

/* 搜索高亮 */
.highlight {
  background: #ffeb3b;
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
}

select {
  padding: 15px 25px;
  background: #16213e;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1.2em;
  margin-bottom: 20px;
}

.panel { display: none; }
.panel.active { display: block; }

/* 响应式 */
@media (max-width: 1200px) {
  .charts { grid-template-columns: 1fr; }
  .rank-item { grid-template-columns: 60px 150px 1fr 120px 140px; font-size: 16px; }
}
/* 骨架屏加载动画 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 26, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  color: #fff;
}
.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #16213e;
  border-top: 6px solid #00d4ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* 骨架屏占位 */
.skeleton { background: linear-gradient(90deg, #16213e 25%, #1a1a2e 50%, #16213e 75%); background-size: 200% 100%; animation: loading 1.5s infinite; }
@keyframes loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-chart { height: 400px; background: #16213e; border-radius: 10px; animation: loading 1s infinite; }
.skeleton-list { height: 600px; background: #16213e; border-radius: 10px; animation: loading 1s infinite; }
.skeleton-table tr { height: 60px; background: #16213e; animation: loading 1s infinite; }
