/* ============================================
   暗黑金融风格 - 企业级ERP系统
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "SF Pro Display", "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #0a0e27;
  background-image: 
    radial-gradient(at 0% 0%, rgba(20, 30, 70, 0.3) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(30, 40, 80, 0.3) 0px, transparent 50%);
  min-height: 100vh;
  color: #e0e6ed;
}

/* 顶部标题栏 */
.header {
  background: linear-gradient(135deg, #1a1f3a 0%, #0f1729 100%);
  padding: 20px 30px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  position: sticky; 
  top: 0; 
  z-index: 100;
  border-bottom: 1px solid rgba(255,215,0,0.2);
}
.header h1 { 
  font-size: 28px; 
  color: #ffd700;
  font-weight: 700;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(255,215,0,0.3);
}
.header .subtitle { 
  font-size: 11px; 
  color: #8b95a5; 
  margin-top: 6px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* 导航标签页 */
.tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px;
  background: rgba(10, 14, 39, 0.6);
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
}
.tab-btn {
  padding: 10px 24px;
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
  letter-spacing: 1.5px;
  background: rgba(26, 31, 58, 0.8);
  color: #8b95a5;
  text-transform: uppercase;
}
.tab-btn:hover { 
  transform: translateY(-2px); 
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 4px 15px rgba(255,215,0,0.2);
}
.tab-btn.active { 
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #0a0e27;
  border-color: #ffd700;
  box-shadow: 0 4px 20px rgba(255,215,0,0.4);
  transform: translateY(-2px);
}

/* 退出登录按钮 */
.btn-logout {
  padding: 10px 20px;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
  letter-spacing: 1px;
  background: rgba(239,68,68,0.1);
  color: #ef4444;
  margin-left: auto;
}
.btn-logout:hover {
  background: rgba(239,68,68,0.2);
  border-color: #ef4444;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(239,68,68,0.3);
}

/* 登录界面 */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 39, 0.95);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.login-box {
  background: linear-gradient(135deg, #1a1f3a 0%, #141829 100%);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 12px;
  padding: 40px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.login-box h2 {
  color: #ffd700;
  text-align: center;
  font-size: 24px;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.login-subtitle {
  text-align: center;
  color: #8b95a5;
  font-size: 11px;
  letter-spacing: 2px;
  margin-bottom: 30px;
  text-transform: uppercase;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  color: #8b95a5;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
}

.input-group input {
  padding: 12px 16px;
  border: 1px solid rgba(139, 149, 165, 0.3);
  border-radius: 6px;
  font-size: 14px;
  background: rgba(10, 14, 39, 0.6);
  color: #e0e6ed;
  transition: all 0.3s;
}

.input-group input:focus {
  border-color: #ffd700;
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,215,0,0.1);
  background: rgba(10, 14, 39, 0.8);
}

.btn-login {
  padding: 14px;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #0a0e27;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  margin-top: 10px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255,215,0,0.5);
}

.login-hint {
  text-align: center;
  color: #5a6270;
  font-size: 11px;
  margin-top: 10px;
  letter-spacing: 0.5px;
}

/* 内容区域 */
.content { max-width: 1200px; margin: 0 auto; padding: 24px; }
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.4s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 卡片 */
.card {
  background: linear-gradient(135deg, #1a1f3a 0%, #141829 100%);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,215,0,0.1);
}
.card h2 {
  font-size: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffd700;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,215,0,0.2);
  padding-bottom: 12px;
}

/* 表单 */
.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}
.form-row label {
  font-size: 12px;
  min-width: 100px;
  font-weight: 500;
  text-align: right;
  color: #8b95a5;
  letter-spacing: 0.5px;
}
.form-row input, .form-row select {
  flex: 1;
  min-width: 120px;
  padding: 10px 14px;
  border: 1px solid rgba(139, 149, 165, 0.3);
  border-radius: 4px;
  font-size: 13px;
  transition: all 0.3s;
  background: rgba(10, 14, 39, 0.6);
  color: #e0e6ed;
}
.form-row input:focus, .form-row select:focus {
  border-color: #ffd700;
  outline: none;
  box-shadow: 0 0 0 2px rgba(255,215,0,0.1);
  background: rgba(10, 14, 39, 0.8);
}
.form-row input[readonly] {
  background: rgba(139, 149, 165, 0.1);
  color: #8b95a5;
  cursor: not-allowed;
}
.form-row input::placeholder, .form-row select option {
  color: #5a6270;
}

/* 按钮 - 统一金融风格 */
.btn {
  padding: 10px 20px;
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 1px;
  background: linear-gradient(135deg, rgba(255,215,0,0.15) 0%, rgba(255,215,0,0.05) 100%);
  color: #ffd700;
}
.btn:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 6px 20px rgba(255,215,0,0.3);
  background: linear-gradient(135deg, rgba(255,215,0,0.25) 0%, rgba(255,215,0,0.15) 100%);
  border-color: #ffd700;
}

/* 主要操作按钮 - 金色 */
.btn-green, .btn-orange, .btn-purple, .btn-pink {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #0a0e27;
  border-color: #ffd700;
}
.btn-green:hover, .btn-orange:hover, .btn-purple:hover, .btn-pink:hover {
  box-shadow: 0 6px 20px rgba(255,215,0,0.5);
}

/* 次要操作按钮 - 银色 */
.btn-cyan, .btn-blue {
  background: linear-gradient(135deg, rgba(139,149,165,0.3) 0%, rgba(139,149,165,0.1) 100%);
  color: #c9d1d9;
  border-color: rgba(139,149,165,0.4);
}
.btn-cyan:hover, .btn-blue:hover {
  background: linear-gradient(135deg, rgba(139,149,165,0.4) 0%, rgba(139,149,165,0.2) 100%);
  border-color: #8b95a5;
  box-shadow: 0 6px 20px rgba(139,149,165,0.3);
}

/* 危险操作按钮 - 深红 */
.btn-red {
  background: linear-gradient(135deg, rgba(239,68,68,0.2) 0%, rgba(220,38,38,0.1) 100%);
  color: #ef4444;
  border-color: rgba(239,68,68,0.4);
}
.btn-red:hover {
  background: linear-gradient(135deg, rgba(239,68,68,0.3) 0%, rgba(220,38,38,0.2) 100%);
  border-color: #ef4444;
  box-shadow: 0 6px 20px rgba(239,68,68,0.3);
}

/* 灰色按钮 - 中性 */
.btn-gray {
  background: linear-gradient(135deg, rgba(107,114,128,0.2) 0%, rgba(75,85,99,0.1) 100%);
  color: #9ca3af;
  border-color: rgba(107,114,128,0.3);
}
.btn-gray:hover {
  background: linear-gradient(135deg, rgba(107,114,128,0.3) 0%, rgba(75,85,99,0.2) 100%);
  border-color: #6b7280;
}

.btn-sm { padding: 6px 14px; font-size: 11px; }

/* 表格 */
.table-wrap { overflow-x: auto; margin-top: 16px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th {
  background: rgba(255,215,0,0.1);
  padding: 12px 10px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid rgba(255,215,0,0.3);
  white-space: nowrap;
  color: #ffd700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 11px;
}
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(139, 149, 165, 0.1);
  white-space: nowrap;
  color: #c9d1d9;
}
tr:hover td { 
  background: rgba(255,215,0,0.05); 
}

/* 统计数字卡片 */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: linear-gradient(135deg, #1a1f3a 0%, #141829 100%);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,215,0,0.15);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ffd700, #ffed4e);
}
.stat-card .number {
  font-size: 32px;
  font-weight: 700;
  margin: 8px 0;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-card .label {
  font-size: 11px;
  color: #8b95a5;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* 库存预警 */
.warning { 
  color: #ef4444; 
  font-weight: 700;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* 空状态 */
.empty-msg {
  text-align: center;
  padding: 40px;
  color: #5a6270;
  font-size: 13px;
  letter-spacing: 1px;
}

/* 提示消息 */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 14px 24px;
  border-radius: 6px;
  color: white;
  font-weight: 600;
  z-index: 999;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.5s forwards;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  letter-spacing: 0.5px;
  border: 1px solid rgba(255,255,255,0.1);
}
.toast-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.toast-error   { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }

@keyframes slideIn {
  from { transform: translateX(400px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* 经销商等级标签 */
.level-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.level-1 { 
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%); 
  color: #0a0e27;
  box-shadow: 0 2px 8px rgba(255,215,0,0.3);
}
.level-2 { 
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%); 
  color: white;
}
.level-3 { 
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%); 
  color: white;
}

/* 原理说明页 */
.explain-box {
  background: rgba(26, 31, 58, 0.6);
  border-left: 3px solid #ffd700;
  padding: 20px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 20px;
}
.explain-box h3 { 
  color: #ffd700; 
  margin-bottom: 12px; 
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.explain-box p, .explain-box li { 
  font-size: 13px; 
  line-height: 1.8; 
  color: #c9d1d9; 
}
.explain-box ul { padding-left: 24px; }
.diagram {
  background: rgba(10, 14, 39, 0.8);
  border: 1px dashed rgba(255,215,0,0.3);
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  margin: 16px 0;
  font-family: "Consolas", "Monaco", monospace;
  line-height: 2;
  color: #8b95a5;
}

/* 报表图表区域 */
.chart-container {
  background: rgba(10, 14, 39, 0.4);
  border-radius: 6px;
  padding: 20px;
  margin-top: 16px;
  border: 1px solid rgba(139, 149, 165, 0.1);
}
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 200px;
  padding: 16px 0;
  border-bottom: 2px solid rgba(255,215,0,0.2);
}
.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.bar {
  width: 100%;
  max-width: 60px;
  border-radius: 4px 4px 0 0;
  transition: height 0.6s ease;
  min-height: 3px;
  background: linear-gradient(180deg, #ffd700 0%, #d97706 100%);
  box-shadow: 0 -2px 10px rgba(255,215,0,0.3);
}
.bar-label { 
  font-size: 10px; 
  color: #8b95a5; 
  text-align: center; 
  word-break: break-all;
  letter-spacing: 0.5px;
}
.bar-value { 
  font-size: 11px; 
  font-weight: 700; 
  color: #ffd700; 
}

/* 导出按钮区域 */
.export-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* 搜索/筛选 */
.filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-row input, .filter-row select {
  padding: 8px 12px;
  border: 1px solid rgba(139, 149, 165, 0.3);
  border-radius: 4px;
  font-size: 12px;
  background: rgba(10, 14, 39, 0.6);
  color: #e0e6ed;
}
.filter-row input:focus, .filter-row select:focus {
  border-color: #ffd700;
  outline: none;
  box-shadow: 0 0 0 2px rgba(255,215,0,0.1);
}

/* 价格计算预览 */
.price-preview {
  background: rgba(255,215,0,0.1);
  border-radius: 6px;
  padding: 14px;
  margin: 12px 0;
  font-size: 12px;
  line-height: 1.8;
  border: 1px solid rgba(255,215,0,0.2);
  color: #c9d1d9;
}
.price-preview b { 
  color: #ffd700;
  font-weight: 700;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(10, 14, 39, 0.4);
}
::-webkit-scrollbar-thumb {
  background: rgba(255,215,0,0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,215,0,0.5);
}

/* 选择框样式 */
select {
  cursor: pointer;
}
select option {
  background: #1a1f3a;
  color: #e0e6ed;
}
